- Rollup Version: 1.21.4
- Operating System (or Browser): N/A
- Node Version: 12.6.0
How Do We Reproduce?
rollup this code
class Foo {
#p;
constructor(v) {
this.#p = v;
}
getV() {
return this.#p;
}
};
const a = new Foo('hello');
const b = new Foo('world');
console.log(a.getV(), b.getV());
repl
Expected Behavior
It rolls up
Actual Behavior
It gets a syntax error
Note: the code snippet above works in Chrome https://jsfiddle.net/greggman/z5w1pd9m/ and in node 12
$ node
Welcome to Node.js v12.6.0.
Type ".help" for more information.
> class Foo {
... #p;
... constructor(v) {
..... this.#p = v;
..... }
... getV() {
..... return this.#p;
..... }
... };
undefined
>
> const a = new Foo('hello');
undefined
> const b = new Foo('world');
undefined
> console.log(a.getV(), b.getV());
hello world
undefined
>
How Do We Reproduce?
rollup this code
repl
Expected Behavior
It rolls up
Actual Behavior
It gets a syntax error
Note: the code snippet above works in Chrome https://jsfiddle.net/greggman/z5w1pd9m/ and in node 12