From b723491387fd1bbec568f2cd46f7479513a2add4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sun, 18 Feb 2024 17:17:17 +0100 Subject: [PATCH] Fix evaluation order of decorators with cached receiver (#16281) * Add failing test * Fix evaluation order of decorators with cached receiver * Use one temp var per decorated element * Use one temp var per class --- .../src/decorators.ts | 22 +++++++++++-------- .../super-in-decorator/output.js | 8 +++---- .../2023-05-misc--to-es2015/this/output.js | 13 ++++------- .../valid-expression-formats/output.js | 8 +++---- .../2023-05-misc/super-in-decorator/output.js | 8 +++---- .../test/fixtures/2023-05-misc/this/output.js | 13 ++++------- .../valid-expression-formats/output.js | 12 +++++----- .../super-in-decorator/output.js | 8 +++---- .../2023-11-misc--to-es2015/this/output.js | 13 ++++------- .../valid-expression-formats/output.js | 8 +++---- .../2023-11-misc/super-in-decorator/output.js | 8 +++---- .../test/fixtures/2023-11-misc/this/output.js | 15 ++++--------- .../valid-expression-formats/output.js | 12 +++++----- .../exec.js | 17 ++++++++++++++ .../input.js | 7 ++++++ .../output.js | 11 ++++++++++ .../input.js | 7 ++++++ .../output.js | 12 ++++++++++ 18 files changed, 111 insertions(+), 91 deletions(-) create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering--to-es2015/decorators-evaluation-with-this-caching/exec.js create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering--to-es2015/decorators-evaluation-with-this-caching/input.js create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering--to-es2015/decorators-evaluation-with-this-caching/output.js create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering/decorators-evaluation-with-this-caching/input.js create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering/decorators-evaluation-with-this-caching/output.js diff --git a/packages/babel-helper-create-class-features-plugin/src/decorators.ts b/packages/babel-helper-create-class-features-plugin/src/decorators.ts index 8cb45d0e2a38..779695be2187 100644 --- a/packages/babel-helper-create-class-features-plugin/src/decorators.ts +++ b/packages/babel-helper-create-class-features-plugin/src/decorators.ts @@ -909,6 +909,7 @@ function transformClass( const decoratedPrivateMethods = new Set(); let classInitLocal: t.Identifier, classIdLocal: t.Identifier; + let decoratorReceiverId: t.Identifier | null = null; // Memoise the this value `a.b` of decorator member expressions `@a.b.dec`, type HandleDecoratorExpressionsResult = { @@ -929,16 +930,19 @@ function transformClass( (!process.env.BABEL_8_BREAKING && version === "2023-05")) && t.isMemberExpression(expression) ) { - if ( - t.isSuper(expression.object) || - t.isThisExpression(expression.object) - ) { - object = memoiseExpression(t.thisExpression(), "obj"); - } else { - if (!scopeParent.isStatic(expression.object)) { - expression.object = memoiseExpression(expression.object, "obj"); - } + if (t.isSuper(expression.object)) { + object = t.thisExpression(); + } else if (scopeParent.isStatic(expression.object)) { object = t.cloneNode(expression.object); + } else { + decoratorReceiverId ??= + scopeParent.generateDeclaredUidIdentifier("obj"); + object = t.assignmentExpression( + "=", + t.cloneNode(decoratorReceiverId), + expression.object, + ); + expression.object = t.cloneNode(decoratorReceiverId); } } decoratorsThis.push(object); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/super-in-decorator/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/super-in-decorator/output.js index 97a034ca1cde..b1b503f32cbf 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/super-in-decorator/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/super-in-decorator/output.js @@ -1,10 +1,8 @@ class A extends B { m() { - var _initProto, _initClass, _obj, _classDecs, _obj2, _m2Decs, _C2; - _obj = this; - _classDecs = [_obj, super.dec1]; - _obj2 = this; - _m2Decs = [_obj2, super.dec2]; + var _initProto, _initClass, _classDecs, _m2Decs, _C2; + _classDecs = [this, super.dec1]; + _m2Decs = [this, super.dec2]; let _C; class C { constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/this/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/this/output.js index 032bd125eda9..82e074666e23 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/this/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/this/output.js @@ -1,12 +1,7 @@ -var _initClass, _obj, _obj2, _classDecs, _obj3, _obj4, _xDecs, _init_x, _obj5, _yDecs, _init_y, _A2; -_obj = o1; -_obj2 = o2; -_classDecs = [_obj, _obj.dec, void 0, dec, _obj2, _obj2.dec]; -_obj3 = o2; -_obj4 = o3.o; -_xDecs = [_obj3, _obj3.dec, _obj4, _obj4.dec]; -_obj5 = o2; -_yDecs = [_obj5, _obj5.dec, void 0, dec]; +var _initClass, _obj, _classDecs, _xDecs, _init_x, _yDecs, _init_y, _A2; +_classDecs = [_obj = o1, _obj.dec, void 0, dec, _obj = o2, _obj.dec]; +_xDecs = [_obj = o2, _obj.dec, _obj = o3.o, _obj.dec]; +_yDecs = [_obj = o2, _obj.dec, void 0, dec]; let _A; class A { constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/valid-expression-formats/output.js index f49c04cc256b..c0295e21ef6f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/valid-expression-formats/output.js @@ -1,9 +1,7 @@ -var _initProto, _initClass, _obj, _classDecs, _obj2, _methodDecs, _Foo2; +var _initProto, _initClass, _obj, _classDecs, _methodDecs, _Foo2; const dec = () => {}; -_obj = array; -_classDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj, _obj[expr]]; -_obj2 = array; -_methodDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj2, _obj2[expr]]; +_classDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj = array, _obj[expr]]; +_methodDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj = array, _obj[expr]]; let _Foo; var _a = /*#__PURE__*/new WeakMap(); class Foo { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/super-in-decorator/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/super-in-decorator/output.js index 5ac3868e392d..0cc5a28d44b1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/super-in-decorator/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/super-in-decorator/output.js @@ -1,10 +1,8 @@ class A extends B { m() { - var _initProto, _initClass, _obj, _classDecs, _obj2, _m2Decs; - _obj = this; - _classDecs = [_obj, super.dec1]; - _obj2 = this; - _m2Decs = [_obj2, super.dec2]; + var _initProto, _initClass, _classDecs, _m2Decs; + _classDecs = [this, super.dec1]; + _m2Decs = [this, super.dec2]; let _C; class C { static { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/this/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/this/output.js index 820c328f670b..dcb99b172e55 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/this/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/this/output.js @@ -1,12 +1,7 @@ -var _initClass, _obj, _obj2, _classDecs, _obj3, _obj4, _xDecs, _init_x, _obj5, _yDecs, _init_y; -_obj = o1; -_obj2 = o2; -_classDecs = [_obj, _obj.dec, void 0, dec, _obj2, _obj2.dec]; -_obj3 = o2; -_obj4 = o3.o; -_xDecs = [_obj3, _obj3.dec, _obj4, _obj4.dec]; -_obj5 = o2; -_yDecs = [_obj5, _obj5.dec, void 0, dec]; +var _initClass, _obj, _classDecs, _xDecs, _init_x, _yDecs, _init_y; +_classDecs = [_obj = o1, _obj.dec, void 0, dec, _obj = o2, _obj.dec]; +_xDecs = [_obj = o2, _obj.dec, _obj = o3.o, _obj.dec]; +_yDecs = [_obj = o2, _obj.dec, void 0, dec]; let _A; class A { static { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/valid-expression-formats/output.js index 76f7fa2de74f..2d0a324851b8 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/valid-expression-formats/output.js @@ -1,9 +1,7 @@ -var _initProto, _initClass, _obj, _classDecs, _obj2, _methodDecs; +var _initProto, _initClass, _obj, _classDecs, _methodDecs; const dec = () => {}; -_obj = array; -_classDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj, _obj[expr]]; -_obj2 = array; -_methodDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj2, _obj2[expr]]; +_classDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj = array, _obj[expr]]; +_methodDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj = array, _obj[expr]]; let _Foo; class Foo { static { @@ -15,8 +13,8 @@ class Foo { #a = void _initProto(this); method() {} makeClass() { - var _obj3, _barDecs, _init_bar; - return _obj3 = this, _barDecs = [_obj3, this.#a], class Nested { + var _barDecs, _init_bar; + return _barDecs = [this, this.#a], class Nested { static { [_init_bar] = babelHelpers.applyDecs2305(this, [[_barDecs, 16, "bar"]], []).e; } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/super-in-decorator/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/super-in-decorator/output.js index 511552fba7c5..10b8fcbe364f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/super-in-decorator/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/super-in-decorator/output.js @@ -1,10 +1,8 @@ class A extends B { m() { - var _initProto, _initClass, _obj, _classDecs, _obj2, _m2Decs, _C2; - _obj = this; - _classDecs = [_obj, super.dec1]; - _obj2 = this; - _m2Decs = [_obj2, super.dec2]; + var _initProto, _initClass, _classDecs, _m2Decs, _C2; + _classDecs = [this, super.dec1]; + _m2Decs = [this, super.dec2]; let _C; class C { constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/this/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/this/output.js index af19de789467..8693d19c84b2 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/this/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/this/output.js @@ -1,12 +1,7 @@ -var _initClass, _obj, _obj2, _classDecs, _obj3, _obj4, _xDecs, _init_x, _init_extra_x, _obj5, _yDecs, _init_y, _init_extra_y, _A2; -_obj = o1; -_obj2 = o2; -_classDecs = [_obj, _obj.dec, void 0, dec, _obj2, _obj2.dec]; -_obj3 = o2; -_obj4 = o3.o; -_xDecs = [_obj3, _obj3.dec, _obj4, _obj4.dec]; -_obj5 = o2; -_yDecs = [_obj5, _obj5.dec, void 0, dec]; +var _initClass, _obj, _classDecs, _xDecs, _init_x, _init_extra_x, _yDecs, _init_y, _init_extra_y, _A2; +_classDecs = [_obj = o1, _obj.dec, void 0, dec, _obj = o2, _obj.dec]; +_xDecs = [_obj = o2, _obj.dec, _obj = o3.o, _obj.dec]; +_yDecs = [_obj = o2, _obj.dec, void 0, dec]; let _A; class A { constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/valid-expression-formats/output.js index 4f60b229b56c..c79ed2d3d9c3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/valid-expression-formats/output.js @@ -1,9 +1,7 @@ -var _initProto, _initClass, _obj, _classDecs, _obj2, _methodDecs, _Foo2; +var _initProto, _initClass, _obj, _classDecs, _methodDecs, _Foo2; const dec = () => {}; -_obj = array; -_classDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj, _obj[expr]]; -_obj2 = array; -_methodDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj2, _obj2[expr]]; +_classDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj = array, _obj[expr]]; +_methodDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj = array, _obj[expr]]; let _Foo; var _a = /*#__PURE__*/new WeakMap(); class Foo { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/super-in-decorator/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/super-in-decorator/output.js index 8017461fdaf0..07ef26247372 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/super-in-decorator/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/super-in-decorator/output.js @@ -1,10 +1,8 @@ class A extends B { m() { - var _initProto, _initClass, _obj, _classDecs, _obj2, _m2Decs; - _obj = this; - _classDecs = [_obj, super.dec1]; - _obj2 = this; - _m2Decs = [_obj2, super.dec2]; + var _initProto, _initClass, _classDecs, _m2Decs; + _classDecs = [this, super.dec1]; + _m2Decs = [this, super.dec2]; let _C; class C { static { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/this/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/this/output.js index f12039c1d2b0..573fdd815815 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/this/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/this/output.js @@ -1,14 +1,7 @@ -var _initClass, _obj, _obj2, _obj3, _classDecs, _obj4, _obj5, _obj6, _xDecs, _init_x, _init_extra_x, _obj7, _yDecs, _init_y, _init_extra_y; -_obj = o1; -_obj2 = o2; -_obj3 = o4.o(); -_classDecs = [_obj, _obj.dec, void 0, dec, _obj2, _obj2.dec, _obj3, _obj3.dec]; -_obj4 = o2; -_obj5 = o3.o; -_obj6 = o4.o(); -_xDecs = [_obj4, _obj4.dec, _obj5, _obj5.dec, _obj6, _obj6.dec]; -_obj7 = o2; -_yDecs = [_obj7, _obj7.dec, void 0, dec]; +var _initClass, _obj, _classDecs, _xDecs, _init_x, _init_extra_x, _yDecs, _init_y, _init_extra_y; +_classDecs = [_obj = o1, _obj.dec, void 0, dec, _obj = o2, _obj.dec, _obj = o4.o(), _obj.dec]; +_xDecs = [_obj = o2, _obj.dec, _obj = o3.o, _obj.dec, _obj = o4.o(), _obj.dec]; +_yDecs = [_obj = o2, _obj.dec, void 0, dec]; let _A; class A { static { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/valid-expression-formats/output.js index 418ad0f4ff31..f8c11b260efd 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/valid-expression-formats/output.js @@ -1,9 +1,7 @@ -var _initProto, _initClass, _obj, _classDecs, _obj2, _methodDecs; +var _initProto, _initClass, _obj, _classDecs, _methodDecs; const dec = () => {}; -_obj = array; -_classDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj, _obj[expr]]; -_obj2 = array; -_methodDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj2, _obj2[expr]]; +_classDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj = array, _obj[expr]]; +_methodDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, _obj = array, _obj[expr]]; let _Foo; class Foo { static { @@ -15,8 +13,8 @@ class Foo { #a = void _initProto(this); method() {} makeClass() { - var _obj3, _barDecs, _init_bar, _init_extra_bar; - return _obj3 = this, _barDecs = [_obj3, this.#a], class Nested { + var _barDecs, _init_bar, _init_extra_bar; + return _barDecs = [this, this.#a], class Nested { static { [_init_bar, _init_extra_bar] = babelHelpers.applyDecs2311(this, [[_barDecs, 16, "bar"]], []).e; } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering--to-es2015/decorators-evaluation-with-this-caching/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering--to-es2015/decorators-evaluation-with-this-caching/exec.js new file mode 100644 index 000000000000..58db24bae6d8 --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering--to-es2015/decorators-evaluation-with-this-caching/exec.js @@ -0,0 +1,17 @@ +let result = []; +const fn = () => { result.push(1); return () => {} } +const obj = { + get prop() { + result.push(2); + return { + get foo() { result.push(3); return () => {} } + } + } +}; +class A { + @fn() + @obj.prop.foo + method() {} +} + +expect(result).toEqual([1, 2, 3]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering--to-es2015/decorators-evaluation-with-this-caching/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering--to-es2015/decorators-evaluation-with-this-caching/input.js new file mode 100644 index 000000000000..819f9050333d --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering--to-es2015/decorators-evaluation-with-this-caching/input.js @@ -0,0 +1,7 @@ +let fn, obj; +class A { + @fn() + @obj.prop.foo + method() {} +} + diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering--to-es2015/decorators-evaluation-with-this-caching/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering--to-es2015/decorators-evaluation-with-this-caching/output.js new file mode 100644 index 000000000000..37553d2f21b4 --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering--to-es2015/decorators-evaluation-with-this-caching/output.js @@ -0,0 +1,11 @@ +var _initProto, _obj, _methodDecs, _A; +let fn, obj; +_methodDecs = [void 0, fn(), _obj = obj.prop, _obj.foo]; +class A { + constructor() { + _initProto(this); + } + method() {} +} +_A = A; +[_initProto] = babelHelpers.applyDecs2311(_A, [[_methodDecs, 18, "method"]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering/decorators-evaluation-with-this-caching/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering/decorators-evaluation-with-this-caching/input.js new file mode 100644 index 000000000000..819f9050333d --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering/decorators-evaluation-with-this-caching/input.js @@ -0,0 +1,7 @@ +let fn, obj; +class A { + @fn() + @obj.prop.foo + method() {} +} + diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering/decorators-evaluation-with-this-caching/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering/decorators-evaluation-with-this-caching/output.js new file mode 100644 index 000000000000..c6ee9ed4a6c8 --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-ordering/decorators-evaluation-with-this-caching/output.js @@ -0,0 +1,12 @@ +var _initProto, _obj, _methodDecs; +let fn, obj; +_methodDecs = [void 0, fn(), _obj = obj.prop, _obj.foo]; +class A { + static { + [_initProto] = babelHelpers.applyDecs2311(this, [[_methodDecs, 18, "method"]], []).e; + } + constructor() { + _initProto(this); + } + method() {} +}