* Add private method syntax support * Add private method spec support * Add private method loose support * Throw error if static private method is used * Add more isStatic & isMethod checks * Remove `writable:false` from private method inits `writable` is false by default. * Add private method func obj equality check * Throw if private accessor is used * Add check for fields === private method loose mode * Throw buildCodeFrameErrors instead of Errors * Move obj destructuring inside for loop * Remove "computed" from ClassPrivateMethod type def
15 lines
319 B
JavaScript
15 lines
319 B
JavaScript
let exfiltrated;
|
|
class Foo {
|
|
#privateMethod() {}
|
|
|
|
constructor() {
|
|
if (exfiltrated === undefined) {
|
|
exfiltrated = this.#privateMethod;
|
|
}
|
|
expect(exfiltrated).toStrictEqual(this.#privateMethod);
|
|
}
|
|
}
|
|
|
|
new Foo();
|
|
// check for private method function object equality
|
|
new Foo(); |