I encountered a bug where I get a bug under very specific circumstances:
super()
in the constructorSource
// src/index.ts
class Parent {
constructor() {}
}
class Feature {
constructor() {}
}
export class Child extends Parent {
feature = new Feature();
constructor() {
console.log("before");
super();
console.log("after");
}
}
Result
constructor(){console.log("before"),super();_class.prototype.__init.call(this);,console.log("after")}
^
Error (when using the built code)
SyntaxError: Unexpected token ','
Reproduction
Context
I found this bug while working on faker-js/faker#2838
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too