From 177903aa37d277ea432f8a7759aff07c6201f15f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 4 Feb 2022 17:01:01 -0500 Subject: [PATCH 01/15] decorated class and class init are returned last --- .../src/transformer-2021-12.ts | 5 +---- .../valid-expression-formats/output.js | 2 +- .../test/fixtures/2021-12-misc/all-decorators/output.js | 2 +- .../fixtures/2021-12-misc/valid-expression-formats/output.js | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts b/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts index 97be9c463e68..a4c663499d4a 100644 --- a/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts +++ b/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts @@ -766,10 +766,6 @@ function transformClass( const locals: t.Identifier[] = extractElementLocalAssignments(elementDecoratorInfo); - if (classDecorators) { - locals.push(classLocal, classInitLocal); - } - if (requiresProtoInit) { protoInitLocal = path.scope.parent.generateDeclaredUidIdentifier("initProto"); @@ -879,6 +875,7 @@ function transformClass( const originalClass = path.node; if (classDecorators) { + locals.push(classLocal, classInitLocal); const statics = []; let staticBlocks: t.StaticBlock[] = []; path.get("body.body").forEach(element => { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js index 79b845170bc7..cbee7920e41e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js @@ -32,7 +32,7 @@ class Foo { } (() => { - [_Foo, _initClass, _initProto] = babelHelpers.applyDecs(Foo, [[[dec, call(), chain.expr(), arbitrary + expr, array[expr]], 2, "method"]], [dec, call(), chain.expr(), arbitrary + expr, array[expr]]); + [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(Foo, [[[dec, call(), chain.expr(), arbitrary + expr, array[expr]], 2, "method"]], [dec, call(), chain.expr(), arbitrary + expr, array[expr]]); })(); (() => { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js index d13052811623..b851ad2a66fb 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js @@ -6,7 +6,7 @@ new class extends babelHelpers.identity { static { class Class { static { - [_init_a, _init_d, _init_e, _call_f, _call_g, _call_g2, _init_h, _get_h, _set_h, _init_i, _init_m, _init_n, _call_o, _call_p, _call_q, _init_r, _get_r, _set_r, _Class, _initClass, _initProto, _initStatic] = babelHelpers.applyDecs(this, [[dec, 0, "a"], [dec, 2, "b"], [dec, 3, "c"], [dec, 4, "c"], [dec, 1, "d"], [dec, 0, "e", function () { + [_init_a, _init_d, _init_e, _call_f, _call_g, _call_g2, _init_h, _get_h, _set_h, _init_i, _init_m, _init_n, _call_o, _call_p, _call_q, _init_r, _get_r, _set_r, _initProto, _initStatic, _Class, _initClass] = babelHelpers.applyDecs(this, [[dec, 0, "a"], [dec, 2, "b"], [dec, 3, "c"], [dec, 4, "c"], [dec, 1, "d"], [dec, 0, "e", function () { return this.#e; }, function (value) { this.#e = value; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js index 5490137a9009..a72db7236833 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js @@ -4,7 +4,7 @@ let _Foo; class Foo { static { - [_Foo, _initClass, _initProto] = babelHelpers.applyDecs(this, [[[dec, call(), chain.expr(), arbitrary + expr, array[expr]], 2, "method"]], [dec, call(), chain.expr(), arbitrary + expr, array[expr]]); + [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(this, [[[dec, call(), chain.expr(), arbitrary + expr, array[expr]], 2, "method"]], [dec, call(), chain.expr(), arbitrary + expr, array[expr]]); } constructor(...args) { From 6c8e7ca2de7edc767bd00885fe43bfe5eef82aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 4 Feb 2022 17:41:00 -0500 Subject: [PATCH 02/15] fix: class decs eval earlier than member decs --- .../babel-helpers/src/helpers-generated.ts | 2 +- .../babel-helpers/src/helpers/applyDecs.js | 2 +- .../src/transformer-2021-12.ts | 2 +- .../private/output.js | 4 ++-- .../public/output.js | 2 +- .../static-private/output.js | 4 ++-- .../static-public/output.js | 2 +- .../2021-12-accessors/private/output.js | 4 ++-- .../2021-12-accessors/public/output.js | 2 +- .../2021-12-accessors/static-private/output.js | 4 ++-- .../2021-12-accessors/static-public/output.js | 2 +- .../output.js | 2 +- .../super-in-private-accessor/output.js | 4 ++-- .../super-in-private-method/output.js | 4 ++-- .../expressions/output.js | 18 +++++++++--------- .../inheritance/output.js | 4 ++-- .../initializers/output.js | 4 ++-- .../output.js | 2 +- .../replacement-static-this/output.js | 2 +- .../replacement-with-expr/output.js | 2 +- .../replacement/output.js | 2 +- .../2021-12-classes/expressions/output.js | 18 +++++++++--------- .../2021-12-classes/inheritance/output.js | 4 ++-- .../2021-12-classes/initializers/output.js | 4 ++-- .../output.js | 2 +- .../replacement-static-this/output.js | 2 +- .../replacement-with-expr/output.js | 2 +- .../2021-12-classes/replacement/output.js | 2 +- .../computed-keys-same-ast/output.js | 2 +- .../computed-keys-same-value/output.js | 2 +- .../method-and-field/output.js | 2 +- .../methods-with-same-key/output.js | 2 +- .../computed-keys-same-ast/output.js | 2 +- .../computed-keys-same-value/output.js | 2 +- .../method-and-field/output.js | 2 +- .../methods-with-same-key/output.js | 2 +- .../private/output.js | 4 ++-- .../2021-12-fields--to-es2015/public/output.js | 2 +- .../static-private/output.js | 4 ++-- .../static-public/output.js | 2 +- .../fixtures/2021-12-fields/private/output.js | 4 ++-- .../fixtures/2021-12-fields/public/output.js | 2 +- .../2021-12-fields/static-private/output.js | 4 ++-- .../2021-12-fields/static-public/output.js | 2 +- .../private/output.js | 4 ++-- .../public/output.js | 2 +- .../static-private/output.js | 4 ++-- .../static-public/output.js | 2 +- .../private/output.js | 4 ++-- .../public/output.js | 2 +- .../static-private/output.js | 4 ++-- .../static-public/output.js | 2 +- .../private/output.js | 4 ++-- .../public/output.js | 2 +- .../static-private/output.js | 4 ++-- .../static-public/output.js | 2 +- .../fixtures/2021-12-getters/private/output.js | 4 ++-- .../fixtures/2021-12-getters/public/output.js | 2 +- .../2021-12-getters/static-private/output.js | 4 ++-- .../2021-12-getters/static-public/output.js | 2 +- .../private/output.js | 4 ++-- .../public/output.js | 2 +- .../static-private/output.js | 4 ++-- .../static-public/output.js | 2 +- .../fixtures/2021-12-methods/private/output.js | 4 ++-- .../fixtures/2021-12-methods/public/output.js | 2 +- .../2021-12-methods/static-private/output.js | 4 ++-- .../2021-12-methods/static-public/output.js | 2 +- .../output.js | 2 +- .../valid-expression-formats/output.js | 4 ++-- .../2021-12-misc/all-decorators/output.js | 4 ++-- .../output.js | 4 ++-- .../output.js | 2 +- .../output.js | 2 +- .../super-in-private-accessor/output.js | 4 ++-- .../super-in-private-method/output.js | 4 ++-- .../valid-expression-formats/output.js | 4 ++-- .../private/output.js | 4 ++-- .../public/output.js | 2 +- .../static-private/output.js | 4 ++-- .../static-public/output.js | 2 +- .../fixtures/2021-12-setters/private/output.js | 4 ++-- .../fixtures/2021-12-setters/public/output.js | 2 +- .../2021-12-setters/static-private/output.js | 4 ++-- .../2021-12-setters/static-public/output.js | 2 +- 85 files changed, 137 insertions(+), 137 deletions(-) diff --git a/packages/babel-helpers/src/helpers-generated.ts b/packages/babel-helpers/src/helpers-generated.ts index 5e96bc36f34f..66481bff9b86 100644 --- a/packages/babel-helpers/src/helpers-generated.ts +++ b/packages/babel-helpers/src/helpers-generated.ts @@ -15,7 +15,7 @@ function helper(minVersion, source) { export default Object.freeze({ applyDecs: helper( "7.17.0", - 'function createMetadataMethodsForProperty(metadataMap,kind,property){return{getMetadata(key){if("symbol"!=typeof key)throw new TypeError("Metadata keys must be symbols, received: "+key);var metadataForKey=metadataMap[key];if(void 0!==metadataForKey)if(1===kind){var pub=metadataForKey.public;if(void 0!==pub)return pub[property]}else if(2===kind){var priv=metadataForKey.private;if(void 0!==priv)return priv.get(property)}else if(Object.hasOwnProperty.call(metadataForKey,"constructor"))return metadataForKey.constructor},setMetadata(key,value){if("symbol"!=typeof key)throw new TypeError("Metadata keys must be symbols, received: "+key);var metadataForKey=metadataMap[key];if(void 0===metadataForKey&&(metadataForKey=metadataMap[key]={}),1===kind){var pub=metadataForKey.public;void 0===pub&&(pub=metadataForKey.public={}),pub[property]=value}else if(2===kind){var priv=metadataForKey.priv;void 0===priv&&(priv=metadataForKey.private=new Map),priv.set(property,value)}else metadataForKey.constructor=value}}}function convertMetadataMapToFinal(obj,metadataMap){var parentMetadataMap=obj[Symbol.metadata||Symbol.for("Symbol.metadata")],metadataKeys=Object.getOwnPropertySymbols(metadataMap);if(0!==metadataKeys.length){for(var i=0;i3,isStatic=kind>=5;if(isStatic?(base=Class,metadataMap=staticMetadataMap,kind-=5,staticInitializers||(staticInitializers=[]),initializers=staticInitializers):(base=Class.prototype,metadataMap=protoMetadataMap,protoInitializers||(protoInitializers=[]),initializers=protoInitializers),0!==kind&&!isPrivate){var existingNonFields=isStatic?existingStaticNonFields:existingProtoNonFields,existingKind=existingNonFields.get(name)||0;if(!0===existingKind||3===existingKind&&4!==kind||4===existingKind&&3!==kind)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+name);!existingKind&&kind>2?existingNonFields.set(name,kind):existingNonFields.set(name,!0)}applyMemberDec(ret,base,decInfo,name,kind,isStatic,isPrivate,metadataMap,initializers)}}protoInitializers&&pushInitializers(ret,protoInitializers),staticInitializers&&pushInitializers(ret,staticInitializers)}function pushInitializers(ret,initializers){initializers.length>0?(initializers=initializers.slice(),ret.push((function(instance){for(var i=0;i0?ret.push((function(){for(var i=0;i3,isStatic=kind>=5;if(isStatic?(base=Class,metadataMap=staticMetadataMap,kind-=5,staticInitializers||(staticInitializers=[]),initializers=staticInitializers):(base=Class.prototype,metadataMap=protoMetadataMap,protoInitializers||(protoInitializers=[]),initializers=protoInitializers),0!==kind&&!isPrivate){var existingNonFields=isStatic?existingStaticNonFields:existingProtoNonFields,existingKind=existingNonFields.get(name)||0;if(!0===existingKind||3===existingKind&&4!==kind||4===existingKind&&3!==kind)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+name);!existingKind&&kind>2?existingNonFields.set(name,kind):existingNonFields.set(name,!0)}applyMemberDec(ret,base,decInfo,name,kind,isStatic,isPrivate,metadataMap,initializers)}}protoInitializers&&pushInitializers(ret,protoInitializers),staticInitializers&&pushInitializers(ret,staticInitializers)}function pushInitializers(ret,initializers){initializers.length>0?(initializers=initializers.slice(),ret.push((function(instance){for(var i=0;i0?ret.push((function(){for(var i=0;i { - [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs(Foo, [[dec, 1, "a", function () { + [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs(Foo, [], [[dec, 1, "a", function () { return babelHelpers.classPrivateFieldGet(this, _A); }, function (value) { babelHelpers.classPrivateFieldSet(this, _A, value); @@ -55,5 +55,5 @@ function _get_b2() { return babelHelpers.classPrivateFieldGet(this, _B); }, function (value) { babelHelpers.classPrivateFieldSet(this, _B, value); - }]], []); + }]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js index 2a6057e84caa..80f4ab1677b3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js @@ -54,5 +54,5 @@ class Foo { } (() => { - [_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs(Foo, [[_dec, 1, "a"], [_dec2, 1, "b"], [_dec3, 1, _computedKey]], []); + [_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs(Foo, [], [[_dec, 1, "a"], [_dec2, 1, "b"], [_dec3, 1, _computedKey]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js index b0ec49e5726f..18dee707a780 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js @@ -35,7 +35,7 @@ function _get_b2() { } (() => { - [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs(Foo, [[dec, 6, "a", function () { + [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs(Foo, [], [[dec, 6, "a", function () { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _A); }, function (value) { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _A, value); @@ -43,7 +43,7 @@ function _get_b2() { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _B); }, function (value) { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _B, value); - }]], []); + }]]); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js index c5a6ac47eba2..ab6cbafbf7c6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js @@ -33,7 +33,7 @@ class Foo { } (() => { - [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs(Foo, [[_dec, 6, "a"], [_dec2, 6, "b"], [_dec3, 6, _computedKey]], []); + [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs(Foo, [], [[_dec, 6, "a"], [_dec2, 6, "b"], [_dec3, 6, _computedKey]]); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/output.js index c054a288032a..8963aecbf802 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/output.js @@ -2,7 +2,7 @@ var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto; class Foo { static { - [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs(this, [[dec, 1, "a", function () { + [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 1, "a", function () { return this.#A; }, function (value) { this.#A = value; @@ -10,7 +10,7 @@ class Foo { return this.#B; }, function (value) { this.#B = value; - }]], []); + }]]); } #A = (_initProto(this), _init_a(this)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/output.js index 0fb94194b1db..615d5f4bd704 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/output.js @@ -7,7 +7,7 @@ _dec3 = dec class Foo { static { - [_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs(this, [[_dec, 1, "a"], [_dec2, 1, "b"], [_dec3, 1, _computedKey]], []); + [_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs(this, [], [[_dec, 1, "a"], [_dec2, 1, "b"], [_dec3, 1, _computedKey]]); } #A = (_initProto(this), _init_a(this)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/output.js index ad30531a425e..4a73a98a2db8 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/output.js @@ -2,7 +2,7 @@ var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic; class Foo { static { - [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs(this, [[dec, 6, "a", function () { + [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs(this, [], [[dec, 6, "a", function () { return this.#A; }, function (value) { this.#A = value; @@ -10,7 +10,7 @@ class Foo { return this.#B; }, function (value) { this.#B = value; - }]], []); + }]]); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/output.js index 471adf36f9c9..8cced673f640 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/output.js @@ -7,7 +7,7 @@ _dec3 = dec class Foo { static { - [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs(this, [[_dec, 6, "a"], [_dec2, 6, "b"], [_dec3, 6, _computedKey]], []); + [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs(this, [], [[_dec, 6, "a"], [_dec2, 6, "b"], [_dec3, 6, _computedKey]]); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/output.js index dcf5a0fae917..0ad7db798b8d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/output.js @@ -4,7 +4,7 @@ let _Foo; class Foo extends Bar { static { - [_Foo, _initClass] = babelHelpers.applyDecs(this, [], [dec]); + [_Foo, _initClass] = babelHelpers.applyDecs(this, [dec], []); } constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/output.js index 17cd5aa63e11..f809cccfae2f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/output.js @@ -2,9 +2,9 @@ var _call_x, _initProto; class Foo extends Bar { static { - [_call_x, _initProto] = babelHelpers.applyDecs(this, [[dec, 3, "x", function () { + [_call_x, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 3, "x", function () { return Bar.prototype.foo.call(this); - }]], []); + }]]); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/output.js index 91246a1f387a..8ba998234c3a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/output.js @@ -2,9 +2,9 @@ var _call_x, _initProto; class Foo extends Bar { static { - [_call_x, _initProto] = babelHelpers.applyDecs(this, [[dec, 2, "x", function () { + [_call_x, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 2, "x", function () { return Bar.prototype.foo.call(this); - }]], []); + }]]); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/output.js index b0cce043afbe..82a7b1955e97 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/output.js @@ -1,41 +1,41 @@ var _initClass, _A, _class, _temp, _initClass2, _C, _class2, _temp2, _initClass3, _D, _class3, _temp3, _initClass4, _decorated_class, _class4, _temp4, _initClass5, _G, _class5, _temp5, _initClass6, _decorated_class2, _class6, _temp6, _initClass7, _H, _class7, _temp7, _initClass8, _K, _class8, _temp8; const A = ((_temp = _class = class A {}, (() => { - [_A, _initClass] = babelHelpers.applyDecs(_class, [], [dec]); + [_A, _initClass] = babelHelpers.applyDecs(_class, [dec], []); })(), (() => { _initClass(); })(), _temp), _A); const B = ((_temp2 = _class2 = class C {}, (() => { - [_C, _initClass2] = babelHelpers.applyDecs(_class2, [], [dec]); + [_C, _initClass2] = babelHelpers.applyDecs(_class2, [dec], []); })(), (() => { _initClass2(); })(), _temp2), _C); const D = ((_temp3 = _class3 = class D {}, (() => { - [_D, _initClass3] = babelHelpers.applyDecs(_class3, [], [dec]); + [_D, _initClass3] = babelHelpers.applyDecs(_class3, [dec], []); })(), (() => { _initClass3(); })(), _temp3), _D); const E = (((_temp4 = _class4 = class {}, (() => { - [_decorated_class, _initClass4] = babelHelpers.applyDecs(_class4, [], [dec]); + [_decorated_class, _initClass4] = babelHelpers.applyDecs(_class4, [dec], []); })(), (() => { _initClass4(); })(), _temp4), _decorated_class), 123); const F = [((_temp5 = _class5 = class G {}, (() => { - [_G, _initClass5] = babelHelpers.applyDecs(_class5, [], [dec]); + [_G, _initClass5] = babelHelpers.applyDecs(_class5, [dec], []); })(), (() => { _initClass5(); })(), _temp5), _G), ((_temp6 = _class6 = class {}, (() => { - [_decorated_class2, _initClass6] = babelHelpers.applyDecs(_class6, [], [dec]); + [_decorated_class2, _initClass6] = babelHelpers.applyDecs(_class6, [dec], []); })(), (() => { _initClass6(); })(), _temp6), _decorated_class2)]; const H = ((_temp7 = _class7 = class H extends I {}, (() => { - [_H, _initClass7] = babelHelpers.applyDecs(_class7, [], [dec]); + [_H, _initClass7] = babelHelpers.applyDecs(_class7, [dec], []); })(), (() => { _initClass7(); })(), _temp7), _H); const J = ((_temp8 = _class8 = class K extends L {}, (() => { - [_K, _initClass8] = babelHelpers.applyDecs(_class8, [], [dec]); + [_K, _initClass8] = babelHelpers.applyDecs(_class8, [dec], []); })(), (() => { _initClass8(); })(), _temp8), _K); @@ -44,7 +44,7 @@ function classFactory() { var _initClass9, _decorated_class3, _class9, _temp9; return (_temp9 = _class9 = class {}, (() => { - [_decorated_class3, _initClass9] = babelHelpers.applyDecs(_class9, [], [dec]); + [_decorated_class3, _initClass9] = babelHelpers.applyDecs(_class9, [dec], []); })(), (() => { _initClass9(); })(), _temp9), _decorated_class3; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/output.js index 605270eadeca..7743aef4790a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/output.js @@ -5,7 +5,7 @@ let _Bar; class Bar {} (() => { - [_Bar, _initClass] = babelHelpers.applyDecs(Bar, [], [dec1]); + [_Bar, _initClass] = babelHelpers.applyDecs(Bar, [dec1], []); })(); (() => { @@ -17,7 +17,7 @@ let _Foo; class Foo extends _Bar {} (() => { - [_Foo, _initClass2] = babelHelpers.applyDecs(Foo, [], [dec2]); + [_Foo, _initClass2] = babelHelpers.applyDecs(Foo, [dec2], []); })(); (() => { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/output.js index 3ed28458cab0..1b83b817ea4d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/output.js @@ -13,7 +13,7 @@ new (_temp2 = class extends babelHelpers.identity { class Foo {} (() => { - [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [], [dec]); + [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [dec], []); })(); })(), _temp2)(); @@ -32,6 +32,6 @@ new (_temp4 = class extends babelHelpers.identity { class Bar extends _Foo {} (() => { - [_Bar, _initClass2] = babelHelpers.applyDecs(Bar, [], [dec]); + [_Bar, _initClass2] = babelHelpers.applyDecs(Bar, [dec], []); })(); })(), _temp4)(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js index f11cf07517d3..0df387024c4d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js @@ -25,7 +25,7 @@ new (_temp2 = (_x = /*#__PURE__*/new WeakMap(), _m = /*#__PURE__*/new WeakSet(), } (() => { - [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [], [dec]); + [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [dec], []); })(); })(), _temp2)(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/output.js index fe77f96f5af9..a9f1868b64bf 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/output.js @@ -17,6 +17,6 @@ new (_temp2 = class extends babelHelpers.identity { class Foo {} (() => { - [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [], [dec]); + [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [dec], []); })(); })(), _temp2)(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/output.js index f1f8cd9df38d..ff7c0363b4aa 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/output.js @@ -6,7 +6,7 @@ const Foo = ((_temp = _class = class Bar { } }, (() => { - [_Bar, _initClass] = babelHelpers.applyDecs(_class, [], [dec]); + [_Bar, _initClass] = babelHelpers.applyDecs(_class, [dec], []); })(), (() => { _initClass(); })(), _temp), _Bar); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/output.js index f302d19a6ecb..512a5a54c15b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/output.js @@ -13,7 +13,7 @@ new (_temp2 = class extends babelHelpers.identity { class Foo {} (() => { - [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [], [dec]); + [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [dec], []); })(); })(), _temp2)(); const foo = new _Foo(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/output.js index 146cdb17ca70..e7d1d8c0e01a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/output.js @@ -2,7 +2,7 @@ var _initClass, _A, _initClass2, _C, _initClass3, _D, _initClass4, _decorated_cl const A = (class A { static { - [_A, _initClass] = babelHelpers.applyDecs(this, [], [dec]); + [_A, _initClass] = babelHelpers.applyDecs(this, [dec], []); } static { _initClass(); @@ -11,7 +11,7 @@ const A = (class A { }, _A); const B = (class C { static { - [_C, _initClass2] = babelHelpers.applyDecs(this, [], [dec]); + [_C, _initClass2] = babelHelpers.applyDecs(this, [dec], []); } static { _initClass2(); @@ -20,7 +20,7 @@ const B = (class C { }, _C); const D = (class D { static { - [_D, _initClass3] = babelHelpers.applyDecs(this, [], [dec]); + [_D, _initClass3] = babelHelpers.applyDecs(this, [dec], []); } static { _initClass3(); @@ -29,7 +29,7 @@ const D = (class D { }, _D); const E = ((class { static { - [_decorated_class, _initClass4] = babelHelpers.applyDecs(this, [], [dec]); + [_decorated_class, _initClass4] = babelHelpers.applyDecs(this, [dec], []); } static { _initClass4(); @@ -38,7 +38,7 @@ const E = ((class { }, _decorated_class), 123); const F = [(class G { static { - [_G, _initClass5] = babelHelpers.applyDecs(this, [], [dec]); + [_G, _initClass5] = babelHelpers.applyDecs(this, [dec], []); } static { _initClass5(); @@ -46,7 +46,7 @@ const F = [(class G { } }, _G), (class { static { - [_decorated_class2, _initClass6] = babelHelpers.applyDecs(this, [], [dec]); + [_decorated_class2, _initClass6] = babelHelpers.applyDecs(this, [dec], []); } static { _initClass6(); @@ -55,7 +55,7 @@ const F = [(class G { }, _decorated_class2)]; const H = (class H extends I { static { - [_H, _initClass7] = babelHelpers.applyDecs(this, [], [dec]); + [_H, _initClass7] = babelHelpers.applyDecs(this, [dec], []); } static { _initClass7(); @@ -64,7 +64,7 @@ const H = (class H extends I { }, _H); const J = (class K extends L { static { - [_K, _initClass8] = babelHelpers.applyDecs(this, [], [dec]); + [_K, _initClass8] = babelHelpers.applyDecs(this, [dec], []); } static { _initClass8(); @@ -77,7 +77,7 @@ function classFactory() { return class { static { - [_decorated_class3, _initClass9] = babelHelpers.applyDecs(this, [], [dec]); + [_decorated_class3, _initClass9] = babelHelpers.applyDecs(this, [dec], []); } static { _initClass9(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/output.js index d7ea9b35166e..f7c7bf3a461c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/output.js @@ -4,7 +4,7 @@ let _Bar; class Bar { static { - [_Bar, _initClass] = babelHelpers.applyDecs(this, [], [dec1]); + [_Bar, _initClass] = babelHelpers.applyDecs(this, [dec1], []); } static { _initClass(); @@ -16,7 +16,7 @@ let _Foo; class Foo extends _Bar { static { - [_Foo, _initClass2] = babelHelpers.applyDecs(this, [], [dec2]); + [_Foo, _initClass2] = babelHelpers.applyDecs(this, [dec2], []); } static { _initClass2(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/output.js index 982a63a72f28..bdac7d68cb92 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/output.js @@ -6,7 +6,7 @@ new class extends babelHelpers.identity { static { class Foo { static { - [_Foo, _initClass] = babelHelpers.applyDecs(this, [], [dec]); + [_Foo, _initClass] = babelHelpers.applyDecs(this, [dec], []); } } @@ -25,7 +25,7 @@ new class extends babelHelpers.identity { static { class Bar extends _Foo { static { - [_Bar, _initClass2] = babelHelpers.applyDecs(this, [], [dec]); + [_Bar, _initClass2] = babelHelpers.applyDecs(this, [dec], []); } } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/output.js index 8f36ec034422..cc29cc50b73c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/output.js @@ -8,7 +8,7 @@ new class extends babelHelpers.identity { static { class Foo { static { - [_Foo, _initClass] = babelHelpers.applyDecs(this, [], [dec]); + [_Foo, _initClass] = babelHelpers.applyDecs(this, [dec], []); } static m() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/output.js index 5ca20ff8d696..c613d339e566 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/output.js @@ -6,7 +6,7 @@ new class extends babelHelpers.identity { static { class Foo { static { - [_Foo, _initClass] = babelHelpers.applyDecs(this, [], [dec]); + [_Foo, _initClass] = babelHelpers.applyDecs(this, [dec], []); } } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/output.js index 4c37edebb1dd..98eb446eb9f6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/output.js @@ -2,7 +2,7 @@ var _initClass, _Bar; const Foo = (class Bar { static { - [_Bar, _initClass] = babelHelpers.applyDecs(this, [], [dec]); + [_Bar, _initClass] = babelHelpers.applyDecs(this, [dec], []); } bar = new _Bar(); static { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/output.js index 42a115d10f2b..21a78b8f3a1d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/output.js @@ -6,7 +6,7 @@ new class extends babelHelpers.identity { static { class Foo { static { - [_Foo, _initClass] = babelHelpers.applyDecs(this, [], [dec]); + [_Foo, _initClass] = babelHelpers.applyDecs(this, [dec], []); } } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/output.js index a70d24de54c9..144405be52a8 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/output.js @@ -21,5 +21,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]], []); + [_initProto] = babelHelpers.applyDecs(Foo, [], [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/output.js index 66e2ac318d83..b9f4dc662701 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/output.js @@ -21,5 +21,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]], []); + [_initProto] = babelHelpers.applyDecs(Foo, [], [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/output.js index fe79aa632006..a48bcd18d086 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/output.js @@ -12,5 +12,5 @@ class Foo { } (() => { - [_init_a, _initProto] = babelHelpers.applyDecs(Foo, [[dec, 0, "a"], [dec, 2, "a"]], []); + [_init_a, _initProto] = babelHelpers.applyDecs(Foo, [], [[dec, 0, "a"], [dec, 2, "a"]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/output.js index 6402e1341ff0..1978501f90eb 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/output.js @@ -16,5 +16,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [[dec, 2, "a"], [dec, 2, "a"]], []); + [_initProto] = babelHelpers.applyDecs(Foo, [], [[dec, 2, "a"], [dec, 2, "a"]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/output.js index 9663aebaf7b3..89a91f4df320 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/output.js @@ -7,7 +7,7 @@ _dec2 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]], []); + [_initProto] = babelHelpers.applyDecs(this, [], [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]]); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/output.js index 76d9f05cad75..5e6009ac8dc4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/output.js @@ -7,7 +7,7 @@ _dec2 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]], []); + [_initProto] = babelHelpers.applyDecs(this, [], [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]]); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/output.js index cb04e3cc2e5d..5658e6460faa 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/output.js @@ -2,7 +2,7 @@ var _init_a, _initProto; class Foo { static { - [_init_a, _initProto] = babelHelpers.applyDecs(this, [[dec, 0, "a"], [dec, 2, "a"]], []); + [_init_a, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 0, "a"], [dec, 2, "a"]]); } a = (_initProto(this), _init_a(this, 123)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/output.js index c4befb4def4d..0ccbda4ec69f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/output.js @@ -2,7 +2,7 @@ var _initProto; class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [[dec, 2, "a"], [dec, 2, "a"]], []); + [_initProto] = babelHelpers.applyDecs(this, [], [[dec, 2, "a"], [dec, 2, "a"]]); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js index af27fce2d289..e861e3d6e86d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js @@ -19,7 +19,7 @@ class Foo { } (() => { - [_init_a, _init_b] = babelHelpers.applyDecs(Foo, [[dec, 0, "a", function () { + [_init_a, _init_b] = babelHelpers.applyDecs(Foo, [], [[dec, 0, "a", function () { return babelHelpers.classPrivateFieldGet(this, _a); }, function (value) { babelHelpers.classPrivateFieldSet(this, _a, value); @@ -27,5 +27,5 @@ class Foo { return babelHelpers.classPrivateFieldGet(this, _b); }, function (value) { babelHelpers.classPrivateFieldSet(this, _b, value); - }]], []); + }]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/output.js index 481926ddfe5a..02ba6397d4e0 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/output.js @@ -15,5 +15,5 @@ class Foo { } (() => { - [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(Foo, [[_dec, 0, "a"], [_dec2, 0, "b"], [_dec3, 0, _computedKey]], []); + [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(Foo, [], [[_dec, 0, "a"], [_dec2, 0, "b"], [_dec3, 0, _computedKey]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js index ad619ac7d598..4dce48c7a5c3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js @@ -3,7 +3,7 @@ var _init_a, _init_b; class Foo {} (() => { - [_init_a, _init_b] = babelHelpers.applyDecs(Foo, [[dec, 5, "a", function () { + [_init_a, _init_b] = babelHelpers.applyDecs(Foo, [], [[dec, 5, "a", function () { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); }, function (value) { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, value); @@ -11,7 +11,7 @@ class Foo {} return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _b); }, function (value) { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _b, value); - }]], []); + }]]); })(); var _a = { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/output.js index c5df8314385b..31c0de3ef18a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/output.js @@ -8,7 +8,7 @@ _dec3 = dec class Foo {} (() => { - [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(Foo, [[_dec, 5, "a"], [_dec2, 5, "b"], [_dec3, 5, _computedKey]], []); + [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(Foo, [], [[_dec, 5, "a"], [_dec2, 5, "b"], [_dec3, 5, _computedKey]]); })(); babelHelpers.defineProperty(Foo, "a", _init_a(Foo)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/output.js index b72a6d971df6..8150d2411131 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/output.js @@ -2,7 +2,7 @@ var _init_a, _init_b; class Foo { static { - [_init_a, _init_b] = babelHelpers.applyDecs(this, [[dec, 0, "a", function () { + [_init_a, _init_b] = babelHelpers.applyDecs(this, [], [[dec, 0, "a", function () { return this.#a; }, function (value) { this.#a = value; @@ -10,7 +10,7 @@ class Foo { return this.#b; }, function (value) { this.#b = value; - }]], []); + }]]); } #a = _init_a(this); #b = _init_b(this, 123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/output.js index 06c0434d04a6..5e4a71f7f7e1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/output.js @@ -7,7 +7,7 @@ _dec3 = dec class Foo { static { - [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(this, [[_dec, 0, "a"], [_dec2, 0, "b"], [_dec3, 0, _computedKey]], []); + [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(this, [], [[_dec, 0, "a"], [_dec2, 0, "b"], [_dec3, 0, _computedKey]]); } a = _init_a(this); b = _init_b(this, 123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/output.js index cb167ff192fd..ce2ffab23da0 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/output.js @@ -2,7 +2,7 @@ var _init_a, _init_b; class Foo { static { - [_init_a, _init_b] = babelHelpers.applyDecs(this, [[dec, 5, "a", function () { + [_init_a, _init_b] = babelHelpers.applyDecs(this, [], [[dec, 5, "a", function () { return this.#a; }, function (value) { this.#a = value; @@ -10,7 +10,7 @@ class Foo { return this.#b; }, function (value) { this.#b = value; - }]], []); + }]]); } static #a = _init_a(this); static #b = _init_b(this, 123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/output.js index 64af25745500..c38ecf2f0a89 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/output.js @@ -7,7 +7,7 @@ _dec3 = dec class Foo { static { - [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(this, [[_dec, 5, "a"], [_dec2, 5, "b"], [_dec3, 5, _computedKey]], []); + [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(this, [], [[_dec, 5, "a"], [_dec2, 5, "b"], [_dec3, 5, _computedKey]]); } static a = _init_a(this); static b = _init_b(this, 123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js index 32971ca073e9..33d0b1969828 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js @@ -24,7 +24,7 @@ function _get_a() { } (() => { - [_call_a, _initProto] = babelHelpers.applyDecs(Foo, [[dec, 3, "a", function () { + [_call_a, _initProto] = babelHelpers.applyDecs(Foo, [], [[dec, 3, "a", function () { return this.value; - }]], []); + }]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/output.js index 0152dbf977de..dff92a9991bb 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/output.js @@ -22,5 +22,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 3, "a"], [_dec2, 3, _computedKey]], []); + [_initProto] = babelHelpers.applyDecs(Foo, [], [[_dec, 3, "a"], [_dec2, 3, _computedKey]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js index e0262570f9e3..96b4c6ee811b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js @@ -17,9 +17,9 @@ var _a = { }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs(Foo, [[dec, 8, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs(Foo, [], [[dec, 8, "a", function () { return this.value; - }]], []); + }]]); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/output.js index 68787d432777..49f3b123df38 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/output.js @@ -16,7 +16,7 @@ class Foo { } (() => { - [_initStatic] = babelHelpers.applyDecs(Foo, [[_dec, 8, "a"], [_dec2, 8, _computedKey]], []); + [_initStatic] = babelHelpers.applyDecs(Foo, [], [[_dec, 8, "a"], [_dec2, 8, _computedKey]]); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js index 71e95a6ee2a2..9aab4cbf2918 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js @@ -32,9 +32,9 @@ function _set_a(v) { } (() => { - [_call_a, _call_a2, _initProto] = babelHelpers.applyDecs(Foo, [[dec, 3, "a", function () { + [_call_a, _call_a2, _initProto] = babelHelpers.applyDecs(Foo, [], [[dec, 3, "a", function () { return this.value; }], [dec, 4, "a", function (v) { this.value = v; - }]], []); + }]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/output.js index a05760c5cfe9..224db038c8ee 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/output.js @@ -33,5 +33,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 3, "a"], [_dec2, 4, "a"], [_dec3, 3, _computedKey], [_dec4, 4, _computedKey2]], []); + [_initProto] = babelHelpers.applyDecs(Foo, [], [[_dec, 3, "a"], [_dec2, 4, "a"], [_dec3, 3, _computedKey], [_dec4, 4, _computedKey2]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js index e9ac78c2c966..3f8dd045cd95 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js @@ -25,11 +25,11 @@ var _a = { }; (() => { - [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs(Foo, [[dec, 8, "a", function () { + [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs(Foo, [], [[dec, 8, "a", function () { return this.value; }], [dec, 9, "a", function (v) { this.value = v; - }]], []); + }]]); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/output.js index edcb11764a7a..4e3ad36df46e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/output.js @@ -27,7 +27,7 @@ class Foo { } (() => { - [_initStatic] = babelHelpers.applyDecs(Foo, [[_dec, 8, "a"], [_dec2, 9, "a"], [_dec3, 8, _computedKey], [_dec4, 9, _computedKey2]], []); + [_initStatic] = babelHelpers.applyDecs(Foo, [], [[_dec, 8, "a"], [_dec2, 9, "a"], [_dec3, 8, _computedKey], [_dec4, 9, _computedKey2]]); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/output.js index bcf3cae9176e..b98e8f8c50df 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/output.js @@ -2,11 +2,11 @@ var _call_a, _call_a2, _initProto; class Foo { static { - [_call_a, _call_a2, _initProto] = babelHelpers.applyDecs(this, [[dec, 3, "a", function () { + [_call_a, _call_a2, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 3, "a", function () { return this.value; }], [dec, 4, "a", function (v) { this.value = v; - }]], []); + }]]); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/output.js index 1a7c8951454d..d3e22d1b8ee2 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/output.js @@ -9,7 +9,7 @@ _dec4 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [[_dec, 3, "a"], [_dec2, 4, "a"], [_dec3, 3, _computedKey], [_dec4, 4, _computedKey2]], []); + [_initProto] = babelHelpers.applyDecs(this, [], [[_dec, 3, "a"], [_dec2, 4, "a"], [_dec3, 3, _computedKey], [_dec4, 4, _computedKey2]]); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/output.js index e897ea3cd18e..ff8959874357 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/output.js @@ -2,11 +2,11 @@ var _call_a, _call_a2, _initStatic; class Foo { static { - [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs(this, [[dec, 8, "a", function () { + [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs(this, [], [[dec, 8, "a", function () { return this.value; }], [dec, 9, "a", function (v) { this.value = v; - }]], []); + }]]); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/output.js index 367b9d127fd7..3226860c5f2e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/output.js @@ -9,7 +9,7 @@ _dec4 = dec class Foo { static { - [_initStatic] = babelHelpers.applyDecs(this, [[_dec, 8, "a"], [_dec2, 9, "a"], [_dec3, 8, _computedKey], [_dec4, 9, _computedKey2]], []); + [_initStatic] = babelHelpers.applyDecs(this, [], [[_dec, 8, "a"], [_dec2, 9, "a"], [_dec3, 8, _computedKey], [_dec4, 9, _computedKey2]]); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/output.js index 06ba2926bfa4..e7f299894cfc 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/output.js @@ -2,9 +2,9 @@ var _call_a, _initProto; class Foo { static { - [_call_a, _initProto] = babelHelpers.applyDecs(this, [[dec, 3, "a", function () { + [_call_a, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 3, "a", function () { return this.value; - }]], []); + }]]); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/output.js index 756adf797e3b..006432a85c55 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/output.js @@ -6,7 +6,7 @@ _dec2 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [[_dec, 3, "a"], [_dec2, 3, _computedKey]], []); + [_initProto] = babelHelpers.applyDecs(this, [], [[_dec, 3, "a"], [_dec2, 3, _computedKey]]); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/output.js index dc93a5313712..e7c048451607 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/output.js @@ -2,9 +2,9 @@ var _call_a, _initStatic; class Foo { static { - [_call_a, _initStatic] = babelHelpers.applyDecs(this, [[dec, 8, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs(this, [], [[dec, 8, "a", function () { return this.value; - }]], []); + }]]); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/output.js index 2ec6f560dc4b..197427e39cab 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/output.js @@ -6,7 +6,7 @@ _dec2 = dec class Foo { static { - [_initStatic] = babelHelpers.applyDecs(this, [[_dec, 8, "a"], [_dec2, 8, _computedKey]], []); + [_initStatic] = babelHelpers.applyDecs(this, [], [[_dec, 8, "a"], [_dec2, 8, _computedKey]]); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js index 4e18191445f1..84734ba87f43 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js @@ -20,7 +20,7 @@ class Foo { } (() => { - [_call_a, _initProto] = babelHelpers.applyDecs(Foo, [[dec, 2, "a", function () { + [_call_a, _initProto] = babelHelpers.applyDecs(Foo, [], [[dec, 2, "a", function () { return this.value; - }]], []); + }]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/output.js index 1835a9fa3548..0c972c01b111 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/output.js @@ -22,5 +22,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 2, "a"], [_dec2, 2, _computedKey]], []); + [_initProto] = babelHelpers.applyDecs(Foo, [], [[_dec, 2, "a"], [_dec2, 2, _computedKey]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js index 3c147c920d64..34869259af22 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js @@ -8,9 +8,9 @@ class Foo { } (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs(Foo, [[dec, 7, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs(Foo, [], [[dec, 7, "a", function () { return this.value; - }]], []); + }]]); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/output.js index d1c334def59e..c56a9ca454b3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/output.js @@ -16,7 +16,7 @@ class Foo { } (() => { - [_initStatic] = babelHelpers.applyDecs(Foo, [[_dec, 7, "a"], [_dec2, 7, _computedKey]], []); + [_initStatic] = babelHelpers.applyDecs(Foo, [], [[_dec, 7, "a"], [_dec2, 7, _computedKey]]); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/output.js index 6f76b6021b6c..6e7c7ff087f9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/output.js @@ -2,9 +2,9 @@ var _call_a, _initProto; class Foo { static { - [_call_a, _initProto] = babelHelpers.applyDecs(this, [[dec, 2, "a", function () { + [_call_a, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 2, "a", function () { return this.value; - }]], []); + }]]); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/output.js index efac40c1c35e..3703724c6d09 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/output.js @@ -6,7 +6,7 @@ _dec2 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [[_dec, 2, "a"], [_dec2, 2, _computedKey]], []); + [_initProto] = babelHelpers.applyDecs(this, [], [[_dec, 2, "a"], [_dec2, 2, _computedKey]]); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/output.js index 6b807803efa6..0da8d1b3cc09 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/output.js @@ -2,9 +2,9 @@ var _call_a, _initStatic; class Foo { static { - [_call_a, _initStatic] = babelHelpers.applyDecs(this, [[dec, 7, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs(this, [], [[dec, 7, "a", function () { return this.value; - }]], []); + }]]); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/output.js index 1ad76b111fb4..5f4939f5cf47 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/output.js @@ -6,7 +6,7 @@ _dec2 = dec class Foo { static { - [_initStatic] = babelHelpers.applyDecs(this, [[_dec, 7, "a"], [_dec2, 7, _computedKey]], []); + [_initStatic] = babelHelpers.applyDecs(this, [], [[_dec, 7, "a"], [_dec2, 7, _computedKey]]); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/output.js index 61a1fde840db..d9cd93561e12 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/output.js @@ -14,5 +14,5 @@ class A extends B { } (() => { - [_initProto] = babelHelpers.applyDecs(A, [[deco, 2, "method"]], []); + [_initProto] = babelHelpers.applyDecs(A, [], [[deco, 2, "method"]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js index cbee7920e41e..e83c8faed4d6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js @@ -25,14 +25,14 @@ class Foo { } }, (() => { - [_init_bar] = babelHelpers.applyDecs(_class, [[babelHelpers.classPrivateFieldGet(_class, _a), 0, "bar"]], []); + [_init_bar] = babelHelpers.applyDecs(_class, [], [[babelHelpers.classPrivateFieldGet(_class, _a), 0, "bar"]]); })(), _temp; } } (() => { - [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(Foo, [[[dec, call(), chain.expr(), arbitrary + expr, array[expr]], 2, "method"]], [dec, call(), chain.expr(), arbitrary + expr, array[expr]]); + [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(Foo, [dec, call(), chain.expr(), arbitrary + expr, array[expr]], [[[dec, call(), chain.expr(), arbitrary + expr, array[expr]], 2, "method"]]); })(); (() => { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js index b851ad2a66fb..1010050f46d8 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js @@ -6,7 +6,7 @@ new class extends babelHelpers.identity { static { class Class { static { - [_init_a, _init_d, _init_e, _call_f, _call_g, _call_g2, _init_h, _get_h, _set_h, _init_i, _init_m, _init_n, _call_o, _call_p, _call_q, _init_r, _get_r, _set_r, _initProto, _initStatic, _Class, _initClass] = babelHelpers.applyDecs(this, [[dec, 0, "a"], [dec, 2, "b"], [dec, 3, "c"], [dec, 4, "c"], [dec, 1, "d"], [dec, 0, "e", function () { + [_init_a, _init_d, _init_e, _call_f, _call_g, _call_g2, _init_h, _get_h, _set_h, _init_i, _init_m, _init_n, _call_o, _call_p, _call_q, _init_r, _get_r, _set_r, _initProto, _initStatic, _Class, _initClass] = babelHelpers.applyDecs(this, [dec], [[dec, 0, "a"], [dec, 2, "b"], [dec, 3, "c"], [dec, 4, "c"], [dec, 1, "d"], [dec, 0, "e", function () { return this.#e; }, function (value) { this.#e = value; @@ -22,7 +22,7 @@ new class extends babelHelpers.identity { return this.#D; }, function (value) { this.#D = value; - }]], [dec]); + }]]); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/output.js index 8a52cbd4b25a..675d7aa43423 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/output.js @@ -2,7 +2,7 @@ var _initProto, _initProto2; class A extends B { static { - [_initProto] = babelHelpers.applyDecs(this, [[deco, 2, "method"]], []); + [_initProto] = babelHelpers.applyDecs(this, [], [[deco, 2, "method"]]); } constructor() { @@ -19,7 +19,7 @@ class A extends B { class C extends B { static { - [_initProto2] = babelHelpers.applyDecs(this, [[deco, 2, "method"]], []); + [_initProto2] = babelHelpers.applyDecs(this, [], [[deco, 2, "method"]]); } constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/output.js index e2fb9d7eb331..c989509e4939 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/output.js @@ -2,7 +2,7 @@ var _initProto; class A extends B { static { - [_initProto] = babelHelpers.applyDecs(this, [[deco, 2, "method"]], []); + [_initProto] = babelHelpers.applyDecs(this, [], [[deco, 2, "method"]]); } constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/output.js index dcf5a0fae917..0ad7db798b8d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/output.js @@ -4,7 +4,7 @@ let _Foo; class Foo extends Bar { static { - [_Foo, _initClass] = babelHelpers.applyDecs(this, [], [dec]); + [_Foo, _initClass] = babelHelpers.applyDecs(this, [dec], []); } constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/output.js index dea033cc9d65..28d6908be1be 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/output.js @@ -2,9 +2,9 @@ var _call_x, _initProto; class Foo extends Bar { static { - [_call_x, _initProto] = babelHelpers.applyDecs(this, [[dec, 3, "x", function () { + [_call_x, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 3, "x", function () { return babelHelpers.get(babelHelpers.getPrototypeOf(Foo), "foo", this).call(this); - }]], []); + }]]); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/output.js index b77541b7c254..cc92aa17cab1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/output.js @@ -2,9 +2,9 @@ var _call_x, _initProto; class Foo extends Bar { static { - [_call_x, _initProto] = babelHelpers.applyDecs(this, [[dec, 2, "x", function () { + [_call_x, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 2, "x", function () { return babelHelpers.get(babelHelpers.getPrototypeOf(Foo), "foo", this).call(this); - }]], []); + }]]); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js index a72db7236833..4f4f87063728 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js @@ -4,7 +4,7 @@ let _Foo; class Foo { static { - [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(this, [[[dec, call(), chain.expr(), arbitrary + expr, array[expr]], 2, "method"]], [dec, call(), chain.expr(), arbitrary + expr, array[expr]]); + [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(this, [dec, call(), chain.expr(), arbitrary + expr, array[expr]], [[[dec, call(), chain.expr(), arbitrary + expr, array[expr]], 2, "method"]]); } constructor(...args) { @@ -20,7 +20,7 @@ class Foo { return class Nested { static { - [_init_bar] = babelHelpers.applyDecs(this, [[this.#a, 0, "bar"]], []); + [_init_bar] = babelHelpers.applyDecs(this, [], [[this.#a, 0, "bar"]]); } bar = _init_bar(this); }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js index 5d0ad516b80b..675254506d6b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js @@ -24,7 +24,7 @@ function _set_a(v) { } (() => { - [_call_a, _initProto] = babelHelpers.applyDecs(Foo, [[dec, 4, "a", function (v) { + [_call_a, _initProto] = babelHelpers.applyDecs(Foo, [], [[dec, 4, "a", function (v) { return this.value = v; - }]], []); + }]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/output.js index 256297632372..f8bb2adfa894 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/output.js @@ -22,5 +22,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 4, "a"], [_dec2, 4, _computedKey]], []); + [_initProto] = babelHelpers.applyDecs(Foo, [], [[_dec, 4, "a"], [_dec2, 4, _computedKey]]); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js index 45e47a57177c..7f3f4c79f9ad 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js @@ -17,9 +17,9 @@ var _a = { }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs(Foo, [[dec, 9, "a", function (v) { + [_call_a, _initStatic] = babelHelpers.applyDecs(Foo, [], [[dec, 9, "a", function (v) { return this.value = v; - }]], []); + }]]); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/output.js index e890b8fb8d4a..97a4ee1720aa 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/output.js @@ -16,7 +16,7 @@ class Foo { } (() => { - [_initStatic] = babelHelpers.applyDecs(Foo, [[_dec, 9, "a"], [_dec2, 9, _computedKey]], []); + [_initStatic] = babelHelpers.applyDecs(Foo, [], [[_dec, 9, "a"], [_dec2, 9, _computedKey]]); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/output.js index a1b2e04ab8f1..81587b0dd11a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/output.js @@ -2,9 +2,9 @@ var _call_a, _initProto; class Foo { static { - [_call_a, _initProto] = babelHelpers.applyDecs(this, [[dec, 4, "a", function (v) { + [_call_a, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 4, "a", function (v) { return this.value = v; - }]], []); + }]]); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/output.js index ad6f2edce743..7e02f5d56ded 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/output.js @@ -6,7 +6,7 @@ _dec2 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [[_dec, 4, "a"], [_dec2, 4, _computedKey]], []); + [_initProto] = babelHelpers.applyDecs(this, [], [[_dec, 4, "a"], [_dec2, 4, _computedKey]]); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/output.js index 6bcadc0cc528..d0976558f535 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/output.js @@ -2,9 +2,9 @@ var _call_a, _initStatic; class Foo { static { - [_call_a, _initStatic] = babelHelpers.applyDecs(this, [[dec, 9, "a", function (v) { + [_call_a, _initStatic] = babelHelpers.applyDecs(this, [], [[dec, 9, "a", function (v) { return this.value = v; - }]], []); + }]]); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/output.js index 230ee2bc8aff..3bdaf51a2b31 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/output.js @@ -6,7 +6,7 @@ _dec2 = dec class Foo { static { - [_initStatic] = babelHelpers.applyDecs(this, [[_dec, 9, "a"], [_dec2, 9, _computedKey]], []); + [_initStatic] = babelHelpers.applyDecs(this, [], [[_dec, 9, "a"], [_dec2, 9, _computedKey]]); _initStatic(this); From 6fdf140c38591082ba9ad944630622e0ae961631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 4 Feb 2022 19:32:15 -0500 Subject: [PATCH 03/15] fix: decorators are applied from right to left --- .../babel-helpers/src/helpers-generated.ts | 2 +- .../babel-helpers/src/helpers/applyDecs.js | 4 +-- .../getting-previously-set-metadata/exec.js | 2 +- .../2021-12-ordering/decorators/exec.js | 31 +++++++++++++++++++ .../field-initializers-after-methods/exec.js | 27 ++++++++++++++++ .../fixtures/2021-12-ordering/options.json | 3 ++ .../exec.js | 23 ++++++++++++++ 7 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/decorators/exec.js create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/field-initializers-after-methods/exec.js create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/options.json create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/static-field-initializers-after-methods/exec.js diff --git a/packages/babel-helpers/src/helpers-generated.ts b/packages/babel-helpers/src/helpers-generated.ts index 66481bff9b86..275b1396a96c 100644 --- a/packages/babel-helpers/src/helpers-generated.ts +++ b/packages/babel-helpers/src/helpers-generated.ts @@ -15,7 +15,7 @@ function helper(minVersion, source) { export default Object.freeze({ applyDecs: helper( "7.17.0", - 'function createMetadataMethodsForProperty(metadataMap,kind,property){return{getMetadata(key){if("symbol"!=typeof key)throw new TypeError("Metadata keys must be symbols, received: "+key);var metadataForKey=metadataMap[key];if(void 0!==metadataForKey)if(1===kind){var pub=metadataForKey.public;if(void 0!==pub)return pub[property]}else if(2===kind){var priv=metadataForKey.private;if(void 0!==priv)return priv.get(property)}else if(Object.hasOwnProperty.call(metadataForKey,"constructor"))return metadataForKey.constructor},setMetadata(key,value){if("symbol"!=typeof key)throw new TypeError("Metadata keys must be symbols, received: "+key);var metadataForKey=metadataMap[key];if(void 0===metadataForKey&&(metadataForKey=metadataMap[key]={}),1===kind){var pub=metadataForKey.public;void 0===pub&&(pub=metadataForKey.public={}),pub[property]=value}else if(2===kind){var priv=metadataForKey.priv;void 0===priv&&(priv=metadataForKey.private=new Map),priv.set(property,value)}else metadataForKey.constructor=value}}}function convertMetadataMapToFinal(obj,metadataMap){var parentMetadataMap=obj[Symbol.metadata||Symbol.for("Symbol.metadata")],metadataKeys=Object.getOwnPropertySymbols(metadataMap);if(0!==metadataKeys.length){for(var i=0;i3,isStatic=kind>=5;if(isStatic?(base=Class,metadataMap=staticMetadataMap,kind-=5,staticInitializers||(staticInitializers=[]),initializers=staticInitializers):(base=Class.prototype,metadataMap=protoMetadataMap,protoInitializers||(protoInitializers=[]),initializers=protoInitializers),0!==kind&&!isPrivate){var existingNonFields=isStatic?existingStaticNonFields:existingProtoNonFields,existingKind=existingNonFields.get(name)||0;if(!0===existingKind||3===existingKind&&4!==kind||4===existingKind&&3!==kind)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+name);!existingKind&&kind>2?existingNonFields.set(name,kind):existingNonFields.set(name,!0)}applyMemberDec(ret,base,decInfo,name,kind,isStatic,isPrivate,metadataMap,initializers)}}protoInitializers&&pushInitializers(ret,protoInitializers),staticInitializers&&pushInitializers(ret,staticInitializers)}function pushInitializers(ret,initializers){initializers.length>0?(initializers=initializers.slice(),ret.push((function(instance){for(var i=0;i0?ret.push((function(){for(var i=0;i=0;i--){var newInit;if(void 0!==(newValue=(0,decs[i])(value,ctx)))assertValidReturnValue(kind,newValue),0===kind?newInit=newValue:1===kind?(newInit=newValue.initializer,get=newValue.get||value.get,set=newValue.set||value.set,value={get:get,set:set}):value=newValue,void 0!==newInit&&(void 0===initializer?initializer=newInit:"function"==typeof initializer?initializer=[initializer,newInit]:initializer.push(newInit))}if(0===kind||1===kind){if(void 0===initializer)initializer=function(instance,init){return init};else if("function"!=typeof initializer){var ownInitializers=initializer;initializer=function(instance,init){for(var value=init,i=0;i3,isStatic=kind>=5;if(isStatic?(base=Class,metadataMap=staticMetadataMap,kind-=5,staticInitializers||(staticInitializers=[]),initializers=staticInitializers):(base=Class.prototype,metadataMap=protoMetadataMap,protoInitializers||(protoInitializers=[]),initializers=protoInitializers),0!==kind&&!isPrivate){var existingNonFields=isStatic?existingStaticNonFields:existingProtoNonFields,existingKind=existingNonFields.get(name)||0;if(!0===existingKind||3===existingKind&&4!==kind||4===existingKind&&3!==kind)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+name);!existingKind&&kind>2?existingNonFields.set(name,kind):existingNonFields.set(name,!0)}applyMemberDec(ret,base,decInfo,name,kind,isStatic,isPrivate,metadataMap,initializers)}}protoInitializers&&pushInitializers(ret,protoInitializers),staticInitializers&&pushInitializers(ret,staticInitializers)}function pushInitializers(ret,initializers){initializers.length>0?(initializers=initializers.slice(),ret.push((function(instance){for(var i=0;i=0;i--)newClass=classDecs[i](newClass,ctx)||newClass;ret.push(newClass),initializers.length>0?ret.push((function(){for(var i=0;i= 0; i--) { var dec = decs[i]; newValue = dec(value, ctx); @@ -541,7 +541,7 @@ function applyClassDecs(ret, targetClass, metadataMap, classDecs) { createMetadataMethodsForProperty(metadataMap, 0 /* CONSTRUCTOR */, name) ); - for (var i = 0; i < classDecs.length; i++) { + for (var i = classDecs.length - 1; i >= 0; i--) { newClass = classDecs[i](newClass, ctx) || newClass; } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-metadata--to-es2015/getting-previously-set-metadata/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-metadata--to-es2015/getting-previously-set-metadata/exec.js index 91d04b4f0df5..31091ae37ee7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-metadata--to-es2015/getting-previously-set-metadata/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-metadata--to-es2015/getting-previously-set-metadata/exec.js @@ -13,7 +13,7 @@ function dec2(_, { setMetadata, getMetadata }) { } class Foo { - @dec1 @dec2 a; + @dec2 @dec1 a; } function dec3(_, { setMetadata, getMetadata }) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/decorators/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/decorators/exec.js new file mode 100644 index 000000000000..795f3a9101dd --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/decorators/exec.js @@ -0,0 +1,31 @@ +var log = []; + +function push(x) { log.push(x); return x; } + +function logDecoratorRun(a, b) { + push(a); + return function (el) { push(b); return el; }; +} + +@logDecoratorRun(0, 19) +@logDecoratorRun(1, 18) +class A { + @logDecoratorRun(2, 11) + @logDecoratorRun(3, 10) + a; + + @logDecoratorRun(4, 13) + @logDecoratorRun(5, 12) + static b; + + @logDecoratorRun(6, 15) + @logDecoratorRun(7, 14) + static #c; + + @logDecoratorRun(8, 17) + @logDecoratorRun(9, 16) + #d; +} + +var nums = Array.from({ length: 20 }, (_, i) => i); +expect(log).toEqual(nums); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/field-initializers-after-methods/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/field-initializers-after-methods/exec.js new file mode 100644 index 000000000000..46e71f7281db --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/field-initializers-after-methods/exec.js @@ -0,0 +1,27 @@ +var counter = 0; + +@(x => x) +class A { + foo = (() => { + counter++; + expect(typeof this.method).toBe("function"); + expect(this.foo).toBeUndefined(); + expect(this.bar).toBeUndefined(); + return "foo"; + })(); + + method() {} + + bar = (() => { + counter++; + expect(typeof this.method).toBe("function"); + expect(this.foo).toBe("foo"); + expect(this.bar).toBeUndefined(); + })(); +} + +expect(counter).toBe(0); + +new A(); + +expect(counter).toBe(2); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/options.json b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/options.json new file mode 100644 index 000000000000..a18e0b8e833f --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["proposal-decorators", { "version": "2021-12" }]] +} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/static-field-initializers-after-methods/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/static-field-initializers-after-methods/exec.js new file mode 100644 index 000000000000..0703f091cc8d --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/static-field-initializers-after-methods/exec.js @@ -0,0 +1,23 @@ +var counter = 0; + +@(x => x) +class A { + static foo = (() => { + counter++; + expect(typeof this.method).toBe("function"); + expect(this.foo).toBeUndefined(); + expect(this.bar).toBeUndefined(); + return "foo"; + })(); + + static method() {} + + static bar = (() => { + counter++; + expect(typeof this.method).toBe("function"); + expect(this.foo).toBe("foo"); + expect(this.bar).toBeUndefined(); + })(); +} + +expect(counter).toBe(2); From 7f2329a45285f359b10a6c943895cc6fad43f4e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 4 Feb 2022 19:53:35 -0500 Subject: [PATCH 04/15] add es2015 test cases --- .../decorators/exec.js | 31 +++++++++++++++++++ .../field-initializers-after-methods/exec.js | 27 ++++++++++++++++ .../2021-12-ordering--to-es2015/options.json | 8 +++++ .../exec.js | 23 ++++++++++++++ .../fixtures/2021-12-ordering/options.json | 3 +- 5 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/decorators/exec.js create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/field-initializers-after-methods/exec.js create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/options.json create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/static-field-initializers-after-methods/exec.js diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/decorators/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/decorators/exec.js new file mode 100644 index 000000000000..795f3a9101dd --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/decorators/exec.js @@ -0,0 +1,31 @@ +var log = []; + +function push(x) { log.push(x); return x; } + +function logDecoratorRun(a, b) { + push(a); + return function (el) { push(b); return el; }; +} + +@logDecoratorRun(0, 19) +@logDecoratorRun(1, 18) +class A { + @logDecoratorRun(2, 11) + @logDecoratorRun(3, 10) + a; + + @logDecoratorRun(4, 13) + @logDecoratorRun(5, 12) + static b; + + @logDecoratorRun(6, 15) + @logDecoratorRun(7, 14) + static #c; + + @logDecoratorRun(8, 17) + @logDecoratorRun(9, 16) + #d; +} + +var nums = Array.from({ length: 20 }, (_, i) => i); +expect(log).toEqual(nums); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/field-initializers-after-methods/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/field-initializers-after-methods/exec.js new file mode 100644 index 000000000000..46e71f7281db --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/field-initializers-after-methods/exec.js @@ -0,0 +1,27 @@ +var counter = 0; + +@(x => x) +class A { + foo = (() => { + counter++; + expect(typeof this.method).toBe("function"); + expect(this.foo).toBeUndefined(); + expect(this.bar).toBeUndefined(); + return "foo"; + })(); + + method() {} + + bar = (() => { + counter++; + expect(typeof this.method).toBe("function"); + expect(this.foo).toBe("foo"); + expect(this.bar).toBeUndefined(); + })(); +} + +expect(counter).toBe(0); + +new A(); + +expect(counter).toBe(2); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/options.json b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/options.json new file mode 100644 index 000000000000..94ccc5a4b228 --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/options.json @@ -0,0 +1,8 @@ +{ + "plugins": [ + ["proposal-decorators", { "version": "2021-12" }], + "proposal-class-properties", + "proposal-private-methods", + "proposal-class-static-block" + ] +} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/static-field-initializers-after-methods/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/static-field-initializers-after-methods/exec.js new file mode 100644 index 000000000000..0703f091cc8d --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/static-field-initializers-after-methods/exec.js @@ -0,0 +1,23 @@ +var counter = 0; + +@(x => x) +class A { + static foo = (() => { + counter++; + expect(typeof this.method).toBe("function"); + expect(this.foo).toBeUndefined(); + expect(this.bar).toBeUndefined(); + return "foo"; + })(); + + static method() {} + + static bar = (() => { + counter++; + expect(typeof this.method).toBe("function"); + expect(this.foo).toBe("foo"); + expect(this.bar).toBeUndefined(); + })(); +} + +expect(counter).toBe(2); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/options.json b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/options.json index a18e0b8e833f..4fdbad965871 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/options.json +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/options.json @@ -1,3 +1,4 @@ { - "plugins": [["proposal-decorators", { "version": "2021-12" }]] + "plugins": [["proposal-decorators", { "version": "2021-12" }]], + "minNodeVersion": "16.11.0" } From ef391c76848c95a5dfe0a0ffb30f22f2d912a20d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 4 Feb 2022 20:19:48 -0500 Subject: [PATCH 05/15] fix: ensure applyDecs is ES5 compliant --- packages/babel-helpers/src/helpers-generated.ts | 2 +- packages/babel-helpers/src/helpers/applyDecs.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/babel-helpers/src/helpers-generated.ts b/packages/babel-helpers/src/helpers-generated.ts index 275b1396a96c..fde3807e69fd 100644 --- a/packages/babel-helpers/src/helpers-generated.ts +++ b/packages/babel-helpers/src/helpers-generated.ts @@ -15,7 +15,7 @@ function helper(minVersion, source) { export default Object.freeze({ applyDecs: helper( "7.17.0", - 'function createMetadataMethodsForProperty(metadataMap,kind,property){return{getMetadata(key){if("symbol"!=typeof key)throw new TypeError("Metadata keys must be symbols, received: "+key);var metadataForKey=metadataMap[key];if(void 0!==metadataForKey)if(1===kind){var pub=metadataForKey.public;if(void 0!==pub)return pub[property]}else if(2===kind){var priv=metadataForKey.private;if(void 0!==priv)return priv.get(property)}else if(Object.hasOwnProperty.call(metadataForKey,"constructor"))return metadataForKey.constructor},setMetadata(key,value){if("symbol"!=typeof key)throw new TypeError("Metadata keys must be symbols, received: "+key);var metadataForKey=metadataMap[key];if(void 0===metadataForKey&&(metadataForKey=metadataMap[key]={}),1===kind){var pub=metadataForKey.public;void 0===pub&&(pub=metadataForKey.public={}),pub[property]=value}else if(2===kind){var priv=metadataForKey.priv;void 0===priv&&(priv=metadataForKey.private=new Map),priv.set(property,value)}else metadataForKey.constructor=value}}}function convertMetadataMapToFinal(obj,metadataMap){var parentMetadataMap=obj[Symbol.metadata||Symbol.for("Symbol.metadata")],metadataKeys=Object.getOwnPropertySymbols(metadataMap);if(0!==metadataKeys.length){for(var i=0;i=0;i--){var newInit;if(void 0!==(newValue=(0,decs[i])(value,ctx)))assertValidReturnValue(kind,newValue),0===kind?newInit=newValue:1===kind?(newInit=newValue.initializer,get=newValue.get||value.get,set=newValue.set||value.set,value={get:get,set:set}):value=newValue,void 0!==newInit&&(void 0===initializer?initializer=newInit:"function"==typeof initializer?initializer=[initializer,newInit]:initializer.push(newInit))}if(0===kind||1===kind){if(void 0===initializer)initializer=function(instance,init){return init};else if("function"!=typeof initializer){var ownInitializers=initializer;initializer=function(instance,init){for(var value=init,i=0;i3,isStatic=kind>=5;if(isStatic?(base=Class,metadataMap=staticMetadataMap,kind-=5,staticInitializers||(staticInitializers=[]),initializers=staticInitializers):(base=Class.prototype,metadataMap=protoMetadataMap,protoInitializers||(protoInitializers=[]),initializers=protoInitializers),0!==kind&&!isPrivate){var existingNonFields=isStatic?existingStaticNonFields:existingProtoNonFields,existingKind=existingNonFields.get(name)||0;if(!0===existingKind||3===existingKind&&4!==kind||4===existingKind&&3!==kind)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+name);!existingKind&&kind>2?existingNonFields.set(name,kind):existingNonFields.set(name,!0)}applyMemberDec(ret,base,decInfo,name,kind,isStatic,isPrivate,metadataMap,initializers)}}protoInitializers&&pushInitializers(ret,protoInitializers),staticInitializers&&pushInitializers(ret,staticInitializers)}function pushInitializers(ret,initializers){initializers.length>0?(initializers=initializers.slice(),ret.push((function(instance){for(var i=0;i=0;i--)newClass=classDecs[i](newClass,ctx)||newClass;ret.push(newClass),initializers.length>0?ret.push((function(){for(var i=0;i=0;i--){var newInit;if(void 0!==(newValue=(0,decs[i])(value,ctx)))assertValidReturnValue(kind,newValue),0===kind?newInit=newValue:1===kind?(newInit=newValue.initializer,get=newValue.get||value.get,set=newValue.set||value.set,value={get:get,set:set}):value=newValue,void 0!==newInit&&(void 0===initializer?initializer=newInit:"function"==typeof initializer?initializer=[initializer,newInit]:initializer.push(newInit))}if(0===kind||1===kind){if(void 0===initializer)initializer=function(instance,init){return init};else if("function"!=typeof initializer){var ownInitializers=initializer;initializer=function(instance,init){for(var value=init,i=0;i3,isStatic=kind>=5;if(isStatic?(base=Class,metadataMap=staticMetadataMap,kind-=5,staticInitializers||(staticInitializers=[]),initializers=staticInitializers):(base=Class.prototype,metadataMap=protoMetadataMap,protoInitializers||(protoInitializers=[]),initializers=protoInitializers),0!==kind&&!isPrivate){var existingNonFields=isStatic?existingStaticNonFields:existingProtoNonFields,existingKind=existingNonFields.get(name)||0;if(!0===existingKind||3===existingKind&&4!==kind||4===existingKind&&3!==kind)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+name);!existingKind&&kind>2?existingNonFields.set(name,kind):existingNonFields.set(name,!0)}applyMemberDec(ret,base,decInfo,name,kind,isStatic,isPrivate,metadataMap,initializers)}}protoInitializers&&pushInitializers(ret,protoInitializers),staticInitializers&&pushInitializers(ret,staticInitializers)}function pushInitializers(ret,initializers){initializers.length>0?(initializers=initializers.slice(),ret.push((function(instance){for(var i=0;i=0;i--)newClass=classDecs[i](newClass,ctx)||newClass;ret.push(newClass),initializers.length>0?ret.push((function(){for(var i=0;i Date: Fri, 4 Feb 2022 20:20:35 -0500 Subject: [PATCH 06/15] bump applyDecs minVersion --- packages/babel-helpers/src/helpers/applyDecs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-helpers/src/helpers/applyDecs.js b/packages/babel-helpers/src/helpers/applyDecs.js index 44c974a19a7b..11ee86973a9c 100644 --- a/packages/babel-helpers/src/helpers/applyDecs.js +++ b/packages/babel-helpers/src/helpers/applyDecs.js @@ -1,4 +1,4 @@ -/* @minVersion 7.17.0 */ +/* @minVersion 7.17.2 */ /** Enums are used in this file, but not assigned to vars to avoid non-hoistable values From 2530ca8e3d35219663363cf7511ef86a41cbdaa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 4 Feb 2022 22:05:43 -0500 Subject: [PATCH 07/15] fix: do not return stub initializer when empty --- .../babel-helpers/src/helpers-generated.ts | 4 +- .../babel-helpers/src/helpers/applyDecs.js | 16 ++---- .../initializers/exec.js | 51 +++++++++++++++++++ .../2021-12-ordering/initializers/exec.js | 51 +++++++++++++++++++ 4 files changed, 108 insertions(+), 14 deletions(-) create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/initializers/exec.js create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/initializers/exec.js diff --git a/packages/babel-helpers/src/helpers-generated.ts b/packages/babel-helpers/src/helpers-generated.ts index fde3807e69fd..cbaf14e2ffb6 100644 --- a/packages/babel-helpers/src/helpers-generated.ts +++ b/packages/babel-helpers/src/helpers-generated.ts @@ -14,8 +14,8 @@ function helper(minVersion, source) { export default Object.freeze({ applyDecs: helper( - "7.17.0", - 'function createMetadataMethodsForProperty(metadataMap,kind,property){return{getMetadata:function(key){if("symbol"!=typeof key)throw new TypeError("Metadata keys must be symbols, received: "+key);var metadataForKey=metadataMap[key];if(void 0!==metadataForKey)if(1===kind){var pub=metadataForKey.public;if(void 0!==pub)return pub[property]}else if(2===kind){var priv=metadataForKey.private;if(void 0!==priv)return priv.get(property)}else if(Object.hasOwnProperty.call(metadataForKey,"constructor"))return metadataForKey.constructor},setMetadata:function(key,value){if("symbol"!=typeof key)throw new TypeError("Metadata keys must be symbols, received: "+key);var metadataForKey=metadataMap[key];if(void 0===metadataForKey&&(metadataForKey=metadataMap[key]={}),1===kind){var pub=metadataForKey.public;void 0===pub&&(pub=metadataForKey.public={}),pub[property]=value}else if(2===kind){var priv=metadataForKey.priv;void 0===priv&&(priv=metadataForKey.private=new Map),priv.set(property,value)}else metadataForKey.constructor=value}}}function convertMetadataMapToFinal(obj,metadataMap){var parentMetadataMap=obj[Symbol.metadata||Symbol.for("Symbol.metadata")],metadataKeys=Object.getOwnPropertySymbols(metadataMap);if(0!==metadataKeys.length){for(var i=0;i=0;i--){var newInit;if(void 0!==(newValue=(0,decs[i])(value,ctx)))assertValidReturnValue(kind,newValue),0===kind?newInit=newValue:1===kind?(newInit=newValue.initializer,get=newValue.get||value.get,set=newValue.set||value.set,value={get:get,set:set}):value=newValue,void 0!==newInit&&(void 0===initializer?initializer=newInit:"function"==typeof initializer?initializer=[initializer,newInit]:initializer.push(newInit))}if(0===kind||1===kind){if(void 0===initializer)initializer=function(instance,init){return init};else if("function"!=typeof initializer){var ownInitializers=initializer;initializer=function(instance,init){for(var value=init,i=0;i3,isStatic=kind>=5;if(isStatic?(base=Class,metadataMap=staticMetadataMap,kind-=5,staticInitializers||(staticInitializers=[]),initializers=staticInitializers):(base=Class.prototype,metadataMap=protoMetadataMap,protoInitializers||(protoInitializers=[]),initializers=protoInitializers),0!==kind&&!isPrivate){var existingNonFields=isStatic?existingStaticNonFields:existingProtoNonFields,existingKind=existingNonFields.get(name)||0;if(!0===existingKind||3===existingKind&&4!==kind||4===existingKind&&3!==kind)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+name);!existingKind&&kind>2?existingNonFields.set(name,kind):existingNonFields.set(name,!0)}applyMemberDec(ret,base,decInfo,name,kind,isStatic,isPrivate,metadataMap,initializers)}}protoInitializers&&pushInitializers(ret,protoInitializers),staticInitializers&&pushInitializers(ret,staticInitializers)}function pushInitializers(ret,initializers){initializers.length>0?(initializers=initializers.slice(),ret.push((function(instance){for(var i=0;i=0;i--)newClass=classDecs[i](newClass,ctx)||newClass;ret.push(newClass),initializers.length>0?ret.push((function(){for(var i=0;i=0;i--){var newInit;if(void 0!==(newValue=(0,decs[i])(value,ctx)))assertValidReturnValue(kind,newValue),0===kind?newInit=newValue:1===kind?(newInit=newValue.initializer,get=newValue.get||value.get,set=newValue.set||value.set,value={get:get,set:set}):value=newValue,void 0!==newInit&&(void 0===initializer?initializer=newInit:"function"==typeof initializer?initializer=[initializer,newInit]:initializer.push(newInit))}if(0===kind||1===kind){if(void 0===initializer)initializer=function(instance,init){return init};else if("function"!=typeof initializer){var ownInitializers=initializer;initializer=function(instance,init){for(var value=init,i=0;i3,isStatic=kind>=5;if(isStatic?(base=Class,metadataMap=staticMetadataMap,kind-=5,initializers=staticInitializers):(base=Class.prototype,metadataMap=protoMetadataMap,initializers=protoInitializers),0!==kind&&!isPrivate){var existingNonFields=isStatic?existingStaticNonFields:existingProtoNonFields,existingKind=existingNonFields.get(name)||0;if(!0===existingKind||3===existingKind&&4!==kind||4===existingKind&&3!==kind)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+name);!existingKind&&kind>2?existingNonFields.set(name,kind):existingNonFields.set(name,!0)}applyMemberDec(ret,base,decInfo,name,kind,isStatic,isPrivate,metadataMap,initializers)}}protoInitializers.length>0&&pushInitializers(ret,protoInitializers),staticInitializers.length>0&&pushInitializers(ret,staticInitializers)}function pushInitializers(ret,initializers){initializers.length>0?(initializers=initializers.slice(),ret.push((function(instance){for(var i=0;i=0;i--)newClass=classDecs[i](newClass,ctx)||newClass;ret.push(newClass),initializers.length>0?ret.push((function(){for(var i=0;i 0) { pushInitializers(ret, protoInitializers); } - if (staticInitializers) { + if (staticInitializers.length > 0) { pushInitializers(ret, staticInitializers); } } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/initializers/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/initializers/exec.js new file mode 100644 index 000000000000..0adac4dc6c94 --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering--to-es2015/initializers/exec.js @@ -0,0 +1,51 @@ +var log = []; + +function push(x) { log.push(x); return x; } + +function logDecoratorRun(a, b, c) { + push(a); + return function (el, { addInitializer }) { + push(b); + addInitializer(function () { push(c); }); + return el; + }; +} + +@logDecoratorRun(0, 35, 45) +@logDecoratorRun(1, 34, 44) +class A { + @logDecoratorRun(2, 19) + @logDecoratorRun(3, 18) + a() {}; + + @logDecoratorRun(4, 21, 37) + @logDecoratorRun(5, 20, 36) + static b() {}; + + @logDecoratorRun(6, 23, 39) + @logDecoratorRun(7, 22, 38) + static #c() {}; + + @logDecoratorRun(8, 25) + @logDecoratorRun(9, 24) + #d() {}; + + @logDecoratorRun(10, 27) + @logDecoratorRun(11, 26) + accessor e; + + @logDecoratorRun(12, 29, 41) + @logDecoratorRun(13, 28, 40) + static accessor f; + + @logDecoratorRun(14, 31, 43) + @logDecoratorRun(15, 30, 42) + static accessor #g; + + @logDecoratorRun(16, 33) + @logDecoratorRun(17, 32) + accessor #h; +} + +var nums = Array.from({ length: 46 }, (_, i) => i); +expect(log).toEqual(nums); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/initializers/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/initializers/exec.js new file mode 100644 index 000000000000..0adac4dc6c94 --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/initializers/exec.js @@ -0,0 +1,51 @@ +var log = []; + +function push(x) { log.push(x); return x; } + +function logDecoratorRun(a, b, c) { + push(a); + return function (el, { addInitializer }) { + push(b); + addInitializer(function () { push(c); }); + return el; + }; +} + +@logDecoratorRun(0, 35, 45) +@logDecoratorRun(1, 34, 44) +class A { + @logDecoratorRun(2, 19) + @logDecoratorRun(3, 18) + a() {}; + + @logDecoratorRun(4, 21, 37) + @logDecoratorRun(5, 20, 36) + static b() {}; + + @logDecoratorRun(6, 23, 39) + @logDecoratorRun(7, 22, 38) + static #c() {}; + + @logDecoratorRun(8, 25) + @logDecoratorRun(9, 24) + #d() {}; + + @logDecoratorRun(10, 27) + @logDecoratorRun(11, 26) + accessor e; + + @logDecoratorRun(12, 29, 41) + @logDecoratorRun(13, 28, 40) + static accessor f; + + @logDecoratorRun(14, 31, 43) + @logDecoratorRun(15, 30, 42) + static accessor #g; + + @logDecoratorRun(16, 33) + @logDecoratorRun(17, 32) + accessor #h; +} + +var nums = Array.from({ length: 46 }, (_, i) => i); +expect(log).toEqual(nums); From dc87a185c040c7c36f158c28e85212721a225d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 7 Feb 2022 09:58:09 -0500 Subject: [PATCH 08/15] Revert "fix: class decs eval earlier than member decs" This reverts commit 4ef1699f0fbc39eddd013225dcdb32ef170b73f3. # Conflicts: # packages/babel-helpers/src/helpers-generated.ts --- .../babel-helpers/src/helpers-generated.ts | 4 ++-- .../babel-helpers/src/helpers/applyDecs.js | 4 ++-- .../src/transformer-2021-12.ts | 2 +- .../private/output.js | 4 ++-- .../public/output.js | 2 +- .../static-private/output.js | 4 ++-- .../static-public/output.js | 2 +- .../2021-12-accessors/private/output.js | 4 ++-- .../2021-12-accessors/public/output.js | 2 +- .../2021-12-accessors/static-private/output.js | 4 ++-- .../2021-12-accessors/static-public/output.js | 2 +- .../output.js | 2 +- .../super-in-private-accessor/output.js | 4 ++-- .../super-in-private-method/output.js | 4 ++-- .../expressions/output.js | 18 +++++++++--------- .../inheritance/output.js | 4 ++-- .../initializers/output.js | 4 ++-- .../output.js | 2 +- .../replacement-static-this/output.js | 2 +- .../replacement-with-expr/output.js | 2 +- .../replacement/output.js | 2 +- .../2021-12-classes/expressions/output.js | 18 +++++++++--------- .../2021-12-classes/inheritance/output.js | 4 ++-- .../2021-12-classes/initializers/output.js | 4 ++-- .../output.js | 2 +- .../replacement-static-this/output.js | 2 +- .../replacement-with-expr/output.js | 2 +- .../2021-12-classes/replacement/output.js | 2 +- .../computed-keys-same-ast/output.js | 2 +- .../computed-keys-same-value/output.js | 2 +- .../method-and-field/output.js | 2 +- .../methods-with-same-key/output.js | 2 +- .../computed-keys-same-ast/output.js | 2 +- .../computed-keys-same-value/output.js | 2 +- .../method-and-field/output.js | 2 +- .../methods-with-same-key/output.js | 2 +- .../private/output.js | 4 ++-- .../2021-12-fields--to-es2015/public/output.js | 2 +- .../static-private/output.js | 4 ++-- .../static-public/output.js | 2 +- .../fixtures/2021-12-fields/private/output.js | 4 ++-- .../fixtures/2021-12-fields/public/output.js | 2 +- .../2021-12-fields/static-private/output.js | 4 ++-- .../2021-12-fields/static-public/output.js | 2 +- .../private/output.js | 4 ++-- .../public/output.js | 2 +- .../static-private/output.js | 4 ++-- .../static-public/output.js | 2 +- .../private/output.js | 4 ++-- .../public/output.js | 2 +- .../static-private/output.js | 4 ++-- .../static-public/output.js | 2 +- .../private/output.js | 4 ++-- .../public/output.js | 2 +- .../static-private/output.js | 4 ++-- .../static-public/output.js | 2 +- .../fixtures/2021-12-getters/private/output.js | 4 ++-- .../fixtures/2021-12-getters/public/output.js | 2 +- .../2021-12-getters/static-private/output.js | 4 ++-- .../2021-12-getters/static-public/output.js | 2 +- .../private/output.js | 4 ++-- .../public/output.js | 2 +- .../static-private/output.js | 4 ++-- .../static-public/output.js | 2 +- .../fixtures/2021-12-methods/private/output.js | 4 ++-- .../fixtures/2021-12-methods/public/output.js | 2 +- .../2021-12-methods/static-private/output.js | 4 ++-- .../2021-12-methods/static-public/output.js | 2 +- .../output.js | 2 +- .../valid-expression-formats/output.js | 4 ++-- .../2021-12-misc/all-decorators/output.js | 4 ++-- .../output.js | 4 ++-- .../output.js | 2 +- .../output.js | 2 +- .../super-in-private-accessor/output.js | 4 ++-- .../super-in-private-method/output.js | 4 ++-- .../valid-expression-formats/output.js | 4 ++-- .../private/output.js | 4 ++-- .../public/output.js | 2 +- .../static-private/output.js | 4 ++-- .../static-public/output.js | 2 +- .../fixtures/2021-12-setters/private/output.js | 4 ++-- .../fixtures/2021-12-setters/public/output.js | 2 +- .../2021-12-setters/static-private/output.js | 4 ++-- .../2021-12-setters/static-public/output.js | 2 +- 85 files changed, 139 insertions(+), 139 deletions(-) diff --git a/packages/babel-helpers/src/helpers-generated.ts b/packages/babel-helpers/src/helpers-generated.ts index cbaf14e2ffb6..e27f2044bd06 100644 --- a/packages/babel-helpers/src/helpers-generated.ts +++ b/packages/babel-helpers/src/helpers-generated.ts @@ -14,8 +14,8 @@ function helper(minVersion, source) { export default Object.freeze({ applyDecs: helper( - "7.17.2", - 'function createMetadataMethodsForProperty(metadataMap,kind,property){return{getMetadata:function(key){if("symbol"!=typeof key)throw new TypeError("Metadata keys must be symbols, received: "+key);var metadataForKey=metadataMap[key];if(void 0!==metadataForKey)if(1===kind){var pub=metadataForKey.public;if(void 0!==pub)return pub[property]}else if(2===kind){var priv=metadataForKey.private;if(void 0!==priv)return priv.get(property)}else if(Object.hasOwnProperty.call(metadataForKey,"constructor"))return metadataForKey.constructor},setMetadata:function(key,value){if("symbol"!=typeof key)throw new TypeError("Metadata keys must be symbols, received: "+key);var metadataForKey=metadataMap[key];if(void 0===metadataForKey&&(metadataForKey=metadataMap[key]={}),1===kind){var pub=metadataForKey.public;void 0===pub&&(pub=metadataForKey.public={}),pub[property]=value}else if(2===kind){var priv=metadataForKey.priv;void 0===priv&&(priv=metadataForKey.private=new Map),priv.set(property,value)}else metadataForKey.constructor=value}}}function convertMetadataMapToFinal(obj,metadataMap){var parentMetadataMap=obj[Symbol.metadata||Symbol.for("Symbol.metadata")],metadataKeys=Object.getOwnPropertySymbols(metadataMap);if(0!==metadataKeys.length){for(var i=0;i=0;i--){var newInit;if(void 0!==(newValue=(0,decs[i])(value,ctx)))assertValidReturnValue(kind,newValue),0===kind?newInit=newValue:1===kind?(newInit=newValue.initializer,get=newValue.get||value.get,set=newValue.set||value.set,value={get:get,set:set}):value=newValue,void 0!==newInit&&(void 0===initializer?initializer=newInit:"function"==typeof initializer?initializer=[initializer,newInit]:initializer.push(newInit))}if(0===kind||1===kind){if(void 0===initializer)initializer=function(instance,init){return init};else if("function"!=typeof initializer){var ownInitializers=initializer;initializer=function(instance,init){for(var value=init,i=0;i3,isStatic=kind>=5;if(isStatic?(base=Class,metadataMap=staticMetadataMap,kind-=5,initializers=staticInitializers):(base=Class.prototype,metadataMap=protoMetadataMap,initializers=protoInitializers),0!==kind&&!isPrivate){var existingNonFields=isStatic?existingStaticNonFields:existingProtoNonFields,existingKind=existingNonFields.get(name)||0;if(!0===existingKind||3===existingKind&&4!==kind||4===existingKind&&3!==kind)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+name);!existingKind&&kind>2?existingNonFields.set(name,kind):existingNonFields.set(name,!0)}applyMemberDec(ret,base,decInfo,name,kind,isStatic,isPrivate,metadataMap,initializers)}}protoInitializers.length>0&&pushInitializers(ret,protoInitializers),staticInitializers.length>0&&pushInitializers(ret,staticInitializers)}function pushInitializers(ret,initializers){initializers.length>0?(initializers=initializers.slice(),ret.push((function(instance){for(var i=0;i=0;i--)newClass=classDecs[i](newClass,ctx)||newClass;ret.push(newClass),initializers.length>0?ret.push((function(){for(var i=0;i=0;i--){var newInit;if(void 0!==(newValue=(0,decs[i])(value,ctx)))assertValidReturnValue(kind,newValue),0===kind?newInit=newValue:1===kind?(newInit=newValue.initializer,get=newValue.get||value.get,set=newValue.set||value.set,value={get:get,set:set}):value=newValue,void 0!==newInit&&(void 0===initializer?initializer=newInit:"function"==typeof initializer?initializer=[initializer,newInit]:initializer.push(newInit))}if(0===kind||1===kind){if(void 0===initializer)initializer=function(instance,init){return init};else if("function"!=typeof initializer){var ownInitializers=initializer;initializer=function(instance,init){for(var value=init,i=0;i3,isStatic=kind>=5;if(isStatic?(base=Class,metadataMap=staticMetadataMap,kind-=5,initializers=staticInitializers):(base=Class.prototype,metadataMap=protoMetadataMap,initializers=protoInitializers),0!==kind&&!isPrivate){var existingNonFields=isStatic?existingStaticNonFields:existingProtoNonFields,existingKind=existingNonFields.get(name)||0;if(!0===existingKind||3===existingKind&&4!==kind||4===existingKind&&3!==kind)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+name);!existingKind&&kind>2?existingNonFields.set(name,kind):existingNonFields.set(name,!0)}applyMemberDec(ret,base,decInfo,name,kind,isStatic,isPrivate,metadataMap,initializers)}}protoInitializers.length>0&&pushInitializers(ret,protoInitializers),staticInitializers.length>0&&pushInitializers(ret,staticInitializers)}function pushInitializers(ret,initializers){initializers.length>0?(initializers=initializers.slice(),ret.push((function(instance){for(var i=0;i=0;i--)newClass=classDecs[i](newClass,ctx)||newClass;ret.push(newClass),initializers.length>0?ret.push((function(){for(var i=0;i { - [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs(Foo, [], [[dec, 1, "a", function () { + [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs(Foo, [[dec, 1, "a", function () { return babelHelpers.classPrivateFieldGet(this, _A); }, function (value) { babelHelpers.classPrivateFieldSet(this, _A, value); @@ -55,5 +55,5 @@ function _get_b2() { return babelHelpers.classPrivateFieldGet(this, _B); }, function (value) { babelHelpers.classPrivateFieldSet(this, _B, value); - }]]); + }]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js index 80f4ab1677b3..2a6057e84caa 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js @@ -54,5 +54,5 @@ class Foo { } (() => { - [_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs(Foo, [], [[_dec, 1, "a"], [_dec2, 1, "b"], [_dec3, 1, _computedKey]]); + [_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs(Foo, [[_dec, 1, "a"], [_dec2, 1, "b"], [_dec3, 1, _computedKey]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js index 18dee707a780..b0ec49e5726f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js @@ -35,7 +35,7 @@ function _get_b2() { } (() => { - [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs(Foo, [], [[dec, 6, "a", function () { + [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs(Foo, [[dec, 6, "a", function () { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _A); }, function (value) { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _A, value); @@ -43,7 +43,7 @@ function _get_b2() { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _B); }, function (value) { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _B, value); - }]]); + }]], []); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js index ab6cbafbf7c6..c5a6ac47eba2 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js @@ -33,7 +33,7 @@ class Foo { } (() => { - [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs(Foo, [], [[_dec, 6, "a"], [_dec2, 6, "b"], [_dec3, 6, _computedKey]]); + [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs(Foo, [[_dec, 6, "a"], [_dec2, 6, "b"], [_dec3, 6, _computedKey]], []); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/output.js index 8963aecbf802..c054a288032a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/output.js @@ -2,7 +2,7 @@ var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto; class Foo { static { - [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 1, "a", function () { + [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs(this, [[dec, 1, "a", function () { return this.#A; }, function (value) { this.#A = value; @@ -10,7 +10,7 @@ class Foo { return this.#B; }, function (value) { this.#B = value; - }]]); + }]], []); } #A = (_initProto(this), _init_a(this)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/output.js index 615d5f4bd704..0fb94194b1db 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/output.js @@ -7,7 +7,7 @@ _dec3 = dec class Foo { static { - [_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs(this, [], [[_dec, 1, "a"], [_dec2, 1, "b"], [_dec3, 1, _computedKey]]); + [_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs(this, [[_dec, 1, "a"], [_dec2, 1, "b"], [_dec3, 1, _computedKey]], []); } #A = (_initProto(this), _init_a(this)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/output.js index 4a73a98a2db8..ad30531a425e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/output.js @@ -2,7 +2,7 @@ var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic; class Foo { static { - [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs(this, [], [[dec, 6, "a", function () { + [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs(this, [[dec, 6, "a", function () { return this.#A; }, function (value) { this.#A = value; @@ -10,7 +10,7 @@ class Foo { return this.#B; }, function (value) { this.#B = value; - }]]); + }]], []); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/output.js index 8cced673f640..471adf36f9c9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/output.js @@ -7,7 +7,7 @@ _dec3 = dec class Foo { static { - [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs(this, [], [[_dec, 6, "a"], [_dec2, 6, "b"], [_dec3, 6, _computedKey]]); + [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs(this, [[_dec, 6, "a"], [_dec2, 6, "b"], [_dec3, 6, _computedKey]], []); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/output.js index 0ad7db798b8d..dcf5a0fae917 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/output.js @@ -4,7 +4,7 @@ let _Foo; class Foo extends Bar { static { - [_Foo, _initClass] = babelHelpers.applyDecs(this, [dec], []); + [_Foo, _initClass] = babelHelpers.applyDecs(this, [], [dec]); } constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/output.js index f809cccfae2f..17cd5aa63e11 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/output.js @@ -2,9 +2,9 @@ var _call_x, _initProto; class Foo extends Bar { static { - [_call_x, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 3, "x", function () { + [_call_x, _initProto] = babelHelpers.applyDecs(this, [[dec, 3, "x", function () { return Bar.prototype.foo.call(this); - }]]); + }]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/output.js index 8ba998234c3a..91246a1f387a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/output.js @@ -2,9 +2,9 @@ var _call_x, _initProto; class Foo extends Bar { static { - [_call_x, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 2, "x", function () { + [_call_x, _initProto] = babelHelpers.applyDecs(this, [[dec, 2, "x", function () { return Bar.prototype.foo.call(this); - }]]); + }]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/output.js index 82a7b1955e97..b0cce043afbe 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/output.js @@ -1,41 +1,41 @@ var _initClass, _A, _class, _temp, _initClass2, _C, _class2, _temp2, _initClass3, _D, _class3, _temp3, _initClass4, _decorated_class, _class4, _temp4, _initClass5, _G, _class5, _temp5, _initClass6, _decorated_class2, _class6, _temp6, _initClass7, _H, _class7, _temp7, _initClass8, _K, _class8, _temp8; const A = ((_temp = _class = class A {}, (() => { - [_A, _initClass] = babelHelpers.applyDecs(_class, [dec], []); + [_A, _initClass] = babelHelpers.applyDecs(_class, [], [dec]); })(), (() => { _initClass(); })(), _temp), _A); const B = ((_temp2 = _class2 = class C {}, (() => { - [_C, _initClass2] = babelHelpers.applyDecs(_class2, [dec], []); + [_C, _initClass2] = babelHelpers.applyDecs(_class2, [], [dec]); })(), (() => { _initClass2(); })(), _temp2), _C); const D = ((_temp3 = _class3 = class D {}, (() => { - [_D, _initClass3] = babelHelpers.applyDecs(_class3, [dec], []); + [_D, _initClass3] = babelHelpers.applyDecs(_class3, [], [dec]); })(), (() => { _initClass3(); })(), _temp3), _D); const E = (((_temp4 = _class4 = class {}, (() => { - [_decorated_class, _initClass4] = babelHelpers.applyDecs(_class4, [dec], []); + [_decorated_class, _initClass4] = babelHelpers.applyDecs(_class4, [], [dec]); })(), (() => { _initClass4(); })(), _temp4), _decorated_class), 123); const F = [((_temp5 = _class5 = class G {}, (() => { - [_G, _initClass5] = babelHelpers.applyDecs(_class5, [dec], []); + [_G, _initClass5] = babelHelpers.applyDecs(_class5, [], [dec]); })(), (() => { _initClass5(); })(), _temp5), _G), ((_temp6 = _class6 = class {}, (() => { - [_decorated_class2, _initClass6] = babelHelpers.applyDecs(_class6, [dec], []); + [_decorated_class2, _initClass6] = babelHelpers.applyDecs(_class6, [], [dec]); })(), (() => { _initClass6(); })(), _temp6), _decorated_class2)]; const H = ((_temp7 = _class7 = class H extends I {}, (() => { - [_H, _initClass7] = babelHelpers.applyDecs(_class7, [dec], []); + [_H, _initClass7] = babelHelpers.applyDecs(_class7, [], [dec]); })(), (() => { _initClass7(); })(), _temp7), _H); const J = ((_temp8 = _class8 = class K extends L {}, (() => { - [_K, _initClass8] = babelHelpers.applyDecs(_class8, [dec], []); + [_K, _initClass8] = babelHelpers.applyDecs(_class8, [], [dec]); })(), (() => { _initClass8(); })(), _temp8), _K); @@ -44,7 +44,7 @@ function classFactory() { var _initClass9, _decorated_class3, _class9, _temp9; return (_temp9 = _class9 = class {}, (() => { - [_decorated_class3, _initClass9] = babelHelpers.applyDecs(_class9, [dec], []); + [_decorated_class3, _initClass9] = babelHelpers.applyDecs(_class9, [], [dec]); })(), (() => { _initClass9(); })(), _temp9), _decorated_class3; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/output.js index 7743aef4790a..605270eadeca 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/output.js @@ -5,7 +5,7 @@ let _Bar; class Bar {} (() => { - [_Bar, _initClass] = babelHelpers.applyDecs(Bar, [dec1], []); + [_Bar, _initClass] = babelHelpers.applyDecs(Bar, [], [dec1]); })(); (() => { @@ -17,7 +17,7 @@ let _Foo; class Foo extends _Bar {} (() => { - [_Foo, _initClass2] = babelHelpers.applyDecs(Foo, [dec2], []); + [_Foo, _initClass2] = babelHelpers.applyDecs(Foo, [], [dec2]); })(); (() => { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/output.js index 1b83b817ea4d..3ed28458cab0 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/output.js @@ -13,7 +13,7 @@ new (_temp2 = class extends babelHelpers.identity { class Foo {} (() => { - [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [dec], []); + [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [], [dec]); })(); })(), _temp2)(); @@ -32,6 +32,6 @@ new (_temp4 = class extends babelHelpers.identity { class Bar extends _Foo {} (() => { - [_Bar, _initClass2] = babelHelpers.applyDecs(Bar, [dec], []); + [_Bar, _initClass2] = babelHelpers.applyDecs(Bar, [], [dec]); })(); })(), _temp4)(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js index 0df387024c4d..f11cf07517d3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js @@ -25,7 +25,7 @@ new (_temp2 = (_x = /*#__PURE__*/new WeakMap(), _m = /*#__PURE__*/new WeakSet(), } (() => { - [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [dec], []); + [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [], [dec]); })(); })(), _temp2)(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/output.js index a9f1868b64bf..fe77f96f5af9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/output.js @@ -17,6 +17,6 @@ new (_temp2 = class extends babelHelpers.identity { class Foo {} (() => { - [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [dec], []); + [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [], [dec]); })(); })(), _temp2)(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/output.js index ff7c0363b4aa..f1f8cd9df38d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/output.js @@ -6,7 +6,7 @@ const Foo = ((_temp = _class = class Bar { } }, (() => { - [_Bar, _initClass] = babelHelpers.applyDecs(_class, [dec], []); + [_Bar, _initClass] = babelHelpers.applyDecs(_class, [], [dec]); })(), (() => { _initClass(); })(), _temp), _Bar); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/output.js index 512a5a54c15b..f302d19a6ecb 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/output.js @@ -13,7 +13,7 @@ new (_temp2 = class extends babelHelpers.identity { class Foo {} (() => { - [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [dec], []); + [_Foo, _initClass] = babelHelpers.applyDecs(Foo, [], [dec]); })(); })(), _temp2)(); const foo = new _Foo(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/output.js index e7d1d8c0e01a..146cdb17ca70 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/output.js @@ -2,7 +2,7 @@ var _initClass, _A, _initClass2, _C, _initClass3, _D, _initClass4, _decorated_cl const A = (class A { static { - [_A, _initClass] = babelHelpers.applyDecs(this, [dec], []); + [_A, _initClass] = babelHelpers.applyDecs(this, [], [dec]); } static { _initClass(); @@ -11,7 +11,7 @@ const A = (class A { }, _A); const B = (class C { static { - [_C, _initClass2] = babelHelpers.applyDecs(this, [dec], []); + [_C, _initClass2] = babelHelpers.applyDecs(this, [], [dec]); } static { _initClass2(); @@ -20,7 +20,7 @@ const B = (class C { }, _C); const D = (class D { static { - [_D, _initClass3] = babelHelpers.applyDecs(this, [dec], []); + [_D, _initClass3] = babelHelpers.applyDecs(this, [], [dec]); } static { _initClass3(); @@ -29,7 +29,7 @@ const D = (class D { }, _D); const E = ((class { static { - [_decorated_class, _initClass4] = babelHelpers.applyDecs(this, [dec], []); + [_decorated_class, _initClass4] = babelHelpers.applyDecs(this, [], [dec]); } static { _initClass4(); @@ -38,7 +38,7 @@ const E = ((class { }, _decorated_class), 123); const F = [(class G { static { - [_G, _initClass5] = babelHelpers.applyDecs(this, [dec], []); + [_G, _initClass5] = babelHelpers.applyDecs(this, [], [dec]); } static { _initClass5(); @@ -46,7 +46,7 @@ const F = [(class G { } }, _G), (class { static { - [_decorated_class2, _initClass6] = babelHelpers.applyDecs(this, [dec], []); + [_decorated_class2, _initClass6] = babelHelpers.applyDecs(this, [], [dec]); } static { _initClass6(); @@ -55,7 +55,7 @@ const F = [(class G { }, _decorated_class2)]; const H = (class H extends I { static { - [_H, _initClass7] = babelHelpers.applyDecs(this, [dec], []); + [_H, _initClass7] = babelHelpers.applyDecs(this, [], [dec]); } static { _initClass7(); @@ -64,7 +64,7 @@ const H = (class H extends I { }, _H); const J = (class K extends L { static { - [_K, _initClass8] = babelHelpers.applyDecs(this, [dec], []); + [_K, _initClass8] = babelHelpers.applyDecs(this, [], [dec]); } static { _initClass8(); @@ -77,7 +77,7 @@ function classFactory() { return class { static { - [_decorated_class3, _initClass9] = babelHelpers.applyDecs(this, [dec], []); + [_decorated_class3, _initClass9] = babelHelpers.applyDecs(this, [], [dec]); } static { _initClass9(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/output.js index f7c7bf3a461c..d7ea9b35166e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/output.js @@ -4,7 +4,7 @@ let _Bar; class Bar { static { - [_Bar, _initClass] = babelHelpers.applyDecs(this, [dec1], []); + [_Bar, _initClass] = babelHelpers.applyDecs(this, [], [dec1]); } static { _initClass(); @@ -16,7 +16,7 @@ let _Foo; class Foo extends _Bar { static { - [_Foo, _initClass2] = babelHelpers.applyDecs(this, [dec2], []); + [_Foo, _initClass2] = babelHelpers.applyDecs(this, [], [dec2]); } static { _initClass2(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/output.js index bdac7d68cb92..982a63a72f28 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/output.js @@ -6,7 +6,7 @@ new class extends babelHelpers.identity { static { class Foo { static { - [_Foo, _initClass] = babelHelpers.applyDecs(this, [dec], []); + [_Foo, _initClass] = babelHelpers.applyDecs(this, [], [dec]); } } @@ -25,7 +25,7 @@ new class extends babelHelpers.identity { static { class Bar extends _Foo { static { - [_Bar, _initClass2] = babelHelpers.applyDecs(this, [dec], []); + [_Bar, _initClass2] = babelHelpers.applyDecs(this, [], [dec]); } } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/output.js index cc29cc50b73c..8f36ec034422 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/output.js @@ -8,7 +8,7 @@ new class extends babelHelpers.identity { static { class Foo { static { - [_Foo, _initClass] = babelHelpers.applyDecs(this, [dec], []); + [_Foo, _initClass] = babelHelpers.applyDecs(this, [], [dec]); } static m() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/output.js index c613d339e566..5ca20ff8d696 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/output.js @@ -6,7 +6,7 @@ new class extends babelHelpers.identity { static { class Foo { static { - [_Foo, _initClass] = babelHelpers.applyDecs(this, [dec], []); + [_Foo, _initClass] = babelHelpers.applyDecs(this, [], [dec]); } } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/output.js index 98eb446eb9f6..4c37edebb1dd 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/output.js @@ -2,7 +2,7 @@ var _initClass, _Bar; const Foo = (class Bar { static { - [_Bar, _initClass] = babelHelpers.applyDecs(this, [dec], []); + [_Bar, _initClass] = babelHelpers.applyDecs(this, [], [dec]); } bar = new _Bar(); static { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/output.js index 21a78b8f3a1d..42a115d10f2b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/output.js @@ -6,7 +6,7 @@ new class extends babelHelpers.identity { static { class Foo { static { - [_Foo, _initClass] = babelHelpers.applyDecs(this, [dec], []); + [_Foo, _initClass] = babelHelpers.applyDecs(this, [], [dec]); } } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/output.js index 144405be52a8..a70d24de54c9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/output.js @@ -21,5 +21,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [], [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]]); + [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/output.js index b9f4dc662701..66e2ac318d83 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/output.js @@ -21,5 +21,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [], [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]]); + [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/output.js index a48bcd18d086..fe79aa632006 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/output.js @@ -12,5 +12,5 @@ class Foo { } (() => { - [_init_a, _initProto] = babelHelpers.applyDecs(Foo, [], [[dec, 0, "a"], [dec, 2, "a"]]); + [_init_a, _initProto] = babelHelpers.applyDecs(Foo, [[dec, 0, "a"], [dec, 2, "a"]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/output.js index 1978501f90eb..6402e1341ff0 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/output.js @@ -16,5 +16,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [], [[dec, 2, "a"], [dec, 2, "a"]]); + [_initProto] = babelHelpers.applyDecs(Foo, [[dec, 2, "a"], [dec, 2, "a"]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/output.js index 89a91f4df320..9663aebaf7b3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/output.js @@ -7,7 +7,7 @@ _dec2 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [], [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]]); + [_initProto] = babelHelpers.applyDecs(this, [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/output.js index 5e6009ac8dc4..76d9f05cad75 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/output.js @@ -7,7 +7,7 @@ _dec2 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [], [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]]); + [_initProto] = babelHelpers.applyDecs(this, [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/output.js index 5658e6460faa..cb04e3cc2e5d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/output.js @@ -2,7 +2,7 @@ var _init_a, _initProto; class Foo { static { - [_init_a, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 0, "a"], [dec, 2, "a"]]); + [_init_a, _initProto] = babelHelpers.applyDecs(this, [[dec, 0, "a"], [dec, 2, "a"]], []); } a = (_initProto(this), _init_a(this, 123)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/output.js index 0ccbda4ec69f..c4befb4def4d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/output.js @@ -2,7 +2,7 @@ var _initProto; class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [], [[dec, 2, "a"], [dec, 2, "a"]]); + [_initProto] = babelHelpers.applyDecs(this, [[dec, 2, "a"], [dec, 2, "a"]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js index e861e3d6e86d..af27fce2d289 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js @@ -19,7 +19,7 @@ class Foo { } (() => { - [_init_a, _init_b] = babelHelpers.applyDecs(Foo, [], [[dec, 0, "a", function () { + [_init_a, _init_b] = babelHelpers.applyDecs(Foo, [[dec, 0, "a", function () { return babelHelpers.classPrivateFieldGet(this, _a); }, function (value) { babelHelpers.classPrivateFieldSet(this, _a, value); @@ -27,5 +27,5 @@ class Foo { return babelHelpers.classPrivateFieldGet(this, _b); }, function (value) { babelHelpers.classPrivateFieldSet(this, _b, value); - }]]); + }]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/output.js index 02ba6397d4e0..481926ddfe5a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/output.js @@ -15,5 +15,5 @@ class Foo { } (() => { - [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(Foo, [], [[_dec, 0, "a"], [_dec2, 0, "b"], [_dec3, 0, _computedKey]]); + [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(Foo, [[_dec, 0, "a"], [_dec2, 0, "b"], [_dec3, 0, _computedKey]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js index 4dce48c7a5c3..ad619ac7d598 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js @@ -3,7 +3,7 @@ var _init_a, _init_b; class Foo {} (() => { - [_init_a, _init_b] = babelHelpers.applyDecs(Foo, [], [[dec, 5, "a", function () { + [_init_a, _init_b] = babelHelpers.applyDecs(Foo, [[dec, 5, "a", function () { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); }, function (value) { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, value); @@ -11,7 +11,7 @@ class Foo {} return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _b); }, function (value) { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _b, value); - }]]); + }]], []); })(); var _a = { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/output.js index 31c0de3ef18a..c5df8314385b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/output.js @@ -8,7 +8,7 @@ _dec3 = dec class Foo {} (() => { - [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(Foo, [], [[_dec, 5, "a"], [_dec2, 5, "b"], [_dec3, 5, _computedKey]]); + [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(Foo, [[_dec, 5, "a"], [_dec2, 5, "b"], [_dec3, 5, _computedKey]], []); })(); babelHelpers.defineProperty(Foo, "a", _init_a(Foo)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/output.js index 8150d2411131..b72a6d971df6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/output.js @@ -2,7 +2,7 @@ var _init_a, _init_b; class Foo { static { - [_init_a, _init_b] = babelHelpers.applyDecs(this, [], [[dec, 0, "a", function () { + [_init_a, _init_b] = babelHelpers.applyDecs(this, [[dec, 0, "a", function () { return this.#a; }, function (value) { this.#a = value; @@ -10,7 +10,7 @@ class Foo { return this.#b; }, function (value) { this.#b = value; - }]]); + }]], []); } #a = _init_a(this); #b = _init_b(this, 123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/output.js index 5e4a71f7f7e1..06c0434d04a6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/output.js @@ -7,7 +7,7 @@ _dec3 = dec class Foo { static { - [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(this, [], [[_dec, 0, "a"], [_dec2, 0, "b"], [_dec3, 0, _computedKey]]); + [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(this, [[_dec, 0, "a"], [_dec2, 0, "b"], [_dec3, 0, _computedKey]], []); } a = _init_a(this); b = _init_b(this, 123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/output.js index ce2ffab23da0..cb167ff192fd 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/output.js @@ -2,7 +2,7 @@ var _init_a, _init_b; class Foo { static { - [_init_a, _init_b] = babelHelpers.applyDecs(this, [], [[dec, 5, "a", function () { + [_init_a, _init_b] = babelHelpers.applyDecs(this, [[dec, 5, "a", function () { return this.#a; }, function (value) { this.#a = value; @@ -10,7 +10,7 @@ class Foo { return this.#b; }, function (value) { this.#b = value; - }]]); + }]], []); } static #a = _init_a(this); static #b = _init_b(this, 123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/output.js index c38ecf2f0a89..64af25745500 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/output.js @@ -7,7 +7,7 @@ _dec3 = dec class Foo { static { - [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(this, [], [[_dec, 5, "a"], [_dec2, 5, "b"], [_dec3, 5, _computedKey]]); + [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(this, [[_dec, 5, "a"], [_dec2, 5, "b"], [_dec3, 5, _computedKey]], []); } static a = _init_a(this); static b = _init_b(this, 123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js index 33d0b1969828..32971ca073e9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js @@ -24,7 +24,7 @@ function _get_a() { } (() => { - [_call_a, _initProto] = babelHelpers.applyDecs(Foo, [], [[dec, 3, "a", function () { + [_call_a, _initProto] = babelHelpers.applyDecs(Foo, [[dec, 3, "a", function () { return this.value; - }]]); + }]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/output.js index dff92a9991bb..0152dbf977de 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/output.js @@ -22,5 +22,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [], [[_dec, 3, "a"], [_dec2, 3, _computedKey]]); + [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 3, "a"], [_dec2, 3, _computedKey]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js index 96b4c6ee811b..e0262570f9e3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js @@ -17,9 +17,9 @@ var _a = { }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs(Foo, [], [[dec, 8, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs(Foo, [[dec, 8, "a", function () { return this.value; - }]]); + }]], []); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/output.js index 49f3b123df38..68787d432777 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/output.js @@ -16,7 +16,7 @@ class Foo { } (() => { - [_initStatic] = babelHelpers.applyDecs(Foo, [], [[_dec, 8, "a"], [_dec2, 8, _computedKey]]); + [_initStatic] = babelHelpers.applyDecs(Foo, [[_dec, 8, "a"], [_dec2, 8, _computedKey]], []); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js index 9aab4cbf2918..71e95a6ee2a2 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js @@ -32,9 +32,9 @@ function _set_a(v) { } (() => { - [_call_a, _call_a2, _initProto] = babelHelpers.applyDecs(Foo, [], [[dec, 3, "a", function () { + [_call_a, _call_a2, _initProto] = babelHelpers.applyDecs(Foo, [[dec, 3, "a", function () { return this.value; }], [dec, 4, "a", function (v) { this.value = v; - }]]); + }]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/output.js index 224db038c8ee..a05760c5cfe9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/output.js @@ -33,5 +33,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [], [[_dec, 3, "a"], [_dec2, 4, "a"], [_dec3, 3, _computedKey], [_dec4, 4, _computedKey2]]); + [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 3, "a"], [_dec2, 4, "a"], [_dec3, 3, _computedKey], [_dec4, 4, _computedKey2]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js index 3f8dd045cd95..e9ac78c2c966 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js @@ -25,11 +25,11 @@ var _a = { }; (() => { - [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs(Foo, [], [[dec, 8, "a", function () { + [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs(Foo, [[dec, 8, "a", function () { return this.value; }], [dec, 9, "a", function (v) { this.value = v; - }]]); + }]], []); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/output.js index 4e3ad36df46e..edcb11764a7a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/output.js @@ -27,7 +27,7 @@ class Foo { } (() => { - [_initStatic] = babelHelpers.applyDecs(Foo, [], [[_dec, 8, "a"], [_dec2, 9, "a"], [_dec3, 8, _computedKey], [_dec4, 9, _computedKey2]]); + [_initStatic] = babelHelpers.applyDecs(Foo, [[_dec, 8, "a"], [_dec2, 9, "a"], [_dec3, 8, _computedKey], [_dec4, 9, _computedKey2]], []); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/output.js index b98e8f8c50df..bcf3cae9176e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/output.js @@ -2,11 +2,11 @@ var _call_a, _call_a2, _initProto; class Foo { static { - [_call_a, _call_a2, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 3, "a", function () { + [_call_a, _call_a2, _initProto] = babelHelpers.applyDecs(this, [[dec, 3, "a", function () { return this.value; }], [dec, 4, "a", function (v) { this.value = v; - }]]); + }]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/output.js index d3e22d1b8ee2..1a7c8951454d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/output.js @@ -9,7 +9,7 @@ _dec4 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [], [[_dec, 3, "a"], [_dec2, 4, "a"], [_dec3, 3, _computedKey], [_dec4, 4, _computedKey2]]); + [_initProto] = babelHelpers.applyDecs(this, [[_dec, 3, "a"], [_dec2, 4, "a"], [_dec3, 3, _computedKey], [_dec4, 4, _computedKey2]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/output.js index ff8959874357..e897ea3cd18e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/output.js @@ -2,11 +2,11 @@ var _call_a, _call_a2, _initStatic; class Foo { static { - [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs(this, [], [[dec, 8, "a", function () { + [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs(this, [[dec, 8, "a", function () { return this.value; }], [dec, 9, "a", function (v) { this.value = v; - }]]); + }]], []); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/output.js index 3226860c5f2e..367b9d127fd7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/output.js @@ -9,7 +9,7 @@ _dec4 = dec class Foo { static { - [_initStatic] = babelHelpers.applyDecs(this, [], [[_dec, 8, "a"], [_dec2, 9, "a"], [_dec3, 8, _computedKey], [_dec4, 9, _computedKey2]]); + [_initStatic] = babelHelpers.applyDecs(this, [[_dec, 8, "a"], [_dec2, 9, "a"], [_dec3, 8, _computedKey], [_dec4, 9, _computedKey2]], []); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/output.js index e7f299894cfc..06ba2926bfa4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/output.js @@ -2,9 +2,9 @@ var _call_a, _initProto; class Foo { static { - [_call_a, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 3, "a", function () { + [_call_a, _initProto] = babelHelpers.applyDecs(this, [[dec, 3, "a", function () { return this.value; - }]]); + }]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/output.js index 006432a85c55..756adf797e3b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/output.js @@ -6,7 +6,7 @@ _dec2 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [], [[_dec, 3, "a"], [_dec2, 3, _computedKey]]); + [_initProto] = babelHelpers.applyDecs(this, [[_dec, 3, "a"], [_dec2, 3, _computedKey]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/output.js index e7c048451607..dc93a5313712 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/output.js @@ -2,9 +2,9 @@ var _call_a, _initStatic; class Foo { static { - [_call_a, _initStatic] = babelHelpers.applyDecs(this, [], [[dec, 8, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs(this, [[dec, 8, "a", function () { return this.value; - }]]); + }]], []); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/output.js index 197427e39cab..2ec6f560dc4b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/output.js @@ -6,7 +6,7 @@ _dec2 = dec class Foo { static { - [_initStatic] = babelHelpers.applyDecs(this, [], [[_dec, 8, "a"], [_dec2, 8, _computedKey]]); + [_initStatic] = babelHelpers.applyDecs(this, [[_dec, 8, "a"], [_dec2, 8, _computedKey]], []); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js index 84734ba87f43..4e18191445f1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js @@ -20,7 +20,7 @@ class Foo { } (() => { - [_call_a, _initProto] = babelHelpers.applyDecs(Foo, [], [[dec, 2, "a", function () { + [_call_a, _initProto] = babelHelpers.applyDecs(Foo, [[dec, 2, "a", function () { return this.value; - }]]); + }]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/output.js index 0c972c01b111..1835a9fa3548 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/output.js @@ -22,5 +22,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [], [[_dec, 2, "a"], [_dec2, 2, _computedKey]]); + [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 2, "a"], [_dec2, 2, _computedKey]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js index 34869259af22..3c147c920d64 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js @@ -8,9 +8,9 @@ class Foo { } (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs(Foo, [], [[dec, 7, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs(Foo, [[dec, 7, "a", function () { return this.value; - }]]); + }]], []); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/output.js index c56a9ca454b3..d1c334def59e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/output.js @@ -16,7 +16,7 @@ class Foo { } (() => { - [_initStatic] = babelHelpers.applyDecs(Foo, [], [[_dec, 7, "a"], [_dec2, 7, _computedKey]]); + [_initStatic] = babelHelpers.applyDecs(Foo, [[_dec, 7, "a"], [_dec2, 7, _computedKey]], []); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/output.js index 6e7c7ff087f9..6f76b6021b6c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/output.js @@ -2,9 +2,9 @@ var _call_a, _initProto; class Foo { static { - [_call_a, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 2, "a", function () { + [_call_a, _initProto] = babelHelpers.applyDecs(this, [[dec, 2, "a", function () { return this.value; - }]]); + }]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/output.js index 3703724c6d09..efac40c1c35e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/output.js @@ -6,7 +6,7 @@ _dec2 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [], [[_dec, 2, "a"], [_dec2, 2, _computedKey]]); + [_initProto] = babelHelpers.applyDecs(this, [[_dec, 2, "a"], [_dec2, 2, _computedKey]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/output.js index 0da8d1b3cc09..6b807803efa6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/output.js @@ -2,9 +2,9 @@ var _call_a, _initStatic; class Foo { static { - [_call_a, _initStatic] = babelHelpers.applyDecs(this, [], [[dec, 7, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs(this, [[dec, 7, "a", function () { return this.value; - }]]); + }]], []); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/output.js index 5f4939f5cf47..1ad76b111fb4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/output.js @@ -6,7 +6,7 @@ _dec2 = dec class Foo { static { - [_initStatic] = babelHelpers.applyDecs(this, [], [[_dec, 7, "a"], [_dec2, 7, _computedKey]]); + [_initStatic] = babelHelpers.applyDecs(this, [[_dec, 7, "a"], [_dec2, 7, _computedKey]], []); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/output.js index d9cd93561e12..61a1fde840db 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/output.js @@ -14,5 +14,5 @@ class A extends B { } (() => { - [_initProto] = babelHelpers.applyDecs(A, [], [[deco, 2, "method"]]); + [_initProto] = babelHelpers.applyDecs(A, [[deco, 2, "method"]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js index e83c8faed4d6..cbee7920e41e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js @@ -25,14 +25,14 @@ class Foo { } }, (() => { - [_init_bar] = babelHelpers.applyDecs(_class, [], [[babelHelpers.classPrivateFieldGet(_class, _a), 0, "bar"]]); + [_init_bar] = babelHelpers.applyDecs(_class, [[babelHelpers.classPrivateFieldGet(_class, _a), 0, "bar"]], []); })(), _temp; } } (() => { - [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(Foo, [dec, call(), chain.expr(), arbitrary + expr, array[expr]], [[[dec, call(), chain.expr(), arbitrary + expr, array[expr]], 2, "method"]]); + [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(Foo, [[[dec, call(), chain.expr(), arbitrary + expr, array[expr]], 2, "method"]], [dec, call(), chain.expr(), arbitrary + expr, array[expr]]); })(); (() => { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js index 1010050f46d8..b851ad2a66fb 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js @@ -6,7 +6,7 @@ new class extends babelHelpers.identity { static { class Class { static { - [_init_a, _init_d, _init_e, _call_f, _call_g, _call_g2, _init_h, _get_h, _set_h, _init_i, _init_m, _init_n, _call_o, _call_p, _call_q, _init_r, _get_r, _set_r, _initProto, _initStatic, _Class, _initClass] = babelHelpers.applyDecs(this, [dec], [[dec, 0, "a"], [dec, 2, "b"], [dec, 3, "c"], [dec, 4, "c"], [dec, 1, "d"], [dec, 0, "e", function () { + [_init_a, _init_d, _init_e, _call_f, _call_g, _call_g2, _init_h, _get_h, _set_h, _init_i, _init_m, _init_n, _call_o, _call_p, _call_q, _init_r, _get_r, _set_r, _initProto, _initStatic, _Class, _initClass] = babelHelpers.applyDecs(this, [[dec, 0, "a"], [dec, 2, "b"], [dec, 3, "c"], [dec, 4, "c"], [dec, 1, "d"], [dec, 0, "e", function () { return this.#e; }, function (value) { this.#e = value; @@ -22,7 +22,7 @@ new class extends babelHelpers.identity { return this.#D; }, function (value) { this.#D = value; - }]]); + }]], [dec]); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/output.js index 675d7aa43423..8a52cbd4b25a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/output.js @@ -2,7 +2,7 @@ var _initProto, _initProto2; class A extends B { static { - [_initProto] = babelHelpers.applyDecs(this, [], [[deco, 2, "method"]]); + [_initProto] = babelHelpers.applyDecs(this, [[deco, 2, "method"]], []); } constructor() { @@ -19,7 +19,7 @@ class A extends B { class C extends B { static { - [_initProto2] = babelHelpers.applyDecs(this, [], [[deco, 2, "method"]]); + [_initProto2] = babelHelpers.applyDecs(this, [[deco, 2, "method"]], []); } constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/output.js index c989509e4939..e2fb9d7eb331 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/output.js @@ -2,7 +2,7 @@ var _initProto; class A extends B { static { - [_initProto] = babelHelpers.applyDecs(this, [], [[deco, 2, "method"]]); + [_initProto] = babelHelpers.applyDecs(this, [[deco, 2, "method"]], []); } constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/output.js index 0ad7db798b8d..dcf5a0fae917 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/output.js @@ -4,7 +4,7 @@ let _Foo; class Foo extends Bar { static { - [_Foo, _initClass] = babelHelpers.applyDecs(this, [dec], []); + [_Foo, _initClass] = babelHelpers.applyDecs(this, [], [dec]); } constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/output.js index 28d6908be1be..dea033cc9d65 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/output.js @@ -2,9 +2,9 @@ var _call_x, _initProto; class Foo extends Bar { static { - [_call_x, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 3, "x", function () { + [_call_x, _initProto] = babelHelpers.applyDecs(this, [[dec, 3, "x", function () { return babelHelpers.get(babelHelpers.getPrototypeOf(Foo), "foo", this).call(this); - }]]); + }]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/output.js index cc92aa17cab1..b77541b7c254 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/output.js @@ -2,9 +2,9 @@ var _call_x, _initProto; class Foo extends Bar { static { - [_call_x, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 2, "x", function () { + [_call_x, _initProto] = babelHelpers.applyDecs(this, [[dec, 2, "x", function () { return babelHelpers.get(babelHelpers.getPrototypeOf(Foo), "foo", this).call(this); - }]]); + }]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js index 4f4f87063728..a72db7236833 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js @@ -4,7 +4,7 @@ let _Foo; class Foo { static { - [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(this, [dec, call(), chain.expr(), arbitrary + expr, array[expr]], [[[dec, call(), chain.expr(), arbitrary + expr, array[expr]], 2, "method"]]); + [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(this, [[[dec, call(), chain.expr(), arbitrary + expr, array[expr]], 2, "method"]], [dec, call(), chain.expr(), arbitrary + expr, array[expr]]); } constructor(...args) { @@ -20,7 +20,7 @@ class Foo { return class Nested { static { - [_init_bar] = babelHelpers.applyDecs(this, [], [[this.#a, 0, "bar"]]); + [_init_bar] = babelHelpers.applyDecs(this, [[this.#a, 0, "bar"]], []); } bar = _init_bar(this); }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js index 675254506d6b..5d0ad516b80b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js @@ -24,7 +24,7 @@ function _set_a(v) { } (() => { - [_call_a, _initProto] = babelHelpers.applyDecs(Foo, [], [[dec, 4, "a", function (v) { + [_call_a, _initProto] = babelHelpers.applyDecs(Foo, [[dec, 4, "a", function (v) { return this.value = v; - }]]); + }]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/output.js index f8bb2adfa894..256297632372 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/output.js @@ -22,5 +22,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [], [[_dec, 4, "a"], [_dec2, 4, _computedKey]]); + [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 4, "a"], [_dec2, 4, _computedKey]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js index 7f3f4c79f9ad..45e47a57177c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js @@ -17,9 +17,9 @@ var _a = { }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs(Foo, [], [[dec, 9, "a", function (v) { + [_call_a, _initStatic] = babelHelpers.applyDecs(Foo, [[dec, 9, "a", function (v) { return this.value = v; - }]]); + }]], []); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/output.js index 97a4ee1720aa..e890b8fb8d4a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/output.js @@ -16,7 +16,7 @@ class Foo { } (() => { - [_initStatic] = babelHelpers.applyDecs(Foo, [], [[_dec, 9, "a"], [_dec2, 9, _computedKey]]); + [_initStatic] = babelHelpers.applyDecs(Foo, [[_dec, 9, "a"], [_dec2, 9, _computedKey]], []); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/output.js index 81587b0dd11a..a1b2e04ab8f1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/output.js @@ -2,9 +2,9 @@ var _call_a, _initProto; class Foo { static { - [_call_a, _initProto] = babelHelpers.applyDecs(this, [], [[dec, 4, "a", function (v) { + [_call_a, _initProto] = babelHelpers.applyDecs(this, [[dec, 4, "a", function (v) { return this.value = v; - }]]); + }]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/output.js index 7e02f5d56ded..ad6f2edce743 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/output.js @@ -6,7 +6,7 @@ _dec2 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [], [[_dec, 4, "a"], [_dec2, 4, _computedKey]]); + [_initProto] = babelHelpers.applyDecs(this, [[_dec, 4, "a"], [_dec2, 4, _computedKey]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/output.js index d0976558f535..6bcadc0cc528 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/output.js @@ -2,9 +2,9 @@ var _call_a, _initStatic; class Foo { static { - [_call_a, _initStatic] = babelHelpers.applyDecs(this, [], [[dec, 9, "a", function (v) { + [_call_a, _initStatic] = babelHelpers.applyDecs(this, [[dec, 9, "a", function (v) { return this.value = v; - }]]); + }]], []); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/output.js index 3bdaf51a2b31..230ee2bc8aff 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/output.js @@ -6,7 +6,7 @@ _dec2 = dec class Foo { static { - [_initStatic] = babelHelpers.applyDecs(this, [], [[_dec, 9, "a"], [_dec2, 9, _computedKey]]); + [_initStatic] = babelHelpers.applyDecs(this, [[_dec, 9, "a"], [_dec2, 9, _computedKey]], []); _initStatic(this); From 46214a1654ae0a57e365c28a909805cc1cf28b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 7 Feb 2022 11:25:00 -0500 Subject: [PATCH 09/15] fix: memoise non-static decorators / keys --- .../src/transformer-2021-12.ts | 95 +++++++++---------- .../private/input.js | 1 + .../private/output.js | 2 + .../public/input.js | 1 + .../public/output.js | 9 +- .../static-private/input.js | 1 + .../static-private/output.js | 2 + .../static-public/input.js | 1 + .../static-public/output.js | 9 +- .../undecorated-private/input.js | 1 + .../undecorated-private/output.js | 2 + .../undecorated-public/input.js | 1 + .../undecorated-public/output.js | 2 + .../undecorated-static-private/input.js | 1 + .../undecorated-static-private/output.js | 2 + .../undecorated-static-public/input.js | 1 + .../undecorated-static-public/output.js | 2 + .../2021-12-accessors/private/input.js | 1 + .../2021-12-accessors/private/output.js | 2 + .../2021-12-accessors/public/input.js | 1 + .../2021-12-accessors/public/output.js | 9 +- .../2021-12-accessors/static-private/input.js | 1 + .../static-private/output.js | 2 + .../2021-12-accessors/static-public/input.js | 1 + .../2021-12-accessors/static-public/output.js | 9 +- .../undecorated-private/input.js | 1 + .../undecorated-private/output.js | 2 + .../undecorated-public/input.js | 1 + .../undecorated-public/output.js | 2 + .../undecorated-static-private/input.js | 1 + .../undecorated-static-private/output.js | 2 + .../undecorated-static-public/input.js | 1 + .../undecorated-static-public/output.js | 2 + .../input.js | 1 + .../output.js | 2 + .../super-in-private-accessor/input.js | 1 + .../super-in-private-accessor/output.js | 2 + .../super-in-private-method/input.js | 1 + .../super-in-private-method/output.js | 2 + .../expressions/input.js | 1 + .../expressions/output.js | 2 + .../inheritance/input.js | 2 + .../inheritance/output.js | 4 + .../initializers/input.js | 1 + .../initializers/output.js | 2 + .../input.js | 1 + .../output.js | 2 + .../replacement-static-this/input.js | 1 + .../replacement-static-this/output.js | 2 + .../replacement-with-expr/input.js | 1 + .../replacement-with-expr/output.js | 2 + .../replacement/input.js | 1 + .../replacement/output.js | 2 + .../2021-12-classes/expressions/input.js | 1 + .../2021-12-classes/expressions/output.js | 2 + .../2021-12-classes/inheritance/input.js | 1 + .../2021-12-classes/inheritance/output.js | 12 ++- .../2021-12-classes/initializers/input.js | 1 + .../2021-12-classes/initializers/output.js | 2 + .../input.js | 1 + .../output.js | 2 + .../replacement-static-this/input.js | 1 + .../replacement-static-this/output.js | 2 + .../replacement-with-expr/input.js | 1 + .../replacement-with-expr/output.js | 2 + .../2021-12-classes/replacement/input.js | 1 + .../2021-12-classes/replacement/output.js | 2 + .../computed-keys-same-ast/input.js | 1 + .../computed-keys-same-ast/output.js | 8 +- .../computed-keys-same-value/input.js | 1 + .../computed-keys-same-value/output.js | 8 +- .../method-and-field/input.js | 1 + .../method-and-field/output.js | 2 + .../methods-with-same-key/input.js | 1 + .../methods-with-same-key/output.js | 2 + .../computed-keys-same-ast/input.js | 1 + .../computed-keys-same-ast/output.js | 8 +- .../computed-keys-same-value/input.js | 1 + .../computed-keys-same-value/output.js | 8 +- .../method-and-field/input.js | 1 + .../method-and-field/output.js | 2 + .../methods-with-same-key/input.js | 1 + .../methods-with-same-key/output.js | 2 + .../private/input.js | 1 + .../private/output.js | 2 + .../2021-12-fields--to-es2015/public/input.js | 1 + .../public/output.js | 9 +- .../static-private/input.js | 1 + .../static-private/output.js | 2 + .../static-public/input.js | 1 + .../static-public/output.js | 9 +- .../fixtures/2021-12-fields/private/input.js | 1 + .../fixtures/2021-12-fields/private/output.js | 2 + .../fixtures/2021-12-fields/public/input.js | 1 + .../fixtures/2021-12-fields/public/output.js | 9 +- .../2021-12-fields/static-private/input.js | 1 + .../2021-12-fields/static-private/output.js | 2 + .../2021-12-fields/static-public/input.js | 1 + .../2021-12-fields/static-public/output.js | 9 +- .../private/input.js | 1 + .../private/output.js | 2 + .../public/input.js | 1 + .../public/output.js | 8 +- .../static-private/input.js | 1 + .../static-private/output.js | 2 + .../static-public/input.js | 1 + .../static-public/output.js | 8 +- .../private/input.js | 1 + .../private/output.js | 2 + .../public/input.js | 1 + .../public/output.js | 10 +- .../static-private/input.js | 1 + .../static-private/output.js | 2 + .../static-public/input.js | 1 + .../static-public/output.js | 10 +- .../private/input.js | 1 + .../private/output.js | 2 + .../public/input.js | 1 + .../public/output.js | 10 +- .../static-private/input.js | 1 + .../static-private/output.js | 2 + .../static-public/input.js | 1 + .../static-public/output.js | 10 +- .../fixtures/2021-12-getters/private/input.js | 1 + .../2021-12-getters/private/output.js | 2 + .../fixtures/2021-12-getters/public/input.js | 1 + .../fixtures/2021-12-getters/public/output.js | 8 +- .../2021-12-getters/static-private/input.js | 1 + .../2021-12-getters/static-private/output.js | 2 + .../2021-12-getters/static-public/input.js | 1 + .../2021-12-getters/static-public/output.js | 8 +- .../private/input.js | 1 + .../private/output.js | 2 + .../public/input.js | 1 + .../public/output.js | 8 +- .../static-private/input.js | 1 + .../static-private/output.js | 2 + .../static-public/input.js | 1 + .../static-public/output.js | 8 +- .../fixtures/2021-12-methods/private/input.js | 1 + .../2021-12-methods/private/output.js | 2 + .../fixtures/2021-12-methods/public/input.js | 1 + .../fixtures/2021-12-methods/public/output.js | 8 +- .../2021-12-methods/static-private/input.js | 1 + .../2021-12-methods/static-private/output.js | 2 + .../2021-12-methods/static-public/input.js | 1 + .../2021-12-methods/static-public/output.js | 8 +- .../input.js | 1 + .../output.js | 8 +- .../valid-expression-formats/input.js | 1 + .../2021-12-misc/all-decorators/input.js | 1 + .../2021-12-misc/all-decorators/output.js | 2 + .../decorator-evaluation-scope/exec.js | 10 ++ .../input.js | 1 + .../output.js | 12 ++- .../input.js | 3 +- .../output.js | 4 +- .../private-keys-in-enclosing-class/input.js | 1 + .../private-keys-in-enclosing-class/output.js | 2 + .../input.js | 1 + .../input.js | 1 + .../input.js | 1 + .../setting-private-method-via-rest/input.js | 1 + .../input.js | 1 + .../setting-private-method/input.js | 1 + .../input.js | 1 + .../output.js | 2 + .../super-in-private-accessor/input.js | 1 + .../super-in-private-accessor/output.js | 2 + .../super-in-private-method/input.js | 1 + .../super-in-private-method/output.js | 2 + .../valid-expression-formats/input.js | 1 + .../private/input.js | 1 + .../private/output.js | 2 + .../public/input.js | 1 + .../public/output.js | 8 +- .../static-private/input.js | 1 + .../static-private/output.js | 2 + .../static-public/input.js | 1 + .../static-public/output.js | 8 +- .../fixtures/2021-12-setters/private/input.js | 1 + .../2021-12-setters/private/output.js | 2 + .../fixtures/2021-12-setters/public/input.js | 1 + .../fixtures/2021-12-setters/public/output.js | 8 +- .../2021-12-setters/static-private/input.js | 1 + .../2021-12-setters/static-private/output.js | 2 + .../2021-12-setters/static-public/input.js | 1 + .../2021-12-setters/static-public/output.js | 8 +- 188 files changed, 410 insertions(+), 187 deletions(-) create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/decorator-evaluation-scope/exec.js diff --git a/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts b/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts index a4c663499d4a..509df8e115d6 100644 --- a/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts +++ b/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts @@ -1,4 +1,4 @@ -import type { NodePath } from "@babel/traverse"; +import type { NodePath, Scope } from "@babel/traverse"; import { types as t, template } from "@babel/core"; import syntaxDecorators from "@babel/plugin-syntax-decorators"; import ReplaceSupers from "@babel/helper-replace-supers"; @@ -506,13 +506,20 @@ function transformClass( let constructorPath: NodePath | undefined; let requiresProtoInit = false; let requiresStaticInit = false; - let hasComputedProps = false; const decoratedPrivateMethods = new Set(); let protoInitLocal: t.Identifier, staticInitLocal: t.Identifier, classInitLocal: t.Identifier, classLocal: t.Identifier; + const assignments: t.AssignmentExpression[] = []; + const scopeParent: Scope = path.scope.parent; + + const memoiseExpression = (expression: t.Expression, hint: string) => { + const localEvaluatedId = scopeParent.generateDeclaredUidIdentifier(hint); + assignments.push(t.assignmentExpression("=", localEvaluatedId, expression)); + return t.cloneNode(localEvaluatedId); + }; if (classDecorators) { classInitLocal = @@ -523,6 +530,15 @@ function transformClass( classLocal = localId; path.node.decorators = null; + + for (const classDecorator of classDecorators) { + if (!scopeParent.isStatic(classDecorator.expression)) { + classDecorator.expression = memoiseExpression( + classDecorator.expression, + "dec", + ); + } + } } else { if (!path.node.id) { path.node.id = path.scope.generateUidIdentifier("Class"); @@ -536,20 +552,42 @@ function transformClass( continue; } - let { key } = element.node; - const kind = getElementKind(element); + const { node } = element; const decorators = element.get("decorators"); - const isPrivate = key.type === "PrivateName"; + const hasDecorators = Array.isArray(decorators) && decorators.length > 0; + + if (hasDecorators) { + for (const decoratorPath of decorators) { + if (!scopeParent.isStatic(decoratorPath.node.expression)) { + decoratorPath.node.expression = memoiseExpression( + decoratorPath.node.expression, + "dec", + ); + } + } + } + const isComputed = "computed" in element.node && element.node.computed === true; + if (isComputed) { + if (!scopeParent.isStatic(node.key)) { + node.key = memoiseExpression(node.key as t.Expression, "computedKey"); + } + } + + const kind = getElementKind(element); + const { key } = node; + + const isPrivate = key.type === "PrivateName"; + const isStatic = !!element.node.static; let name = "computedKey"; if (isPrivate) { name = (key as t.PrivateName).id.name; - } else if (key.type === "Identifier") { + } else if (!isComputed && key.type === "Identifier") { name = key.name; } @@ -557,22 +595,7 @@ function transformClass( constructorPath = element; } - if (isComputed) { - const keyPath = element.get("key"); - const localComputedNameId = - keyPath.scope.parent.generateDeclaredUidIdentifier(name); - keyPath.replaceWith(localComputedNameId); - - elementDecoratorInfo.push({ - localComputedNameId: t.cloneNode(localComputedNameId), - keyNode: t.cloneNode(key as t.Expression), - }); - - key = localComputedNameId; - hasComputedProps = true; - } - - if (Array.isArray(decorators) && decorators.length > 0) { + if (hasDecorators) { let locals: t.Identifier | t.Identifier[]; let privateMethods: t.FunctionExpression | t.FunctionExpression[]; @@ -730,33 +753,7 @@ function transformClass( } } - if (hasComputedProps) { - const assignments: t.AssignmentExpression[] = []; - - for (const info of elementDecoratorInfo) { - if (isDecoratorInfo(info)) { - const { decorators } = info; - const newDecorators: t.Identifier[] = []; - - for (const decorator of decorators) { - const localComputedNameId = - path.scope.parent.generateDeclaredUidIdentifier("dec"); - assignments.push( - t.assignmentExpression("=", localComputedNameId, decorator), - ); - newDecorators.push(t.cloneNode(localComputedNameId)); - } - - info.decorators = newDecorators; - } else { - assignments.push( - t.assignmentExpression("=", info.localComputedNameId, info.keyNode), - ); - } - } - - path.insertBefore(assignments); - } + path.insertBefore(assignments); const elementDecorations = generateDecorationExprs(elementDecoratorInfo); const classDecorations = t.arrayExpression( diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/private/input.js index be4f348923bc..aa152db91d94 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec accessor #a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/private/output.js index 69673b7af6d2..2d753e957d94 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/private/output.js @@ -1,5 +1,7 @@ var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto; +const dec = () => {}; + var _A = /*#__PURE__*/new WeakMap(); var _a = /*#__PURE__*/new WeakMap(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/input.js index 5945d3196f1d..bd8be5cbe225 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec accessor a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js index 2a6057e84caa..c4a2e3b65722 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js @@ -1,9 +1,8 @@ -var _init_a, _init_b, _computedKey, _init_computedKey, _dec, _dec2, _dec3, _initProto; +var _init_a, _init_b, _computedKey, _init_computedKey, _initProto; + +const dec = () => {}; -_dec = dec -_dec2 = dec _computedKey = 'c' -_dec3 = dec var _A = /*#__PURE__*/new WeakMap(); @@ -54,5 +53,5 @@ class Foo { } (() => { - [_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs(Foo, [[_dec, 1, "a"], [_dec2, 1, "b"], [_dec3, 1, _computedKey]], []); + [_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs(Foo, [[dec, 1, "a"], [dec, 1, "b"], [dec, 1, _computedKey]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/input.js index ebb88a741572..c30e61d463bc 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec static accessor #a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js index b0ec49e5726f..2cd651f5e68a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js @@ -1,5 +1,7 @@ var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic; +const dec = () => {}; + var _a = /*#__PURE__*/new WeakMap(); var _b = /*#__PURE__*/new WeakMap(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/input.js index edf06478601f..50f05c065848 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec static accessor a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js index c5a6ac47eba2..333884b1c59c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js @@ -1,9 +1,8 @@ -var _init_a, _init_b, _computedKey, _init_computedKey, _dec, _dec2, _dec3, _initStatic; +var _init_a, _init_b, _computedKey, _init_computedKey, _initStatic; + +const dec = () => {}; -_dec = dec -_dec2 = dec _computedKey = 'c' -_dec3 = dec class Foo { static get a() { @@ -33,7 +32,7 @@ class Foo { } (() => { - [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs(Foo, [[_dec, 6, "a"], [_dec2, 6, "b"], [_dec3, 6, _computedKey]], []); + [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs(Foo, [[dec, 6, "a"], [dec, 6, "b"], [dec, 6, _computedKey]], []); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-private/input.js index 4afc45261337..07804cb8a125 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { accessor #a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-private/output.js index 29d3fbd66965..ff585899f911 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-private/output.js @@ -1,3 +1,5 @@ +const dec = () => {}; + var _A = /*#__PURE__*/new WeakMap(); var _a = /*#__PURE__*/new WeakMap(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-public/input.js index ad27f18d5ed3..62dbd0c0381a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { accessor a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-public/output.js index 6ec6f9255a06..f737b0e17936 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-public/output.js @@ -1,3 +1,5 @@ +const dec = () => {}; + var _A = /*#__PURE__*/new WeakMap(); var _B = /*#__PURE__*/new WeakMap(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-private/input.js index 2e516a961de9..9e893b86b863 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static accessor #a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-private/output.js index 51de21b149b2..cd052d1aa957 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-private/output.js @@ -1,3 +1,5 @@ +const dec = () => {}; + class Foo {} function _get_a() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-public/input.js index 160e72cd531c..eb7463cb9fc1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static accessor a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-public/output.js index 4fe37de40ebf..8ebb5ed6cba4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-public/output.js @@ -1,3 +1,5 @@ +const dec = () => {}; + class Foo { static get a() { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _A); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/input.js index be4f348923bc..aa152db91d94 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec accessor #a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/output.js index c054a288032a..90e773d6dee2 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/private/output.js @@ -1,5 +1,7 @@ var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto; +const dec = () => {}; + class Foo { static { [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs(this, [[dec, 1, "a", function () { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/input.js index 5945d3196f1d..bd8be5cbe225 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec accessor a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/output.js index 0fb94194b1db..78dcb770052c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/output.js @@ -1,13 +1,12 @@ -var _init_a, _init_b, _computedKey, _init_computedKey, _dec, _dec2, _dec3, _initProto; +var _init_a, _init_b, _computedKey, _init_computedKey, _initProto; + +const dec = () => {}; -_dec = dec -_dec2 = dec _computedKey = 'c' -_dec3 = dec class Foo { static { - [_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs(this, [[_dec, 1, "a"], [_dec2, 1, "b"], [_dec3, 1, _computedKey]], []); + [_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs(this, [[dec, 1, "a"], [dec, 1, "b"], [dec, 1, _computedKey]], []); } #A = (_initProto(this), _init_a(this)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/input.js index ebb88a741572..c30e61d463bc 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec static accessor #a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/output.js index ad30531a425e..a62cf5634aff 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-private/output.js @@ -1,5 +1,7 @@ var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic; +const dec = () => {}; + class Foo { static { [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs(this, [[dec, 6, "a", function () { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/input.js index edf06478601f..50f05c065848 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec static accessor a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/output.js index 471adf36f9c9..3eb7622b70e8 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/output.js @@ -1,13 +1,12 @@ -var _init_a, _init_b, _computedKey, _init_computedKey, _dec, _dec2, _dec3, _initStatic; +var _init_a, _init_b, _computedKey, _init_computedKey, _initStatic; + +const dec = () => {}; -_dec = dec -_dec2 = dec _computedKey = 'c' -_dec3 = dec class Foo { static { - [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs(this, [[_dec, 6, "a"], [_dec2, 6, "b"], [_dec3, 6, _computedKey]], []); + [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs(this, [[dec, 6, "a"], [dec, 6, "b"], [dec, 6, _computedKey]], []); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-private/input.js index 4afc45261337..07804cb8a125 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { accessor #a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-private/output.js index 9eb7268e4131..48bd7037ef2c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-private/output.js @@ -1,3 +1,5 @@ +const dec = () => {}; + class Foo { #A; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-public/input.js index ad27f18d5ed3..62dbd0c0381a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { accessor a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-public/output.js index f6269be736f1..478dff1b4ee9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-public/output.js @@ -1,3 +1,5 @@ +const dec = () => {}; + class Foo { #A; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-private/input.js index 2e516a961de9..9e893b86b863 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static accessor #a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-private/output.js index 04cc0ef030d0..985081906eb4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-private/output.js @@ -1,3 +1,5 @@ +const dec = () => {}; + class Foo { static #A; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-public/input.js index 160e72cd531c..eb7463cb9fc1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static accessor a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-public/output.js index 187ad5214a67..e066c9045da5 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/undecorated-static-public/output.js @@ -1,3 +1,5 @@ +const dec = () => {}; + class Foo { static #A; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/input.js index ebd79d22da06..6bc1a7dbbc4b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; @dec class Foo extends Bar { constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/output.js index dcf5a0fae917..eeae9e4d8ff1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-nested-constructor-expression/output.js @@ -1,5 +1,7 @@ var _initClass; +const dec = () => {}; + let _Foo; class Foo extends Bar { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/input.js index 4be504d54e70..b32ea0bd378f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo extends Bar { @dec get #x() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/output.js index 17cd5aa63e11..77b1b3c4f1c4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-accessor/output.js @@ -1,5 +1,7 @@ var _call_x, _initProto; +const dec = () => {}; + class Foo extends Bar { static { [_call_x, _initProto] = babelHelpers.applyDecs(this, [[dec, 3, "x", function () { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/input.js index 73200f5f673d..36f9bd37dfa7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo extends Bar { @dec #x() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/output.js index 91246a1f387a..4ad35da7a786 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-assumption-constantSuper/super-in-private-method/output.js @@ -1,5 +1,7 @@ var _call_x, _initProto; +const dec = () => {}; + class Foo extends Bar { static { [_call_x, _initProto] = babelHelpers.applyDecs(this, [[dec, 2, "x", function () { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/input.js index 542bf870c079..77060bea50ff 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; const A = @dec class A {} const B = @dec class C {} const D = @dec class {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/output.js index b0cce043afbe..e5285c7fe78c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions/output.js @@ -1,5 +1,7 @@ var _initClass, _A, _class, _temp, _initClass2, _C, _class2, _temp2, _initClass3, _D, _class3, _temp3, _initClass4, _decorated_class, _class4, _temp4, _initClass5, _G, _class5, _temp5, _initClass6, _decorated_class2, _class6, _temp6, _initClass7, _H, _class7, _temp7, _initClass8, _K, _class8, _temp8; +const dec = () => {}; + const A = ((_temp = _class = class A {}, (() => { [_A, _initClass] = babelHelpers.applyDecs(_class, [], [dec]); })(), (() => { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/input.js index 7a4a6684555a..96a13523506c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/input.js @@ -1,3 +1,5 @@ +const dec1 = () => {}; +const dec2 = () => {}; @dec1 class Bar {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/output.js index 605270eadeca..a6b0bbea747b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/inheritance/output.js @@ -1,5 +1,9 @@ var _initClass, _initClass2; +const dec1 = () => {}; + +const dec2 = () => {}; + let _Bar; class Bar {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/input.js index deeb483448f7..87c785d39a93 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; @dec class Foo { static field = 123; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/output.js index 3ed28458cab0..e2484dd973ae 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/initializers/output.js @@ -1,5 +1,7 @@ var _initClass, _temp2, _initClass2, _temp4; +const dec = () => {}; + let _Foo; new (_temp2 = class extends babelHelpers.identity { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/input.js index daf74ddd2d36..e8c62db59046 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; let hasX, hasM; @dec diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js index f11cf07517d3..8403fb9bb9ba 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js @@ -1,5 +1,7 @@ var _initClass, _x, _m, _temp2; +const dec = () => {}; + let hasX, hasM; let _Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/input.js index 51bc09c85652..1b8d46cf3ac0 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; @dec class Foo { static { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/output.js index fe77f96f5af9..5ff5ed1f935b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-this/output.js @@ -1,5 +1,7 @@ var _initClass, _temp2; +const dec = () => {}; + let _Foo; new (_temp2 = class extends babelHelpers.identity { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/input.js index fde7feb1abd7..0cd5e45110b7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; const Foo = @dec class Bar { bar = new Bar(); }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/output.js index f1f8cd9df38d..911bb3449af4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-with-expr/output.js @@ -1,5 +1,7 @@ var _initClass, _Bar, _class, _temp; +const dec = () => {}; + const Foo = ((_temp = _class = class Bar { constructor() { babelHelpers.defineProperty(this, "bar", new _Bar()); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/input.js index e6da5000db62..8f0a4dfe092f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; @dec class Foo { static foo = new Foo(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/output.js index f302d19a6ecb..f2fb1fb216f7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement/output.js @@ -1,5 +1,7 @@ var _initClass, _temp2; +const dec = () => {}; + let _Foo; new (_temp2 = class extends babelHelpers.identity { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/input.js index 542bf870c079..77060bea50ff 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; const A = @dec class A {} const B = @dec class C {} const D = @dec class {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/output.js index 146cdb17ca70..33d00cc709eb 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/expressions/output.js @@ -1,5 +1,7 @@ var _initClass, _A, _initClass2, _C, _initClass3, _D, _initClass4, _decorated_class, _initClass5, _G, _initClass6, _decorated_class2, _initClass7, _H, _initClass8, _K; +const dec = () => {}; + const A = (class A { static { [_A, _initClass] = babelHelpers.applyDecs(this, [], [dec]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/input.js index 7a4a6684555a..0657f6e2b364 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; @dec1 class Bar {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/output.js index d7ea9b35166e..6ffb0703782e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/output.js @@ -1,10 +1,14 @@ -var _initClass, _initClass2; +var _initClass, _dec, _initClass2, _dec2; + +const dec = () => {}; let _Bar; +_dec = dec1 + class Bar { static { - [_Bar, _initClass] = babelHelpers.applyDecs(this, [], [dec1]); + [_Bar, _initClass] = babelHelpers.applyDecs(this, [], [_dec]); } static { _initClass(); @@ -14,9 +18,11 @@ class Bar { let _Foo; +_dec2 = dec2 + class Foo extends _Bar { static { - [_Foo, _initClass2] = babelHelpers.applyDecs(this, [], [dec2]); + [_Foo, _initClass2] = babelHelpers.applyDecs(this, [], [_dec2]); } static { _initClass2(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/input.js index deeb483448f7..87c785d39a93 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; @dec class Foo { static field = 123; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/output.js index 982a63a72f28..82878b9723c4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/initializers/output.js @@ -1,5 +1,7 @@ var _initClass, _initClass2; +const dec = () => {}; + let _Foo; new class extends babelHelpers.identity { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/input.js index daf74ddd2d36..e8c62db59046 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; let hasX, hasM; @dec diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/output.js index 8f36ec034422..e673706e8f64 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-installed-on-correct-class/output.js @@ -1,5 +1,7 @@ var _initClass; +const dec = () => {}; + let hasX, hasM; let _Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/input.js index 51bc09c85652..1b8d46cf3ac0 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; @dec class Foo { static { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/output.js index 5ca20ff8d696..0d7e92d18761 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-static-this/output.js @@ -1,5 +1,7 @@ var _initClass; +const dec = () => {}; + let _Foo; new class extends babelHelpers.identity { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/input.js index fde7feb1abd7..0cd5e45110b7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; const Foo = @dec class Bar { bar = new Bar(); }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/output.js index 4c37edebb1dd..dff079e0eb9f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement-with-expr/output.js @@ -1,5 +1,7 @@ var _initClass, _Bar; +const dec = () => {}; + const Foo = (class Bar { static { [_Bar, _initClass] = babelHelpers.applyDecs(this, [], [dec]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/input.js index e6da5000db62..8f0a4dfe092f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; @dec class Foo { static foo = new Foo(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/output.js index 42a115d10f2b..51724d5ac64f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/replacement/output.js @@ -1,5 +1,7 @@ var _initClass; +const dec = () => {}; + let _Foo; new class extends babelHelpers.identity { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/input.js index 2ca438188867..fd4743f81bc7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec [getKey()]() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/output.js index a70d24de54c9..eaa7583421ee 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/output.js @@ -1,9 +1,9 @@ -var _computedKey, _computedKey2, _dec, _dec2, _initProto; +var _computedKey, _computedKey2, _initProto; + +const dec = () => {}; _computedKey = getKey() -_dec = dec _computedKey2 = getKey() -_dec2 = dec class Foo { constructor(...args) { @@ -21,5 +21,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]], []); + [_initProto] = babelHelpers.applyDecs(Foo, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/input.js index 8aeb57759b76..0f6e2ca31d39 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec [getKeyI()]() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/output.js index 66e2ac318d83..bf6329e0b21f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/output.js @@ -1,9 +1,9 @@ -var _computedKey, _computedKey2, _dec, _dec2, _initProto; +var _computedKey, _computedKey2, _initProto; + +const dec = () => {}; _computedKey = getKeyI() -_dec = dec _computedKey2 = getKeyJ() -_dec2 = dec class Foo { constructor(...args) { @@ -21,5 +21,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]], []); + [_initProto] = babelHelpers.applyDecs(Foo, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/input.js index 522da0061204..e2bfd2a7b415 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec a = 123; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/output.js index fe79aa632006..b70d02e25fc7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/output.js @@ -1,5 +1,7 @@ var _init_a, _initProto; +const dec = () => {}; + class Foo { constructor() { babelHelpers.defineProperty(this, "a", (_initProto(this), _init_a(this, 123))); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/input.js index db90a40aa67b..ab961fbc9dfb 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec a() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/output.js index 6402e1341ff0..01e4e3298fce 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/methods-with-same-key/output.js @@ -1,5 +1,7 @@ var _initProto; +const dec = () => {}; + class Foo { constructor(...args) { _initProto(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/input.js index 2ca438188867..fd4743f81bc7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec [getKey()]() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/output.js index 9663aebaf7b3..294a15adaac3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/output.js @@ -1,13 +1,13 @@ -var _computedKey, _computedKey2, _dec, _dec2, _initProto; +var _computedKey, _computedKey2, _initProto; + +const dec = () => {}; _computedKey = getKey() -_dec = dec _computedKey2 = getKey() -_dec2 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]], []); + [_initProto] = babelHelpers.applyDecs(this, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/input.js index 8aeb57759b76..0f6e2ca31d39 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec [getKeyI()]() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/output.js index 76d9f05cad75..3a79df5344da 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/output.js @@ -1,13 +1,13 @@ -var _computedKey, _computedKey2, _dec, _dec2, _initProto; +var _computedKey, _computedKey2, _initProto; + +const dec = () => {}; _computedKey = getKeyI() -_dec = dec _computedKey2 = getKeyJ() -_dec2 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [[_dec, 2, _computedKey], [_dec2, 2, _computedKey2]], []); + [_initProto] = babelHelpers.applyDecs(this, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/input.js index 522da0061204..e2bfd2a7b415 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec a = 123; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/output.js index cb04e3cc2e5d..6c1bdff1940b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/method-and-field/output.js @@ -1,5 +1,7 @@ var _init_a, _initProto; +const dec = () => {}; + class Foo { static { [_init_a, _initProto] = babelHelpers.applyDecs(this, [[dec, 0, "a"], [dec, 2, "a"]], []); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/input.js index db90a40aa67b..ab961fbc9dfb 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec a() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/output.js index c4befb4def4d..4cee39fbc75b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/methods-with-same-key/output.js @@ -1,5 +1,7 @@ var _initProto; +const dec = () => {}; + class Foo { static { [_initProto] = babelHelpers.applyDecs(this, [[dec, 2, "a"], [dec, 2, "a"]], []); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/input.js index 222ec09fc95e..2cd77e99b7e3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec #a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js index af27fce2d289..54c3d026df17 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js @@ -1,5 +1,7 @@ var _init_a, _init_b; +const dec = () => {}; + var _a = /*#__PURE__*/new WeakMap(); var _b = /*#__PURE__*/new WeakMap(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/input.js index 8dff95c99a3a..16a36d324047 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/output.js index 481926ddfe5a..78f642ce628a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/public/output.js @@ -1,9 +1,8 @@ -var _init_a, _init_b, _computedKey, _init_computedKey, _dec, _dec2, _dec3; +var _init_a, _init_b, _computedKey, _init_computedKey; + +const dec = () => {}; -_dec = dec -_dec2 = dec _computedKey = 'c' -_dec3 = dec class Foo { constructor() { @@ -15,5 +14,5 @@ class Foo { } (() => { - [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(Foo, [[_dec, 0, "a"], [_dec2, 0, "b"], [_dec3, 0, _computedKey]], []); + [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(Foo, [[dec, 0, "a"], [dec, 0, "b"], [dec, 0, _computedKey]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/input.js index 830d82321863..bc6f56f17527 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec static #a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js index ad619ac7d598..b149d703302f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js @@ -1,5 +1,7 @@ var _init_a, _init_b; +const dec = () => {}; + class Foo {} (() => { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/input.js index 9b9dae98314a..e7e44bf1ec16 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec static a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/output.js index c5df8314385b..5d900ae41652 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-public/output.js @@ -1,14 +1,13 @@ -var _init_a, _init_b, _computedKey, _init_computedKey, _dec, _dec2, _dec3; +var _init_a, _init_b, _computedKey, _init_computedKey; + +const dec = () => {}; -_dec = dec -_dec2 = dec _computedKey = 'c' -_dec3 = dec class Foo {} (() => { - [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(Foo, [[_dec, 5, "a"], [_dec2, 5, "b"], [_dec3, 5, _computedKey]], []); + [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(Foo, [[dec, 5, "a"], [dec, 5, "b"], [dec, 5, _computedKey]], []); })(); babelHelpers.defineProperty(Foo, "a", _init_a(Foo)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/input.js index 222ec09fc95e..2cd77e99b7e3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec #a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/output.js index b72a6d971df6..a1f8978d4a10 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/private/output.js @@ -1,5 +1,7 @@ var _init_a, _init_b; +const dec = () => {}; + class Foo { static { [_init_a, _init_b] = babelHelpers.applyDecs(this, [[dec, 0, "a", function () { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/input.js index 8dff95c99a3a..16a36d324047 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/output.js index 06c0434d04a6..74138e9cf70b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/public/output.js @@ -1,13 +1,12 @@ -var _init_a, _init_b, _computedKey, _init_computedKey, _dec, _dec2, _dec3; +var _init_a, _init_b, _computedKey, _init_computedKey; + +const dec = () => {}; -_dec = dec -_dec2 = dec _computedKey = 'c' -_dec3 = dec class Foo { static { - [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(this, [[_dec, 0, "a"], [_dec2, 0, "b"], [_dec3, 0, _computedKey]], []); + [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(this, [[dec, 0, "a"], [dec, 0, "b"], [dec, 0, _computedKey]], []); } a = _init_a(this); b = _init_b(this, 123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/input.js index 830d82321863..bc6f56f17527 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec static #a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/output.js index cb167ff192fd..ff09b3d44586 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-private/output.js @@ -1,5 +1,7 @@ var _init_a, _init_b; +const dec = () => {}; + class Foo { static { [_init_a, _init_b] = babelHelpers.applyDecs(this, [[dec, 5, "a", function () { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/input.js index 9b9dae98314a..e7e44bf1ec16 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec static a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/output.js index 64af25745500..7f24c5944c7c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields/static-public/output.js @@ -1,13 +1,12 @@ -var _init_a, _init_b, _computedKey, _init_computedKey, _dec, _dec2, _dec3; +var _init_a, _init_b, _computedKey, _init_computedKey; + +const dec = () => {}; -_dec = dec -_dec2 = dec _computedKey = 'c' -_dec3 = dec class Foo { static { - [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(this, [[_dec, 5, "a"], [_dec2, 5, "b"], [_dec3, 5, _computedKey]], []); + [_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(this, [[dec, 5, "a"], [dec, 5, "b"], [dec, 5, _computedKey]], []); } static a = _init_a(this); static b = _init_b(this, 123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/input.js index 49c601a1dd5b..28519502bf46 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js index 32971ca073e9..f22674b1b8d9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js @@ -1,5 +1,7 @@ var _call_a, _initProto; +const dec = () => {}; + var _a = /*#__PURE__*/new WeakMap(); class Foo { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/input.js index 9d1cbae52f1d..392f9e03412f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/output.js index 0152dbf977de..3f3de7e5bbcc 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/public/output.js @@ -1,8 +1,8 @@ -var _computedKey, _dec, _dec2, _initProto; +var _computedKey, _initProto; + +const dec = () => {}; -_dec = dec _computedKey = 'b' -_dec2 = dec class Foo { constructor(...args) { @@ -22,5 +22,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 3, "a"], [_dec2, 3, _computedKey]], []); + [_initProto] = babelHelpers.applyDecs(Foo, [[dec, 3, "a"], [dec, 3, _computedKey]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/input.js index 90edd26364d8..9d64c02982da 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js index e0262570f9e3..efe85df511ec 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js @@ -1,5 +1,7 @@ var _call_a, _initStatic; +const dec = () => {}; + class Foo { static getA() { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/input.js index 1383fa58abf4..3bc53fb17cc5 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/output.js index 68787d432777..87f360a260d9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-public/output.js @@ -1,8 +1,8 @@ -var _computedKey, _dec, _dec2, _initStatic; +var _computedKey, _initStatic; + +const dec = () => {}; -_dec = dec _computedKey = 'b' -_dec2 = dec class Foo { static get a() { @@ -16,7 +16,7 @@ class Foo { } (() => { - [_initStatic] = babelHelpers.applyDecs(Foo, [[_dec, 8, "a"], [_dec2, 8, _computedKey]], []); + [_initStatic] = babelHelpers.applyDecs(Foo, [[dec, 8, "a"], [dec, 8, _computedKey]], []); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/input.js index 060ae225a21e..fdf137cc4a64 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js index 71e95a6ee2a2..a3ba90c2d423 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js @@ -1,5 +1,7 @@ var _call_a, _call_a2, _initProto; +const dec = () => {}; + var _a = /*#__PURE__*/new WeakMap(); class Foo { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/input.js index ef384166d689..1af1569ba988 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/output.js index a05760c5cfe9..ca1620b75abe 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/public/output.js @@ -1,11 +1,9 @@ -var _computedKey, _computedKey2, _dec, _dec2, _dec3, _dec4, _initProto; +var _computedKey, _computedKey2, _initProto; + +const dec = () => {}; -_dec = dec -_dec2 = dec _computedKey = 'b' -_dec3 = dec _computedKey2 = 'b' -_dec4 = dec class Foo { constructor(...args) { @@ -33,5 +31,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 3, "a"], [_dec2, 4, "a"], [_dec3, 3, _computedKey], [_dec4, 4, _computedKey2]], []); + [_initProto] = babelHelpers.applyDecs(Foo, [[dec, 3, "a"], [dec, 4, "a"], [dec, 3, _computedKey], [dec, 4, _computedKey2]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/input.js index f439a9152528..c832634c6b72 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js index e9ac78c2c966..8b8a774ad47f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js @@ -1,5 +1,7 @@ var _call_a, _call_a2, _initStatic; +const dec = () => {}; + class Foo { static getA() { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/input.js index 193bf7b836a2..bbad4af972ed 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/output.js index edcb11764a7a..2cfd5e545551 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-public/output.js @@ -1,11 +1,9 @@ -var _computedKey, _computedKey2, _dec, _dec2, _dec3, _dec4, _initStatic; +var _computedKey, _computedKey2, _initStatic; + +const dec = () => {}; -_dec = dec -_dec2 = dec _computedKey = 'b' -_dec3 = dec _computedKey2 = 'b' -_dec4 = dec class Foo { static get a() { @@ -27,7 +25,7 @@ class Foo { } (() => { - [_initStatic] = babelHelpers.applyDecs(Foo, [[_dec, 8, "a"], [_dec2, 9, "a"], [_dec3, 8, _computedKey], [_dec4, 9, _computedKey2]], []); + [_initStatic] = babelHelpers.applyDecs(Foo, [[dec, 8, "a"], [dec, 9, "a"], [dec, 8, _computedKey], [dec, 9, _computedKey2]], []); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/input.js index 060ae225a21e..fdf137cc4a64 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/output.js index bcf3cae9176e..35030f7c00bf 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/private/output.js @@ -1,5 +1,7 @@ var _call_a, _call_a2, _initProto; +const dec = () => {}; + class Foo { static { [_call_a, _call_a2, _initProto] = babelHelpers.applyDecs(this, [[dec, 3, "a", function () { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/input.js index ef384166d689..1af1569ba988 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/output.js index 1a7c8951454d..9d22fada3a67 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/public/output.js @@ -1,15 +1,13 @@ -var _computedKey, _computedKey2, _dec, _dec2, _dec3, _dec4, _initProto; +var _computedKey, _computedKey2, _initProto; + +const dec = () => {}; -_dec = dec -_dec2 = dec _computedKey = 'b' -_dec3 = dec _computedKey2 = 'b' -_dec4 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [[_dec, 3, "a"], [_dec2, 4, "a"], [_dec3, 3, _computedKey], [_dec4, 4, _computedKey2]], []); + [_initProto] = babelHelpers.applyDecs(this, [[dec, 3, "a"], [dec, 4, "a"], [dec, 3, _computedKey], [dec, 4, _computedKey2]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/input.js index f439a9152528..c832634c6b72 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/output.js index e897ea3cd18e..169367e7ae6b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-private/output.js @@ -1,5 +1,7 @@ var _call_a, _call_a2, _initStatic; +const dec = () => {}; + class Foo { static { [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs(this, [[dec, 8, "a", function () { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/input.js index 193bf7b836a2..bbad4af972ed 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/output.js index 367b9d127fd7..2777d0e553c1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters/static-public/output.js @@ -1,15 +1,13 @@ -var _computedKey, _computedKey2, _dec, _dec2, _dec3, _dec4, _initStatic; +var _computedKey, _computedKey2, _initStatic; + +const dec = () => {}; -_dec = dec -_dec2 = dec _computedKey = 'b' -_dec3 = dec _computedKey2 = 'b' -_dec4 = dec class Foo { static { - [_initStatic] = babelHelpers.applyDecs(this, [[_dec, 8, "a"], [_dec2, 9, "a"], [_dec3, 8, _computedKey], [_dec4, 9, _computedKey2]], []); + [_initStatic] = babelHelpers.applyDecs(this, [[dec, 8, "a"], [dec, 9, "a"], [dec, 8, _computedKey], [dec, 9, _computedKey2]], []); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/input.js index 49c601a1dd5b..28519502bf46 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/output.js index 06ba2926bfa4..bc2319dab14d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/private/output.js @@ -1,5 +1,7 @@ var _call_a, _initProto; +const dec = () => {}; + class Foo { static { [_call_a, _initProto] = babelHelpers.applyDecs(this, [[dec, 3, "a", function () { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/input.js index 9d1cbae52f1d..392f9e03412f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/output.js index 756adf797e3b..6ec290a3e353 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/public/output.js @@ -1,12 +1,12 @@ -var _computedKey, _dec, _dec2, _initProto; +var _computedKey, _initProto; + +const dec = () => {}; -_dec = dec _computedKey = 'b' -_dec2 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [[_dec, 3, "a"], [_dec2, 3, _computedKey]], []); + [_initProto] = babelHelpers.applyDecs(this, [[dec, 3, "a"], [dec, 3, _computedKey]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/input.js index 90edd26364d8..9d64c02982da 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/output.js index dc93a5313712..0eca748ff170 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-private/output.js @@ -1,5 +1,7 @@ var _call_a, _initStatic; +const dec = () => {}; + class Foo { static { [_call_a, _initStatic] = babelHelpers.applyDecs(this, [[dec, 8, "a", function () { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/input.js index 1383fa58abf4..3bc53fb17cc5 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/output.js index 2ec6f560dc4b..de0bb4f017ff 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters/static-public/output.js @@ -1,12 +1,12 @@ -var _computedKey, _dec, _dec2, _initStatic; +var _computedKey, _initStatic; + +const dec = () => {}; -_dec = dec _computedKey = 'b' -_dec2 = dec class Foo { static { - [_initStatic] = babelHelpers.applyDecs(this, [[_dec, 8, "a"], [_dec2, 8, _computedKey]], []); + [_initStatic] = babelHelpers.applyDecs(this, [[dec, 8, "a"], [dec, 8, _computedKey]], []); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/input.js index fc7ace8128ee..098bbbb687f2 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js index 4e18191445f1..69a2adb83d4b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js @@ -1,5 +1,7 @@ var _call_a, _initProto; +const dec = () => {}; + var _a = /*#__PURE__*/new WeakMap(); class Foo { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/input.js index f364442146ea..3a7f4cfaae9c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/output.js index 1835a9fa3548..36b8fdb4aba6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/public/output.js @@ -1,8 +1,8 @@ -var _computedKey, _dec, _dec2, _initProto; +var _computedKey, _initProto; + +const dec = () => {}; -_dec = dec _computedKey = 'b' -_dec2 = dec class Foo { constructor(...args) { @@ -22,5 +22,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 2, "a"], [_dec2, 2, _computedKey]], []); + [_initProto] = babelHelpers.applyDecs(Foo, [[dec, 2, "a"], [dec, 2, _computedKey]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/input.js index e68191455f14..4a6ae5d4d7fd 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js index 3c147c920d64..02427925f057 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js @@ -1,5 +1,7 @@ var _call_a, _initStatic; +const dec = () => {}; + class Foo { static callA() { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a).call(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/input.js index 77dae8711cd3..5f81da5c0405 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/output.js index d1c334def59e..68326d08fdfa 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-public/output.js @@ -1,8 +1,8 @@ -var _computedKey, _dec, _dec2, _initStatic; +var _computedKey, _initStatic; + +const dec = () => {}; -_dec = dec _computedKey = 'b' -_dec2 = dec class Foo { static a() { @@ -16,7 +16,7 @@ class Foo { } (() => { - [_initStatic] = babelHelpers.applyDecs(Foo, [[_dec, 7, "a"], [_dec2, 7, _computedKey]], []); + [_initStatic] = babelHelpers.applyDecs(Foo, [[dec, 7, "a"], [dec, 7, _computedKey]], []); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/input.js index fc7ace8128ee..098bbbb687f2 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/output.js index 6f76b6021b6c..ba38b17b2032 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/private/output.js @@ -1,5 +1,7 @@ var _call_a, _initProto; +const dec = () => {}; + class Foo { static { [_call_a, _initProto] = babelHelpers.applyDecs(this, [[dec, 2, "a", function () { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/input.js index f364442146ea..3a7f4cfaae9c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/output.js index efac40c1c35e..729fb28176f4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/public/output.js @@ -1,12 +1,12 @@ -var _computedKey, _dec, _dec2, _initProto; +var _computedKey, _initProto; + +const dec = () => {}; -_dec = dec _computedKey = 'b' -_dec2 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [[_dec, 2, "a"], [_dec2, 2, _computedKey]], []); + [_initProto] = babelHelpers.applyDecs(this, [[dec, 2, "a"], [dec, 2, _computedKey]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/input.js index e68191455f14..4a6ae5d4d7fd 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/output.js index 6b807803efa6..e68c51222a2f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-private/output.js @@ -1,5 +1,7 @@ var _call_a, _initStatic; +const dec = () => {}; + class Foo { static { [_call_a, _initStatic] = babelHelpers.applyDecs(this, [[dec, 7, "a", function () { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/input.js index 77dae8711cd3..5f81da5c0405 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/output.js index 1ad76b111fb4..d15d1734e9bf 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods/static-public/output.js @@ -1,12 +1,12 @@ -var _computedKey, _dec, _dec2, _initStatic; +var _computedKey, _initStatic; + +const dec = () => {}; -_dec = dec _computedKey = 'b' -_dec2 = dec class Foo { static { - [_initStatic] = babelHelpers.applyDecs(this, [[_dec, 7, "a"], [_dec2, 7, _computedKey]], []); + [_initStatic] = babelHelpers.applyDecs(this, [[dec, 7, "a"], [dec, 7, _computedKey]], []); _initStatic(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/input.js index d72d66fd2a29..68484c72749d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class A extends B { constructor() { let a = 2; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/output.js index 61a1fde840db..fc7ff8dff1d1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/output.js @@ -1,4 +1,8 @@ -var _initProto; +var _dec, _initProto; + +const dec = () => {}; + +_dec = deco class A extends B { constructor() { @@ -14,5 +18,5 @@ class A extends B { } (() => { - [_initProto] = babelHelpers.applyDecs(A, [[deco, 2, "method"]], []); + [_initProto] = babelHelpers.applyDecs(A, [[_dec, 2, "method"]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/input.js index 844a924e3e80..586564c5e219 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; @dec @call() @chain.expr() diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/input.js index e57aa75977ea..6986908e606d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; @dec class Class { @dec a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js index b851ad2a66fb..ab809be8665c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/all-decorators/output.js @@ -1,5 +1,7 @@ var _initClass, _init_a, _init_d, _init_e, _call_f, _call_g, _call_g2, _init_h, _get_h, _set_h, _init_i, _init_m, _init_n, _call_o, _call_p, _call_q, _init_r, _get_r, _set_r, _initProto, _initStatic; +const dec = () => {}; + let _Class; new class extends babelHelpers.identity { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/decorator-evaluation-scope/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/decorator-evaluation-scope/exec.js new file mode 100644 index 000000000000..cb08014670f4 --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/decorator-evaluation-scope/exec.js @@ -0,0 +1,10 @@ +let receivedName; +function decFactory(name) { receivedName = name; return x => x } +class B { + static { + class C { + @decFactory(this.name) p; + } + } +} +expect(receivedName).toBe("B"); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/input.js index 6b0bc3b5a233..a8da039942d6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class A extends B { constructor() { if (Math.random() > 0.5) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/output.js index 8a52cbd4b25a..a2277d035d16 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor-multiple-super/output.js @@ -1,8 +1,12 @@ -var _initProto, _initProto2; +var _dec, _initProto, _dec2, _initProto2; + +const dec = () => {}; + +_dec = deco class A extends B { static { - [_initProto] = babelHelpers.applyDecs(this, [[deco, 2, "method"]], []); + [_initProto] = babelHelpers.applyDecs(this, [[_dec, 2, "method"]], []); } constructor() { @@ -17,9 +21,11 @@ class A extends B { } +_dec2 = deco + class C extends B { static { - [_initProto2] = babelHelpers.applyDecs(this, [[deco, 2, "method"]], []); + [_initProto2] = babelHelpers.applyDecs(this, [[_dec2, 2, "method"]], []); } constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/input.js index d72d66fd2a29..b3c7b6f85e9b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class A extends B { constructor() { let a = 2; @@ -5,6 +6,6 @@ class A extends B { foo(); } - @deco + @dec method() {} } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/output.js index e2fb9d7eb331..792c39589878 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/initProto-existing-derived-constructor/output.js @@ -1,8 +1,10 @@ var _initProto; +const dec = () => {}; + class A extends B { static { - [_initProto] = babelHelpers.applyDecs(this, [[deco, 2, "method"]], []); + [_initProto] = babelHelpers.applyDecs(this, [[dec, 2, "method"]], []); } constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/private-keys-in-enclosing-class/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/private-keys-in-enclosing-class/input.js index 586fb0adef1e..0e7ac6161824 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/private-keys-in-enclosing-class/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/private-keys-in-enclosing-class/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class A { #A = 1; static B = class B extends A { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/private-keys-in-enclosing-class/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/private-keys-in-enclosing-class/output.js index 102e9e463973..501a4db46595 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/private-keys-in-enclosing-class/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/private-keys-in-enclosing-class/output.js @@ -1,3 +1,5 @@ +const dec = () => {}; + class A { #A = 1; static B = class B extends A { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-array-pattern/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-array-pattern/input.js index ff2a3c43e415..53848c42cb07 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-array-pattern/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-array-pattern/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec #x() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-for-of/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-for-of/input.js index 34df0b29ed8b..2ffabb75d901 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-for-of/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-for-of/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec #x() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-object-pattern/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-object-pattern/input.js index 56e2501e42e1..a60de2bae344 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-object-pattern/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-object-pattern/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec #x() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-rest/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-rest/input.js index c24cac0560ad..6b513a380627 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-rest/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-rest/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec #x() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-update/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-update/input.js index f3b235ffe0df..7d01837e1b51 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-update/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-update/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec #x() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method/input.js index 46f4ecf6453b..b6417214fec7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { @dec #x() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/input.js index ebd79d22da06..6bc1a7dbbc4b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; @dec class Foo extends Bar { constructor() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/output.js index dcf5a0fae917..eeae9e4d8ff1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-nested-constructor-expression/output.js @@ -1,5 +1,7 @@ var _initClass; +const dec = () => {}; + let _Foo; class Foo extends Bar { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/input.js index 4be504d54e70..b32ea0bd378f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo extends Bar { @dec get #x() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/output.js index dea033cc9d65..f36f017cce02 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-accessor/output.js @@ -1,5 +1,7 @@ var _call_x, _initProto; +const dec = () => {}; + class Foo extends Bar { static { [_call_x, _initProto] = babelHelpers.applyDecs(this, [[dec, 3, "x", function () { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/input.js index 73200f5f673d..36f9bd37dfa7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo extends Bar { @dec #x() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/output.js index b77541b7c254..2ad8522c0bcc 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/super-in-private-method/output.js @@ -1,5 +1,7 @@ var _call_x, _initProto; +const dec = () => {}; + class Foo extends Bar { static { [_call_x, _initProto] = babelHelpers.applyDecs(this, [[dec, 2, "x", function () { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/input.js index 844a924e3e80..586564c5e219 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; @dec @call() @chain.expr() diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/input.js index 254f2f102f9a..66dd78268d19 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js index 5d0ad516b80b..157576c66e2b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js @@ -1,5 +1,7 @@ var _call_a, _initProto; +const dec = () => {}; + var _a = /*#__PURE__*/new WeakMap(); class Foo { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/input.js index b8b837257ff0..9a7faf175edd 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/output.js index 256297632372..b211810b2a0e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/public/output.js @@ -1,8 +1,8 @@ -var _computedKey, _dec, _dec2, _initProto; +var _computedKey, _initProto; + +const dec = () => {}; -_dec = dec _computedKey = 'b' -_dec2 = dec class Foo { constructor(...args) { @@ -22,5 +22,5 @@ class Foo { } (() => { - [_initProto] = babelHelpers.applyDecs(Foo, [[_dec, 4, "a"], [_dec2, 4, _computedKey]], []); + [_initProto] = babelHelpers.applyDecs(Foo, [[dec, 4, "a"], [dec, 4, _computedKey]], []); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/input.js index 0038d6b6bd30..6bf29a2a2c94 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js index 45e47a57177c..2ddd942ccbf6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js @@ -1,5 +1,7 @@ var _call_a, _initStatic; +const dec = () => {}; + class Foo { static setA(v) { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/input.js index 0cca65be7fa3..ed0a661dcb2d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/output.js index e890b8fb8d4a..9a9c4427a87e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-public/output.js @@ -1,8 +1,8 @@ -var _computedKey, _dec, _dec2, _initStatic; +var _computedKey, _initStatic; + +const dec = () => {}; -_dec = dec _computedKey = 'b' -_dec2 = dec class Foo { static set a(v) { @@ -16,7 +16,7 @@ class Foo { } (() => { - [_initStatic] = babelHelpers.applyDecs(Foo, [[_dec, 9, "a"], [_dec2, 9, _computedKey]], []); + [_initStatic] = babelHelpers.applyDecs(Foo, [[dec, 9, "a"], [dec, 9, _computedKey]], []); _initStatic(Foo); })(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/input.js index 254f2f102f9a..66dd78268d19 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/output.js index a1b2e04ab8f1..6e9be3867fa8 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/private/output.js @@ -1,5 +1,7 @@ var _call_a, _initProto; +const dec = () => {}; + class Foo { static { [_call_a, _initProto] = babelHelpers.applyDecs(this, [[dec, 4, "a", function (v) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/input.js index b8b837257ff0..9a7faf175edd 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/output.js index ad6f2edce743..d13084ea6431 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/public/output.js @@ -1,12 +1,12 @@ -var _computedKey, _dec, _dec2, _initProto; +var _computedKey, _initProto; + +const dec = () => {}; -_dec = dec _computedKey = 'b' -_dec2 = dec class Foo { static { - [_initProto] = babelHelpers.applyDecs(this, [[_dec, 4, "a"], [_dec2, 4, _computedKey]], []); + [_initProto] = babelHelpers.applyDecs(this, [[dec, 4, "a"], [dec, 4, _computedKey]], []); } constructor(...args) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/input.js index 0038d6b6bd30..6bf29a2a2c94 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/output.js index 6bcadc0cc528..e677f8402ac3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-private/output.js @@ -1,5 +1,7 @@ var _call_a, _initStatic; +const dec = () => {}; + class Foo { static { [_call_a, _initStatic] = babelHelpers.applyDecs(this, [[dec, 9, "a", function (v) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/input.js index 0cca65be7fa3..ed0a661dcb2d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/input.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/input.js @@ -1,3 +1,4 @@ +const dec = () => {}; class Foo { static value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/output.js index 230ee2bc8aff..a059f040662e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters/static-public/output.js @@ -1,12 +1,12 @@ -var _computedKey, _dec, _dec2, _initStatic; +var _computedKey, _initStatic; + +const dec = () => {}; -_dec = dec _computedKey = 'b' -_dec2 = dec class Foo { static { - [_initStatic] = babelHelpers.applyDecs(this, [[_dec, 9, "a"], [_dec2, 9, _computedKey]], []); + [_initStatic] = babelHelpers.applyDecs(this, [[dec, 9, "a"], [dec, 9, _computedKey]], []); _initStatic(this); From 3f5e0c6d3f20eb576235981627e3faf6c8c58689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 7 Feb 2022 12:27:19 -0500 Subject: [PATCH 10/15] fix: move insertBefore after path queries --- .../src/transformer-2021-12.ts | 6 +++-- .../valid-expression-formats/output.js | 23 ++++++++++++++----- .../valid-expression-formats/output.js | 21 +++++++++++++---- 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts b/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts index 509df8e115d6..67d45567f3a5 100644 --- a/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts +++ b/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts @@ -753,8 +753,6 @@ function transformClass( } } - path.insertBefore(assignments); - const elementDecorations = generateDecorationExprs(elementDecoratorInfo); const classDecorations = t.arrayExpression( (classDecorators || []).map(d => d.expression), @@ -976,6 +974,10 @@ function transformClass( ), ); + // When path is a ClassExpression, path.insertBefore will convert `path` + // into a SequenceExpression + path.insertBefore(assignments); + // Recrawl the scope to make sure new identifiers are properly synced path.scope.crawl(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js index cbee7920e41e..c6a734ce3d65 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js @@ -1,7 +1,18 @@ -var _initClass, _initProto; +var _initClass, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _initProto; + +const dec = () => {}; let _Foo; +_dec = call() +_dec2 = chain.expr() +_dec3 = arbitrary + expr +_dec4 = array[expr] +_dec5 = call() +_dec6 = chain.expr() +_dec7 = arbitrary + expr +_dec8 = array[expr] + var _a = /*#__PURE__*/new WeakMap(); class Foo { @@ -17,22 +28,22 @@ class Foo { method() {} makeClass() { - var _init_bar, _class, _temp; + var _dec9, _init_bar, _class, _temp; - return _temp = _class = class Nested { + return _dec9 = babelHelpers.classPrivateFieldGet(this, _a), (_temp = _class = class Nested { constructor() { babelHelpers.defineProperty(this, "bar", _init_bar(this)); } }, (() => { - [_init_bar] = babelHelpers.applyDecs(_class, [[babelHelpers.classPrivateFieldGet(_class, _a), 0, "bar"]], []); - })(), _temp; + [_init_bar] = babelHelpers.applyDecs(_class, [[_dec9, 0, "bar"]], []); + })(), _temp); } } (() => { - [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(Foo, [[[dec, call(), chain.expr(), arbitrary + expr, array[expr]], 2, "method"]], [dec, call(), chain.expr(), arbitrary + expr, array[expr]]); + [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(Foo, [[[dec, _dec5, _dec6, _dec7, _dec8], 2, "method"]], [dec, _dec, _dec2, _dec3, _dec4]); })(); (() => { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js index a72db7236833..99243189adb3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/valid-expression-formats/output.js @@ -1,10 +1,21 @@ -var _initClass, _initProto; +var _initClass, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _initProto; + +const dec = () => {}; let _Foo; +_dec = call() +_dec2 = chain.expr() +_dec3 = arbitrary + expr +_dec4 = array[expr] +_dec5 = call() +_dec6 = chain.expr() +_dec7 = arbitrary + expr +_dec8 = array[expr] + class Foo { static { - [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(this, [[[dec, call(), chain.expr(), arbitrary + expr, array[expr]], 2, "method"]], [dec, call(), chain.expr(), arbitrary + expr, array[expr]]); + [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(this, [[[dec, _dec5, _dec6, _dec7, _dec8], 2, "method"]], [dec, _dec, _dec2, _dec3, _dec4]); } constructor(...args) { @@ -16,11 +27,11 @@ class Foo { method() {} makeClass() { - var _init_bar; + var _dec9, _init_bar; - return class Nested { + return _dec9 = this.#a, class Nested { static { - [_init_bar] = babelHelpers.applyDecs(this, [[this.#a, 0, "bar"]], []); + [_init_bar] = babelHelpers.applyDecs(this, [[_dec9, 0, "bar"]], []); } bar = _init_bar(this); }; From ca71772fcde9f5f3dd6c4dd7e6a7f7395e618c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 7 Feb 2022 12:31:24 -0500 Subject: [PATCH 11/15] test: add computed keys to ordering test --- .../2021-12-ordering/decorators/exec.js | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/decorators/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/decorators/exec.js index 795f3a9101dd..b241220635c7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/decorators/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-ordering/decorators/exec.js @@ -7,25 +7,25 @@ function logDecoratorRun(a, b) { return function (el) { push(b); return el; }; } -@logDecoratorRun(0, 19) -@logDecoratorRun(1, 18) +@logDecoratorRun(0, 21) +@logDecoratorRun(1, 20) class A { - @logDecoratorRun(2, 11) - @logDecoratorRun(3, 10) - a; + @logDecoratorRun(2, 13) + @logDecoratorRun(3, 12) + [push(4)]; - @logDecoratorRun(4, 13) - @logDecoratorRun(5, 12) - static b; - - @logDecoratorRun(6, 15) - @logDecoratorRun(7, 14) - static #c; + @logDecoratorRun(5, 15) + @logDecoratorRun(6, 14) + static [push(7)]; @logDecoratorRun(8, 17) @logDecoratorRun(9, 16) + static #c; + + @logDecoratorRun(10, 19) + @logDecoratorRun(11, 18) #d; } -var nums = Array.from({ length: 20 }, (_, i) => i); +var nums = Array.from({ length: 22 }, (_, i) => i); expect(log).toEqual(nums); From e31ee57d03059a04ee9e993d09127bafd11a8088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 7 Feb 2022 12:50:22 -0500 Subject: [PATCH 12/15] make node 14 happy --- .../fixtures/2021-12-misc/decorator-evaluation-scope/exec.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/decorator-evaluation-scope/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/decorator-evaluation-scope/exec.js index cb08014670f4..ec8beb3b8cbf 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/decorator-evaluation-scope/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/decorator-evaluation-scope/exec.js @@ -1,10 +1,12 @@ let receivedName; function decFactory(name) { receivedName = name; return x => x } class B { - static { + static m() { class C { @decFactory(this.name) p; } } } + +B.m(); expect(receivedName).toBe("B"); From d328835b811123693659a83208c7f35d245ca326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 7 Feb 2022 12:54:13 -0500 Subject: [PATCH 13/15] add es2015 test --- .../decorator-evaluation-scope/exec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/decorator-evaluation-scope/exec.js diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/decorator-evaluation-scope/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/decorator-evaluation-scope/exec.js new file mode 100644 index 000000000000..ec8beb3b8cbf --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/decorator-evaluation-scope/exec.js @@ -0,0 +1,12 @@ +let receivedName; +function decFactory(name) { receivedName = name; return x => x } +class B { + static m() { + class C { + @decFactory(this.name) p; + } + } +} + +B.m(); +expect(receivedName).toBe("B"); From 4f1ba1d4455ce251afc99f2482d3da94ad2ea321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 7 Feb 2022 12:56:56 -0500 Subject: [PATCH 14/15] cleanup --- .../src/transformer-2021-12.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts b/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts index 67d45567f3a5..2f4676921163 100644 --- a/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts +++ b/packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts @@ -522,8 +522,7 @@ function transformClass( }; if (classDecorators) { - classInitLocal = - path.scope.parent.generateDeclaredUidIdentifier("initClass"); + classInitLocal = scopeParent.generateDeclaredUidIdentifier("initClass"); const [localId, classPath] = replaceClassWithVar(path); path = classPath; @@ -762,8 +761,7 @@ function transformClass( extractElementLocalAssignments(elementDecoratorInfo); if (requiresProtoInit) { - protoInitLocal = - path.scope.parent.generateDeclaredUidIdentifier("initProto"); + protoInitLocal = scopeParent.generateDeclaredUidIdentifier("initProto"); locals.push(protoInitLocal); const protoInitCall = t.callExpression(t.cloneNode(protoInitLocal), [ @@ -824,8 +822,7 @@ function transformClass( } if (requiresStaticInit) { - staticInitLocal = - path.scope.parent.generateDeclaredUidIdentifier("initStatic"); + staticInitLocal = scopeParent.generateDeclaredUidIdentifier("initStatic"); locals.push(staticInitLocal); } From 796ccba2f47944ad81304a56c4d27b9bbee57f9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 7 Feb 2022 15:19:21 -0500 Subject: [PATCH 15/15] test: apply static block for node 14 --- .../2021-12-misc/decorator-evaluation-scope/options.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/decorator-evaluation-scope/options.json diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/decorator-evaluation-scope/options.json b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/decorator-evaluation-scope/options.json new file mode 100644 index 000000000000..2d1b9e92b326 --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/decorator-evaluation-scope/options.json @@ -0,0 +1,7 @@ +{ + "plugins": [ + ["proposal-decorators", { "version": "2021-12" }], + "proposal-class-static-block" + ], + "minNodeVersion": "12.0.0" +}