diff --git a/packages/babel-helper-create-class-features-plugin/src/decorators.ts b/packages/babel-helper-create-class-features-plugin/src/decorators.ts index 8fa64962f029..0df4496a318e 100644 --- a/packages/babel-helper-create-class-features-plugin/src/decorators.ts +++ b/packages/babel-helper-create-class-features-plugin/src/decorators.ts @@ -562,7 +562,7 @@ function transformClass( continue; } - if (element.node.decorators && element.node.decorators.length > 0) { + if (element.node.decorators?.length) { switch (element.node.type) { case "ClassProperty": // @ts-expect-error todo: propertyVisitor.ClassProperty should be callable. Improve typings. @@ -646,29 +646,50 @@ function transformClass( classIdLocal: t.Identifier; const decoratorsThis = new Map(); - const maybeExtractDecorator = (decorator: t.Decorator) => { - const { expression } = decorator; - if (version === "2023-05" && t.isMemberExpression(expression)) { - let object; - if ( - t.isSuper(expression.object) || - t.isThisExpression(expression.object) - ) { - object = memoiseExpression(t.thisExpression(), "obj"); - } else if (!scopeParent.isStatic(expression.object)) { - object = memoiseExpression(expression.object, "obj"); - expression.object = object; - } else { - object = expression.object; + const maybeExtractDecorators = ( + decorators: t.Decorator[], + memoiseInPlace: boolean, + ) => { + let needMemoise = false; + for (const decorator of decorators) { + const { expression } = decorator; + if (version === "2023-05" && t.isMemberExpression(expression)) { + let object; + if ( + t.isSuper(expression.object) || + t.isThisExpression(expression.object) + ) { + needMemoise = true; + if (memoiseInPlace) { + object = memoiseExpression(t.thisExpression(), "obj"); + } else { + object = t.thisExpression(); + } + } else { + if (!scopeParent.isStatic(expression.object)) { + needMemoise = true; + if (memoiseInPlace) { + expression.object = memoiseExpression(expression.object, "obj"); + } + } + object = t.cloneNode(expression.object); + } + decoratorsThis.set(decorator, object); + } + if (!scopeParent.isStatic(expression)) { + needMemoise = true; + if (memoiseInPlace) { + decorator.expression = memoiseExpression(expression, "dec"); + } } - decoratorsThis.set(decorator, t.cloneNode(object)); - } - if (!scopeParent.isStatic(expression)) { - decorator.expression = memoiseExpression(expression, "dec"); } + return needMemoise && !memoiseInPlace; }; let needsDeclaraionForClassBinding = false; + let classDecorationsFlag = 0; + let classDecorations: t.Expression[] = []; + let classDecorationsId: t.Identifier; if (classDecorators) { classInitLocal = scopeParent.generateDeclaredUidIdentifier("initClass"); needsDeclaraionForClassBinding = path.isClassDeclaration(); @@ -676,8 +697,21 @@ function transformClass( path.node.decorators = null; - for (const classDecorator of classDecorators) { - maybeExtractDecorator(classDecorator); + const needMemoise = maybeExtractDecorators(classDecorators, false); + + const { hasThis, decs } = generateDecorationList( + classDecorators.map(el => el.expression), + classDecorators.map(dec => decoratorsThis.get(dec)), + version, + ); + classDecorationsFlag = hasThis ? 1 : 0; + classDecorations = decs; + + if (needMemoise) { + classDecorationsId = memoiseExpression( + t.arrayExpression(classDecorations), + "classDecs", + ); } } else { if (!path.node.id) { @@ -696,18 +730,15 @@ function transformClass( } const { node } = element; - const decorators = element.get("decorators"); + const decorators = element.node.decorators; - const hasDecorators = Array.isArray(decorators) && decorators.length > 0; + const hasDecorators = !!decorators?.length; if (hasDecorators) { - for (const decoratorPath of decorators) { - maybeExtractDecorator(decoratorPath.node); - } + maybeExtractDecorators(decorators, true); } - const isComputed = - "computed" in element.node && element.node.computed === true; + const isComputed = "computed" in element.node && element.node.computed; if (isComputed) { if (!element.get("key").isConstantExpression()) { node.key = memoiseExpression( @@ -722,7 +753,7 @@ function transformClass( const isPrivate = key.type === "PrivateName"; - const isStatic = !!element.node.static; + const isStatic = element.node.static; let name = "computedKey"; @@ -881,8 +912,8 @@ function transformClass( elementDecoratorInfo.push({ kind, - decorators: decorators.map(d => d.node.expression), - decoratorsThis: decorators.map(d => decoratorsThis.get(d.node)), + decorators: decorators.map(d => d.expression), + decoratorsThis: decorators.map(d => decoratorsThis.get(d)), name: nameExpr, isStatic, privateMethods, @@ -918,17 +949,6 @@ function transformClass( elementDecoratorInfo, version, ); - let classDecorationsFlag = 0; - let classDecorations: t.Expression[] = []; - if (classDecorators) { - const { hasThis, decs } = generateDecorationList( - classDecorators.map(el => el.expression), - classDecorators.map(dec => decoratorsThis.get(dec)), - version, - ); - classDecorationsFlag = hasThis ? 1 : 0; - classDecorations = decs; - } const elementLocals: t.Identifier[] = extractElementLocalAssignments(elementDecoratorInfo); @@ -992,7 +1012,7 @@ function transformClass( t.classMethod( "constructor", t.identifier("constructor"), - [t.restElement(t.identifier("args"))], + path.node.superClass ? [t.restElement(t.identifier("args"))] : [], t.blockStatement(body), ), ); @@ -1143,7 +1163,6 @@ function transformClass( superClass = id; } } - originalClass.body.body.unshift( t.staticBlock( [ @@ -1152,7 +1171,9 @@ function transformClass( elementLocals, classLocals, elementDecorations, - t.arrayExpression(classDecorations), + classDecorationsId + ? t.cloneNode(classDecorationsId) + : t.arrayExpression(classDecorations), t.numericLiteral(classDecorationsFlag), needsInstancePrivateBrandCheck ? lastInstancePrivateName : null, typeof className === "object" ? className : undefined, @@ -1192,8 +1213,8 @@ function transformClass( function createLocalsAssignment( elementLocals: t.Identifier[], classLocals: t.Identifier[], - elementDecorations: t.ArrayExpression, - classDecorations: t.ArrayExpression, + elementDecorations: t.ArrayExpression | t.Identifier, + classDecorations: t.ArrayExpression | t.Identifier, classDecorationsFlag: t.NumericLiteral, maybePrivateBranName: t.PrivateName | null, setClassName: t.Identifier | t.StringLiteral | undefined, diff --git a/packages/babel-helper-create-class-features-plugin/src/fields.ts b/packages/babel-helper-create-class-features-plugin/src/fields.ts index c36138e71227..5a762786c987 100644 --- a/packages/babel-helper-create-class-features-plugin/src/fields.ts +++ b/packages/babel-helper-create-class-features-plugin/src/fields.ts @@ -1110,7 +1110,8 @@ export function buildFieldsInitNodes( }; const classRefForInnerBinding = - ref ?? props[0].scope.generateUidIdentifier("class"); + ref ?? + props[0].scope.generateUidIdentifier(innerBindingRef?.name || "Class"); ref ??= t.cloneNode(innerBindingRef); for (const prop of props) { diff --git a/packages/babel-helper-create-class-features-plugin/src/index.ts b/packages/babel-helper-create-class-features-plugin/src/index.ts index e04a73df3ce7..731e967e202f 100644 --- a/packages/babel-helper-create-class-features-plugin/src/index.ts +++ b/packages/babel-helper-create-class-features-plugin/src/index.ts @@ -230,7 +230,7 @@ export function createClassFeaturePlugin({ let ref: t.Identifier | null; if (!innerBinding || !pathIsClassDeclaration) { nameFunction(path); - ref = path.scope.generateUidIdentifier("class"); + ref = path.scope.generateUidIdentifier(innerBinding?.name || "Class"); } const classRefForDefine = ref ?? t.cloneNode(innerBinding); diff --git a/packages/babel-helper-create-class-features-plugin/test/fixtures/replace-supers/method/output.js b/packages/babel-helper-create-class-features-plugin/test/fixtures/replace-supers/method/output.js index 6f57629c8656..56fe66244196 100644 --- a/packages/babel-helper-create-class-features-plugin/test/fixtures/replace-supers/method/output.js +++ b/packages/babel-helper-create-class-features-plugin/test/fixtures/replace-supers/method/output.js @@ -1,4 +1,4 @@ -var _class; +var _A; var _foo = /*#__PURE__*/new WeakSet(); class A extends B { constructor(...args) { @@ -6,8 +6,8 @@ class A extends B { babelHelpers.classPrivateMethodInitSpec(this, _foo); } } -_class = A; +_A = A; function _foo2() { - let _A; - babelHelpers.get(babelHelpers.getPrototypeOf(_class.prototype), "x", this); + let _A2; + babelHelpers.get(babelHelpers.getPrototypeOf(_A.prototype), "x", this); } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2018-09-transformation/export-default-anonymous/output.mjs b/packages/babel-plugin-proposal-decorators/test/fixtures/2018-09-transformation/export-default-anonymous/output.mjs index 40c61255dd41..8274847eeb82 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2018-09-transformation/export-default-anonymous/output.mjs +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2018-09-transformation/export-default-anonymous/output.mjs @@ -1,11 +1,11 @@ export default babelHelpers.decorate([dec()], function (_initialize) { - class _class { + class _Class { constructor() { _initialize(this); } } return { - F: _class, + F: _Class, d: [] }; }); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2018-09-transformation/expression/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2018-09-transformation/expression/output.js index 45aadfa406c5..a97fb68ea8b9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2018-09-transformation/expression/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2018-09-transformation/expression/output.js @@ -1,13 +1,13 @@ babelHelpers.decorate([dec()], function (_initialize) { "use strict"; - class _class { + class _Class { constructor() { _initialize(this); } } return { - F: _class, + F: _Class, d: [] }; }); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/context-name/output.js index 6e38793c14cf..9ae9debad6c7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _initStatic, _class; +var _init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -67,7 +67,7 @@ class Foo { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _I, v); } } -_class = Foo; +_Foo = Foo; function _set_a2(v) { _set_a(this, v); } @@ -75,47 +75,47 @@ function _get_a2() { return _get_a(this); } (() => { - [_init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7, _initStatic] = babelHelpers.applyDecs(_class, [[dec, 6, "a"], [dec, 6, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _B); + [_init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7, _initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 6, "a"], [dec, 6, "a", function () { + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _B); }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _B, value); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _B, value); }], [dec, 6, "b"], [dec, 6, "c"], [dec, 6, 0], [dec, 6, 1], [dec, 6, 2n], [dec, 6, 3n], [dec, 6, _computedKey]], []); - _initStatic(_class); + _initStatic(_Foo); })(); var _A = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _B = { writable: true, - value: _init_a2(_class) + value: _init_a2(_Foo) }; var _C = { writable: true, - value: _init_computedKey(_class) + value: _init_computedKey(_Foo) }; var _D = { writable: true, - value: _init_computedKey2(_class) + value: _init_computedKey2(_Foo) }; var _E = { writable: true, - value: _init_computedKey3(_class) + value: _init_computedKey3(_Foo) }; var _F = { writable: true, - value: _init_computedKey4(_class) + value: _init_computedKey4(_Foo) }; var _G = { writable: true, - value: _init_computedKey5(_class) + value: _init_computedKey5(_Foo) }; var _H = { writable: true, - value: _init_computedKey6(_class) + value: _init_computedKey6(_Foo) }; var _I = { writable: true, - value: _init_computedKey7(_class) + value: _init_computedKey7(_Foo) }; expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); 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 033773acc409..41587ce4f930 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,4 +1,4 @@ -var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto, _class; +var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto, _Foo; const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); var _a = /*#__PURE__*/new WeakMap(); @@ -24,7 +24,7 @@ class Foo { }); } } -_class = Foo; +_Foo = Foo; function _set_a2(v) { _set_a(this, v); } @@ -37,7 +37,7 @@ function _set_b2(v) { function _get_b2() { return _get_b(this); } -[_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs(_class, [[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); 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 09ff4fc800dc..78ddd8970f94 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,4 +1,4 @@ -var _init_a, _init_b, _init_computedKey, _initProto, _class; +var _init_a, _init_b, _init_computedKey, _initProto, _Foo; const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); var _B = /*#__PURE__*/new WeakMap(); @@ -37,5 +37,5 @@ class Foo { babelHelpers.classPrivateFieldSet(this, _C, v); } } -_class = Foo; -[_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs(_class, [[dec, 1, "a"], [dec, 1, "b"], [dec, 1, 'c']], []); +_Foo = Foo; +[_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs(_Foo, [[dec, 1, "a"], [dec, 1, "b"], [dec, 1, 'c']], []); 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 b047b2354ab9..48581e59f06d 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,4 +1,4 @@ -var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic, _class; +var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); var _b = /*#__PURE__*/new WeakMap(); @@ -14,7 +14,7 @@ class Foo { }); } } -_class = Foo; +_Foo = Foo; function _set_a2(v) { _set_a(this, v); } @@ -28,22 +28,22 @@ function _get_b2() { return _get_b(this); } (() => { - [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs(_class, [[dec, 6, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _A); + [_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, _class, _A, value); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _A, value); }], [dec, 6, "b", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _B); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _B); }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _B, value); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _B, value); }]], []); - _initStatic(_class); + _initStatic(_Foo); })(); var _A = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _B = { writable: true, - value: _init_b(_class, 123) + value: _init_b(_Foo, 123) }; 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 0dd678f02fd7..ac51068701ce 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,4 +1,4 @@ -var _init_a, _init_b, _init_computedKey, _initStatic, _class; +var _init_a, _init_b, _init_computedKey, _initStatic, _Foo; const dec = () => {}; class Foo { static get a() { @@ -20,20 +20,20 @@ class Foo { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _C, v); } } -_class = Foo; +_Foo = Foo; (() => { - [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs(_class, [[dec, 6, "a"], [dec, 6, "b"], [dec, 6, 'c']], []); - _initStatic(_class); + [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 6, "a"], [dec, 6, "b"], [dec, 6, 'c']], []); + _initStatic(_Foo); })(); var _A = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _B = { writable: true, - value: _init_b(_class, 123) + value: _init_b(_Foo, 123) }; var _C = { writable: true, - value: _init_computedKey(_class, 456) + value: _init_computedKey(_Foo, 456) }; 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 965b9ed9d1b6..ae0ff8265ff9 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,18 +1,18 @@ -var _class; +var _Foo; const dec = () => {}; class Foo {} -_class = Foo; +_Foo = Foo; function _get_a() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _A); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _A); } function _set_a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _A, v); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _A, v); } function _get_b() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _B); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _B); } function _set_b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _B, v); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _B, v); } var _b = { get: _get_b, diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions-static-blocks/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions-static-blocks/output.js index f6a9e77357c9..54e0f1088e53 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions-static-blocks/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/expressions-static-blocks/output.js @@ -1,73 +1,73 @@ -var _initClass, _A, _temp, _initClass2, _C, _temp2, _initClass3, _D, _temp3, _initClass4, _decorated_class, _temp4, _class5, _initClass5, _G, _temp5, _initClass6, _decorated_class2, _temp6, _class7, _initClass7, _H, _temp7, _initClass8, _K, _temp8; +var _initClass, _A, _temp, _initClass2, _C, _temp2, _initClass3, _D, _temp3, _initClass4, _decorated_class, _temp4, _Class2, _initClass5, _G, _temp5, _initClass6, _decorated_class2, _temp6, _Class3, _initClass7, _H, _temp7, _initClass8, _K, _temp8; const dec = () => {}; const A = (new (_temp = class extends babelHelpers.identity { constructor() { super(_A), (() => {})(), _initClass(); } -}, (_class2 => { +}, (_A2 => { class A {} - _class2 = A; - [_A, _initClass] = babelHelpers.applyDecs(_class2, [], [dec]); + _A2 = A; + [_A, _initClass] = babelHelpers.applyDecs(_A2, [], [dec]); })(), _temp)(), _A); const B = (new (_temp2 = class extends babelHelpers.identity { constructor() { super(_C), (() => {})(), _initClass2(); } -}, (_class3 => { +}, (_C2 => { class C {} - _class3 = C; - [_C, _initClass2] = babelHelpers.applyDecs(_class3, [], [dec]); + _C2 = C; + [_C, _initClass2] = babelHelpers.applyDecs(_C2, [], [dec]); })(), _temp2)(), _C); const D = (new (_temp3 = class extends babelHelpers.identity { constructor() { super(_D), (() => {})(), _initClass3(); } -}, (_class4 => { +}, (_D2 => { class D {} - _class4 = D; - [_D, _initClass3] = babelHelpers.applyDecs(_class4, [], [dec]); + _D2 = D; + [_D, _initClass3] = babelHelpers.applyDecs(_D2, [], [dec]); })(), _temp3)(), _D); const E = ((new (_temp4 = class extends babelHelpers.identity { constructor() { super(_decorated_class), (() => {})(), _initClass4(); } -}, (_class5 = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs(_class5, [], [dec])), _temp4)(), _decorated_class), 123); +}, (_Class2 = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs(_Class2, [], [dec])), _temp4)(), _decorated_class), 123); const F = [(new (_temp5 = class extends babelHelpers.identity { constructor() { super(_G), (() => {})(), _initClass5(); } -}, (_class6 => { +}, (_G2 => { class G {} - _class6 = G; - [_G, _initClass5] = babelHelpers.applyDecs(_class6, [], [dec]); + _G2 = G; + [_G, _initClass5] = babelHelpers.applyDecs(_G2, [], [dec]); })(), _temp5)(), _G), (new (_temp6 = class extends babelHelpers.identity { constructor() { super(_decorated_class2), (() => {})(), _initClass6(); } -}, (_class7 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs(_class7, [], [dec])), _temp6)(), _decorated_class2)]; +}, (_Class3 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs(_Class3, [], [dec])), _temp6)(), _decorated_class2)]; const H = (new (_temp7 = class extends babelHelpers.identity { constructor() { super(_H), (() => {})(), _initClass7(); } -}, (_class8 => { +}, (_H2 => { class H extends I {} - _class8 = H; - [_H, _initClass7] = babelHelpers.applyDecs(_class8, [], [dec]); + _H2 = H; + [_H, _initClass7] = babelHelpers.applyDecs(_H2, [], [dec]); })(), _temp7)(), _H); const J = (new (_temp8 = class extends babelHelpers.identity { constructor() { super(_K), (() => {})(), _initClass8(); } -}, (_class9 => { +}, (_K2 => { class K extends L {} - _class9 = K; - [_K, _initClass8] = babelHelpers.applyDecs(_class9, [], [dec]); + _K2 = K; + [_K, _initClass8] = babelHelpers.applyDecs(_K2, [], [dec]); })(), _temp8)(), _K); function classFactory() { - var _initClass9, _decorated_class3, _temp9, _class11; + var _initClass9, _decorated_class3, _temp9, _Class5; return new (_temp9 = class extends babelHelpers.identity { constructor() { super(_decorated_class3), (() => {})(), _initClass9(); } - }, (_class11 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs(_class11, [], [dec])), _temp9)(), _decorated_class3; + }, (_Class5 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs(_Class5, [], [dec])), _temp9)(), _decorated_class3; } 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 b45ca2080a9a..1b14f6de4cf3 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,13 +1,13 @@ -var _initClass, _A, _class, _initClass2, _C, _class2, _initClass3, _D, _class3, _initClass4, _decorated_class, _class4, _initClass5, _G, _class5, _initClass6, _decorated_class2, _class6, _initClass7, _H, _class7, _initClass8, _K, _class8; +var _initClass, _A, _A2, _initClass2, _C, _C2, _initClass3, _D, _D2, _initClass4, _decorated_class, _Class, _initClass5, _G, _G2, _initClass6, _decorated_class2, _Class2, _initClass7, _H, _H2, _initClass8, _K, _K2; const dec = () => {}; -const A = ((_class = class A {}, [_A, _initClass] = babelHelpers.applyDecs(_class, [], [dec]), _initClass()), _A); -const B = ((_class2 = class C {}, [_C, _initClass2] = babelHelpers.applyDecs(_class2, [], [dec]), _initClass2()), _C); -const D = ((_class3 = class D {}, [_D, _initClass3] = babelHelpers.applyDecs(_class3, [], [dec]), _initClass3()), _D); -const E = (((_class4 = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs(_class4, [], [dec]), _initClass4()), _decorated_class), 123); -const F = [((_class5 = class G {}, [_G, _initClass5] = babelHelpers.applyDecs(_class5, [], [dec]), _initClass5()), _G), ((_class6 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs(_class6, [], [dec]), _initClass6()), _decorated_class2)]; -const H = ((_class7 = class H extends I {}, [_H, _initClass7] = babelHelpers.applyDecs(_class7, [], [dec]), _initClass7()), _H); -const J = ((_class8 = class K extends L {}, [_K, _initClass8] = babelHelpers.applyDecs(_class8, [], [dec]), _initClass8()), _K); +const A = ((_A2 = class A {}, [_A, _initClass] = babelHelpers.applyDecs(_A2, [], [dec]), _initClass()), _A); +const B = ((_C2 = class C {}, [_C, _initClass2] = babelHelpers.applyDecs(_C2, [], [dec]), _initClass2()), _C); +const D = ((_D2 = class D {}, [_D, _initClass3] = babelHelpers.applyDecs(_D2, [], [dec]), _initClass3()), _D); +const E = (((_Class = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs(_Class, [], [dec]), _initClass4()), _decorated_class), 123); +const F = [((_G2 = class G {}, [_G, _initClass5] = babelHelpers.applyDecs(_G2, [], [dec]), _initClass5()), _G), ((_Class2 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs(_Class2, [], [dec]), _initClass6()), _decorated_class2)]; +const H = ((_H2 = class H extends I {}, [_H, _initClass7] = babelHelpers.applyDecs(_H2, [], [dec]), _initClass7()), _H); +const J = ((_K2 = class K extends L {}, [_K, _initClass8] = babelHelpers.applyDecs(_K2, [], [dec]), _initClass8()), _K); function classFactory() { - var _initClass9, _decorated_class3, _class9; - return (_class9 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs(_class9, [], [dec]), _initClass9()), _decorated_class3; + var _initClass9, _decorated_class3, _Class3; + return (_Class3 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs(_Class3, [], [dec]), _initClass9()), _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 2a2d3241f810..23bba951aea6 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,13 +1,13 @@ -var _initClass, _class, _initClass2, _class2; +var _initClass, _Bar2, _initClass2, _Foo2; const dec1 = () => {}; const dec2 = () => {}; let _Bar; class Bar {} -_class = Bar; -[_Bar, _initClass] = babelHelpers.applyDecs(_class, [], [dec1]); +_Bar2 = Bar; +[_Bar, _initClass] = babelHelpers.applyDecs(_Bar2, [], [dec1]); _initClass(); let _Foo; class Foo extends _Bar {} -_class2 = Foo; -[_Foo, _initClass2] = babelHelpers.applyDecs(_class2, [], [dec2]); +_Foo2 = Foo; +[_Foo, _initClass2] = babelHelpers.applyDecs(_Foo2, [], [dec2]); _initClass2(); 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 2fe8a9f41288..da6d41d72d30 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 @@ -5,10 +5,10 @@ new (_temp = class extends babelHelpers.identity { constructor() { (super(_Foo), babelHelpers.defineProperty(this, "field", 123)), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo {} - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs(_class2, [], [dec]); + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs(_Foo2, [], [dec]); })(), _temp)(); let _Bar; new (_temp2 = class extends babelHelpers.identity { @@ -17,8 +17,8 @@ new (_temp2 = class extends babelHelpers.identity { this.otherField = 456; })(), 123))), _initClass2(); } -}, (_class3 => { +}, (_Bar2 => { class Bar extends _Foo {} - _class3 = Bar; - [_Bar, _initClass2] = babelHelpers.applyDecs(_class3, [], [dec]); + _Bar2 = Bar; + [_Bar, _initClass2] = babelHelpers.applyDecs(_Bar2, [], [dec]); })(), _temp2)(); 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 cabc1dc3bca9..3855f7b96691 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 @@ -12,11 +12,11 @@ new (_x = /*#__PURE__*/new WeakMap(), _m = /*#__PURE__*/new WeakSet(), (_temp = hasM = o => _m.has(babelHelpers.checkInRHS(o)); })(), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo { static m() {} } - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs(_class2, [], [dec]); + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs(_Foo2, [], [dec]); })(), _temp))(); function _m2() {} 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 636c18879ad4..43ad6f8c19b3 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 @@ -9,8 +9,8 @@ new (_temp = class extends babelHelpers.identity { this; })(), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo {} - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs(_class2, [], [dec]); + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs(_Foo2, [], [dec]); })(), _temp)(); 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 015857636f30..57816df6c4fd 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,8 +1,8 @@ -var _initClass, _Bar, _class; +var _initClass, _Bar, _Bar2; const dec = () => {}; -const Foo = ((_class = class Bar { +const Foo = ((_Bar2 = class Bar { constructor() { babelHelpers.defineProperty(this, "bar", new _Bar()); } -}, [_Bar, _initClass] = babelHelpers.applyDecs(_class, [], [dec]), _initClass()), _Bar); +}, [_Bar, _initClass] = babelHelpers.applyDecs(_Bar2, [], [dec]), _initClass()), _Bar); const 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 09cfc6ba516e..e99e938833e0 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 @@ -5,9 +5,9 @@ new (_temp = class extends babelHelpers.identity { constructor() { (super(_Foo), babelHelpers.defineProperty(this, "foo", new _Foo())), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo {} - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs(_class2, [], [dec]); + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs(_Foo2, [], [dec]); })(), _temp)(); const foo = new _Foo(); 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 cda22bb92a3a..be066ad5ae82 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,20 +1,20 @@ -var _initClass, _dec, _initClass2, _dec2; +var _initClass, _classDecs, _initClass2, _classDecs2; const dec = () => {}; -_dec = dec1; +_classDecs = [dec1]; let _Bar; class Bar { static { - [_Bar, _initClass] = babelHelpers.applyDecs(this, [], [_dec]); + [_Bar, _initClass] = babelHelpers.applyDecs(this, [], _classDecs); } static { _initClass(); } } -_dec2 = dec2; +_classDecs2 = [dec2]; let _Foo; class Foo extends _Bar { static { - [_Foo, _initClass2] = babelHelpers.applyDecs(this, [], [_dec2]); + [_Foo, _initClass2] = babelHelpers.applyDecs(this, [], _classDecs2); } static { _initClass2(); 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 d3a3cf740f99..74964c45dd7f 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, _initProto, _class; +var _computedKey, _computedKey2, _initProto, _Foo; const dec = () => {}; _computedKey = babelHelpers.toPropertyKey(getKey()); _computedKey2 = babelHelpers.toPropertyKey(getKey()); class Foo { - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { @@ -13,5 +13,5 @@ class Foo { return 2; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs(_class, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []); +_Foo = Foo; +[_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/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/output.js index 9fdcd8f843c4..8890d5f647b9 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, _initProto, _class; +var _computedKey, _computedKey2, _initProto, _Foo; const dec = () => {}; _computedKey = babelHelpers.toPropertyKey(getKeyI()); _computedKey2 = babelHelpers.toPropertyKey(getKeyJ()); class Foo { - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { @@ -13,5 +13,5 @@ class Foo { return 2; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs(_class, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []); +_Foo = Foo; +[_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/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/method-and-field/output.js index aea523b9fdf1..b2a479935eb8 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,4 +1,4 @@ -var _init_a, _initProto, _class; +var _init_a, _initProto, _Foo; const dec = () => {}; class Foo { constructor() { @@ -8,5 +8,5 @@ class Foo { return 1; } } -_class = Foo; -[_init_a, _initProto] = babelHelpers.applyDecs(_class, [[dec, 2, "a"], [dec, 0, "a"]], []); +_Foo = Foo; +[_init_a, _initProto] = babelHelpers.applyDecs(_Foo, [[dec, 2, "a"], [dec, 0, "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 c52bbe4ea0f6..9c3024817fe7 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,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { _initProto(this); } a() { @@ -11,5 +11,5 @@ class Foo { return 2; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs(_class, [[dec, 2, "a"], [dec, 2, "a"]], []); +_Foo = Foo; +[_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 744efbaaddbb..e11302f3cb1f 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 @@ -6,7 +6,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs(this, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []); } - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { 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 fbe1637783ab..fb9e7590f55a 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 @@ -6,7 +6,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs(this, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []); } - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { 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 cb3b1a16e1ad..3ea9d97ab696 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 @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs(this, [[dec, 2, "a"], [dec, 2, "a"]], []); } - constructor(...args) { + constructor() { _initProto(this); } a() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/default-anonymous/output.mjs b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/default-anonymous/output.mjs index 0d4cfda18623..7f26f1df86fb 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/default-anonymous/output.mjs +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/default-anonymous/output.mjs @@ -1,9 +1,9 @@ -var _initClass, _dec; -_dec = dec; +var _initClass, _classDecs; +_classDecs = [dec]; let _A; class A { static { - [_A, _initClass] = babelHelpers.applyDecs(this, [], [_dec]); + [_A, _initClass] = babelHelpers.applyDecs(this, [], _classDecs); } static { _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/default-named/output.mjs b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/default-named/output.mjs index 363d81edaed5..4bcfd68f1f90 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/default-named/output.mjs +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/default-named/output.mjs @@ -1,9 +1,9 @@ -var _initClass, _dec; -_dec = dec; +var _initClass, _classDecs; +_classDecs = [dec]; let _default2; class _default { static { - [_default2, _initClass] = babelHelpers.applyDecs(babelHelpers.setFunctionName(this, "default"), [], [_dec]); + [_default2, _initClass] = babelHelpers.applyDecs(babelHelpers.setFunctionName(this, "default"), [], _classDecs); } static { _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/named/output.mjs b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/named/output.mjs index db929c3e9398..2804f80e94c4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/named/output.mjs +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/named/output.mjs @@ -1,9 +1,9 @@ -var _initClass, _dec; -_dec = dec; +var _initClass, _classDecs; +_classDecs = [dec]; let _A; class A { static { - [_A, _initClass] = babelHelpers.applyDecs(this, [], [_dec]); + [_A, _initClass] = babelHelpers.applyDecs(this, [], _classDecs); } static { _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/context-name/output.js index 3983e9d889e5..4aafcdfb4802 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _class; +var _init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -11,22 +11,22 @@ const f = () => { }; _computedKey = babelHelpers.toPropertyKey(f()); class Foo {} -_class = Foo; -[_init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7] = babelHelpers.applyDecs(_class, [[dec, 5, "a"], [dec, 5, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _a); +_Foo = Foo; +[_init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7] = babelHelpers.applyDecs(_Foo, [[dec, 5, "a"], [dec, 5, "a", function () { + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _a); }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _a, value); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _a, value); }], [dec, 5, "b"], [dec, 5, "c"], [dec, 5, 0], [dec, 5, 1], [dec, 5, 2n], [dec, 5, 3n], [dec, 5, _computedKey]], []); -babelHelpers.defineProperty(Foo, "a", _init_a(_class)); +babelHelpers.defineProperty(Foo, "a", _init_a(_Foo)); var _a = { writable: true, - value: _init_a2(_class) + value: _init_a2(_Foo) }; -babelHelpers.defineProperty(Foo, "b", _init_computedKey(_class)); -babelHelpers.defineProperty(Foo, "c", _init_computedKey2(_class)); -babelHelpers.defineProperty(Foo, 0, _init_computedKey3(_class)); -babelHelpers.defineProperty(Foo, 1, _init_computedKey4(_class)); -babelHelpers.defineProperty(Foo, 2n, _init_computedKey5(_class)); -babelHelpers.defineProperty(Foo, 3n, _init_computedKey6(_class)); -babelHelpers.defineProperty(Foo, _computedKey, _init_computedKey7(_class)); +babelHelpers.defineProperty(Foo, "b", _init_computedKey(_Foo)); +babelHelpers.defineProperty(Foo, "c", _init_computedKey2(_Foo)); +babelHelpers.defineProperty(Foo, 0, _init_computedKey3(_Foo)); +babelHelpers.defineProperty(Foo, 1, _init_computedKey4(_Foo)); +babelHelpers.defineProperty(Foo, 2n, _init_computedKey5(_Foo)); +babelHelpers.defineProperty(Foo, 3n, _init_computedKey6(_Foo)); +babelHelpers.defineProperty(Foo, _computedKey, _init_computedKey7(_Foo)); expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); 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 8ffd2f0e35e2..8304c745a458 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,4 +1,4 @@ -var _init_a, _init_b, _class; +var _init_a, _init_b, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); var _b = /*#__PURE__*/new WeakMap(); @@ -14,8 +14,8 @@ class Foo { }); } } -_class = Foo; -[_init_a, _init_b] = babelHelpers.applyDecs(_class, [[dec, 0, "a", function () { +_Foo = Foo; +[_init_a, _init_b] = babelHelpers.applyDecs(_Foo, [[dec, 0, "a", function () { return babelHelpers.classPrivateFieldGet(this, _a); }, function (value) { babelHelpers.classPrivateFieldSet(this, _a, 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 e3b0bca327ff..b1c049c86243 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,4 +1,4 @@ -var _init_a, _init_b, _init_computedKey, _class; +var _init_a, _init_b, _init_computedKey, _Foo; const dec = () => {}; class Foo { constructor() { @@ -7,5 +7,5 @@ class Foo { babelHelpers.defineProperty(this, 'c', _init_computedKey(this, 456)); } } -_class = Foo; -[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(_class, [[dec, 0, "a"], [dec, 0, "b"], [dec, 0, 'c']], []); +_Foo = Foo; +[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(_Foo, [[dec, 0, "a"], [dec, 0, "b"], [dec, 0, 'c']], []); 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 dfca330f4ebb..c901b3068bd3 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,21 +1,21 @@ -var _init_a, _init_b, _class; +var _init_a, _init_b, _Foo; const dec = () => {}; class Foo {} -_class = Foo; -[_init_a, _init_b] = babelHelpers.applyDecs(_class, [[dec, 5, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _a); +_Foo = Foo; +[_init_a, _init_b] = babelHelpers.applyDecs(_Foo, [[dec, 5, "a", function () { + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _a); }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _a, value); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _a, value); }], [dec, 5, "b", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _b); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _b); }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _b, value); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _b, value); }]], []); var _a = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _b = { writable: true, - value: _init_b(_class, 123) + value: _init_b(_Foo, 123) }; 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 df97b4c2becc..75c1beafd22e 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,8 +1,8 @@ -var _init_a, _init_b, _init_computedKey, _class; +var _init_a, _init_b, _init_computedKey, _Foo; const dec = () => {}; class Foo {} -_class = Foo; -[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(_class, [[dec, 5, "a"], [dec, 5, "b"], [dec, 5, 'c']], []); -babelHelpers.defineProperty(Foo, "a", _init_a(_class)); -babelHelpers.defineProperty(Foo, "b", _init_b(_class, 123)); -babelHelpers.defineProperty(Foo, 'c', _init_computedKey(_class, 456)); +_Foo = Foo; +[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs(_Foo, [[dec, 5, "a"], [dec, 5, "b"], [dec, 5, 'c']], []); +babelHelpers.defineProperty(Foo, "a", _init_a(_Foo)); +babelHelpers.defineProperty(Foo, "b", _init_b(_Foo, 123)); +babelHelpers.defineProperty(Foo, 'c', _init_computedKey(_Foo, 456)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/context-name/output.js index e8fcbbd59949..f92e7baf99b8 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _call_a, _computedKey, _initStatic, _class; +var _call_a, _computedKey, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -20,7 +20,7 @@ class Foo { static get [3n]() {} static get [_computedKey]() {} } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } @@ -29,7 +29,7 @@ var _a = { set: void 0 }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs(_class, [[dec, 8, "a"], [dec, 8, "a", function () {}], [dec, 8, "b"], [dec, 8, "c"], [dec, 8, 0], [dec, 8, 1], [dec, 8, 2n], [dec, 8, 3n], [dec, 8, _computedKey]], []); - _initStatic(_class); + [_call_a, _initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 8, "a"], [dec, 8, "a", function () {}], [dec, 8, "b"], [dec, 8, "c"], [dec, 8, 0], [dec, 8, 1], [dec, 8, 2n], [dec, 8, 3n], [dec, 8, _computedKey]], []); + _initStatic(_Foo); })(); expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); 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 357b78516ab0..ee0df6150e19 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,8 +1,8 @@ -var _call_a, _initProto, _class; +var _call_a, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { get: _get_a, set: void 0 @@ -14,10 +14,10 @@ class Foo { return babelHelpers.classPrivateFieldGet(this, _a); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } -[_call_a, _initProto] = babelHelpers.applyDecs(_class, [[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 f91d0cd3480d..5b0d03ac0f01 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,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -12,5 +12,5 @@ class Foo { return this.value; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs(_class, [[dec, 3, "a"], [dec, 3, 'b']], []); +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs(_Foo, [[dec, 3, "a"], [dec, 3, 'b']], []); 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 f4050fe81130..c77e95907900 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,11 +1,11 @@ -var _call_a, _initStatic, _class; +var _call_a, _initStatic, _Foo; const dec = () => {}; class Foo { static getA() { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } @@ -14,9 +14,9 @@ var _a = { set: void 0 }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs(_class, [[dec, 8, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 8, "a", function () { return this.value; }]], []); - _initStatic(_class); + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "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 3df6a9101d89..8a43cea181c6 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,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static get a() { @@ -8,9 +8,9 @@ class Foo { return this.value; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs(_class, [[dec, 8, "a"], [dec, 8, 'b']], []); - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 8, "a"], [dec, 8, 'b']], []); + _initStatic(_Foo); })(); babelHelpers.defineProperty(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 db14a1c346a7..8f116c2c7ef1 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,8 +1,8 @@ -var _call_a, _call_a2, _initProto, _class; +var _call_a, _call_a2, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { get: _get_a, set: _set_a @@ -17,14 +17,14 @@ class Foo { babelHelpers.classPrivateFieldSet(this, _a, v); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } function _set_a(v) { _call_a2(this, v); } -[_call_a, _call_a2, _initProto] = babelHelpers.applyDecs(_class, [[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 dfa03acc8b3a..1f851c178653 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,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -18,5 +18,5 @@ class Foo { this.value = v; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs(_class, [[dec, 3, "a"], [dec, 4, "a"], [dec, 3, 'b'], [dec, 4, 'b']], []); +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs(_Foo, [[dec, 3, "a"], [dec, 4, "a"], [dec, 3, 'b'], [dec, 4, 'b']], []); 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 59234e7359ab..49eeda2b28a2 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,4 +1,4 @@ -var _call_a, _call_a2, _initStatic, _class; +var _call_a, _call_a2, _initStatic, _Foo; const dec = () => {}; class Foo { static getA() { @@ -8,7 +8,7 @@ class Foo { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } @@ -20,11 +20,11 @@ var _a = { set: _set_a }; (() => { - [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs(_class, [[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(_class); + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "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 f08582bc16ba..1da6fd5e5893 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,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static get a() { @@ -14,9 +14,9 @@ class Foo { this.value = v; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs(_class, [[dec, 8, "a"], [dec, 9, "a"], [dec, 8, 'b'], [dec, 9, 'b']], []); - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 8, "a"], [dec, 9, "a"], [dec, 8, 'b'], [dec, 9, 'b']], []); + _initStatic(_Foo); })(); babelHelpers.defineProperty(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 358dca0b4c0c..1e25ab2cb30e 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 @@ -8,7 +8,7 @@ class Foo { this.value = v; }]], []); } - constructor(...args) { + constructor() { _initProto(this); } 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 d28810906e4d..7957cca6437f 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 @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs(this, [[dec, 3, "a"], [dec, 4, "a"], [dec, 3, 'b'], [dec, 4, 'b']], []); } - constructor(...args) { + constructor() { _initProto(this); } 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 193928cfa461..2d9a9d8379bb 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 @@ -6,7 +6,7 @@ class Foo { return this.value; }]], []); } - constructor(...args) { + constructor() { _initProto(this); } 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 b56600b4abe7..4c26f758d9b7 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 @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs(this, [[dec, 3, "a"], [dec, 3, 'b']], []); } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/context-name/output.js index 04a6994396be..df67d28da283 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _call_a, _computedKey, _initStatic, _class; +var _call_a, _computedKey, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -20,10 +20,10 @@ class Foo { static [3n]() {} static [_computedKey]() {} } -_class = Foo; +_Foo = Foo; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs(_class, [[dec, 7, "a"], [dec, 7, "a", function () {}], [dec, 7, "b"], [dec, 7, "c"], [dec, 7, 0], [dec, 7, 1], [dec, 7, 2n], [dec, 7, 3n], [dec, 7, _computedKey]], []); - _initStatic(_class); + [_call_a, _initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 7, "a"], [dec, 7, "a", function () {}], [dec, 7, "b"], [dec, 7, "c"], [dec, 7, 0], [dec, 7, 1], [dec, 7, 2n], [dec, 7, 3n], [dec, 7, _computedKey]], []); + _initStatic(_Foo); })(); var _a = { writable: true, 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 7dab48db81f2..6d2406f61a23 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,8 +1,8 @@ -var _call_a, _initProto, _class; +var _call_a, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { writable: true, value: _call_a @@ -14,7 +14,7 @@ class Foo { return babelHelpers.classPrivateFieldGet(this, _a).call(this); } } -_class = Foo; -[_call_a, _initProto] = babelHelpers.applyDecs(_class, [[dec, 2, "a", function () { +_Foo = Foo; +[_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 a17331a3d09d..2d431786fcfc 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,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -12,5 +12,5 @@ class Foo { return this.value; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs(_class, [[dec, 2, "a"], [dec, 2, 'b']], []); +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs(_Foo, [[dec, 2, "a"], [dec, 2, 'b']], []); 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 d1c6467a8c19..5317a27d44e4 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,16 +1,16 @@ -var _call_a, _initStatic, _class; +var _call_a, _initStatic, _Foo; const dec = () => {}; class Foo { static callA() { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a).call(this); } } -_class = Foo; +_Foo = Foo; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs(_class, [[dec, 7, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 7, "a", function () { return this.value; }]], []); - _initStatic(_class); + _initStatic(_Foo); })(); var _a = { writable: true, 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 261fbf7ff217..e97903d6ffeb 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,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static a() { @@ -8,9 +8,9 @@ class Foo { return this.value; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs(_class, [[dec, 7, "a"], [dec, 7, 'b']], []); - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 7, "a"], [dec, 7, 'b']], []); + _initStatic(_Foo); })(); babelHelpers.defineProperty(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 861657d770f0..5e64b09a53fb 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 @@ -6,7 +6,7 @@ class Foo { return this.value; }]], []); } - constructor(...args) { + constructor() { _initProto(this); } #a = _call_a; 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 947cb9744d8b..435b643e5150 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 @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs(this, [[dec, 2, "a"], [dec, 2, 'b']], []); } - constructor(...args) { + constructor() { _initProto(this); } value = 1; 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 22da48109b64..181e01d58548 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,4 @@ -var _dec, _initProto, _class; +var _dec, _initProto, _A; const dec = () => {}; _dec = deco; class A extends B { @@ -9,5 +9,5 @@ class A extends B { } method() {} } -_class = A; -[_initProto] = babelHelpers.applyDecs(_class, [[_dec, 2, "method"]], []); +_A = A; +[_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/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js index 9a593d05a601..855f672ad5a8 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,17 +1,14 @@ -var _initClass, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _initProto, _class; +var _initClass, _classDecs, _dec, _dec2, _dec3, _dec4, _initProto, _Foo2; const dec = () => {}; +_classDecs = [dec, call(), chain.expr(), arbitrary + expr, array[expr]]; _dec = call(); _dec2 = chain.expr(); _dec3 = arbitrary + expr; _dec4 = array[expr]; -_dec5 = call(); -_dec6 = chain.expr(); -_dec7 = arbitrary + expr; -_dec8 = array[expr]; let _Foo; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { writable: true, value: void 0 @@ -20,14 +17,14 @@ class Foo { } method() {} makeClass() { - var _dec9, _init_bar, _class2; - return _dec9 = babelHelpers.classPrivateFieldGet(this, _a), (_class2 = class Nested { + var _dec5, _init_bar, _Nested; + return _dec5 = babelHelpers.classPrivateFieldGet(this, _a), (_Nested = class Nested { constructor() { babelHelpers.defineProperty(this, "bar", _init_bar(this)); } - }, [_init_bar] = babelHelpers.applyDecs(_class2, [[_dec9, 0, "bar"]], []), _class2); + }, [_init_bar] = babelHelpers.applyDecs(_Nested, [[_dec5, 0, "bar"]], []), _Nested); } } -_class = Foo; -[_initProto, _Foo, _initClass] = babelHelpers.applyDecs(_class, [[[dec, _dec5, _dec6, _dec7, _dec8], 2, "method"]], [dec, _dec, _dec2, _dec3, _dec4]); +_Foo2 = Foo; +[_initProto, _Foo, _initClass] = babelHelpers.applyDecs(_Foo2, [[[dec, _dec, _dec2, _dec3, _dec4], 2, "method"]], _classDecs); _initClass(); 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 e6c554b64b94..8f671ab9eccb 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,28 +1,25 @@ -var _initClass, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _initProto; +var _initClass, _classDecs, _dec, _dec2, _dec3, _dec4, _initProto; const dec = () => {}; +_classDecs = [dec, call(), chain.expr(), arbitrary + expr, array[expr]]; _dec = call(); _dec2 = chain.expr(); _dec3 = arbitrary + expr; _dec4 = array[expr]; -_dec5 = call(); -_dec6 = chain.expr(); -_dec7 = arbitrary + expr; -_dec8 = array[expr]; let _Foo; class Foo { static { - [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(this, [[[dec, _dec5, _dec6, _dec7, _dec8], 2, "method"]], [dec, _dec, _dec2, _dec3, _dec4]); + [_initProto, _Foo, _initClass] = babelHelpers.applyDecs(this, [[[dec, _dec, _dec2, _dec3, _dec4], 2, "method"]], _classDecs); } - constructor(...args) { + constructor() { _initProto(this); } #a; method() {} makeClass() { - var _dec9, _init_bar; - return _dec9 = this.#a, class Nested { + var _dec5, _init_bar; + return _dec5 = this.#a, class Nested { static { - [_init_bar] = babelHelpers.applyDecs(this, [[_dec9, 0, "bar"]], []); + [_init_bar] = babelHelpers.applyDecs(this, [[_dec5, 0, "bar"]], []); } bar = _init_bar(this); }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/context-name/output.js index 6aa29210532d..e7306ad66a37 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _call_a, _computedKey, _initStatic, _class; +var _call_a, _computedKey, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -20,7 +20,7 @@ class Foo { static set [3n](v) {} static set [_computedKey](v) {} } -_class = Foo; +_Foo = Foo; function _set_a(v) { _call_a(this, v); } @@ -29,7 +29,7 @@ var _a = { set: _set_a }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs(_class, [[dec, 9, "a"], [dec, 9, "a", function (v) {}], [dec, 9, "b"], [dec, 9, "c"], [dec, 9, 0], [dec, 9, 1], [dec, 9, 2n], [dec, 9, 3n], [dec, 9, _computedKey]], []); - _initStatic(_class); + [_call_a, _initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 9, "a"], [dec, 9, "a", function (v) {}], [dec, 9, "b"], [dec, 9, "c"], [dec, 9, 0], [dec, 9, 1], [dec, 9, 2n], [dec, 9, 3n], [dec, 9, _computedKey]], []); + _initStatic(_Foo); })(); expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); 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 6cf0259d2995..5a2674cf24d4 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,8 +1,8 @@ -var _call_a, _initProto, _class; +var _call_a, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { get: void 0, set: _set_a @@ -14,10 +14,10 @@ class Foo { babelHelpers.classPrivateFieldSet(this, _a, v); } } -_class = Foo; +_Foo = Foo; function _set_a(v) { _call_a(this, v); } -[_call_a, _initProto] = babelHelpers.applyDecs(_class, [[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 4456f41f0807..a0d6d759b759 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,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -12,5 +12,5 @@ class Foo { return this.value = v; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs(_class, [[dec, 4, "a"], [dec, 4, 'b']], []); +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs(_Foo, [[dec, 4, "a"], [dec, 4, 'b']], []); 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 c5dd49788a1f..1cda6ae8fa70 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,11 +1,11 @@ -var _call_a, _initStatic, _class; +var _call_a, _initStatic, _Foo; const dec = () => {}; class Foo { static setA(v) { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); } } -_class = Foo; +_Foo = Foo; function _set_a(v) { _call_a(this, v); } @@ -14,9 +14,9 @@ var _a = { set: _set_a }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs(_class, [[dec, 9, "a", function (v) { + [_call_a, _initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 9, "a", function (v) { return this.value = v; }]], []); - _initStatic(_class); + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "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 4e0713a6e92c..7801b8cd5977 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,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static set a(v) { @@ -8,9 +8,9 @@ class Foo { return this.value = v; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs(_class, [[dec, 9, "a"], [dec, 9, 'b']], []); - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 9, "a"], [dec, 9, 'b']], []); + _initStatic(_Foo); })(); babelHelpers.defineProperty(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 aa919a3d1463..569aae77040d 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 @@ -6,7 +6,7 @@ class Foo { return this.value = v; }]], []); } - constructor(...args) { + constructor() { _initProto(this); } 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 5abd28269910..20232121f41c 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 @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs(this, [[dec, 4, "a"], [dec, 4, 'b']], []); } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/context-name/output.js index cae646fa8f1a..5851e6f99780 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _initStatic, _class; +var _init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -67,7 +67,7 @@ class Foo { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _I, v); } } -_class = Foo; +_Foo = Foo; function _set_a2(v) { _set_a(this, v); } @@ -75,47 +75,47 @@ function _get_a2() { return _get_a(this); } (() => { - [_init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7, _initStatic] = babelHelpers.applyDecs2203R(_class, [[dec, 6, "a"], [dec, 6, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _B); + [_init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 6, "a"], [dec, 6, "a", function () { + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _B); }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _B, value); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _B, value); }], [dec, 6, "b"], [dec, 6, "c"], [dec, 6, 0], [dec, 6, 1], [dec, 6, 2n], [dec, 6, 3n], [dec, 6, _computedKey]], []).e; - _initStatic(_class); + _initStatic(_Foo); })(); var _A = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _B = { writable: true, - value: _init_a2(_class) + value: _init_a2(_Foo) }; var _C = { writable: true, - value: _init_computedKey(_class) + value: _init_computedKey(_Foo) }; var _D = { writable: true, - value: _init_computedKey2(_class) + value: _init_computedKey2(_Foo) }; var _E = { writable: true, - value: _init_computedKey3(_class) + value: _init_computedKey3(_Foo) }; var _F = { writable: true, - value: _init_computedKey4(_class) + value: _init_computedKey4(_Foo) }; var _G = { writable: true, - value: _init_computedKey5(_class) + value: _init_computedKey5(_Foo) }; var _H = { writable: true, - value: _init_computedKey6(_class) + value: _init_computedKey6(_Foo) }; var _I = { writable: true, - value: _init_computedKey7(_class) + value: _init_computedKey7(_Foo) }; expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/private/output.js index 62b1b0531a4d..53d73aa5dc80 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/private/output.js @@ -1,4 +1,4 @@ -var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto, _class; +var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto, _Foo; const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); var _a = /*#__PURE__*/new WeakMap(); @@ -24,7 +24,7 @@ class Foo { }); } } -_class = Foo; +_Foo = Foo; function _set_a2(v) { _set_a(this, v); } @@ -37,7 +37,7 @@ function _set_b2(v) { function _get_b2() { return _get_b(this); } -[_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs2203R(_class, [[dec, 1, "a", function () { +[_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs2203R(_Foo, [[dec, 1, "a", function () { return babelHelpers.classPrivateFieldGet(this, _A); }, function (value) { babelHelpers.classPrivateFieldSet(this, _A, value); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/public/output.js index a78447d3b861..1a1a53ce662d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/public/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_b, _init_computedKey, _initProto, _class; +var _init_a, _init_b, _init_computedKey, _initProto, _Foo; const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); var _B = /*#__PURE__*/new WeakMap(); @@ -37,5 +37,5 @@ class Foo { babelHelpers.classPrivateFieldSet(this, _C, v); } } -_class = Foo; -[_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs2203R(_class, [[dec, 1, "a"], [dec, 1, "b"], [dec, 1, 'c']], []).e; +_Foo = Foo; +[_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs2203R(_Foo, [[dec, 1, "a"], [dec, 1, "b"], [dec, 1, 'c']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-private/output.js index 2c99a2fea5f3..eb54426667c6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-private/output.js @@ -1,4 +1,4 @@ -var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic, _class; +var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); var _b = /*#__PURE__*/new WeakMap(); @@ -14,7 +14,7 @@ class Foo { }); } } -_class = Foo; +_Foo = Foo; function _set_a2(v) { _set_a(this, v); } @@ -28,22 +28,22 @@ function _get_b2() { return _get_b(this); } (() => { - [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs2203R(_class, [[dec, 6, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _A); + [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 6, "a", function () { + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _A); }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _A, value); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _A, value); }], [dec, 6, "b", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _B); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _B); }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _B, value); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _B, value); }]], []).e; - _initStatic(_class); + _initStatic(_Foo); })(); var _A = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _B = { writable: true, - value: _init_b(_class, 123) + value: _init_b(_Foo, 123) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-public/output.js index 502752d9ff75..383407892cf9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-public/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_b, _init_computedKey, _initStatic, _class; +var _init_a, _init_b, _init_computedKey, _initStatic, _Foo; const dec = () => {}; class Foo { static get a() { @@ -20,20 +20,20 @@ class Foo { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _C, v); } } -_class = Foo; +_Foo = Foo; (() => { - [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs2203R(_class, [[dec, 6, "a"], [dec, 6, "b"], [dec, 6, 'c']], []).e; - _initStatic(_class); + [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 6, "a"], [dec, 6, "b"], [dec, 6, 'c']], []).e; + _initStatic(_Foo); })(); var _A = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _B = { writable: true, - value: _init_b(_class, 123) + value: _init_b(_Foo, 123) }; var _C = { writable: true, - value: _init_computedKey(_class, 456) + value: _init_computedKey(_Foo, 456) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-static-private/output.js index 965b9ed9d1b6..ae0ff8265ff9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-static-private/output.js @@ -1,18 +1,18 @@ -var _class; +var _Foo; const dec = () => {}; class Foo {} -_class = Foo; +_Foo = Foo; function _get_a() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _A); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _A); } function _set_a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _A, v); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _A, v); } function _get_b() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _B); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _B); } function _set_b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _B, v); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _B, v); } var _b = { get: _get_b, diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/decorator-access-modified-fields/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/decorator-access-modified-fields/output.js index 83fbd1dec9de..b7a0941ba5cd 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/decorator-access-modified-fields/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/decorator-access-modified-fields/output.js @@ -1,4 +1,4 @@ -var _initClass, _init_m, _class; +var _initClass, _init_m, _C2; var value; const classDec = Class => { value = new Class().p; @@ -11,9 +11,9 @@ class C { babelHelpers.defineProperty(this, "m", _init_m(this)); } } -_class = C; +_C2 = C; ({ e: [_init_m], c: [_C, _initClass] -} = babelHelpers.applyDecs2203R(_class, [[memberDec, 0, "m"]], [classDec])); +} = babelHelpers.applyDecs2203R(_C2, [[memberDec, 0, "m"]], [classDec])); _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/decorator-access-modified-methods/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/decorator-access-modified-methods/output.js index 1face5566523..729b13c01861 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/decorator-access-modified-methods/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/decorator-access-modified-methods/output.js @@ -1,4 +1,4 @@ -var _initClass, _initProto, _class; +var _initClass, _initProto, _C2; var value; const classDec = Class => { value = new Class().m(); @@ -7,14 +7,14 @@ const classDec = Class => { const memberDec = () => () => 42; let _C; class C { - constructor(...args) { + constructor() { _initProto(this); } m() {} } -_class = C; +_C2 = C; ({ e: [_initProto], c: [_C, _initClass] -} = babelHelpers.applyDecs2203R(_class, [[memberDec, 2, "m"]], [classDec])); +} = babelHelpers.applyDecs2203R(_C2, [[memberDec, 2, "m"]], [classDec])); _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/expressions-static-blocks/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/expressions-static-blocks/output.js index 6f493c0435f8..40aec4dd1dd4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/expressions-static-blocks/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/expressions-static-blocks/output.js @@ -1,73 +1,73 @@ -var _initClass, _A, _temp, _initClass2, _C, _temp2, _initClass3, _D, _temp3, _initClass4, _decorated_class, _temp4, _class5, _initClass5, _G, _temp5, _initClass6, _decorated_class2, _temp6, _class7, _initClass7, _H, _temp7, _initClass8, _K, _temp8; +var _initClass, _A, _temp, _initClass2, _C, _temp2, _initClass3, _D, _temp3, _initClass4, _decorated_class, _temp4, _Class2, _initClass5, _G, _temp5, _initClass6, _decorated_class2, _temp6, _Class3, _initClass7, _H, _temp7, _initClass8, _K, _temp8; const dec = () => {}; const A = (new (_temp = class extends babelHelpers.identity { constructor() { super(_A), (() => {})(), _initClass(); } -}, (_class2 => { +}, (_A2 => { class A {} - _class2 = A; - [_A, _initClass] = babelHelpers.applyDecs2203R(_class2, [], [dec]).c; + _A2 = A; + [_A, _initClass] = babelHelpers.applyDecs2203R(_A2, [], [dec]).c; })(), _temp)(), _A); const B = (new (_temp2 = class extends babelHelpers.identity { constructor() { super(_C), (() => {})(), _initClass2(); } -}, (_class3 => { +}, (_C2 => { class C {} - _class3 = C; - [_C, _initClass2] = babelHelpers.applyDecs2203R(_class3, [], [dec]).c; + _C2 = C; + [_C, _initClass2] = babelHelpers.applyDecs2203R(_C2, [], [dec]).c; })(), _temp2)(), _C); const D = (new (_temp3 = class extends babelHelpers.identity { constructor() { super(_D), (() => {})(), _initClass3(); } -}, (_class4 => { +}, (_D2 => { class D {} - _class4 = D; - [_D, _initClass3] = babelHelpers.applyDecs2203R(_class4, [], [dec]).c; + _D2 = D; + [_D, _initClass3] = babelHelpers.applyDecs2203R(_D2, [], [dec]).c; })(), _temp3)(), _D); const E = ((new (_temp4 = class extends babelHelpers.identity { constructor() { super(_decorated_class), (() => {})(), _initClass4(); } -}, (_class5 = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs2203R(_class5, [], [dec]).c), _temp4)(), _decorated_class), 123); +}, (_Class2 = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs2203R(_Class2, [], [dec]).c), _temp4)(), _decorated_class), 123); const F = [(new (_temp5 = class extends babelHelpers.identity { constructor() { super(_G), (() => {})(), _initClass5(); } -}, (_class6 => { +}, (_G2 => { class G {} - _class6 = G; - [_G, _initClass5] = babelHelpers.applyDecs2203R(_class6, [], [dec]).c; + _G2 = G; + [_G, _initClass5] = babelHelpers.applyDecs2203R(_G2, [], [dec]).c; })(), _temp5)(), _G), (new (_temp6 = class extends babelHelpers.identity { constructor() { super(_decorated_class2), (() => {})(), _initClass6(); } -}, (_class7 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs2203R(_class7, [], [dec]).c), _temp6)(), _decorated_class2)]; +}, (_Class3 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs2203R(_Class3, [], [dec]).c), _temp6)(), _decorated_class2)]; const H = (new (_temp7 = class extends babelHelpers.identity { constructor() { super(_H), (() => {})(), _initClass7(); } -}, (_class8 => { +}, (_H2 => { class H extends I {} - _class8 = H; - [_H, _initClass7] = babelHelpers.applyDecs2203R(_class8, [], [dec]).c; + _H2 = H; + [_H, _initClass7] = babelHelpers.applyDecs2203R(_H2, [], [dec]).c; })(), _temp7)(), _H); const J = (new (_temp8 = class extends babelHelpers.identity { constructor() { super(_K), (() => {})(), _initClass8(); } -}, (_class9 => { +}, (_K2 => { class K extends L {} - _class9 = K; - [_K, _initClass8] = babelHelpers.applyDecs2203R(_class9, [], [dec]).c; + _K2 = K; + [_K, _initClass8] = babelHelpers.applyDecs2203R(_K2, [], [dec]).c; })(), _temp8)(), _K); function classFactory() { - var _initClass9, _decorated_class3, _temp9, _class11; + var _initClass9, _decorated_class3, _temp9, _Class5; return new (_temp9 = class extends babelHelpers.identity { constructor() { super(_decorated_class3), (() => {})(), _initClass9(); } - }, (_class11 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs2203R(_class11, [], [dec]).c), _temp9)(), _decorated_class3; + }, (_Class5 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs2203R(_Class5, [], [dec]).c), _temp9)(), _decorated_class3; } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/expressions/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/expressions/output.js index 3d97a05f98a3..dd7ab10cc092 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/expressions/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/expressions/output.js @@ -1,13 +1,13 @@ -var _initClass, _A, _class, _initClass2, _C, _class2, _initClass3, _D, _class3, _initClass4, _decorated_class, _class4, _initClass5, _G, _class5, _initClass6, _decorated_class2, _class6, _initClass7, _H, _class7, _initClass8, _K, _class8; +var _initClass, _A, _A2, _initClass2, _C, _C2, _initClass3, _D, _D2, _initClass4, _decorated_class, _Class, _initClass5, _G, _G2, _initClass6, _decorated_class2, _Class2, _initClass7, _H, _H2, _initClass8, _K, _K2; const dec = () => {}; -const A = ((_class = class A {}, [_A, _initClass] = babelHelpers.applyDecs2203R(_class, [], [dec]).c, _initClass()), _A); -const B = ((_class2 = class C {}, [_C, _initClass2] = babelHelpers.applyDecs2203R(_class2, [], [dec]).c, _initClass2()), _C); -const D = ((_class3 = class D {}, [_D, _initClass3] = babelHelpers.applyDecs2203R(_class3, [], [dec]).c, _initClass3()), _D); -const E = (((_class4 = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs2203R(_class4, [], [dec]).c, _initClass4()), _decorated_class), 123); -const F = [((_class5 = class G {}, [_G, _initClass5] = babelHelpers.applyDecs2203R(_class5, [], [dec]).c, _initClass5()), _G), ((_class6 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs2203R(_class6, [], [dec]).c, _initClass6()), _decorated_class2)]; -const H = ((_class7 = class H extends I {}, [_H, _initClass7] = babelHelpers.applyDecs2203R(_class7, [], [dec]).c, _initClass7()), _H); -const J = ((_class8 = class K extends L {}, [_K, _initClass8] = babelHelpers.applyDecs2203R(_class8, [], [dec]).c, _initClass8()), _K); +const A = ((_A2 = class A {}, [_A, _initClass] = babelHelpers.applyDecs2203R(_A2, [], [dec]).c, _initClass()), _A); +const B = ((_C2 = class C {}, [_C, _initClass2] = babelHelpers.applyDecs2203R(_C2, [], [dec]).c, _initClass2()), _C); +const D = ((_D2 = class D {}, [_D, _initClass3] = babelHelpers.applyDecs2203R(_D2, [], [dec]).c, _initClass3()), _D); +const E = (((_Class = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs2203R(_Class, [], [dec]).c, _initClass4()), _decorated_class), 123); +const F = [((_G2 = class G {}, [_G, _initClass5] = babelHelpers.applyDecs2203R(_G2, [], [dec]).c, _initClass5()), _G), ((_Class2 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs2203R(_Class2, [], [dec]).c, _initClass6()), _decorated_class2)]; +const H = ((_H2 = class H extends I {}, [_H, _initClass7] = babelHelpers.applyDecs2203R(_H2, [], [dec]).c, _initClass7()), _H); +const J = ((_K2 = class K extends L {}, [_K, _initClass8] = babelHelpers.applyDecs2203R(_K2, [], [dec]).c, _initClass8()), _K); function classFactory() { - var _initClass9, _decorated_class3, _class9; - return (_class9 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs2203R(_class9, [], [dec]).c, _initClass9()), _decorated_class3; + var _initClass9, _decorated_class3, _Class3; + return (_Class3 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs2203R(_Class3, [], [dec]).c, _initClass9()), _decorated_class3; } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/inheritance/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/inheritance/output.js index 999b6af78298..e2e5bcf42415 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/inheritance/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/inheritance/output.js @@ -1,13 +1,13 @@ -var _initClass, _class, _initClass2, _class2; +var _initClass, _Bar2, _initClass2, _Foo2; const dec1 = () => {}; const dec2 = () => {}; let _Bar; class Bar {} -_class = Bar; -[_Bar, _initClass] = babelHelpers.applyDecs2203R(_class, [], [dec1]).c; +_Bar2 = Bar; +[_Bar, _initClass] = babelHelpers.applyDecs2203R(_Bar2, [], [dec1]).c; _initClass(); let _Foo; class Foo extends _Bar {} -_class2 = Foo; -[_Foo, _initClass2] = babelHelpers.applyDecs2203R(_class2, [], [dec2]).c; +_Foo2 = Foo; +[_Foo, _initClass2] = babelHelpers.applyDecs2203R(_Foo2, [], [dec2]).c; _initClass2(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/initializers/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/initializers/output.js index 51ea399a6f48..a4e0538fbc43 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/initializers/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/initializers/output.js @@ -5,10 +5,10 @@ new (_temp = class extends babelHelpers.identity { constructor() { (super(_Foo), babelHelpers.defineProperty(this, "field", 123)), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo {} - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs2203R(_class2, [], [dec]).c; + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs2203R(_Foo2, [], [dec]).c; })(), _temp)(); let _Bar; new (_temp2 = class extends babelHelpers.identity { @@ -17,8 +17,8 @@ new (_temp2 = class extends babelHelpers.identity { this.otherField = 456; })(), 123))), _initClass2(); } -}, (_class3 => { +}, (_Bar2 => { class Bar extends _Foo {} - _class3 = Bar; - [_Bar, _initClass2] = babelHelpers.applyDecs2203R(_class3, [], [dec]).c; + _Bar2 = Bar; + [_Bar, _initClass2] = babelHelpers.applyDecs2203R(_Bar2, [], [dec]).c; })(), _temp2)(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-static-installed-on-correct-class/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-static-installed-on-correct-class/output.js index 8fbe3d58a932..42f6c93d0c37 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-static-installed-on-correct-class/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-static-installed-on-correct-class/output.js @@ -12,11 +12,11 @@ new (_x = /*#__PURE__*/new WeakMap(), _m = /*#__PURE__*/new WeakSet(), (_temp = hasM = o => _m.has(babelHelpers.checkInRHS(o)); })(), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo { static m() {} } - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs2203R(_class2, [], [dec]).c; + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs2203R(_Foo2, [], [dec]).c; })(), _temp))(); function _m2() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-static-this/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-static-this/output.js index f8ca0f232822..aab7c89d49b2 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-static-this/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-static-this/output.js @@ -9,8 +9,8 @@ new (_temp = class extends babelHelpers.identity { this; })(), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo {} - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs2203R(_class2, [], [dec]).c; + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs2203R(_Foo2, [], [dec]).c; })(), _temp)(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-with-expr/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-with-expr/output.js index 461573f9be3f..de9b1aec3b46 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-with-expr/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-with-expr/output.js @@ -1,8 +1,8 @@ -var _initClass, _Bar, _class; +var _initClass, _Bar, _Bar2; const dec = () => {}; -const Foo = ((_class = class Bar { +const Foo = ((_Bar2 = class Bar { constructor() { babelHelpers.defineProperty(this, "bar", new _Bar()); } -}, [_Bar, _initClass] = babelHelpers.applyDecs2203R(_class, [], [dec]).c, _initClass()), _Bar); +}, [_Bar, _initClass] = babelHelpers.applyDecs2203R(_Bar2, [], [dec]).c, _initClass()), _Bar); const foo = new Foo(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement/output.js index 982a4e71d208..acc6b8d569b7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement/output.js @@ -5,9 +5,9 @@ new (_temp = class extends babelHelpers.identity { constructor() { (super(_Foo), babelHelpers.defineProperty(this, "foo", new _Foo())), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo {} - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs2203R(_class2, [], [dec]).c; + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs2203R(_Foo2, [], [dec]).c; })(), _temp)(); const foo = new _Foo(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes/decorator-access-modified-methods/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes/decorator-access-modified-methods/output.js index de19d8af4fdc..fb78d07d9b44 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes/decorator-access-modified-methods/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes/decorator-access-modified-methods/output.js @@ -13,7 +13,7 @@ class C { c: [_C, _initClass] } = babelHelpers.applyDecs2203R(this, [[memberDec, 2, "m"]], [classDec])); } - constructor(...args) { + constructor() { _initProto(this); } m() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes/inheritance/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes/inheritance/output.js index 784f04fd9865..8992c2a85d50 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes/inheritance/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes/inheritance/output.js @@ -1,20 +1,20 @@ -var _initClass, _dec, _initClass2, _dec2; +var _initClass, _classDecs, _initClass2, _classDecs2; const dec = () => {}; -_dec = dec1; +_classDecs = [dec1]; let _Bar; class Bar { static { - [_Bar, _initClass] = babelHelpers.applyDecs2203R(this, [], [_dec]).c; + [_Bar, _initClass] = babelHelpers.applyDecs2203R(this, [], _classDecs).c; } static { _initClass(); } } -_dec2 = dec2; +_classDecs2 = [dec2]; let _Foo; class Foo extends _Bar { static { - [_Foo, _initClass2] = babelHelpers.applyDecs2203R(this, [], [_dec2]).c; + [_Foo, _initClass2] = babelHelpers.applyDecs2203R(this, [], _classDecs2).c; } static { _initClass2(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/computed-keys-same-ast/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/computed-keys-same-ast/output.js index 3617116101b9..9591f2b01aa7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/computed-keys-same-ast/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/computed-keys-same-ast/output.js @@ -1,9 +1,9 @@ -var _computedKey, _computedKey2, _initProto, _class; +var _computedKey, _computedKey2, _initProto, _Foo; const dec = () => {}; _computedKey = babelHelpers.toPropertyKey(getKey()); _computedKey2 = babelHelpers.toPropertyKey(getKey()); class Foo { - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { @@ -13,5 +13,5 @@ class Foo { return 2; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2203R(_class, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2203R(_Foo, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/computed-keys-same-value/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/computed-keys-same-value/output.js index d4be01e3f1c1..14602a3ec769 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/computed-keys-same-value/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/computed-keys-same-value/output.js @@ -1,9 +1,9 @@ -var _computedKey, _computedKey2, _initProto, _class; +var _computedKey, _computedKey2, _initProto, _Foo; const dec = () => {}; _computedKey = babelHelpers.toPropertyKey(getKeyI()); _computedKey2 = babelHelpers.toPropertyKey(getKeyJ()); class Foo { - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { @@ -13,5 +13,5 @@ class Foo { return 2; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2203R(_class, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2203R(_Foo, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/method-and-field/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/method-and-field/output.js index 1f275de0b000..1e5e9dc88263 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/method-and-field/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/method-and-field/output.js @@ -1,4 +1,4 @@ -var _init_a, _initProto, _class; +var _init_a, _initProto, _Foo; const dec = () => {}; class Foo { constructor() { @@ -8,5 +8,5 @@ class Foo { return 1; } } -_class = Foo; -[_init_a, _initProto] = babelHelpers.applyDecs2203R(_class, [[dec, 2, "a"], [dec, 0, "a"]], []).e; +_Foo = Foo; +[_init_a, _initProto] = babelHelpers.applyDecs2203R(_Foo, [[dec, 2, "a"], [dec, 0, "a"]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/methods-with-same-key/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/methods-with-same-key/output.js index 84990abb4a47..289aa6bfeab6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/methods-with-same-key/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys--to-es2015/methods-with-same-key/output.js @@ -1,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { _initProto(this); } a() { @@ -11,5 +11,5 @@ class Foo { return 2; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2203R(_class, [[dec, 2, "a"], [dec, 2, "a"]], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2203R(_Foo, [[dec, 2, "a"], [dec, 2, "a"]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys/computed-keys-same-ast/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys/computed-keys-same-ast/output.js index 0531f86e2a3c..d6bdbfafad92 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys/computed-keys-same-ast/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys/computed-keys-same-ast/output.js @@ -6,7 +6,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2203R(this, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; } - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys/computed-keys-same-value/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys/computed-keys-same-value/output.js index e453791b6dda..220f74a618d3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys/computed-keys-same-value/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys/computed-keys-same-value/output.js @@ -6,7 +6,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2203R(this, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; } - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys/methods-with-same-key/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys/methods-with-same-key/output.js index 6ec98cdb463c..2f1b1719593f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys/methods-with-same-key/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-duplicated-keys/methods-with-same-key/output.js @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2203R(this, [[dec, 2, "a"], [dec, 2, "a"]], []).e; } - constructor(...args) { + constructor() { _initProto(this); } a() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-exported/default-anonymous/output.mjs b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-exported/default-anonymous/output.mjs index a04088ae4f93..f01b705db0dc 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-exported/default-anonymous/output.mjs +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-exported/default-anonymous/output.mjs @@ -1,9 +1,9 @@ -var _initClass, _dec; -_dec = dec; +var _initClass, _classDecs; +_classDecs = [dec]; let _A; class A { static { - [_A, _initClass] = babelHelpers.applyDecs2203R(this, [], [_dec]).c; + [_A, _initClass] = babelHelpers.applyDecs2203R(this, [], _classDecs).c; } static { _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-exported/default-named/output.mjs b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-exported/default-named/output.mjs index 52fc3c9ac581..313607906049 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-exported/default-named/output.mjs +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-exported/default-named/output.mjs @@ -1,9 +1,9 @@ -var _initClass, _dec; -_dec = dec; +var _initClass, _classDecs; +_classDecs = [dec]; let _default2; class _default { static { - [_default2, _initClass] = babelHelpers.applyDecs2203R(babelHelpers.setFunctionName(this, "default"), [], [_dec]).c; + [_default2, _initClass] = babelHelpers.applyDecs2203R(babelHelpers.setFunctionName(this, "default"), [], _classDecs).c; } static { _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-exported/named/output.mjs b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-exported/named/output.mjs index 2a32e8bf1935..2032d931b34e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-exported/named/output.mjs +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-exported/named/output.mjs @@ -1,9 +1,9 @@ -var _initClass, _dec; -_dec = dec; +var _initClass, _classDecs; +_classDecs = [dec]; let _A; class A { static { - [_A, _initClass] = babelHelpers.applyDecs2203R(this, [], [_dec]).c; + [_A, _initClass] = babelHelpers.applyDecs2203R(this, [], _classDecs).c; } static { _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/context-name/output.js index 03cf993f5a25..eb402a378345 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _class; +var _init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -11,22 +11,22 @@ const f = () => { }; _computedKey = babelHelpers.toPropertyKey(f()); class Foo {} -_class = Foo; -[_init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7] = babelHelpers.applyDecs2203R(_class, [[dec, 5, "a"], [dec, 5, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _a); +_Foo = Foo; +[_init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7] = babelHelpers.applyDecs2203R(_Foo, [[dec, 5, "a"], [dec, 5, "a", function () { + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _a); }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _a, value); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _a, value); }], [dec, 5, "b"], [dec, 5, "c"], [dec, 5, 0], [dec, 5, 1], [dec, 5, 2n], [dec, 5, 3n], [dec, 5, _computedKey]], []).e; -babelHelpers.defineProperty(Foo, "a", _init_a(_class)); +babelHelpers.defineProperty(Foo, "a", _init_a(_Foo)); var _a = { writable: true, - value: _init_a2(_class) + value: _init_a2(_Foo) }; -babelHelpers.defineProperty(Foo, "b", _init_computedKey(_class)); -babelHelpers.defineProperty(Foo, "c", _init_computedKey2(_class)); -babelHelpers.defineProperty(Foo, 0, _init_computedKey3(_class)); -babelHelpers.defineProperty(Foo, 1, _init_computedKey4(_class)); -babelHelpers.defineProperty(Foo, 2n, _init_computedKey5(_class)); -babelHelpers.defineProperty(Foo, 3n, _init_computedKey6(_class)); -babelHelpers.defineProperty(Foo, _computedKey, _init_computedKey7(_class)); +babelHelpers.defineProperty(Foo, "b", _init_computedKey(_Foo)); +babelHelpers.defineProperty(Foo, "c", _init_computedKey2(_Foo)); +babelHelpers.defineProperty(Foo, 0, _init_computedKey3(_Foo)); +babelHelpers.defineProperty(Foo, 1, _init_computedKey4(_Foo)); +babelHelpers.defineProperty(Foo, 2n, _init_computedKey5(_Foo)); +babelHelpers.defineProperty(Foo, 3n, _init_computedKey6(_Foo)); +babelHelpers.defineProperty(Foo, _computedKey, _init_computedKey7(_Foo)); expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/private/output.js index ed1601d4ab08..d72abd7b500c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/private/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_b, _class; +var _init_a, _init_b, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); var _b = /*#__PURE__*/new WeakMap(); @@ -14,8 +14,8 @@ class Foo { }); } } -_class = Foo; -[_init_a, _init_b] = babelHelpers.applyDecs2203R(_class, [[dec, 0, "a", function () { +_Foo = Foo; +[_init_a, _init_b] = babelHelpers.applyDecs2203R(_Foo, [[dec, 0, "a", function () { return babelHelpers.classPrivateFieldGet(this, _a); }, function (value) { babelHelpers.classPrivateFieldSet(this, _a, value); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/public/output.js index bf086a40ac5c..b2fc89c6ad35 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/public/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_b, _init_computedKey, _class; +var _init_a, _init_b, _init_computedKey, _Foo; const dec = () => {}; class Foo { constructor() { @@ -7,5 +7,5 @@ class Foo { babelHelpers.defineProperty(this, 'c', _init_computedKey(this, 456)); } } -_class = Foo; -[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs2203R(_class, [[dec, 0, "a"], [dec, 0, "b"], [dec, 0, 'c']], []).e; +_Foo = Foo; +[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs2203R(_Foo, [[dec, 0, "a"], [dec, 0, "b"], [dec, 0, 'c']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-private/output.js index a93ec8d96013..73d70dbf8c4a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-private/output.js @@ -1,21 +1,21 @@ -var _init_a, _init_b, _class; +var _init_a, _init_b, _Foo; const dec = () => {}; class Foo {} -_class = Foo; -[_init_a, _init_b] = babelHelpers.applyDecs2203R(_class, [[dec, 5, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _a); +_Foo = Foo; +[_init_a, _init_b] = babelHelpers.applyDecs2203R(_Foo, [[dec, 5, "a", function () { + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _a); }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _a, value); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _a, value); }], [dec, 5, "b", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _b); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _b); }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _b, value); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _b, value); }]], []).e; var _a = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _b = { writable: true, - value: _init_b(_class, 123) + value: _init_b(_Foo, 123) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-public/output.js index f0ba0703cbd4..e699745568c9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-public/output.js @@ -1,8 +1,8 @@ -var _init_a, _init_b, _init_computedKey, _class; +var _init_a, _init_b, _init_computedKey, _Foo; const dec = () => {}; class Foo {} -_class = Foo; -[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs2203R(_class, [[dec, 5, "a"], [dec, 5, "b"], [dec, 5, 'c']], []).e; -babelHelpers.defineProperty(Foo, "a", _init_a(_class)); -babelHelpers.defineProperty(Foo, "b", _init_b(_class, 123)); -babelHelpers.defineProperty(Foo, 'c', _init_computedKey(_class, 456)); +_Foo = Foo; +[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs2203R(_Foo, [[dec, 5, "a"], [dec, 5, "b"], [dec, 5, 'c']], []).e; +babelHelpers.defineProperty(Foo, "a", _init_a(_Foo)); +babelHelpers.defineProperty(Foo, "b", _init_b(_Foo, 123)); +babelHelpers.defineProperty(Foo, 'c', _init_computedKey(_Foo, 456)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/context-name/output.js index 0a5a4f90f5ac..750a9c24cfd4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _call_a, _computedKey, _initStatic, _class; +var _call_a, _computedKey, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -20,7 +20,7 @@ class Foo { static get [3n]() {} static get [_computedKey]() {} } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } @@ -29,7 +29,7 @@ var _a = { set: void 0 }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_class, [[dec, 8, "a"], [dec, 8, "a", function () {}], [dec, 8, "b"], [dec, 8, "c"], [dec, 8, 0], [dec, 8, 1], [dec, 8, 2n], [dec, 8, 3n], [dec, 8, _computedKey]], []).e; - _initStatic(_class); + [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 8, "a"], [dec, 8, "a", function () {}], [dec, 8, "b"], [dec, 8, "c"], [dec, 8, 0], [dec, 8, 1], [dec, 8, 2n], [dec, 8, 3n], [dec, 8, _computedKey]], []).e; + _initStatic(_Foo); })(); expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/private/output.js index 7b3d1e0a0625..42b9d574218c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/private/output.js @@ -1,8 +1,8 @@ -var _call_a, _initProto, _class; +var _call_a, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { get: _get_a, set: void 0 @@ -14,10 +14,10 @@ class Foo { return babelHelpers.classPrivateFieldGet(this, _a); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } -[_call_a, _initProto] = babelHelpers.applyDecs2203R(_class, [[dec, 3, "a", function () { +[_call_a, _initProto] = babelHelpers.applyDecs2203R(_Foo, [[dec, 3, "a", function () { return this.value; }]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/public/output.js index c899755004d0..bd48c8dd40c8 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/public/output.js @@ -1,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -12,5 +12,5 @@ class Foo { return this.value; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2203R(_class, [[dec, 3, "a"], [dec, 3, 'b']], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2203R(_Foo, [[dec, 3, "a"], [dec, 3, 'b']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-private/output.js index f4eeef478362..81bdc7538343 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-private/output.js @@ -1,11 +1,11 @@ -var _call_a, _initStatic, _class; +var _call_a, _initStatic, _Foo; const dec = () => {}; class Foo { static getA() { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } @@ -14,9 +14,9 @@ var _a = { set: void 0 }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_class, [[dec, 8, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 8, "a", function () { return this.value; }]], []).e; - _initStatic(_class); + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-public/output.js index 921b1aa07972..4ae1e8f2a68e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-public/output.js @@ -1,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static get a() { @@ -8,9 +8,9 @@ class Foo { return this.value; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs2203R(_class, [[dec, 8, "a"], [dec, 8, 'b']], []).e; - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 8, "a"], [dec, 8, 'b']], []).e; + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/private/output.js index b8341547229b..d67195fab015 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/private/output.js @@ -1,8 +1,8 @@ -var _call_a, _call_a2, _initProto, _class; +var _call_a, _call_a2, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { get: _get_a, set: _set_a @@ -17,14 +17,14 @@ class Foo { babelHelpers.classPrivateFieldSet(this, _a, v); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } function _set_a(v) { _call_a2(this, v); } -[_call_a, _call_a2, _initProto] = babelHelpers.applyDecs2203R(_class, [[dec, 3, "a", function () { +[_call_a, _call_a2, _initProto] = babelHelpers.applyDecs2203R(_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/2022-03-getters-and-setters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/public/output.js index d1b537055ac6..5c3ccdb999d8 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/public/output.js @@ -1,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -18,5 +18,5 @@ class Foo { this.value = v; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2203R(_class, [[dec, 3, "a"], [dec, 4, "a"], [dec, 3, 'b'], [dec, 4, 'b']], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2203R(_Foo, [[dec, 3, "a"], [dec, 4, "a"], [dec, 3, 'b'], [dec, 4, 'b']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-private/output.js index ca5c4795862e..563df3182cc1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-private/output.js @@ -1,4 +1,4 @@ -var _call_a, _call_a2, _initStatic, _class; +var _call_a, _call_a2, _initStatic, _Foo; const dec = () => {}; class Foo { static getA() { @@ -8,7 +8,7 @@ class Foo { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } @@ -20,11 +20,11 @@ var _a = { set: _set_a }; (() => { - [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs2203R(_class, [[dec, 8, "a", function () { + [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 8, "a", function () { return this.value; }], [dec, 9, "a", function (v) { this.value = v; }]], []).e; - _initStatic(_class); + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-public/output.js index 60590f426bc8..b87a0af3d2b8 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-public/output.js @@ -1,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static get a() { @@ -14,9 +14,9 @@ class Foo { this.value = v; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs2203R(_class, [[dec, 8, "a"], [dec, 9, "a"], [dec, 8, 'b'], [dec, 9, 'b']], []).e; - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 8, "a"], [dec, 9, "a"], [dec, 8, 'b'], [dec, 9, 'b']], []).e; + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters/private/output.js index cf5c61680bb7..ce6bdebcba76 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters/private/output.js @@ -8,7 +8,7 @@ class Foo { this.value = v; }]], []).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters/public/output.js index e4c51df6faf8..83e21e953023 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters/public/output.js @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2203R(this, [[dec, 3, "a"], [dec, 4, "a"], [dec, 3, 'b'], [dec, 4, 'b']], []).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters/private/output.js index c7aa0e42f425..2f19fbcdd2bb 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters/private/output.js @@ -6,7 +6,7 @@ class Foo { return this.value; }]], []).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters/public/output.js index 643df081bddb..66c911322189 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters/public/output.js @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2203R(this, [[dec, 3, "a"], [dec, 3, 'b']], []).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/context-name/output.js index c1da7bf666a0..ac83e14eab64 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _call_a, _computedKey, _initStatic, _class; +var _call_a, _computedKey, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -20,10 +20,10 @@ class Foo { static [3n]() {} static [_computedKey]() {} } -_class = Foo; +_Foo = Foo; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_class, [[dec, 7, "a"], [dec, 7, "a", function () {}], [dec, 7, "b"], [dec, 7, "c"], [dec, 7, 0], [dec, 7, 1], [dec, 7, 2n], [dec, 7, 3n], [dec, 7, _computedKey]], []).e; - _initStatic(_class); + [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 7, "a"], [dec, 7, "a", function () {}], [dec, 7, "b"], [dec, 7, "c"], [dec, 7, 0], [dec, 7, 1], [dec, 7, 2n], [dec, 7, 3n], [dec, 7, _computedKey]], []).e; + _initStatic(_Foo); })(); var _a = { writable: true, diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/private/output.js index e45d5cc74add..2a2cdffa15cd 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/private/output.js @@ -1,8 +1,8 @@ -var _call_a, _initProto, _class; +var _call_a, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { writable: true, value: _call_a @@ -14,7 +14,7 @@ class Foo { return babelHelpers.classPrivateFieldGet(this, _a).call(this); } } -_class = Foo; -[_call_a, _initProto] = babelHelpers.applyDecs2203R(_class, [[dec, 2, "a", function () { +_Foo = Foo; +[_call_a, _initProto] = babelHelpers.applyDecs2203R(_Foo, [[dec, 2, "a", function () { return this.value; }]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/public/output.js index f9563d0d9df2..4c0cf4fe5e95 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/public/output.js @@ -1,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -12,5 +12,5 @@ class Foo { return this.value; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2203R(_class, [[dec, 2, "a"], [dec, 2, 'b']], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2203R(_Foo, [[dec, 2, "a"], [dec, 2, 'b']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-private/output.js index ad72e16033d5..3ef2a45d8373 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-private/output.js @@ -1,16 +1,16 @@ -var _call_a, _initStatic, _class; +var _call_a, _initStatic, _Foo; const dec = () => {}; class Foo { static callA() { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a).call(this); } } -_class = Foo; +_Foo = Foo; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_class, [[dec, 7, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 7, "a", function () { return this.value; }]], []).e; - _initStatic(_class); + _initStatic(_Foo); })(); var _a = { writable: true, diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-public/output.js index 6272a8202088..2a77e583501f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-public/output.js @@ -1,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static a() { @@ -8,9 +8,9 @@ class Foo { return this.value; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs2203R(_class, [[dec, 7, "a"], [dec, 7, 'b']], []).e; - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 7, "a"], [dec, 7, 'b']], []).e; + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods/private/output.js index e478b01a6fb4..543c65880523 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods/private/output.js @@ -6,7 +6,7 @@ class Foo { return this.value; }]], []).e; } - constructor(...args) { + constructor() { _initProto(this); } #a = _call_a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods/public/output.js index 2fc16ab72de2..adadecda72fd 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods/public/output.js @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2203R(this, [[dec, 2, "a"], [dec, 2, 'b']], []).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/initProto-existing-derived-constructor/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/initProto-existing-derived-constructor/output.js index a7811cff018b..0d02b4298e9d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/initProto-existing-derived-constructor/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/initProto-existing-derived-constructor/output.js @@ -1,5 +1,5 @@ { - var _initProto, _class; + var _initProto, _A; let self, a, initCalled; function deco(_, context) { context.addInitializer(() => { @@ -18,8 +18,8 @@ } method() {} } - _class = A; - [_initProto] = babelHelpers.applyDecs2203R(_class, [[deco, 2, "method"]], []).e; + _A = A; + [_initProto] = babelHelpers.applyDecs2203R(_A, [[deco, 2, "method"]], []).e; let instance = new A(); expect(self).toBe(instance); expect(a).toBe(2); @@ -40,7 +40,7 @@ } } { - var _initProto2, _class2; + var _initProto2, _A2; "super() nested within another constructor should not be transformed"; let log = []; class A extends B { @@ -56,8 +56,8 @@ return this.a; } } - _class2 = A; - [_initProto2] = babelHelpers.applyDecs2203R(_class2, [[dec, 2, "method"]], []).e; + _A2 = A; + [_initProto2] = babelHelpers.applyDecs2203R(_A2, [[dec, 2, "method"]], []).e; new A(); expect(log + "").toBe("103,4"); } @@ -66,7 +66,7 @@ let log = []; new class Dummy extends B { constructor() { - var _computedKey, _initProto3, _class3; + var _computedKey, _initProto3, _A3; let key; _computedKey = babelHelpers.toPropertyKey((key = super(5).method(), log.push(key), key)); class A extends B { @@ -77,8 +77,8 @@ return this.a; } } - _class3 = A; - [_initProto3] = babelHelpers.applyDecs2203R(_class3, [[dec, 2, "method"]], []).e; + _A3 = A; + [_initProto3] = babelHelpers.applyDecs2203R(_A3, [[dec, 2, "method"]], []).e; new A(); } }(); @@ -90,7 +90,7 @@ const noop = () => fn => fn; new class extends B { constructor() { - var _dec, _initProto4, _class4; + var _dec, _initProto4, _A4; _dec = noop(log.push(super(7).method())); class A extends B { constructor() { @@ -101,15 +101,15 @@ } noop() {} } - _class4 = A; - [_initProto4] = babelHelpers.applyDecs2203R(_class4, [[dec, 2, "method"], [_dec, 2, "noop"]], []).e; + _A4 = A; + [_initProto4] = babelHelpers.applyDecs2203R(_A4, [[dec, 2, "method"], [_dec, 2, "noop"]], []).e; new A(); } }(); expect(log + "").toBe("7,108"); } { - var _initProto5, _class5; + var _initProto5, _A5; "super() within decorated derived constructor should be transformed: computed key"; let log = []; class A extends B { @@ -126,32 +126,32 @@ return this.a; } } - _class5 = A; - [_initProto5] = babelHelpers.applyDecs2203R(_class5, [[dec, 2, "method"]], []).e; + _A5 = A; + [_initProto5] = babelHelpers.applyDecs2203R(_A5, [[dec, 2, "method"]], []).e; new A(); expect(log + "").toBe("109,10"); } { - var _initProto6, _class7; + var _initProto6, _A6; "super() within decorated derived constructor should be transformed: decorator expression"; let log = []; const noop = () => fn => fn; class A extends B { constructor() { - var _dec2, _initProto7, _class8; - new (_dec2 = noop(log.push(_initProto6(super(11)).method())), (_class8 = class Dummy extends B { + var _dec2, _initProto7, _Dummy2; + new (_dec2 = noop(log.push(_initProto6(super(11)).method())), (_Dummy2 = class Dummy extends B { constructor() { log.push(_initProto7(super(12)).method()); } noop() {} - }, [_initProto7] = babelHelpers.applyDecs2203R(_class8, [[_dec2, 2, "noop"]], []).e, _class8))(); + }, [_initProto7] = babelHelpers.applyDecs2203R(_Dummy2, [[_dec2, 2, "noop"]], []).e, _Dummy2))(); } method() { return this.a; } } - _class7 = A; - [_initProto6] = babelHelpers.applyDecs2203R(_class7, [[dec, 2, "method"]], []).e; + _A6 = A; + [_initProto6] = babelHelpers.applyDecs2203R(_A6, [[dec, 2, "method"]], []).e; new A(); expect(log + "").toBe("111,12"); } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/valid-expression-formats/output.js index 8eed9894cf56..962ef99a87a6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/valid-expression-formats/output.js @@ -1,17 +1,14 @@ -var _initClass, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _initProto, _class; +var _initClass, _classDecs, _dec, _dec2, _dec3, _dec4, _initProto, _Foo2; const dec = () => {}; +_classDecs = [dec, call(), chain.expr(), arbitrary + expr, array[expr]]; _dec = call(); _dec2 = chain.expr(); _dec3 = arbitrary + expr; _dec4 = array[expr]; -_dec5 = call(); -_dec6 = chain.expr(); -_dec7 = arbitrary + expr; -_dec8 = array[expr]; let _Foo; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { writable: true, value: void 0 @@ -20,17 +17,17 @@ class Foo { } method() {} makeClass() { - var _dec9, _init_bar, _class2; - return _dec9 = babelHelpers.classPrivateFieldGet(this, _a), (_class2 = class Nested { + var _dec5, _init_bar, _Nested; + return _dec5 = babelHelpers.classPrivateFieldGet(this, _a), (_Nested = class Nested { constructor() { babelHelpers.defineProperty(this, "bar", _init_bar(this)); } - }, [_init_bar] = babelHelpers.applyDecs2203R(_class2, [[_dec9, 0, "bar"]], []).e, _class2); + }, [_init_bar] = babelHelpers.applyDecs2203R(_Nested, [[_dec5, 0, "bar"]], []).e, _Nested); } } -_class = Foo; +_Foo2 = Foo; ({ e: [_initProto], c: [_Foo, _initClass] -} = babelHelpers.applyDecs2203R(_class, [[[dec, _dec5, _dec6, _dec7, _dec8], 2, "method"]], [dec, _dec, _dec2, _dec3, _dec4])); +} = babelHelpers.applyDecs2203R(_Foo2, [[[dec, _dec, _dec2, _dec3, _dec4], 2, "method"]], _classDecs)); _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc/valid-expression-formats/output.js index 25b0468a6b44..b577e199b09f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc/valid-expression-formats/output.js @@ -1,31 +1,28 @@ -var _initClass, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _initProto; +var _initClass, _classDecs, _dec, _dec2, _dec3, _dec4, _initProto; const dec = () => {}; +_classDecs = [dec, call(), chain.expr(), arbitrary + expr, array[expr]]; _dec = call(); _dec2 = chain.expr(); _dec3 = arbitrary + expr; _dec4 = array[expr]; -_dec5 = call(); -_dec6 = chain.expr(); -_dec7 = arbitrary + expr; -_dec8 = array[expr]; let _Foo; class Foo { static { ({ e: [_initProto], c: [_Foo, _initClass] - } = babelHelpers.applyDecs2203R(this, [[[dec, _dec5, _dec6, _dec7, _dec8], 2, "method"]], [dec, _dec, _dec2, _dec3, _dec4])); + } = babelHelpers.applyDecs2203R(this, [[[dec, _dec, _dec2, _dec3, _dec4], 2, "method"]], _classDecs)); } - constructor(...args) { + constructor() { _initProto(this); } #a; method() {} makeClass() { - var _dec9, _init_bar; - return _dec9 = this.#a, class Nested { + var _dec5, _init_bar; + return _dec5 = this.#a, class Nested { static { - [_init_bar] = babelHelpers.applyDecs2203R(this, [[_dec9, 0, "bar"]], []).e; + [_init_bar] = babelHelpers.applyDecs2203R(this, [[_dec5, 0, "bar"]], []).e; } bar = _init_bar(this); }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/context-name/output.js index a78759d4142c..ef115ef3c915 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _call_a, _computedKey, _initStatic, _class; +var _call_a, _computedKey, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -20,7 +20,7 @@ class Foo { static set [3n](v) {} static set [_computedKey](v) {} } -_class = Foo; +_Foo = Foo; function _set_a(v) { _call_a(this, v); } @@ -29,7 +29,7 @@ var _a = { set: _set_a }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_class, [[dec, 9, "a"], [dec, 9, "a", function (v) {}], [dec, 9, "b"], [dec, 9, "c"], [dec, 9, 0], [dec, 9, 1], [dec, 9, 2n], [dec, 9, 3n], [dec, 9, _computedKey]], []).e; - _initStatic(_class); + [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 9, "a"], [dec, 9, "a", function (v) {}], [dec, 9, "b"], [dec, 9, "c"], [dec, 9, 0], [dec, 9, 1], [dec, 9, 2n], [dec, 9, 3n], [dec, 9, _computedKey]], []).e; + _initStatic(_Foo); })(); expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/private/output.js index 72213a7496e3..6d4caad719b1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/private/output.js @@ -1,8 +1,8 @@ -var _call_a, _initProto, _class; +var _call_a, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { get: void 0, set: _set_a @@ -14,10 +14,10 @@ class Foo { babelHelpers.classPrivateFieldSet(this, _a, v); } } -_class = Foo; +_Foo = Foo; function _set_a(v) { _call_a(this, v); } -[_call_a, _initProto] = babelHelpers.applyDecs2203R(_class, [[dec, 4, "a", function (v) { +[_call_a, _initProto] = babelHelpers.applyDecs2203R(_Foo, [[dec, 4, "a", function (v) { return this.value = v; }]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/public/output.js index 0e0137af5e8c..2ca1e39a57e6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/public/output.js @@ -1,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -12,5 +12,5 @@ class Foo { return this.value = v; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2203R(_class, [[dec, 4, "a"], [dec, 4, 'b']], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2203R(_Foo, [[dec, 4, "a"], [dec, 4, 'b']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-private/output.js index 249c05cece35..c42f68900d97 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-private/output.js @@ -1,11 +1,11 @@ -var _call_a, _initStatic, _class; +var _call_a, _initStatic, _Foo; const dec = () => {}; class Foo { static setA(v) { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); } } -_class = Foo; +_Foo = Foo; function _set_a(v) { _call_a(this, v); } @@ -14,9 +14,9 @@ var _a = { set: _set_a }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_class, [[dec, 9, "a", function (v) { + [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 9, "a", function (v) { return this.value = v; }]], []).e; - _initStatic(_class); + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-public/output.js index 5f963d1b58b6..aaef721c9819 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-public/output.js @@ -1,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static set a(v) { @@ -8,9 +8,9 @@ class Foo { return this.value = v; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs2203R(_class, [[dec, 9, "a"], [dec, 9, 'b']], []).e; - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 9, "a"], [dec, 9, 'b']], []).e; + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters/private/output.js index 90fdbc773eb4..3d5e8a01dc63 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters/private/output.js @@ -6,7 +6,7 @@ class Foo { return this.value = v; }]], []).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters/public/output.js index 78f8c3c11474..0aec9e16ccbb 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters/public/output.js @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2203R(this, [[dec, 4, "a"], [dec, 4, 'b']], []).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/context-name/output.js index edf6ae857575..4388ebe7ecdf 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _initStatic, _class; +var _init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -67,7 +67,7 @@ class Foo { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _I, v); } } -_class = Foo; +_Foo = Foo; function _set_a2(v) { _set_a(this, v); } @@ -75,43 +75,43 @@ function _get_a2() { return _get_a(this); } (() => { - [_init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7, _initStatic] = babelHelpers.applyDecs2301(_class, [[dec, 6, "a"], [dec, 6, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _class, _B), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _class, _B, v)], [dec, 6, "b"], [dec, 6, "c"], [dec, 6, 0], [dec, 6, 1], [dec, 6, 2n], [dec, 6, 3n], [dec, 6, _computedKey]], []).e; - _initStatic(_class); + [_init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 6, "a"], [dec, 6, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _B), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _B, v)], [dec, 6, "b"], [dec, 6, "c"], [dec, 6, 0], [dec, 6, 1], [dec, 6, 2n], [dec, 6, 3n], [dec, 6, _computedKey]], []).e; + _initStatic(_Foo); })(); var _A = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _B = { writable: true, - value: _init_a2(_class) + value: _init_a2(_Foo) }; var _C = { writable: true, - value: _init_computedKey(_class) + value: _init_computedKey(_Foo) }; var _D = { writable: true, - value: _init_computedKey2(_class) + value: _init_computedKey2(_Foo) }; var _E = { writable: true, - value: _init_computedKey3(_class) + value: _init_computedKey3(_Foo) }; var _F = { writable: true, - value: _init_computedKey4(_class) + value: _init_computedKey4(_Foo) }; var _G = { writable: true, - value: _init_computedKey5(_class) + value: _init_computedKey5(_Foo) }; var _H = { writable: true, - value: _init_computedKey6(_class) + value: _init_computedKey6(_Foo) }; var _I = { writable: true, - value: _init_computedKey7(_class) + value: _init_computedKey7(_Foo) }; expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/private/output.js index c7f2c8019ee2..a78dd2be2761 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/private/output.js @@ -1,4 +1,4 @@ -var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto, _class; +var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto, _Foo; const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); var _a = /*#__PURE__*/new WeakMap(); @@ -24,7 +24,7 @@ class Foo { }); } } -_class = Foo; +_Foo = Foo; function _set_a2(v) { _set_a(this, v); } @@ -37,4 +37,4 @@ function _set_b2(v) { function _get_b2() { return _get_b(this); } -[_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs2301(_class, [[dec, 1, "a", o => babelHelpers.classPrivateFieldGet(o, _A), (o, v) => babelHelpers.classPrivateFieldSet(o, _A, v)], [dec, 1, "b", o => babelHelpers.classPrivateFieldGet(o, _B), (o, v) => babelHelpers.classPrivateFieldSet(o, _B, v)]], [], _ => _a.has(babelHelpers.checkInRHS(_))).e; +[_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs2301(_Foo, [[dec, 1, "a", o => babelHelpers.classPrivateFieldGet(o, _A), (o, v) => babelHelpers.classPrivateFieldSet(o, _A, v)], [dec, 1, "b", o => babelHelpers.classPrivateFieldGet(o, _B), (o, v) => babelHelpers.classPrivateFieldSet(o, _B, v)]], [], _ => _a.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/public/output.js index 681defdd02cc..3958c9aed6e5 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/public/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_b, _init_computedKey, _initProto, _class; +var _init_a, _init_b, _init_computedKey, _initProto, _Foo; const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); var _B = /*#__PURE__*/new WeakMap(); @@ -37,5 +37,5 @@ class Foo { babelHelpers.classPrivateFieldSet(this, _C, v); } } -_class = Foo; -[_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs2301(_class, [[dec, 1, "a"], [dec, 1, "b"], [dec, 1, 'c']], []).e; +_Foo = Foo; +[_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs2301(_Foo, [[dec, 1, "a"], [dec, 1, "b"], [dec, 1, 'c']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-private/output.js index c4387eec496b..727c63d93a9b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-private/output.js @@ -1,4 +1,4 @@ -var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic, _class; +var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); var _b = /*#__PURE__*/new WeakMap(); @@ -14,7 +14,7 @@ class Foo { }); } } -_class = Foo; +_Foo = Foo; function _set_a2(v) { _set_a(this, v); } @@ -28,14 +28,14 @@ function _get_b2() { return _get_b(this); } (() => { - [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs2301(_class, [[dec, 6, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _class, _A), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _class, _A, v)], [dec, 6, "b", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _class, _B), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _class, _B, v)]], []).e; - _initStatic(_class); + [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 6, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _A), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _A, v)], [dec, 6, "b", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _B), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _B, v)]], []).e; + _initStatic(_Foo); })(); var _A = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _B = { writable: true, - value: _init_b(_class, 123) + value: _init_b(_Foo, 123) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-public/output.js index 57ce56259d51..7c84b8dedcd9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-public/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_b, _init_computedKey, _initStatic, _class; +var _init_a, _init_b, _init_computedKey, _initStatic, _Foo; const dec = () => {}; class Foo { static get a() { @@ -20,20 +20,20 @@ class Foo { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _C, v); } } -_class = Foo; +_Foo = Foo; (() => { - [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs2301(_class, [[dec, 6, "a"], [dec, 6, "b"], [dec, 6, 'c']], []).e; - _initStatic(_class); + [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 6, "a"], [dec, 6, "b"], [dec, 6, 'c']], []).e; + _initStatic(_Foo); })(); var _A = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _B = { writable: true, - value: _init_b(_class, 123) + value: _init_b(_Foo, 123) }; var _C = { writable: true, - value: _init_computedKey(_class, 456) + value: _init_computedKey(_Foo, 456) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-static-private/output.js index 965b9ed9d1b6..ae0ff8265ff9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-static-private/output.js @@ -1,18 +1,18 @@ -var _class; +var _Foo; const dec = () => {}; class Foo {} -_class = Foo; +_Foo = Foo; function _get_a() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _A); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _A); } function _set_a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _A, v); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _A, v); } function _get_b() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _B); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _B); } function _set_b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _B, v); + babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _B, v); } var _b = { get: _get_b, diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/decorator-access-modified-fields/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/decorator-access-modified-fields/output.js index c71f270be0e8..5cb3d0ea28c3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/decorator-access-modified-fields/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/decorator-access-modified-fields/output.js @@ -1,4 +1,4 @@ -var _initClass, _init_m, _class; +var _initClass, _init_m, _C2; var value; const classDec = Class => { value = new Class().p; @@ -11,9 +11,9 @@ class C { babelHelpers.defineProperty(this, "m", _init_m(this)); } } -_class = C; +_C2 = C; ({ e: [_init_m], c: [_C, _initClass] -} = babelHelpers.applyDecs2301(_class, [[memberDec, 0, "m"]], [classDec])); +} = babelHelpers.applyDecs2301(_C2, [[memberDec, 0, "m"]], [classDec])); _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/decorator-access-modified-methods/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/decorator-access-modified-methods/output.js index 2a9b25c6b548..b637652a11f3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/decorator-access-modified-methods/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/decorator-access-modified-methods/output.js @@ -1,4 +1,4 @@ -var _initClass, _initProto, _class; +var _initClass, _initProto, _C2; var value; const classDec = Class => { value = new Class().m(); @@ -7,14 +7,14 @@ const classDec = Class => { const memberDec = () => () => 42; let _C; class C { - constructor(...args) { + constructor() { _initProto(this); } m() {} } -_class = C; +_C2 = C; ({ e: [_initProto], c: [_C, _initClass] -} = babelHelpers.applyDecs2301(_class, [[memberDec, 2, "m"]], [classDec])); +} = babelHelpers.applyDecs2301(_C2, [[memberDec, 2, "m"]], [classDec])); _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/expressions-static-blocks/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/expressions-static-blocks/output.js index dab6c7d41d25..094578f69562 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/expressions-static-blocks/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/expressions-static-blocks/output.js @@ -1,73 +1,73 @@ -var _initClass, _A, _temp, _initClass2, _C, _temp2, _initClass3, _D, _temp3, _initClass4, _decorated_class, _temp4, _class5, _initClass5, _G, _temp5, _initClass6, _decorated_class2, _temp6, _class7, _initClass7, _H, _temp7, _initClass8, _K, _temp8; +var _initClass, _A, _temp, _initClass2, _C, _temp2, _initClass3, _D, _temp3, _initClass4, _decorated_class, _temp4, _Class2, _initClass5, _G, _temp5, _initClass6, _decorated_class2, _temp6, _Class3, _initClass7, _H, _temp7, _initClass8, _K, _temp8; const dec = () => {}; const A = (new (_temp = class extends babelHelpers.identity { constructor() { super(_A), (() => {})(), _initClass(); } -}, (_class2 => { +}, (_A2 => { class A {} - _class2 = A; - [_A, _initClass] = babelHelpers.applyDecs2301(_class2, [], [dec]).c; + _A2 = A; + [_A, _initClass] = babelHelpers.applyDecs2301(_A2, [], [dec]).c; })(), _temp)(), _A); const B = (new (_temp2 = class extends babelHelpers.identity { constructor() { super(_C), (() => {})(), _initClass2(); } -}, (_class3 => { +}, (_C2 => { class C {} - _class3 = C; - [_C, _initClass2] = babelHelpers.applyDecs2301(_class3, [], [dec]).c; + _C2 = C; + [_C, _initClass2] = babelHelpers.applyDecs2301(_C2, [], [dec]).c; })(), _temp2)(), _C); const D = (new (_temp3 = class extends babelHelpers.identity { constructor() { super(_D), (() => {})(), _initClass3(); } -}, (_class4 => { +}, (_D2 => { class D {} - _class4 = D; - [_D, _initClass3] = babelHelpers.applyDecs2301(_class4, [], [dec]).c; + _D2 = D; + [_D, _initClass3] = babelHelpers.applyDecs2301(_D2, [], [dec]).c; })(), _temp3)(), _D); const E = ((new (_temp4 = class extends babelHelpers.identity { constructor() { super(_decorated_class), (() => {})(), _initClass4(); } -}, (_class5 = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs2301(_class5, [], [dec]).c), _temp4)(), _decorated_class), 123); +}, (_Class2 = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs2301(_Class2, [], [dec]).c), _temp4)(), _decorated_class), 123); const F = [(new (_temp5 = class extends babelHelpers.identity { constructor() { super(_G), (() => {})(), _initClass5(); } -}, (_class6 => { +}, (_G2 => { class G {} - _class6 = G; - [_G, _initClass5] = babelHelpers.applyDecs2301(_class6, [], [dec]).c; + _G2 = G; + [_G, _initClass5] = babelHelpers.applyDecs2301(_G2, [], [dec]).c; })(), _temp5)(), _G), (new (_temp6 = class extends babelHelpers.identity { constructor() { super(_decorated_class2), (() => {})(), _initClass6(); } -}, (_class7 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs2301(_class7, [], [dec]).c), _temp6)(), _decorated_class2)]; +}, (_Class3 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs2301(_Class3, [], [dec]).c), _temp6)(), _decorated_class2)]; const H = (new (_temp7 = class extends babelHelpers.identity { constructor() { super(_H), (() => {})(), _initClass7(); } -}, (_class8 => { +}, (_H2 => { class H extends I {} - _class8 = H; - [_H, _initClass7] = babelHelpers.applyDecs2301(_class8, [], [dec]).c; + _H2 = H; + [_H, _initClass7] = babelHelpers.applyDecs2301(_H2, [], [dec]).c; })(), _temp7)(), _H); const J = (new (_temp8 = class extends babelHelpers.identity { constructor() { super(_K), (() => {})(), _initClass8(); } -}, (_class9 => { +}, (_K2 => { class K extends L {} - _class9 = K; - [_K, _initClass8] = babelHelpers.applyDecs2301(_class9, [], [dec]).c; + _K2 = K; + [_K, _initClass8] = babelHelpers.applyDecs2301(_K2, [], [dec]).c; })(), _temp8)(), _K); function classFactory() { - var _initClass9, _decorated_class3, _temp9, _class11; + var _initClass9, _decorated_class3, _temp9, _Class5; return new (_temp9 = class extends babelHelpers.identity { constructor() { super(_decorated_class3), (() => {})(), _initClass9(); } - }, (_class11 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs2301(_class11, [], [dec]).c), _temp9)(), _decorated_class3; + }, (_Class5 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs2301(_Class5, [], [dec]).c), _temp9)(), _decorated_class3; } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/expressions/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/expressions/output.js index 1549614786a8..f498ca759a32 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/expressions/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/expressions/output.js @@ -1,13 +1,13 @@ -var _initClass, _A, _class, _initClass2, _C, _class2, _initClass3, _D, _class3, _initClass4, _decorated_class, _class4, _initClass5, _G, _class5, _initClass6, _decorated_class2, _class6, _initClass7, _H, _class7, _initClass8, _K, _class8; +var _initClass, _A, _A2, _initClass2, _C, _C2, _initClass3, _D, _D2, _initClass4, _decorated_class, _Class, _initClass5, _G, _G2, _initClass6, _decorated_class2, _Class2, _initClass7, _H, _H2, _initClass8, _K, _K2; const dec = () => {}; -const A = ((_class = class A {}, [_A, _initClass] = babelHelpers.applyDecs2301(_class, [], [dec]).c, _initClass()), _A); -const B = ((_class2 = class C {}, [_C, _initClass2] = babelHelpers.applyDecs2301(_class2, [], [dec]).c, _initClass2()), _C); -const D = ((_class3 = class D {}, [_D, _initClass3] = babelHelpers.applyDecs2301(_class3, [], [dec]).c, _initClass3()), _D); -const E = (((_class4 = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs2301(_class4, [], [dec]).c, _initClass4()), _decorated_class), 123); -const F = [((_class5 = class G {}, [_G, _initClass5] = babelHelpers.applyDecs2301(_class5, [], [dec]).c, _initClass5()), _G), ((_class6 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs2301(_class6, [], [dec]).c, _initClass6()), _decorated_class2)]; -const H = ((_class7 = class H extends I {}, [_H, _initClass7] = babelHelpers.applyDecs2301(_class7, [], [dec]).c, _initClass7()), _H); -const J = ((_class8 = class K extends L {}, [_K, _initClass8] = babelHelpers.applyDecs2301(_class8, [], [dec]).c, _initClass8()), _K); +const A = ((_A2 = class A {}, [_A, _initClass] = babelHelpers.applyDecs2301(_A2, [], [dec]).c, _initClass()), _A); +const B = ((_C2 = class C {}, [_C, _initClass2] = babelHelpers.applyDecs2301(_C2, [], [dec]).c, _initClass2()), _C); +const D = ((_D2 = class D {}, [_D, _initClass3] = babelHelpers.applyDecs2301(_D2, [], [dec]).c, _initClass3()), _D); +const E = (((_Class = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs2301(_Class, [], [dec]).c, _initClass4()), _decorated_class), 123); +const F = [((_G2 = class G {}, [_G, _initClass5] = babelHelpers.applyDecs2301(_G2, [], [dec]).c, _initClass5()), _G), ((_Class2 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs2301(_Class2, [], [dec]).c, _initClass6()), _decorated_class2)]; +const H = ((_H2 = class H extends I {}, [_H, _initClass7] = babelHelpers.applyDecs2301(_H2, [], [dec]).c, _initClass7()), _H); +const J = ((_K2 = class K extends L {}, [_K, _initClass8] = babelHelpers.applyDecs2301(_K2, [], [dec]).c, _initClass8()), _K); function classFactory() { - var _initClass9, _decorated_class3, _class9; - return (_class9 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs2301(_class9, [], [dec]).c, _initClass9()), _decorated_class3; + var _initClass9, _decorated_class3, _Class3; + return (_Class3 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs2301(_Class3, [], [dec]).c, _initClass9()), _decorated_class3; } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/inheritance/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/inheritance/output.js index 517ecae1873e..6388278fc193 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/inheritance/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/inheritance/output.js @@ -1,13 +1,13 @@ -var _initClass, _class, _initClass2, _class2; +var _initClass, _Bar2, _initClass2, _Foo2; const dec1 = () => {}; const dec2 = () => {}; let _Bar; class Bar {} -_class = Bar; -[_Bar, _initClass] = babelHelpers.applyDecs2301(_class, [], [dec1]).c; +_Bar2 = Bar; +[_Bar, _initClass] = babelHelpers.applyDecs2301(_Bar2, [], [dec1]).c; _initClass(); let _Foo; class Foo extends _Bar {} -_class2 = Foo; -[_Foo, _initClass2] = babelHelpers.applyDecs2301(_class2, [], [dec2]).c; +_Foo2 = Foo; +[_Foo, _initClass2] = babelHelpers.applyDecs2301(_Foo2, [], [dec2]).c; _initClass2(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/initializers/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/initializers/output.js index 73b9821a4bca..cd3b2f57ab1a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/initializers/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/initializers/output.js @@ -5,10 +5,10 @@ new (_temp = class extends babelHelpers.identity { constructor() { (super(_Foo), babelHelpers.defineProperty(this, "field", 123)), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo {} - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs2301(_class2, [], [dec]).c; + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs2301(_Foo2, [], [dec]).c; })(), _temp)(); let _Bar; new (_temp2 = class extends babelHelpers.identity { @@ -17,8 +17,8 @@ new (_temp2 = class extends babelHelpers.identity { this.otherField = 456; })(), 123))), _initClass2(); } -}, (_class3 => { +}, (_Bar2 => { class Bar extends _Foo {} - _class3 = Bar; - [_Bar, _initClass2] = babelHelpers.applyDecs2301(_class3, [], [dec]).c; + _Bar2 = Bar; + [_Bar, _initClass2] = babelHelpers.applyDecs2301(_Bar2, [], [dec]).c; })(), _temp2)(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-static-installed-on-correct-class/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-static-installed-on-correct-class/output.js index 937f4dc0cbcf..da41a8179809 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-static-installed-on-correct-class/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-static-installed-on-correct-class/output.js @@ -12,11 +12,11 @@ new (_x = /*#__PURE__*/new WeakMap(), _m = /*#__PURE__*/new WeakSet(), (_temp = hasM = o => _m.has(babelHelpers.checkInRHS(o)); })(), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo { static m() {} } - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs2301(_class2, [], [dec]).c; + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs2301(_Foo2, [], [dec]).c; })(), _temp))(); function _m2() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-static-this/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-static-this/output.js index 6e457524c57c..e674c50a0598 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-static-this/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-static-this/output.js @@ -9,8 +9,8 @@ new (_temp = class extends babelHelpers.identity { this; })(), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo {} - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs2301(_class2, [], [dec]).c; + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs2301(_Foo2, [], [dec]).c; })(), _temp)(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-with-expr/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-with-expr/output.js index 4554f9e5d0be..573de9481133 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-with-expr/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-with-expr/output.js @@ -1,8 +1,8 @@ -var _initClass, _Bar, _class; +var _initClass, _Bar, _Bar2; const dec = () => {}; -const Foo = ((_class = class Bar { +const Foo = ((_Bar2 = class Bar { constructor() { babelHelpers.defineProperty(this, "bar", new _Bar()); } -}, [_Bar, _initClass] = babelHelpers.applyDecs2301(_class, [], [dec]).c, _initClass()), _Bar); +}, [_Bar, _initClass] = babelHelpers.applyDecs2301(_Bar2, [], [dec]).c, _initClass()), _Bar); const foo = new Foo(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement/output.js index acb61454b15d..13713b593434 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement/output.js @@ -5,9 +5,9 @@ new (_temp = class extends babelHelpers.identity { constructor() { (super(_Foo), babelHelpers.defineProperty(this, "foo", new _Foo())), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo {} - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs2301(_class2, [], [dec]).c; + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs2301(_Foo2, [], [dec]).c; })(), _temp)(); const foo = new _Foo(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes/decorator-access-modified-methods/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes/decorator-access-modified-methods/output.js index 6fc59bb2e887..6f8f1ec41735 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes/decorator-access-modified-methods/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes/decorator-access-modified-methods/output.js @@ -13,7 +13,7 @@ class C { c: [_C, _initClass] } = babelHelpers.applyDecs2301(this, [[memberDec, 2, "m"]], [classDec])); } - constructor(...args) { + constructor() { _initProto(this); } m() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes/inheritance/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes/inheritance/output.js index cea201b97aab..11e1dfd40f13 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes/inheritance/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes/inheritance/output.js @@ -1,20 +1,20 @@ -var _initClass, _dec, _initClass2, _dec2; +var _initClass, _classDecs, _initClass2, _classDecs2; const dec = () => {}; -_dec = dec1; +_classDecs = [dec1]; let _Bar; class Bar { static { - [_Bar, _initClass] = babelHelpers.applyDecs2301(this, [], [_dec]).c; + [_Bar, _initClass] = babelHelpers.applyDecs2301(this, [], _classDecs).c; } static { _initClass(); } } -_dec2 = dec2; +_classDecs2 = [dec2]; let _Foo; class Foo extends _Bar { static { - [_Foo, _initClass2] = babelHelpers.applyDecs2301(this, [], [_dec2]).c; + [_Foo, _initClass2] = babelHelpers.applyDecs2301(this, [], _classDecs2).c; } static { _initClass2(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/computed-keys-same-ast/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/computed-keys-same-ast/output.js index bcc80f0f9fbc..b7b5356dcb48 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/computed-keys-same-ast/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/computed-keys-same-ast/output.js @@ -1,9 +1,9 @@ -var _computedKey, _computedKey2, _initProto, _class; +var _computedKey, _computedKey2, _initProto, _Foo; const dec = () => {}; _computedKey = babelHelpers.toPropertyKey(getKey()); _computedKey2 = babelHelpers.toPropertyKey(getKey()); class Foo { - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { @@ -13,5 +13,5 @@ class Foo { return 2; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2301(_class, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2301(_Foo, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/computed-keys-same-value/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/computed-keys-same-value/output.js index 5cc275a7d86f..942d36275879 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/computed-keys-same-value/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/computed-keys-same-value/output.js @@ -1,9 +1,9 @@ -var _computedKey, _computedKey2, _initProto, _class; +var _computedKey, _computedKey2, _initProto, _Foo; const dec = () => {}; _computedKey = babelHelpers.toPropertyKey(getKeyI()); _computedKey2 = babelHelpers.toPropertyKey(getKeyJ()); class Foo { - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { @@ -13,5 +13,5 @@ class Foo { return 2; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2301(_class, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2301(_Foo, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/method-and-field/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/method-and-field/output.js index 5f65c0eae3f3..0da80438ea3e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/method-and-field/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/method-and-field/output.js @@ -1,4 +1,4 @@ -var _init_a, _initProto, _class; +var _init_a, _initProto, _Foo; const dec = () => {}; class Foo { constructor() { @@ -8,5 +8,5 @@ class Foo { return 1; } } -_class = Foo; -[_init_a, _initProto] = babelHelpers.applyDecs2301(_class, [[dec, 2, "a"], [dec, 0, "a"]], []).e; +_Foo = Foo; +[_init_a, _initProto] = babelHelpers.applyDecs2301(_Foo, [[dec, 2, "a"], [dec, 0, "a"]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/methods-with-same-key/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/methods-with-same-key/output.js index 809a6e4baeca..ced079e46f7d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/methods-with-same-key/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys--to-es2015/methods-with-same-key/output.js @@ -1,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { _initProto(this); } a() { @@ -11,5 +11,5 @@ class Foo { return 2; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2301(_class, [[dec, 2, "a"], [dec, 2, "a"]], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2301(_Foo, [[dec, 2, "a"], [dec, 2, "a"]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys/computed-keys-same-ast/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys/computed-keys-same-ast/output.js index fa080a2ee925..1a1bfcf287d9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys/computed-keys-same-ast/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys/computed-keys-same-ast/output.js @@ -6,7 +6,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2301(this, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; } - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys/computed-keys-same-value/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys/computed-keys-same-value/output.js index e29a241da999..402487430fd9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys/computed-keys-same-value/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys/computed-keys-same-value/output.js @@ -6,7 +6,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2301(this, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; } - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys/methods-with-same-key/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys/methods-with-same-key/output.js index 9e58c5937595..7545ea07783e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys/methods-with-same-key/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-duplicated-keys/methods-with-same-key/output.js @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2301(this, [[dec, 2, "a"], [dec, 2, "a"]], []).e; } - constructor(...args) { + constructor() { _initProto(this); } a() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-exported/default-anonymous/output.mjs b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-exported/default-anonymous/output.mjs index afde28517a72..e240c0c0f60e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-exported/default-anonymous/output.mjs +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-exported/default-anonymous/output.mjs @@ -1,9 +1,9 @@ -var _initClass, _dec; -_dec = dec; +var _initClass, _classDecs; +_classDecs = [dec]; let _A; class A { static { - [_A, _initClass] = babelHelpers.applyDecs2301(this, [], [_dec]).c; + [_A, _initClass] = babelHelpers.applyDecs2301(this, [], _classDecs).c; } static { _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-exported/default-named/output.mjs b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-exported/default-named/output.mjs index 38dea6e7fdb1..f3d47dd81201 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-exported/default-named/output.mjs +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-exported/default-named/output.mjs @@ -1,9 +1,9 @@ -var _initClass, _dec; -_dec = dec; +var _initClass, _classDecs; +_classDecs = [dec]; let _default2; class _default { static { - [_default2, _initClass] = babelHelpers.applyDecs2301(babelHelpers.setFunctionName(this, "default"), [], [_dec]).c; + [_default2, _initClass] = babelHelpers.applyDecs2301(babelHelpers.setFunctionName(this, "default"), [], _classDecs).c; } static { _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-exported/named/output.mjs b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-exported/named/output.mjs index 653433404830..c53312456c6e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-exported/named/output.mjs +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-exported/named/output.mjs @@ -1,9 +1,9 @@ -var _initClass, _dec; -_dec = dec; +var _initClass, _classDecs; +_classDecs = [dec]; let _A; class A { static { - [_A, _initClass] = babelHelpers.applyDecs2301(this, [], [_dec]).c; + [_A, _initClass] = babelHelpers.applyDecs2301(this, [], _classDecs).c; } static { _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/context-name/output.js index ea59e0633120..66b7ae24c225 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _class; +var _init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -11,18 +11,18 @@ const f = () => { }; _computedKey = babelHelpers.toPropertyKey(f()); class Foo {} -_class = Foo; -[_init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7] = babelHelpers.applyDecs2301(_class, [[dec, 5, "a"], [dec, 5, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _class, _a), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _class, _a, v)], [dec, 5, "b"], [dec, 5, "c"], [dec, 5, 0], [dec, 5, 1], [dec, 5, 2n], [dec, 5, 3n], [dec, 5, _computedKey]], []).e; -babelHelpers.defineProperty(Foo, "a", _init_a(_class)); +_Foo = Foo; +[_init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7] = babelHelpers.applyDecs2301(_Foo, [[dec, 5, "a"], [dec, 5, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _a), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _a, v)], [dec, 5, "b"], [dec, 5, "c"], [dec, 5, 0], [dec, 5, 1], [dec, 5, 2n], [dec, 5, 3n], [dec, 5, _computedKey]], []).e; +babelHelpers.defineProperty(Foo, "a", _init_a(_Foo)); var _a = { writable: true, - value: _init_a2(_class) + value: _init_a2(_Foo) }; -babelHelpers.defineProperty(Foo, "b", _init_computedKey(_class)); -babelHelpers.defineProperty(Foo, "c", _init_computedKey2(_class)); -babelHelpers.defineProperty(Foo, 0, _init_computedKey3(_class)); -babelHelpers.defineProperty(Foo, 1, _init_computedKey4(_class)); -babelHelpers.defineProperty(Foo, 2n, _init_computedKey5(_class)); -babelHelpers.defineProperty(Foo, 3n, _init_computedKey6(_class)); -babelHelpers.defineProperty(Foo, _computedKey, _init_computedKey7(_class)); +babelHelpers.defineProperty(Foo, "b", _init_computedKey(_Foo)); +babelHelpers.defineProperty(Foo, "c", _init_computedKey2(_Foo)); +babelHelpers.defineProperty(Foo, 0, _init_computedKey3(_Foo)); +babelHelpers.defineProperty(Foo, 1, _init_computedKey4(_Foo)); +babelHelpers.defineProperty(Foo, 2n, _init_computedKey5(_Foo)); +babelHelpers.defineProperty(Foo, 3n, _init_computedKey6(_Foo)); +babelHelpers.defineProperty(Foo, _computedKey, _init_computedKey7(_Foo)); expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/private/output.js index 72e2b0880945..e0434607f25d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/private/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_b, _class; +var _init_a, _init_b, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); var _b = /*#__PURE__*/new WeakMap(); @@ -14,5 +14,5 @@ class Foo { }); } } -_class = Foo; -[_init_a, _init_b] = babelHelpers.applyDecs2301(_class, [[dec, 0, "a", o => babelHelpers.classPrivateFieldGet(o, _a), (o, v) => babelHelpers.classPrivateFieldSet(o, _a, v)], [dec, 0, "b", o => babelHelpers.classPrivateFieldGet(o, _b), (o, v) => babelHelpers.classPrivateFieldSet(o, _b, v)]], [], _ => _b.has(babelHelpers.checkInRHS(_))).e; +_Foo = Foo; +[_init_a, _init_b] = babelHelpers.applyDecs2301(_Foo, [[dec, 0, "a", o => babelHelpers.classPrivateFieldGet(o, _a), (o, v) => babelHelpers.classPrivateFieldSet(o, _a, v)], [dec, 0, "b", o => babelHelpers.classPrivateFieldGet(o, _b), (o, v) => babelHelpers.classPrivateFieldSet(o, _b, v)]], [], _ => _b.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/public/output.js index 14b9239376a0..e970d8239873 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/public/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_b, _init_computedKey, _class; +var _init_a, _init_b, _init_computedKey, _Foo; const dec = () => {}; class Foo { constructor() { @@ -7,5 +7,5 @@ class Foo { babelHelpers.defineProperty(this, 'c', _init_computedKey(this, 456)); } } -_class = Foo; -[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs2301(_class, [[dec, 0, "a"], [dec, 0, "b"], [dec, 0, 'c']], []).e; +_Foo = Foo; +[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs2301(_Foo, [[dec, 0, "a"], [dec, 0, "b"], [dec, 0, 'c']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/static-private/output.js index 1b00c5af6edc..bf7635495e6a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/static-private/output.js @@ -1,13 +1,13 @@ -var _init_a, _init_b, _class; +var _init_a, _init_b, _Foo; const dec = () => {}; class Foo {} -_class = Foo; -[_init_a, _init_b] = babelHelpers.applyDecs2301(_class, [[dec, 5, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _class, _a), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _class, _a, v)], [dec, 5, "b", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _class, _b), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _class, _b, v)]], []).e; +_Foo = Foo; +[_init_a, _init_b] = babelHelpers.applyDecs2301(_Foo, [[dec, 5, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _a), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _a, v)], [dec, 5, "b", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _b), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _b, v)]], []).e; var _a = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _b = { writable: true, - value: _init_b(_class, 123) + value: _init_b(_Foo, 123) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/static-public/output.js index 9bba992772b8..11daa6a40de2 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/static-public/output.js @@ -1,8 +1,8 @@ -var _init_a, _init_b, _init_computedKey, _class; +var _init_a, _init_b, _init_computedKey, _Foo; const dec = () => {}; class Foo {} -_class = Foo; -[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs2301(_class, [[dec, 5, "a"], [dec, 5, "b"], [dec, 5, 'c']], []).e; -babelHelpers.defineProperty(Foo, "a", _init_a(_class)); -babelHelpers.defineProperty(Foo, "b", _init_b(_class, 123)); -babelHelpers.defineProperty(Foo, 'c', _init_computedKey(_class, 456)); +_Foo = Foo; +[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs2301(_Foo, [[dec, 5, "a"], [dec, 5, "b"], [dec, 5, 'c']], []).e; +babelHelpers.defineProperty(Foo, "a", _init_a(_Foo)); +babelHelpers.defineProperty(Foo, "b", _init_b(_Foo, 123)); +babelHelpers.defineProperty(Foo, 'c', _init_computedKey(_Foo, 456)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/context-name/output.js index d6976db45b36..c1b22686c857 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _call_a, _computedKey, _initStatic, _class; +var _call_a, _computedKey, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -20,7 +20,7 @@ class Foo { static get [3n]() {} static get [_computedKey]() {} } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } @@ -29,7 +29,7 @@ var _a = { set: void 0 }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2301(_class, [[dec, 8, "a"], [dec, 8, "a", function () {}], [dec, 8, "b"], [dec, 8, "c"], [dec, 8, 0], [dec, 8, 1], [dec, 8, 2n], [dec, 8, 3n], [dec, 8, _computedKey]], []).e; - _initStatic(_class); + [_call_a, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 8, "a"], [dec, 8, "a", function () {}], [dec, 8, "b"], [dec, 8, "c"], [dec, 8, 0], [dec, 8, 1], [dec, 8, 2n], [dec, 8, 3n], [dec, 8, _computedKey]], []).e; + _initStatic(_Foo); })(); expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/private/output.js index 0e24d3f0c8ba..56b9d18eb4b4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/private/output.js @@ -1,8 +1,8 @@ -var _call_a, _initProto, _class; +var _call_a, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { get: _get_a, set: void 0 @@ -14,10 +14,10 @@ class Foo { return babelHelpers.classPrivateFieldGet(this, _a); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } -[_call_a, _initProto] = babelHelpers.applyDecs2301(_class, [[dec, 3, "a", function () { +[_call_a, _initProto] = babelHelpers.applyDecs2301(_Foo, [[dec, 3, "a", function () { return this.value; }]], [], _ => _a.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/public/output.js index 6b8f067b06cc..7dbf738ad476 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/public/output.js @@ -1,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -12,5 +12,5 @@ class Foo { return this.value; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2301(_class, [[dec, 3, "a"], [dec, 3, 'b']], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2301(_Foo, [[dec, 3, "a"], [dec, 3, 'b']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/static-private/output.js index f0ce2747dcb0..0d704a2fbe57 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/static-private/output.js @@ -1,11 +1,11 @@ -var _call_a, _initStatic, _class; +var _call_a, _initStatic, _Foo; const dec = () => {}; class Foo { static getA() { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } @@ -14,9 +14,9 @@ var _a = { set: void 0 }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2301(_class, [[dec, 8, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 8, "a", function () { return this.value; }]], []).e; - _initStatic(_class); + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/static-public/output.js index a3443994cd04..e43bc8cfeb5b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/static-public/output.js @@ -1,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static get a() { @@ -8,9 +8,9 @@ class Foo { return this.value; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs2301(_class, [[dec, 8, "a"], [dec, 8, 'b']], []).e; - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 8, "a"], [dec, 8, 'b']], []).e; + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/private/output.js index e3a03d3c8ca3..c11a7d7d8682 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/private/output.js @@ -1,8 +1,8 @@ -var _call_a, _call_a2, _initProto, _class; +var _call_a, _call_a2, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { get: _get_a, set: _set_a @@ -17,14 +17,14 @@ class Foo { babelHelpers.classPrivateFieldSet(this, _a, v); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } function _set_a(v) { _call_a2(this, v); } -[_call_a, _call_a2, _initProto] = babelHelpers.applyDecs2301(_class, [[dec, 3, "a", function () { +[_call_a, _call_a2, _initProto] = babelHelpers.applyDecs2301(_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/2023-01-getters-and-setters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/public/output.js index 30950332713d..782fe19ccef5 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/public/output.js @@ -1,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -18,5 +18,5 @@ class Foo { this.value = v; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2301(_class, [[dec, 3, "a"], [dec, 4, "a"], [dec, 3, 'b'], [dec, 4, 'b']], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2301(_Foo, [[dec, 3, "a"], [dec, 4, "a"], [dec, 3, 'b'], [dec, 4, 'b']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/static-private/output.js index 96e8b63d2fa6..cf1e8bc2b415 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/static-private/output.js @@ -1,4 +1,4 @@ -var _call_a, _call_a2, _initStatic, _class; +var _call_a, _call_a2, _initStatic, _Foo; const dec = () => {}; class Foo { static getA() { @@ -8,7 +8,7 @@ class Foo { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } @@ -20,11 +20,11 @@ var _a = { set: _set_a }; (() => { - [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs2301(_class, [[dec, 8, "a", function () { + [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 8, "a", function () { return this.value; }], [dec, 9, "a", function (v) { this.value = v; }]], []).e; - _initStatic(_class); + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/static-public/output.js index b769e28a65e3..4c2e689c4b83 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/static-public/output.js @@ -1,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static get a() { @@ -14,9 +14,9 @@ class Foo { this.value = v; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs2301(_class, [[dec, 8, "a"], [dec, 9, "a"], [dec, 8, 'b'], [dec, 9, 'b']], []).e; - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 8, "a"], [dec, 9, "a"], [dec, 8, 'b'], [dec, 9, 'b']], []).e; + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters/private/output.js index d3e63656c91c..9c5dbe4d83a4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters/private/output.js @@ -8,7 +8,7 @@ class Foo { this.value = v; }]], [], _ => #a in _).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters/public/output.js index 99af42123ab4..6603960496c9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters/public/output.js @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2301(this, [[dec, 3, "a"], [dec, 4, "a"], [dec, 3, 'b'], [dec, 4, 'b']], []).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters/private/output.js index aa2ee78b680a..733ca2a17e3e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters/private/output.js @@ -6,7 +6,7 @@ class Foo { return this.value; }]], [], _ => #a in _).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters/public/output.js index 1a0c4519252b..bdd0120fbd9f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters/public/output.js @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2301(this, [[dec, 3, "a"], [dec, 3, 'b']], []).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/context-name/output.js index 94e260399dcf..7e963f03ed3a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _call_a, _computedKey, _initStatic, _class; +var _call_a, _computedKey, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -20,10 +20,10 @@ class Foo { static [3n]() {} static [_computedKey]() {} } -_class = Foo; +_Foo = Foo; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2301(_class, [[dec, 7, "a"], [dec, 7, "a", function () {}], [dec, 7, "b"], [dec, 7, "c"], [dec, 7, 0], [dec, 7, 1], [dec, 7, 2n], [dec, 7, 3n], [dec, 7, _computedKey]], []).e; - _initStatic(_class); + [_call_a, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 7, "a"], [dec, 7, "a", function () {}], [dec, 7, "b"], [dec, 7, "c"], [dec, 7, 0], [dec, 7, 1], [dec, 7, 2n], [dec, 7, 3n], [dec, 7, _computedKey]], []).e; + _initStatic(_Foo); })(); var _a = { writable: true, diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/private/output.js index 884da6448eda..dc7403a91382 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/private/output.js @@ -1,8 +1,8 @@ -var _call_a, _initProto, _class; +var _call_a, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { writable: true, value: _call_a @@ -14,7 +14,7 @@ class Foo { return babelHelpers.classPrivateFieldGet(this, _a).call(this); } } -_class = Foo; -[_call_a, _initProto] = babelHelpers.applyDecs2301(_class, [[dec, 2, "a", function () { +_Foo = Foo; +[_call_a, _initProto] = babelHelpers.applyDecs2301(_Foo, [[dec, 2, "a", function () { return this.value; }]], [], _ => _a.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/public/output.js index 52d7070a8dea..52bc152665b9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/public/output.js @@ -1,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -12,5 +12,5 @@ class Foo { return this.value; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2301(_class, [[dec, 2, "a"], [dec, 2, 'b']], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2301(_Foo, [[dec, 2, "a"], [dec, 2, 'b']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/static-private/output.js index 6bfb39649324..4abf178ce2e1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/static-private/output.js @@ -1,16 +1,16 @@ -var _call_a, _initStatic, _class; +var _call_a, _initStatic, _Foo; const dec = () => {}; class Foo { static callA() { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a).call(this); } } -_class = Foo; +_Foo = Foo; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2301(_class, [[dec, 7, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 7, "a", function () { return this.value; }]], []).e; - _initStatic(_class); + _initStatic(_Foo); })(); var _a = { writable: true, diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/static-public/output.js index d9fe3b22d307..55438df77b41 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/static-public/output.js @@ -1,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static a() { @@ -8,9 +8,9 @@ class Foo { return this.value; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs2301(_class, [[dec, 7, "a"], [dec, 7, 'b']], []).e; - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 7, "a"], [dec, 7, 'b']], []).e; + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods/private/output.js index 1a093ee88e38..24eb8595d25e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods/private/output.js @@ -6,7 +6,7 @@ class Foo { return this.value; }]], [], _ => #a in _).e; } - constructor(...args) { + constructor() { _initProto(this); } #a = _call_a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods/public/output.js index eaa33ae7b859..0461062f7c14 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods/public/output.js @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2301(this, [[dec, 2, "a"], [dec, 2, 'b']], []).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc--to-es2015/initProto-existing-derived-constructor/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc--to-es2015/initProto-existing-derived-constructor/output.js index 7b85c17497db..0bf4f2e73758 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc--to-es2015/initProto-existing-derived-constructor/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc--to-es2015/initProto-existing-derived-constructor/output.js @@ -1,5 +1,5 @@ { - var _initProto, _class; + var _initProto, _A; let self, a, initCalled; function deco(_, context) { context.addInitializer(() => { @@ -18,8 +18,8 @@ } method() {} } - _class = A; - [_initProto] = babelHelpers.applyDecs2301(_class, [[deco, 2, "method"]], []).e; + _A = A; + [_initProto] = babelHelpers.applyDecs2301(_A, [[deco, 2, "method"]], []).e; let instance = new A(); expect(self).toBe(instance); expect(a).toBe(2); @@ -40,7 +40,7 @@ } } { - var _initProto2, _class2; + var _initProto2, _A2; "super() nested within another constructor should not be transformed"; let log = []; class A extends B { @@ -56,8 +56,8 @@ return this.a; } } - _class2 = A; - [_initProto2] = babelHelpers.applyDecs2301(_class2, [[dec, 2, "method"]], []).e; + _A2 = A; + [_initProto2] = babelHelpers.applyDecs2301(_A2, [[dec, 2, "method"]], []).e; new A(); expect(log + "").toBe("103,4"); } @@ -66,7 +66,7 @@ let log = []; new class Dummy extends B { constructor() { - var _computedKey, _initProto3, _class3; + var _computedKey, _initProto3, _A3; let key; _computedKey = babelHelpers.toPropertyKey((key = super(5).method(), log.push(key), key)); class A extends B { @@ -77,8 +77,8 @@ return this.a; } } - _class3 = A; - [_initProto3] = babelHelpers.applyDecs2301(_class3, [[dec, 2, "method"]], []).e; + _A3 = A; + [_initProto3] = babelHelpers.applyDecs2301(_A3, [[dec, 2, "method"]], []).e; new A(); } }(); @@ -90,7 +90,7 @@ const noop = () => fn => fn; new class extends B { constructor() { - var _dec, _initProto4, _class4; + var _dec, _initProto4, _A4; _dec = noop(log.push(super(7).method())); class A extends B { constructor() { @@ -101,15 +101,15 @@ } noop() {} } - _class4 = A; - [_initProto4] = babelHelpers.applyDecs2301(_class4, [[dec, 2, "method"], [_dec, 2, "noop"]], []).e; + _A4 = A; + [_initProto4] = babelHelpers.applyDecs2301(_A4, [[dec, 2, "method"], [_dec, 2, "noop"]], []).e; new A(); } }(); expect(log + "").toBe("7,108"); } { - var _initProto5, _class5; + var _initProto5, _A5; "super() within decorated derived constructor should be transformed: computed key"; let log = []; class A extends B { @@ -126,32 +126,32 @@ return this.a; } } - _class5 = A; - [_initProto5] = babelHelpers.applyDecs2301(_class5, [[dec, 2, "method"]], []).e; + _A5 = A; + [_initProto5] = babelHelpers.applyDecs2301(_A5, [[dec, 2, "method"]], []).e; new A(); expect(log + "").toBe("109,10"); } { - var _initProto6, _class7; + var _initProto6, _A6; "super() within decorated derived constructor should be transformed: decorator expression"; let log = []; const noop = () => fn => fn; class A extends B { constructor() { - var _dec2, _initProto7, _class8; - new (_dec2 = noop(log.push(_initProto6(super(11)).method())), (_class8 = class Dummy extends B { + var _dec2, _initProto7, _Dummy2; + new (_dec2 = noop(log.push(_initProto6(super(11)).method())), (_Dummy2 = class Dummy extends B { constructor() { log.push(_initProto7(super(12)).method()); } noop() {} - }, [_initProto7] = babelHelpers.applyDecs2301(_class8, [[_dec2, 2, "noop"]], []).e, _class8))(); + }, [_initProto7] = babelHelpers.applyDecs2301(_Dummy2, [[_dec2, 2, "noop"]], []).e, _Dummy2))(); } method() { return this.a; } } - _class7 = A; - [_initProto6] = babelHelpers.applyDecs2301(_class7, [[dec, 2, "method"]], []).e; + _A6 = A; + [_initProto6] = babelHelpers.applyDecs2301(_A6, [[dec, 2, "method"]], []).e; new A(); expect(log + "").toBe("111,12"); } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc--to-es2015/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc--to-es2015/valid-expression-formats/output.js index a784b7d07773..483f9a944e0c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc--to-es2015/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc--to-es2015/valid-expression-formats/output.js @@ -1,17 +1,14 @@ -var _initClass, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _initProto, _class; +var _initClass, _classDecs, _dec, _dec2, _dec3, _dec4, _initProto, _Foo2; const dec = () => {}; +_classDecs = [dec, call(), chain.expr(), arbitrary + expr, array[expr]]; _dec = call(); _dec2 = chain.expr(); _dec3 = arbitrary + expr; _dec4 = array[expr]; -_dec5 = call(); -_dec6 = chain.expr(); -_dec7 = arbitrary + expr; -_dec8 = array[expr]; let _Foo; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { writable: true, value: void 0 @@ -20,17 +17,17 @@ class Foo { } method() {} makeClass() { - var _dec9, _init_bar, _class2; - return _dec9 = babelHelpers.classPrivateFieldGet(this, _a), (_class2 = class Nested { + var _dec5, _init_bar, _Nested; + return _dec5 = babelHelpers.classPrivateFieldGet(this, _a), (_Nested = class Nested { constructor() { babelHelpers.defineProperty(this, "bar", _init_bar(this)); } - }, [_init_bar] = babelHelpers.applyDecs2301(_class2, [[_dec9, 0, "bar"]], []).e, _class2); + }, [_init_bar] = babelHelpers.applyDecs2301(_Nested, [[_dec5, 0, "bar"]], []).e, _Nested); } } -_class = Foo; +_Foo2 = Foo; ({ e: [_initProto], c: [_Foo, _initClass] -} = babelHelpers.applyDecs2301(_class, [[[dec, _dec5, _dec6, _dec7, _dec8], 2, "method"]], [dec, _dec, _dec2, _dec3, _dec4])); +} = babelHelpers.applyDecs2301(_Foo2, [[[dec, _dec, _dec2, _dec3, _dec4], 2, "method"]], _classDecs)); _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc/valid-expression-formats/output.js index 049fe9632211..1b0c31cb8029 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc/valid-expression-formats/output.js @@ -1,31 +1,28 @@ -var _initClass, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _initProto; +var _initClass, _classDecs, _dec, _dec2, _dec3, _dec4, _initProto; const dec = () => {}; +_classDecs = [dec, call(), chain.expr(), arbitrary + expr, array[expr]]; _dec = call(); _dec2 = chain.expr(); _dec3 = arbitrary + expr; _dec4 = array[expr]; -_dec5 = call(); -_dec6 = chain.expr(); -_dec7 = arbitrary + expr; -_dec8 = array[expr]; let _Foo; class Foo { static { ({ e: [_initProto], c: [_Foo, _initClass] - } = babelHelpers.applyDecs2301(this, [[[dec, _dec5, _dec6, _dec7, _dec8], 2, "method"]], [dec, _dec, _dec2, _dec3, _dec4])); + } = babelHelpers.applyDecs2301(this, [[[dec, _dec, _dec2, _dec3, _dec4], 2, "method"]], _classDecs)); } - constructor(...args) { + constructor() { _initProto(this); } #a; method() {} makeClass() { - var _dec9, _init_bar; - return _dec9 = this.#a, class Nested { + var _dec5, _init_bar; + return _dec5 = this.#a, class Nested { static { - [_init_bar] = babelHelpers.applyDecs2301(this, [[_dec9, 0, "bar"]], []).e; + [_init_bar] = babelHelpers.applyDecs2301(this, [[_dec5, 0, "bar"]], []).e; } bar = _init_bar(this); }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/context-name/output.js index 9deb166b64aa..0d20ecb86abe 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _call_a, _computedKey, _initStatic, _class; +var _call_a, _computedKey, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -20,7 +20,7 @@ class Foo { static set [3n](v) {} static set [_computedKey](v) {} } -_class = Foo; +_Foo = Foo; function _set_a(v) { _call_a(this, v); } @@ -29,7 +29,7 @@ var _a = { set: _set_a }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2301(_class, [[dec, 9, "a"], [dec, 9, "a", function (v) {}], [dec, 9, "b"], [dec, 9, "c"], [dec, 9, 0], [dec, 9, 1], [dec, 9, 2n], [dec, 9, 3n], [dec, 9, _computedKey]], []).e; - _initStatic(_class); + [_call_a, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 9, "a"], [dec, 9, "a", function (v) {}], [dec, 9, "b"], [dec, 9, "c"], [dec, 9, 0], [dec, 9, 1], [dec, 9, 2n], [dec, 9, 3n], [dec, 9, _computedKey]], []).e; + _initStatic(_Foo); })(); expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/private/output.js index 1a5fd7bc0663..955c53f3c146 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/private/output.js @@ -1,8 +1,8 @@ -var _call_a, _initProto, _class; +var _call_a, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { get: void 0, set: _set_a @@ -14,10 +14,10 @@ class Foo { babelHelpers.classPrivateFieldSet(this, _a, v); } } -_class = Foo; +_Foo = Foo; function _set_a(v) { _call_a(this, v); } -[_call_a, _initProto] = babelHelpers.applyDecs2301(_class, [[dec, 4, "a", function (v) { +[_call_a, _initProto] = babelHelpers.applyDecs2301(_Foo, [[dec, 4, "a", function (v) { return this.value = v; }]], [], _ => _a.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/public/output.js index 81352f755061..76ea251c40b3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/public/output.js @@ -1,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -12,5 +12,5 @@ class Foo { return this.value = v; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2301(_class, [[dec, 4, "a"], [dec, 4, 'b']], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2301(_Foo, [[dec, 4, "a"], [dec, 4, 'b']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/static-private/output.js index 9f45d76eb526..9c31c0d8dbff 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/static-private/output.js @@ -1,11 +1,11 @@ -var _call_a, _initStatic, _class; +var _call_a, _initStatic, _Foo; const dec = () => {}; class Foo { static setA(v) { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); } } -_class = Foo; +_Foo = Foo; function _set_a(v) { _call_a(this, v); } @@ -14,9 +14,9 @@ var _a = { set: _set_a }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2301(_class, [[dec, 9, "a", function (v) { + [_call_a, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 9, "a", function (v) { return this.value = v; }]], []).e; - _initStatic(_class); + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/static-public/output.js index 7af103f393c1..43536b00688c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/static-public/output.js @@ -1,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static set a(v) { @@ -8,9 +8,9 @@ class Foo { return this.value = v; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs2301(_class, [[dec, 9, "a"], [dec, 9, 'b']], []).e; - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 9, "a"], [dec, 9, 'b']], []).e; + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters/private/output.js index d95063e256e6..b54a24957d89 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters/private/output.js @@ -6,7 +6,7 @@ class Foo { return this.value = v; }]], [], _ => #a in _).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters/public/output.js index 89a00183efd6..d9b498c62205 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters/public/output.js @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2301(this, [[dec, 4, "a"], [dec, 4, 'b']], []).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/context-name/output.js index e177ac33c11d..e2bf61d00532 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _initStatic, _class; +var _init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -67,7 +67,7 @@ class Foo { babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _I, v); } } -_class = Foo; +_Foo = Foo; function _set_a2(v) { _set_a(this, v); } @@ -75,43 +75,43 @@ function _get_a2() { return _get_a(this); } (() => { - [_init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7, _initStatic] = babelHelpers.applyDecs2305(_class, [[dec, 9, "a"], [dec, 9, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _class, _B), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _class, _B, v)], [dec, 9, "b"], [dec, 9, "c"], [dec, 9, 0], [dec, 9, 1], [dec, 9, 2n], [dec, 9, 3n], [dec, 9, _computedKey]], []).e; - _initStatic(_class); + [_init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 9, "a"], [dec, 9, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _B), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _B, v)], [dec, 9, "b"], [dec, 9, "c"], [dec, 9, 0], [dec, 9, 1], [dec, 9, 2n], [dec, 9, 3n], [dec, 9, _computedKey]], []).e; + _initStatic(_Foo); })(); var _A = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _B = { writable: true, - value: _init_a2(_class) + value: _init_a2(_Foo) }; var _C = { writable: true, - value: _init_computedKey(_class) + value: _init_computedKey(_Foo) }; var _D = { writable: true, - value: _init_computedKey2(_class) + value: _init_computedKey2(_Foo) }; var _E = { writable: true, - value: _init_computedKey3(_class) + value: _init_computedKey3(_Foo) }; var _F = { writable: true, - value: _init_computedKey4(_class) + value: _init_computedKey4(_Foo) }; var _G = { writable: true, - value: _init_computedKey5(_class) + value: _init_computedKey5(_Foo) }; var _H = { writable: true, - value: _init_computedKey6(_class) + value: _init_computedKey6(_Foo) }; var _I = { writable: true, - value: _init_computedKey7(_class) + value: _init_computedKey7(_Foo) }; expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/private/output.js index 28f76f6f2275..9786c4940369 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/private/output.js @@ -1,4 +1,4 @@ -var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto, _class; +var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto, _Foo; const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); var _a = /*#__PURE__*/new WeakMap(); @@ -24,7 +24,7 @@ class Foo { }); } } -_class = Foo; +_Foo = Foo; function _set_a2(v) { _set_a(this, v); } @@ -37,4 +37,4 @@ function _set_b2(v) { function _get_b2() { return _get_b(this); } -[_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs2305(_class, [[dec, 1, "a", o => babelHelpers.classPrivateFieldGet(o, _A), (o, v) => babelHelpers.classPrivateFieldSet(o, _A, v)], [dec, 1, "b", o => babelHelpers.classPrivateFieldGet(o, _B), (o, v) => babelHelpers.classPrivateFieldSet(o, _B, v)]], [], 0, _ => _a.has(babelHelpers.checkInRHS(_))).e; +[_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs2305(_Foo, [[dec, 1, "a", o => babelHelpers.classPrivateFieldGet(o, _A), (o, v) => babelHelpers.classPrivateFieldSet(o, _A, v)], [dec, 1, "b", o => babelHelpers.classPrivateFieldGet(o, _B), (o, v) => babelHelpers.classPrivateFieldSet(o, _B, v)]], [], 0, _ => _a.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/public/output.js index d1e0ffee32df..7da8c40e378a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/public/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_b, _init_computedKey, _initProto, _class; +var _init_a, _init_b, _init_computedKey, _initProto, _Foo; const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); var _B = /*#__PURE__*/new WeakMap(); @@ -37,5 +37,5 @@ class Foo { babelHelpers.classPrivateFieldSet(this, _C, v); } } -_class = Foo; -[_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs2305(_class, [[dec, 1, "a"], [dec, 1, "b"], [dec, 1, 'c']], []).e; +_Foo = Foo; +[_init_a, _init_b, _init_computedKey, _initProto] = babelHelpers.applyDecs2305(_Foo, [[dec, 1, "a"], [dec, 1, "b"], [dec, 1, 'c']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-private/output.js index d4dd8e0d614a..bed16262901d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-private/output.js @@ -1,4 +1,4 @@ -var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic, _class; +var _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); var _b = /*#__PURE__*/new WeakMap(); @@ -14,7 +14,7 @@ class Foo { }); } } -_class = Foo; +_Foo = Foo; function _set_a2(v) { _set_a(this, v); } @@ -28,14 +28,14 @@ function _get_b2() { return _get_b(this); } (() => { - [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs2305(_class, [[dec, 9, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _class, _A), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _class, _A, v)], [dec, 9, "b", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _class, _B), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _class, _B, v)]], []).e; - _initStatic(_class); + [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 9, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _A), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _A, v)], [dec, 9, "b", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _B), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _B, v)]], []).e; + _initStatic(_Foo); })(); var _A = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _B = { writable: true, - value: _init_b(_class, 123) + value: _init_b(_Foo, 123) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-public/output.js index 73cb6b2bc5c0..6f731c7bbe76 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-public/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_b, _init_computedKey, _initStatic, _class; +var _init_a, _init_b, _init_computedKey, _initStatic, _Foo; const dec = () => {}; class Foo { static get a() { @@ -20,20 +20,20 @@ class Foo { babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _C, v); } } -_class = Foo; +_Foo = Foo; (() => { - [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs2305(_class, [[dec, 9, "a"], [dec, 9, "b"], [dec, 9, 'c']], []).e; - _initStatic(_class); + [_init_a, _init_b, _init_computedKey, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 9, "a"], [dec, 9, "b"], [dec, 9, 'c']], []).e; + _initStatic(_Foo); })(); var _A = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _B = { writable: true, - value: _init_b(_class, 123) + value: _init_b(_Foo, 123) }; var _C = { writable: true, - value: _init_computedKey(_class, 456) + value: _init_computedKey(_Foo, 456) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-static-private/output.js index 675adc1f2261..8f07059b17a4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-static-private/output.js @@ -1,18 +1,18 @@ -var _class; +var _Foo; const dec = () => {}; class Foo {} -_class = Foo; +_Foo = Foo; function _get_a() { - return babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _A); + return babelHelpers.classStaticPrivateFieldSpecGet(_Foo, _Foo, _A); } function _set_a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(_class, _class, _A, v); + babelHelpers.classStaticPrivateFieldSpecSet(_Foo, _Foo, _A, v); } function _get_b() { - return babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _B); + return babelHelpers.classStaticPrivateFieldSpecGet(_Foo, _Foo, _B); } function _set_b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(_class, _class, _B, v); + babelHelpers.classStaticPrivateFieldSpecSet(_Foo, _Foo, _B, v); } var _b = { get: _get_b, diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/decorator-access-modified-fields/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/decorator-access-modified-fields/output.js index 28040e7c7579..7bf9bf79afcd 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/decorator-access-modified-fields/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/decorator-access-modified-fields/output.js @@ -1,4 +1,4 @@ -var _initClass, _init_m, _class; +var _initClass, _init_m, _C2; var value; const classDec = Class => { value = new Class().p; @@ -11,9 +11,9 @@ class C { babelHelpers.defineProperty(this, "m", _init_m(this)); } } -_class = C; +_C2 = C; ({ e: [_init_m], c: [_C, _initClass] -} = babelHelpers.applyDecs2305(_class, [[memberDec, 0, "m"]], [classDec])); +} = babelHelpers.applyDecs2305(_C2, [[memberDec, 0, "m"]], [classDec])); _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/decorator-access-modified-methods/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/decorator-access-modified-methods/output.js index 7e124e2a82f8..9453a135f947 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/decorator-access-modified-methods/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/decorator-access-modified-methods/output.js @@ -1,4 +1,4 @@ -var _initClass, _initProto, _class; +var _initClass, _initProto, _C2; var value; const classDec = Class => { value = new Class().m(); @@ -7,14 +7,14 @@ const classDec = Class => { const memberDec = () => () => 42; let _C; class C { - constructor(...args) { + constructor() { _initProto(this); } m() {} } -_class = C; +_C2 = C; ({ e: [_initProto], c: [_C, _initClass] -} = babelHelpers.applyDecs2305(_class, [[memberDec, 2, "m"]], [classDec])); +} = babelHelpers.applyDecs2305(_C2, [[memberDec, 2, "m"]], [classDec])); _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/expressions-static-blocks/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/expressions-static-blocks/output.js index d1d114a95710..d6df0f071d05 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/expressions-static-blocks/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/expressions-static-blocks/output.js @@ -1,73 +1,73 @@ -var _initClass, _A, _temp, _initClass2, _C, _temp2, _initClass3, _D, _temp3, _initClass4, _decorated_class, _temp4, _class5, _initClass5, _G, _temp5, _initClass6, _decorated_class2, _temp6, _class7, _initClass7, _H, _I, _temp7, _initClass8, _K, _L, _temp8; +var _initClass, _A, _temp, _initClass2, _C, _temp2, _initClass3, _D, _temp3, _initClass4, _decorated_class, _temp4, _Class2, _initClass5, _G, _temp5, _initClass6, _decorated_class2, _temp6, _Class3, _initClass7, _H, _I, _temp7, _initClass8, _K, _L, _temp8; const dec = () => {}; const A = (new (_temp = class extends babelHelpers.identity { constructor() { super(_A), (() => {})(), _initClass(); } -}, (_class2 => { +}, (_A2 => { class A {} - _class2 = A; - [_A, _initClass] = babelHelpers.applyDecs2305(_class2, [], [dec]).c; + _A2 = A; + [_A, _initClass] = babelHelpers.applyDecs2305(_A2, [], [dec]).c; })(), _temp)(), _A); const B = (new (_temp2 = class extends babelHelpers.identity { constructor() { super(_C), (() => {})(), _initClass2(); } -}, (_class3 => { +}, (_C2 => { class C {} - _class3 = C; - [_C, _initClass2] = babelHelpers.applyDecs2305(_class3, [], [dec]).c; + _C2 = C; + [_C, _initClass2] = babelHelpers.applyDecs2305(_C2, [], [dec]).c; })(), _temp2)(), _C); const D = (new (_temp3 = class extends babelHelpers.identity { constructor() { super(_D), (() => {})(), _initClass3(); } -}, (_class4 => { +}, (_D2 => { class D {} - _class4 = D; - [_D, _initClass3] = babelHelpers.applyDecs2305(_class4, [], [dec]).c; + _D2 = D; + [_D, _initClass3] = babelHelpers.applyDecs2305(_D2, [], [dec]).c; })(), _temp3)(), _D); const E = ((new (_temp4 = class extends babelHelpers.identity { constructor() { super(_decorated_class), (() => {})(), _initClass4(); } -}, (_class5 = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs2305(_class5, [], [dec]).c), _temp4)(), _decorated_class), 123); +}, (_Class2 = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs2305(_Class2, [], [dec]).c), _temp4)(), _decorated_class), 123); const F = [(new (_temp5 = class extends babelHelpers.identity { constructor() { super(_G), (() => {})(), _initClass5(); } -}, (_class6 => { +}, (_G2 => { class G {} - _class6 = G; - [_G, _initClass5] = babelHelpers.applyDecs2305(_class6, [], [dec]).c; + _G2 = G; + [_G, _initClass5] = babelHelpers.applyDecs2305(_G2, [], [dec]).c; })(), _temp5)(), _G), (new (_temp6 = class extends babelHelpers.identity { constructor() { super(_decorated_class2), (() => {})(), _initClass6(); } -}, (_class7 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs2305(_class7, [], [dec]).c), _temp6)(), _decorated_class2)]; +}, (_Class3 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs2305(_Class3, [], [dec]).c), _temp6)(), _decorated_class2)]; const H = (new (_temp7 = class extends babelHelpers.identity { constructor() { super(_H), (() => {})(), _initClass7(); } -}, (_class8 => { +}, (_H2 => { class H extends (_I = I) {} - _class8 = H; - [_H, _initClass7] = babelHelpers.applyDecs2305(_class8, [], [dec], 0, void 0, _I).c; + _H2 = H; + [_H, _initClass7] = babelHelpers.applyDecs2305(_H2, [], [dec], 0, void 0, _I).c; })(), _temp7)(), _H); const J = (new (_temp8 = class extends babelHelpers.identity { constructor() { super(_K), (() => {})(), _initClass8(); } -}, (_class9 => { +}, (_K2 => { class K extends (_L = L) {} - _class9 = K; - [_K, _initClass8] = babelHelpers.applyDecs2305(_class9, [], [dec], 0, void 0, _L).c; + _K2 = K; + [_K, _initClass8] = babelHelpers.applyDecs2305(_K2, [], [dec], 0, void 0, _L).c; })(), _temp8)(), _K); function classFactory() { - var _initClass9, _decorated_class3, _temp9, _class11; + var _initClass9, _decorated_class3, _temp9, _Class5; return new (_temp9 = class extends babelHelpers.identity { constructor() { super(_decorated_class3), (() => {})(), _initClass9(); } - }, (_class11 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs2305(_class11, [], [dec]).c), _temp9)(), _decorated_class3; + }, (_Class5 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs2305(_Class5, [], [dec]).c), _temp9)(), _decorated_class3; } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/expressions/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/expressions/output.js index 20649ccc04d8..4be601251860 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/expressions/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/expressions/output.js @@ -1,13 +1,13 @@ -var _initClass, _A, _class, _initClass2, _C, _class2, _initClass3, _D, _class3, _initClass4, _decorated_class, _class4, _initClass5, _G, _class5, _initClass6, _decorated_class2, _class6, _initClass7, _H, _I, _class7, _initClass8, _K, _L, _class8; +var _initClass, _A, _A2, _initClass2, _C, _C2, _initClass3, _D, _D2, _initClass4, _decorated_class, _Class, _initClass5, _G, _G2, _initClass6, _decorated_class2, _Class2, _initClass7, _H, _I, _H2, _initClass8, _K, _L, _K2; const dec = () => {}; -const A = ((_class = class A {}, [_A, _initClass] = babelHelpers.applyDecs2305(_class, [], [dec]).c, _initClass()), _A); -const B = ((_class2 = class C {}, [_C, _initClass2] = babelHelpers.applyDecs2305(_class2, [], [dec]).c, _initClass2()), _C); -const D = ((_class3 = class D {}, [_D, _initClass3] = babelHelpers.applyDecs2305(_class3, [], [dec]).c, _initClass3()), _D); -const E = (((_class4 = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs2305(_class4, [], [dec]).c, _initClass4()), _decorated_class), 123); -const F = [((_class5 = class G {}, [_G, _initClass5] = babelHelpers.applyDecs2305(_class5, [], [dec]).c, _initClass5()), _G), ((_class6 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs2305(_class6, [], [dec]).c, _initClass6()), _decorated_class2)]; -const H = ((_class7 = class H extends (_I = I) {}, [_H, _initClass7] = babelHelpers.applyDecs2305(_class7, [], [dec], 0, void 0, _I).c, _initClass7()), _H); -const J = ((_class8 = class K extends (_L = L) {}, [_K, _initClass8] = babelHelpers.applyDecs2305(_class8, [], [dec], 0, void 0, _L).c, _initClass8()), _K); +const A = ((_A2 = class A {}, [_A, _initClass] = babelHelpers.applyDecs2305(_A2, [], [dec]).c, _initClass()), _A); +const B = ((_C2 = class C {}, [_C, _initClass2] = babelHelpers.applyDecs2305(_C2, [], [dec]).c, _initClass2()), _C); +const D = ((_D2 = class D {}, [_D, _initClass3] = babelHelpers.applyDecs2305(_D2, [], [dec]).c, _initClass3()), _D); +const E = (((_Class = class {}, [_decorated_class, _initClass4] = babelHelpers.applyDecs2305(_Class, [], [dec]).c, _initClass4()), _decorated_class), 123); +const F = [((_G2 = class G {}, [_G, _initClass5] = babelHelpers.applyDecs2305(_G2, [], [dec]).c, _initClass5()), _G), ((_Class2 = class {}, [_decorated_class2, _initClass6] = babelHelpers.applyDecs2305(_Class2, [], [dec]).c, _initClass6()), _decorated_class2)]; +const H = ((_H2 = class H extends (_I = I) {}, [_H, _initClass7] = babelHelpers.applyDecs2305(_H2, [], [dec], 0, void 0, _I).c, _initClass7()), _H); +const J = ((_K2 = class K extends (_L = L) {}, [_K, _initClass8] = babelHelpers.applyDecs2305(_K2, [], [dec], 0, void 0, _L).c, _initClass8()), _K); function classFactory() { - var _initClass9, _decorated_class3, _class9; - return (_class9 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs2305(_class9, [], [dec]).c, _initClass9()), _decorated_class3; + var _initClass9, _decorated_class3, _Class3; + return (_Class3 = class {}, [_decorated_class3, _initClass9] = babelHelpers.applyDecs2305(_Class3, [], [dec]).c, _initClass9()), _decorated_class3; } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/inheritance/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/inheritance/output.js index 9d5974672efc..df645e44905d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/inheritance/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/inheritance/output.js @@ -1,13 +1,13 @@ -var _initClass, _class, _initClass2, _Bar2, _class2; +var _initClass, _Bar2, _initClass2, _Bar3, _Foo2; const dec1 = () => {}; const dec2 = () => {}; let _Bar; class Bar {} -_class = Bar; -[_Bar, _initClass] = babelHelpers.applyDecs2305(_class, [], [dec1]).c; +_Bar2 = Bar; +[_Bar, _initClass] = babelHelpers.applyDecs2305(_Bar2, [], [dec1]).c; _initClass(); let _Foo; -class Foo extends (_Bar2 = _Bar) {} -_class2 = Foo; -[_Foo, _initClass2] = babelHelpers.applyDecs2305(_class2, [], [dec2], 0, void 0, _Bar2).c; +class Foo extends (_Bar3 = _Bar) {} +_Foo2 = Foo; +[_Foo, _initClass2] = babelHelpers.applyDecs2305(_Foo2, [], [dec2], 0, void 0, _Bar3).c; _initClass2(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/initializers/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/initializers/output.js index 64630a884ec0..210989e0f1c8 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/initializers/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/initializers/output.js @@ -1,14 +1,14 @@ -var _initClass, _temp, _initClass2, _Foo2, _temp2; +var _initClass, _temp, _initClass2, _Foo3, _temp2; const dec = () => {}; let _Foo; new (_temp = class extends babelHelpers.identity { constructor() { (super(_Foo), babelHelpers.defineProperty(this, "field", 123)), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo {} - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs2305(_class2, [], [dec]).c; + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs2305(_Foo2, [], [dec]).c; })(), _temp)(); let _Bar; new (_temp2 = class extends babelHelpers.identity { @@ -17,8 +17,8 @@ new (_temp2 = class extends babelHelpers.identity { this.otherField = 456; })(), 123))), _initClass2(); } -}, (_class3 => { - class Bar extends (_Foo2 = _Foo) {} - _class3 = Bar; - [_Bar, _initClass2] = babelHelpers.applyDecs2305(_class3, [], [dec], 0, void 0, _Foo2).c; +}, (_Bar2 => { + class Bar extends (_Foo3 = _Foo) {} + _Bar2 = Bar; + [_Bar, _initClass2] = babelHelpers.applyDecs2305(_Bar2, [], [dec], 0, void 0, _Foo3).c; })(), _temp2)(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-static-installed-on-correct-class/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-static-installed-on-correct-class/output.js index b2d3d2fc3d49..3d2c4767a6a8 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-static-installed-on-correct-class/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-static-installed-on-correct-class/output.js @@ -12,11 +12,11 @@ new (_x = /*#__PURE__*/new WeakMap(), _m = /*#__PURE__*/new WeakSet(), (_temp = hasM = o => _m.has(babelHelpers.checkInRHS(o)); })(), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo { static m() {} } - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs2305(_class2, [], [dec]).c; + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs2305(_Foo2, [], [dec]).c; })(), _temp))(); function _m2() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-static-this/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-static-this/output.js index 258de570bf58..b873b5d71557 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-static-this/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-static-this/output.js @@ -9,8 +9,8 @@ new (_temp = class extends babelHelpers.identity { this; })(), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo {} - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs2305(_class2, [], [dec]).c; + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs2305(_Foo2, [], [dec]).c; })(), _temp)(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-with-expr/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-with-expr/output.js index 6f91424929d4..e9e3ee356079 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-with-expr/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-with-expr/output.js @@ -1,8 +1,8 @@ -var _initClass, _Bar, _class; +var _initClass, _Bar, _Bar2; const dec = () => {}; -const Foo = ((_class = class Bar { +const Foo = ((_Bar2 = class Bar { constructor() { babelHelpers.defineProperty(this, "bar", new _Bar()); } -}, [_Bar, _initClass] = babelHelpers.applyDecs2305(_class, [], [dec]).c, _initClass()), _Bar); +}, [_Bar, _initClass] = babelHelpers.applyDecs2305(_Bar2, [], [dec]).c, _initClass()), _Bar); const foo = new Foo(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement/output.js index 45e29c85d2db..53a09e92090f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement/output.js @@ -5,9 +5,9 @@ new (_temp = class extends babelHelpers.identity { constructor() { (super(_Foo), babelHelpers.defineProperty(this, "foo", new _Foo())), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { class Foo {} - _class2 = Foo; - [_Foo, _initClass] = babelHelpers.applyDecs2305(_class2, [], [dec]).c; + _Foo2 = Foo; + [_Foo, _initClass] = babelHelpers.applyDecs2305(_Foo2, [], [dec]).c; })(), _temp)(); const foo = new _Foo(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes/decorator-access-modified-methods/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes/decorator-access-modified-methods/output.js index 79e6ff7facb3..3f18c8554d5e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes/decorator-access-modified-methods/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes/decorator-access-modified-methods/output.js @@ -13,7 +13,7 @@ class C { c: [_C, _initClass] } = babelHelpers.applyDecs2305(this, [[memberDec, 2, "m"]], [classDec])); } - constructor(...args) { + constructor() { _initProto(this); } m() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes/inheritance/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes/inheritance/output.js index 48db96e1ef53..57aebf7cdd15 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes/inheritance/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes/inheritance/output.js @@ -1,20 +1,20 @@ -var _initClass, _dec, _initClass2, _dec2, _Bar2; +var _initClass, _classDecs, _initClass2, _classDecs2, _Bar2; const dec = () => {}; -_dec = dec1; +_classDecs = [dec1]; let _Bar; class Bar { static { - [_Bar, _initClass] = babelHelpers.applyDecs2305(this, [], [_dec]).c; + [_Bar, _initClass] = babelHelpers.applyDecs2305(this, [], _classDecs).c; } static { _initClass(); } } -_dec2 = dec2; +_classDecs2 = [dec2]; let _Foo; class Foo extends (_Bar2 = _Bar) { static { - [_Foo, _initClass2] = babelHelpers.applyDecs2305(this, [], [_dec2], 0, void 0, _Bar2).c; + [_Foo, _initClass2] = babelHelpers.applyDecs2305(this, [], _classDecs2, 0, void 0, _Bar2).c; } static { _initClass2(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/computed-keys-same-ast/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/computed-keys-same-ast/output.js index 1714b98fc562..a4795f4fd455 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/computed-keys-same-ast/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/computed-keys-same-ast/output.js @@ -1,9 +1,9 @@ -var _computedKey, _computedKey2, _initProto, _class; +var _computedKey, _computedKey2, _initProto, _Foo; const dec = () => {}; _computedKey = babelHelpers.toPropertyKey(getKey()); _computedKey2 = babelHelpers.toPropertyKey(getKey()); class Foo { - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { @@ -13,5 +13,5 @@ class Foo { return 2; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2305(_class, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2305(_Foo, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/computed-keys-same-value/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/computed-keys-same-value/output.js index b6563940b038..5a1d7c24587f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/computed-keys-same-value/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/computed-keys-same-value/output.js @@ -1,9 +1,9 @@ -var _computedKey, _computedKey2, _initProto, _class; +var _computedKey, _computedKey2, _initProto, _Foo; const dec = () => {}; _computedKey = babelHelpers.toPropertyKey(getKeyI()); _computedKey2 = babelHelpers.toPropertyKey(getKeyJ()); class Foo { - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { @@ -13,5 +13,5 @@ class Foo { return 2; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2305(_class, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2305(_Foo, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/method-and-field/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/method-and-field/output.js index 49eb2db68e20..74f8c5e3476b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/method-and-field/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/method-and-field/output.js @@ -1,4 +1,4 @@ -var _init_a, _initProto, _class; +var _init_a, _initProto, _Foo; const dec = () => {}; class Foo { constructor() { @@ -8,5 +8,5 @@ class Foo { return 1; } } -_class = Foo; -[_init_a, _initProto] = babelHelpers.applyDecs2305(_class, [[dec, 2, "a"], [dec, 0, "a"]], []).e; +_Foo = Foo; +[_init_a, _initProto] = babelHelpers.applyDecs2305(_Foo, [[dec, 2, "a"], [dec, 0, "a"]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/methods-with-same-key/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/methods-with-same-key/output.js index 37346e088349..d1c6c049b124 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/methods-with-same-key/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys--to-es2015/methods-with-same-key/output.js @@ -1,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { _initProto(this); } a() { @@ -11,5 +11,5 @@ class Foo { return 2; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2305(_class, [[dec, 2, "a"], [dec, 2, "a"]], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2305(_Foo, [[dec, 2, "a"], [dec, 2, "a"]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys/computed-keys-same-ast/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys/computed-keys-same-ast/output.js index 854b2d16fcb8..b7f23bc9ba5b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys/computed-keys-same-ast/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys/computed-keys-same-ast/output.js @@ -6,7 +6,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2305(this, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; } - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys/computed-keys-same-value/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys/computed-keys-same-value/output.js index 4af5f5590a04..124cb00454f3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys/computed-keys-same-value/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys/computed-keys-same-value/output.js @@ -6,7 +6,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2305(this, [[dec, 2, _computedKey], [dec, 2, _computedKey2]], []).e; } - constructor(...args) { + constructor() { _initProto(this); } [_computedKey]() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys/methods-with-same-key/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys/methods-with-same-key/output.js index b05c1ca3ee94..e6ebe3d3f423 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys/methods-with-same-key/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-duplicated-keys/methods-with-same-key/output.js @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2305(this, [[dec, 2, "a"], [dec, 2, "a"]], []).e; } - constructor(...args) { + constructor() { _initProto(this); } a() { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-exported/default-anonymous/output.mjs b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-exported/default-anonymous/output.mjs index 311a493a5c31..3886c6ec0fb3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-exported/default-anonymous/output.mjs +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-exported/default-anonymous/output.mjs @@ -1,9 +1,9 @@ -var _initClass, _dec; -_dec = dec; +var _initClass, _classDecs; +_classDecs = [dec]; let _A; class A { static { - [_A, _initClass] = babelHelpers.applyDecs2305(this, [], [_dec]).c; + [_A, _initClass] = babelHelpers.applyDecs2305(this, [], _classDecs).c; } static { _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-exported/default-named/output.mjs b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-exported/default-named/output.mjs index 178abaf10e45..8b3d9b2426b1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-exported/default-named/output.mjs +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-exported/default-named/output.mjs @@ -1,9 +1,9 @@ -var _initClass, _dec; -_dec = dec; +var _initClass, _classDecs; +_classDecs = [dec]; let _default2; class _default { static { - [_default2, _initClass] = babelHelpers.applyDecs2305(babelHelpers.setFunctionName(this, "default"), [], [_dec]).c; + [_default2, _initClass] = babelHelpers.applyDecs2305(babelHelpers.setFunctionName(this, "default"), [], _classDecs).c; } static { _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-exported/named/output.mjs b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-exported/named/output.mjs index 7554be3ca8fb..77ac0b9d4df6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-exported/named/output.mjs +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-exported/named/output.mjs @@ -1,9 +1,9 @@ -var _initClass, _dec; -_dec = dec; +var _initClass, _classDecs; +_classDecs = [dec]; let _A; class A { static { - [_A, _initClass] = babelHelpers.applyDecs2305(this, [], [_dec]).c; + [_A, _initClass] = babelHelpers.applyDecs2305(this, [], _classDecs).c; } static { _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/context-name/output.js index 68418cdda9a8..a57e4639d565 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _class; +var _init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -11,18 +11,18 @@ const f = () => { }; _computedKey = babelHelpers.toPropertyKey(f()); class Foo {} -_class = Foo; -[_init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7] = babelHelpers.applyDecs2305(_class, [[dec, 8, "a"], [dec, 8, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _class, _a), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _class, _a, v)], [dec, 8, "b"], [dec, 8, "c"], [dec, 8, 0], [dec, 8, 1], [dec, 8, 2n], [dec, 8, 3n], [dec, 8, _computedKey]], []).e; -babelHelpers.defineProperty(Foo, "a", _init_a(_class)); +_Foo = Foo; +[_init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7] = babelHelpers.applyDecs2305(_Foo, [[dec, 8, "a"], [dec, 8, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _a), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _a, v)], [dec, 8, "b"], [dec, 8, "c"], [dec, 8, 0], [dec, 8, 1], [dec, 8, 2n], [dec, 8, 3n], [dec, 8, _computedKey]], []).e; +babelHelpers.defineProperty(Foo, "a", _init_a(_Foo)); var _a = { writable: true, - value: _init_a2(_class) + value: _init_a2(_Foo) }; -babelHelpers.defineProperty(Foo, "b", _init_computedKey(_class)); -babelHelpers.defineProperty(Foo, "c", _init_computedKey2(_class)); -babelHelpers.defineProperty(Foo, 0, _init_computedKey3(_class)); -babelHelpers.defineProperty(Foo, 1, _init_computedKey4(_class)); -babelHelpers.defineProperty(Foo, 2n, _init_computedKey5(_class)); -babelHelpers.defineProperty(Foo, 3n, _init_computedKey6(_class)); -babelHelpers.defineProperty(Foo, _computedKey, _init_computedKey7(_class)); +babelHelpers.defineProperty(Foo, "b", _init_computedKey(_Foo)); +babelHelpers.defineProperty(Foo, "c", _init_computedKey2(_Foo)); +babelHelpers.defineProperty(Foo, 0, _init_computedKey3(_Foo)); +babelHelpers.defineProperty(Foo, 1, _init_computedKey4(_Foo)); +babelHelpers.defineProperty(Foo, 2n, _init_computedKey5(_Foo)); +babelHelpers.defineProperty(Foo, 3n, _init_computedKey6(_Foo)); +babelHelpers.defineProperty(Foo, _computedKey, _init_computedKey7(_Foo)); expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/private/output.js index f5a245297fb3..94d9722e1a58 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/private/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_b, _class; +var _init_a, _init_b, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); var _b = /*#__PURE__*/new WeakMap(); @@ -14,5 +14,5 @@ class Foo { }); } } -_class = Foo; -[_init_a, _init_b] = babelHelpers.applyDecs2305(_class, [[dec, 0, "a", o => babelHelpers.classPrivateFieldGet(o, _a), (o, v) => babelHelpers.classPrivateFieldSet(o, _a, v)], [dec, 0, "b", o => babelHelpers.classPrivateFieldGet(o, _b), (o, v) => babelHelpers.classPrivateFieldSet(o, _b, v)]], [], 0, _ => _b.has(babelHelpers.checkInRHS(_))).e; +_Foo = Foo; +[_init_a, _init_b] = babelHelpers.applyDecs2305(_Foo, [[dec, 0, "a", o => babelHelpers.classPrivateFieldGet(o, _a), (o, v) => babelHelpers.classPrivateFieldSet(o, _a, v)], [dec, 0, "b", o => babelHelpers.classPrivateFieldGet(o, _b), (o, v) => babelHelpers.classPrivateFieldSet(o, _b, v)]], [], 0, _ => _b.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/public/output.js index 3b1489b5fc20..144328684a8d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/public/output.js @@ -1,4 +1,4 @@ -var _init_a, _init_b, _init_computedKey, _class; +var _init_a, _init_b, _init_computedKey, _Foo; const dec = () => {}; class Foo { constructor() { @@ -7,5 +7,5 @@ class Foo { babelHelpers.defineProperty(this, 'c', _init_computedKey(this, 456)); } } -_class = Foo; -[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs2305(_class, [[dec, 0, "a"], [dec, 0, "b"], [dec, 0, 'c']], []).e; +_Foo = Foo; +[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs2305(_Foo, [[dec, 0, "a"], [dec, 0, "b"], [dec, 0, 'c']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/static-private/output.js index e0a890c0633d..fa49dda1c0fc 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/static-private/output.js @@ -1,13 +1,13 @@ -var _init_a, _init_b, _class; +var _init_a, _init_b, _Foo; const dec = () => {}; class Foo {} -_class = Foo; -[_init_a, _init_b] = babelHelpers.applyDecs2305(_class, [[dec, 8, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _class, _a), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _class, _a, v)], [dec, 8, "b", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _class, _b), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _class, _b, v)]], []).e; +_Foo = Foo; +[_init_a, _init_b] = babelHelpers.applyDecs2305(_Foo, [[dec, 8, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _a), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _a, v)], [dec, 8, "b", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _b), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _b, v)]], []).e; var _a = { writable: true, - value: _init_a(_class) + value: _init_a(_Foo) }; var _b = { writable: true, - value: _init_b(_class, 123) + value: _init_b(_Foo, 123) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/static-public/output.js index abf02aeb42fd..34e655668549 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/static-public/output.js @@ -1,8 +1,8 @@ -var _init_a, _init_b, _init_computedKey, _class; +var _init_a, _init_b, _init_computedKey, _Foo; const dec = () => {}; class Foo {} -_class = Foo; -[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs2305(_class, [[dec, 8, "a"], [dec, 8, "b"], [dec, 8, 'c']], []).e; -babelHelpers.defineProperty(Foo, "a", _init_a(_class)); -babelHelpers.defineProperty(Foo, "b", _init_b(_class, 123)); -babelHelpers.defineProperty(Foo, 'c', _init_computedKey(_class, 456)); +_Foo = Foo; +[_init_a, _init_b, _init_computedKey] = babelHelpers.applyDecs2305(_Foo, [[dec, 8, "a"], [dec, 8, "b"], [dec, 8, 'c']], []).e; +babelHelpers.defineProperty(Foo, "a", _init_a(_Foo)); +babelHelpers.defineProperty(Foo, "b", _init_b(_Foo, 123)); +babelHelpers.defineProperty(Foo, 'c', _init_computedKey(_Foo, 456)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/context-name/output.js index 4d6c65504b45..41dbc76bbf6e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _call_a, _computedKey, _initStatic, _class; +var _call_a, _computedKey, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -20,7 +20,7 @@ class Foo { static get [3n]() {} static get [_computedKey]() {} } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } @@ -29,7 +29,7 @@ var _a = { set: void 0 }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2305(_class, [[dec, 11, "a"], [dec, 11, "a", function () {}], [dec, 11, "b"], [dec, 11, "c"], [dec, 11, 0], [dec, 11, 1], [dec, 11, 2n], [dec, 11, 3n], [dec, 11, _computedKey]], []).e; - _initStatic(_class); + [_call_a, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 11, "a"], [dec, 11, "a", function () {}], [dec, 11, "b"], [dec, 11, "c"], [dec, 11, 0], [dec, 11, 1], [dec, 11, 2n], [dec, 11, 3n], [dec, 11, _computedKey]], []).e; + _initStatic(_Foo); })(); expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/private/output.js index 7485874beae5..17bb9c70fc1a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/private/output.js @@ -1,8 +1,8 @@ -var _call_a, _initProto, _class; +var _call_a, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { get: _get_a, set: void 0 @@ -14,10 +14,10 @@ class Foo { return babelHelpers.classPrivateFieldGet(this, _a); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } -[_call_a, _initProto] = babelHelpers.applyDecs2305(_class, [[dec, 3, "a", function () { +[_call_a, _initProto] = babelHelpers.applyDecs2305(_Foo, [[dec, 3, "a", function () { return this.value; }]], [], 0, _ => _a.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/public/output.js index 9f0885e8edf7..b895e447ba75 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/public/output.js @@ -1,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -12,5 +12,5 @@ class Foo { return this.value; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2305(_class, [[dec, 3, "a"], [dec, 3, 'b']], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2305(_Foo, [[dec, 3, "a"], [dec, 3, 'b']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/static-private/output.js index 3901b04f558a..b903c711cde0 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/static-private/output.js @@ -1,11 +1,11 @@ -var _call_a, _initStatic, _class; +var _call_a, _initStatic, _Foo; const dec = () => {}; class Foo { static getA() { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } @@ -14,9 +14,9 @@ var _a = { set: void 0 }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2305(_class, [[dec, 11, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 11, "a", function () { return this.value; }]], []).e; - _initStatic(_class); + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/static-public/output.js index 4418b536a4a2..df66c90c0073 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/static-public/output.js @@ -1,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static get a() { @@ -8,9 +8,9 @@ class Foo { return this.value; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs2305(_class, [[dec, 11, "a"], [dec, 11, 'b']], []).e; - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 11, "a"], [dec, 11, 'b']], []).e; + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/private/output.js index 04368655b9a2..31e0396652ff 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/private/output.js @@ -1,8 +1,8 @@ -var _call_a, _call_a2, _initProto, _class; +var _call_a, _call_a2, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { get: _get_a, set: _set_a @@ -17,14 +17,14 @@ class Foo { babelHelpers.classPrivateFieldSet(this, _a, v); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } function _set_a(v) { _call_a2(this, v); } -[_call_a, _call_a2, _initProto] = babelHelpers.applyDecs2305(_class, [[dec, 3, "a", function () { +[_call_a, _call_a2, _initProto] = babelHelpers.applyDecs2305(_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/2023-05-getters-and-setters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/public/output.js index bfa46075556d..ded216f4f759 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/public/output.js @@ -1,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -18,5 +18,5 @@ class Foo { this.value = v; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2305(_class, [[dec, 3, "a"], [dec, 4, "a"], [dec, 3, 'b'], [dec, 4, 'b']], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2305(_Foo, [[dec, 3, "a"], [dec, 4, "a"], [dec, 3, 'b'], [dec, 4, 'b']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/static-private/output.js index 6e21839adca8..bcc0734a53c3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/static-private/output.js @@ -1,4 +1,4 @@ -var _call_a, _call_a2, _initStatic, _class; +var _call_a, _call_a2, _initStatic, _Foo; const dec = () => {}; class Foo { static getA() { @@ -8,7 +8,7 @@ class Foo { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); } } -_class = Foo; +_Foo = Foo; function _get_a() { return _call_a(this); } @@ -20,11 +20,11 @@ var _a = { set: _set_a }; (() => { - [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs2305(_class, [[dec, 11, "a", function () { + [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 11, "a", function () { return this.value; }], [dec, 12, "a", function (v) { this.value = v; }]], []).e; - _initStatic(_class); + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/static-public/output.js index dff888509e5a..9ce7f2f873e4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/static-public/output.js @@ -1,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static get a() { @@ -14,9 +14,9 @@ class Foo { this.value = v; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs2305(_class, [[dec, 11, "a"], [dec, 12, "a"], [dec, 11, 'b'], [dec, 12, 'b']], []).e; - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 11, "a"], [dec, 12, "a"], [dec, 11, 'b'], [dec, 12, 'b']], []).e; + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters/private/output.js index b1df32728c7f..606cafe76d31 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters/private/output.js @@ -8,7 +8,7 @@ class Foo { this.value = v; }]], [], 0, _ => #a in _).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters/public/output.js index 32ee88a2c120..7a1bc2dd6701 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters/public/output.js @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2305(this, [[dec, 3, "a"], [dec, 4, "a"], [dec, 3, 'b'], [dec, 4, 'b']], []).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters/private/output.js index 5f696817f78d..6f9b4e67d682 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters/private/output.js @@ -6,7 +6,7 @@ class Foo { return this.value; }]], [], 0, _ => #a in _).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters/public/output.js index 8df2533d17c0..895e2d98f4a4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters/public/output.js @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2305(this, [[dec, 3, "a"], [dec, 3, 'b']], []).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/context-name/output.js index b9a2184a873c..c677da558f5b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _call_a, _computedKey, _initStatic, _class; +var _call_a, _computedKey, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -20,10 +20,10 @@ class Foo { static [3n]() {} static [_computedKey]() {} } -_class = Foo; +_Foo = Foo; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2305(_class, [[dec, 10, "a"], [dec, 10, "a", function () {}], [dec, 10, "b"], [dec, 10, "c"], [dec, 10, 0], [dec, 10, 1], [dec, 10, 2n], [dec, 10, 3n], [dec, 10, _computedKey]], []).e; - _initStatic(_class); + [_call_a, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 10, "a"], [dec, 10, "a", function () {}], [dec, 10, "b"], [dec, 10, "c"], [dec, 10, 0], [dec, 10, 1], [dec, 10, 2n], [dec, 10, 3n], [dec, 10, _computedKey]], []).e; + _initStatic(_Foo); })(); var _a = { writable: true, diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/private/output.js index e1075873f668..5fb9a0536e0c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/private/output.js @@ -1,8 +1,8 @@ -var _call_a, _initProto, _class; +var _call_a, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { writable: true, value: _call_a @@ -14,7 +14,7 @@ class Foo { return babelHelpers.classPrivateFieldGet(this, _a).call(this); } } -_class = Foo; -[_call_a, _initProto] = babelHelpers.applyDecs2305(_class, [[dec, 2, "a", function () { +_Foo = Foo; +[_call_a, _initProto] = babelHelpers.applyDecs2305(_Foo, [[dec, 2, "a", function () { return this.value; }]], [], 0, _ => _a.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/public/output.js index 64351a9dedc5..a57514e64a5f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/public/output.js @@ -1,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -12,5 +12,5 @@ class Foo { return this.value; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2305(_class, [[dec, 2, "a"], [dec, 2, 'b']], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2305(_Foo, [[dec, 2, "a"], [dec, 2, 'b']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/static-private/output.js index 644a944bd957..7d976a84de47 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/static-private/output.js @@ -1,16 +1,16 @@ -var _call_a, _initStatic, _class; +var _call_a, _initStatic, _Foo; const dec = () => {}; class Foo { static callA() { return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a).call(this); } } -_class = Foo; +_Foo = Foo; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2305(_class, [[dec, 10, "a", function () { + [_call_a, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 10, "a", function () { return this.value; }]], []).e; - _initStatic(_class); + _initStatic(_Foo); })(); var _a = { writable: true, diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/static-public/output.js index c863924c085c..08a472ba5a03 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/static-public/output.js @@ -1,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static a() { @@ -8,9 +8,9 @@ class Foo { return this.value; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs2305(_class, [[dec, 10, "a"], [dec, 10, 'b']], []).e; - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 10, "a"], [dec, 10, 'b']], []).e; + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods/private/output.js index 1f2a2abb25d1..1bf658be1e46 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods/private/output.js @@ -6,7 +6,7 @@ class Foo { return this.value; }]], [], 0, _ => #a in _).e; } - constructor(...args) { + constructor() { _initProto(this); } #a = _call_a; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods/public/output.js index bf43452b3662..4ecb7ac18511 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods/public/output.js @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2305(this, [[dec, 2, "a"], [dec, 2, 'b']], []).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/initProto-existing-derived-constructor/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/initProto-existing-derived-constructor/output.js index 0822acb640e6..89a65afcf632 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/initProto-existing-derived-constructor/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/initProto-existing-derived-constructor/output.js @@ -1,5 +1,5 @@ { - var _initProto, _class; + var _initProto, _A; let self, a, initCalled; function deco(_, context) { context.addInitializer(() => { @@ -18,8 +18,8 @@ } method() {} } - _class = A; - [_initProto] = babelHelpers.applyDecs2305(_class, [[deco, 2, "method"]], [], 0, void 0, B).e; + _A = A; + [_initProto] = babelHelpers.applyDecs2305(_A, [[deco, 2, "method"]], [], 0, void 0, B).e; let instance = new A(); expect(self).toBe(instance); expect(a).toBe(2); @@ -40,7 +40,7 @@ } } { - var _initProto2, _class2; + var _initProto2, _A2; "super() nested within another constructor should not be transformed"; let log = []; class A extends B { @@ -56,8 +56,8 @@ return this.a; } } - _class2 = A; - [_initProto2] = babelHelpers.applyDecs2305(_class2, [[dec, 2, "method"]], [], 0, void 0, B).e; + _A2 = A; + [_initProto2] = babelHelpers.applyDecs2305(_A2, [[dec, 2, "method"]], [], 0, void 0, B).e; new A(); expect(log + "").toBe("103,4"); } @@ -66,7 +66,7 @@ let log = []; new class Dummy extends B { constructor() { - var _computedKey, _initProto3, _class3; + var _computedKey, _initProto3, _A3; let key; _computedKey = babelHelpers.toPropertyKey((key = super(5).method(), log.push(key), key)); class A extends B { @@ -77,8 +77,8 @@ return this.a; } } - _class3 = A; - [_initProto3] = babelHelpers.applyDecs2305(_class3, [[dec, 2, "method"]], [], 0, void 0, B).e; + _A3 = A; + [_initProto3] = babelHelpers.applyDecs2305(_A3, [[dec, 2, "method"]], [], 0, void 0, B).e; new A(); } }(); @@ -90,7 +90,7 @@ const noop = () => fn => fn; new class extends B { constructor() { - var _dec, _initProto4, _class4; + var _dec, _initProto4, _A4; _dec = noop(log.push(super(7).method())); class A extends B { constructor() { @@ -101,15 +101,15 @@ } noop() {} } - _class4 = A; - [_initProto4] = babelHelpers.applyDecs2305(_class4, [[dec, 2, "method"], [_dec, 2, "noop"]], [], 0, void 0, B).e; + _A4 = A; + [_initProto4] = babelHelpers.applyDecs2305(_A4, [[dec, 2, "method"], [_dec, 2, "noop"]], [], 0, void 0, B).e; new A(); } }(); expect(log + "").toBe("7,108"); } { - var _initProto5, _class5; + var _initProto5, _A5; "super() within decorated derived constructor should be transformed: computed key"; let log = []; class A extends B { @@ -126,32 +126,32 @@ return this.a; } } - _class5 = A; - [_initProto5] = babelHelpers.applyDecs2305(_class5, [[dec, 2, "method"]], [], 0, void 0, B).e; + _A5 = A; + [_initProto5] = babelHelpers.applyDecs2305(_A5, [[dec, 2, "method"]], [], 0, void 0, B).e; new A(); expect(log + "").toBe("109,10"); } { - var _initProto6, _class7; + var _initProto6, _A6; "super() within decorated derived constructor should be transformed: decorator expression"; let log = []; const noop = () => fn => fn; class A extends B { constructor() { - var _dec2, _initProto7, _class8; - new (_dec2 = noop(log.push(_initProto6(super(11)).method())), (_class8 = class Dummy extends B { + var _dec2, _initProto7, _Dummy2; + new (_dec2 = noop(log.push(_initProto6(super(11)).method())), (_Dummy2 = class Dummy extends B { constructor() { log.push(_initProto7(super(12)).method()); } noop() {} - }, [_initProto7] = babelHelpers.applyDecs2305(_class8, [[_dec2, 2, "noop"]], [], 0, void 0, B).e, _class8))(); + }, [_initProto7] = babelHelpers.applyDecs2305(_Dummy2, [[_dec2, 2, "noop"]], [], 0, void 0, B).e, _Dummy2))(); } method() { return this.a; } } - _class7 = A; - [_initProto6] = babelHelpers.applyDecs2305(_class7, [[dec, 2, "method"]], [], 0, void 0, B).e; + _A6 = A; + [_initProto6] = babelHelpers.applyDecs2305(_A6, [[dec, 2, "method"]], [], 0, void 0, B).e; new A(); expect(log + "").toBe("111,12"); } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/super-in-decorator/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/super-in-decorator/output.js index 6d6e7e1b4236..e97bf99dfeb5 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/super-in-decorator/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/super-in-decorator/output.js @@ -1,22 +1,21 @@ class A extends B { m() { - var _initClass, _obj, _dec, _obj2, _dec2, _initProto, _class; + var _initClass, _classDecs, _obj, _dec, _initProto, _C2; + _classDecs = [this, super.dec1]; _obj = this; - _dec = super.dec1; - _obj2 = this; - _dec2 = super.dec2; + _dec = super.dec2; let _C; class C { - constructor(...args) { + constructor() { _initProto(this); } m2() {} } - _class = C; + _C2 = C; ({ e: [_initProto], c: [_C, _initClass] - } = babelHelpers.applyDecs2305(_class, [[[_obj2, _dec2], 18, "m2"]], [_obj, _dec], 1)); + } = babelHelpers.applyDecs2305(_C2, [[[_obj, _dec], 18, "m2"]], _classDecs, 1)); _initClass(); } } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/this/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/this/output.js index b136847bf5c9..64056d316141 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/this/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/this/output.js @@ -1,16 +1,12 @@ -var _initClass, _obj, _dec, _dec2, _obj2, _dec3, _obj3, _dec4, _obj4, _dec5, _init_x, _obj5, _dec6, _dec7, _init_y, _class; -_obj = o1; +var _initClass, _classDecs, _obj, _dec, _obj2, _dec2, _init_x, _obj3, _dec3, _dec4, _init_y, _A2; +_classDecs = [o1, o1.dec, void 0, dec, o2, o2.dec]; +_obj = o2; _dec = _obj.dec; -_dec2 = dec; -_obj2 = o2; -_dec3 = _obj2.dec; +_obj2 = o3.o; +_dec2 = _obj2.dec; _obj3 = o2; -_dec4 = _obj3.dec; -_obj4 = o3.o; -_dec5 = _obj4.dec; -_obj5 = o2; -_dec6 = _obj5.dec; -_dec7 = dec; +_dec3 = _obj3.dec; +_dec4 = dec; let _A; class A { constructor() { @@ -18,9 +14,9 @@ class A { babelHelpers.defineProperty(this, "y", _init_y(this)); } } -_class = A; +_A2 = A; ({ e: [_init_x, _init_y], c: [_A, _initClass] -} = babelHelpers.applyDecs2305(_class, [[[_obj3, _dec4, _obj4, _dec5], 16, "x"], [[_obj5, _dec6, void 0, _dec7], 16, "y"]], [_obj, _dec, void 0, _dec2, _obj2, _dec3], 1)); +} = babelHelpers.applyDecs2305(_A2, [[[_obj, _dec, _obj2, _dec2], 16, "x"], [[_obj3, _dec3, void 0, _dec4], 16, "y"]], _classDecs, 1)); _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/valid-expression-formats/output.js index 04a2e3131c29..59bca0574648 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/valid-expression-formats/output.js @@ -1,19 +1,15 @@ -var _initClass, _dec, _dec2, _dec3, _obj, _dec4, _dec5, _dec6, _dec7, _obj2, _dec8, _initProto, _class; +var _initClass, _classDecs, _dec, _dec2, _dec3, _obj, _dec4, _initProto, _Foo2; const dec = () => {}; +_classDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, array, array[expr]]; _dec = call(); _dec2 = chain.expr(); _dec3 = arbitrary + expr; _obj = array; _dec4 = _obj[expr]; -_dec5 = call(); -_dec6 = chain.expr(); -_dec7 = arbitrary + expr; -_obj2 = array; -_dec8 = _obj2[expr]; let _Foo; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { writable: true, value: void 0 @@ -22,17 +18,17 @@ class Foo { } method() {} makeClass() { - var _dec9, _init_bar, _class2; - return _dec9 = babelHelpers.classPrivateFieldGet(this, _a), (_class2 = class Nested { + var _dec5, _init_bar, _Nested; + return _dec5 = babelHelpers.classPrivateFieldGet(this, _a), (_Nested = class Nested { constructor() { babelHelpers.defineProperty(this, "bar", _init_bar(this)); } - }, [_init_bar] = babelHelpers.applyDecs2305(_class2, [[_dec9, 0, "bar"]], []).e, _class2); + }, [_init_bar] = babelHelpers.applyDecs2305(_Nested, [[_dec5, 0, "bar"]], []).e, _Nested); } } -_class = Foo; +_Foo2 = Foo; ({ e: [_initProto], c: [_Foo, _initClass] -} = babelHelpers.applyDecs2305(_class, [[[void 0, dec, void 0, _dec5, void 0, _dec6, void 0, _dec7, _obj2, _dec8], 18, "method"]], [void 0, dec, void 0, _dec, void 0, _dec2, void 0, _dec3, _obj, _dec4], 1)); +} = babelHelpers.applyDecs2305(_Foo2, [[[void 0, dec, void 0, _dec, void 0, _dec2, void 0, _dec3, _obj, _dec4], 18, "method"]], _classDecs, 1)); _initClass(); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/super-in-decorator/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/super-in-decorator/output.js index c833b3bbdcaf..72666c63d7bf 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/super-in-decorator/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/super-in-decorator/output.js @@ -1,19 +1,18 @@ class A extends B { m() { - var _initClass, _obj, _dec, _obj2, _dec2, _initProto; + var _initClass, _classDecs, _obj, _dec, _initProto; + _classDecs = [this, super.dec1]; _obj = this; - _dec = super.dec1; - _obj2 = this; - _dec2 = super.dec2; + _dec = super.dec2; let _C; class C { static { ({ e: [_initProto], c: [_C, _initClass] - } = babelHelpers.applyDecs2305(this, [[[_obj2, _dec2], 18, "m2"]], [_obj, _dec], 1)); + } = babelHelpers.applyDecs2305(this, [[[_obj, _dec], 18, "m2"]], _classDecs, 1)); } - constructor(...args) { + constructor() { _initProto(this); } m2() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/this/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/this/output.js index a3cbb9547eef..6e82f11cf027 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/this/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/this/output.js @@ -1,23 +1,19 @@ -var _initClass, _obj, _dec, _dec2, _obj2, _dec3, _obj3, _dec4, _obj4, _dec5, _init_x, _obj5, _dec6, _dec7, _init_y; -_obj = o1; +var _initClass, _classDecs, _obj, _dec, _obj2, _dec2, _init_x, _obj3, _dec3, _dec4, _init_y; +_classDecs = [o1, o1.dec, void 0, dec, o2, o2.dec]; +_obj = o2; _dec = _obj.dec; -_dec2 = dec; -_obj2 = o2; -_dec3 = _obj2.dec; +_obj2 = o3.o; +_dec2 = _obj2.dec; _obj3 = o2; -_dec4 = _obj3.dec; -_obj4 = o3.o; -_dec5 = _obj4.dec; -_obj5 = o2; -_dec6 = _obj5.dec; -_dec7 = dec; +_dec3 = _obj3.dec; +_dec4 = dec; let _A; class A { static { ({ e: [_init_x, _init_y], c: [_A, _initClass] - } = babelHelpers.applyDecs2305(this, [[[_obj3, _dec4, _obj4, _dec5], 16, "x"], [[_obj5, _dec6, void 0, _dec7], 16, "y"]], [_obj, _dec, void 0, _dec2, _obj2, _dec3], 1)); + } = babelHelpers.applyDecs2305(this, [[[_obj, _dec, _obj2, _dec2], 16, "x"], [[_obj3, _dec3, void 0, _dec4], 16, "y"]], _classDecs, 1)); } x = _init_x(this); y = _init_y(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/valid-expression-formats/output.js index 77ba4f5e230f..249e46b4c383 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc/valid-expression-formats/output.js @@ -1,33 +1,29 @@ -var _initClass, _dec, _dec2, _dec3, _obj, _dec4, _dec5, _dec6, _dec7, _obj2, _dec8, _initProto; +var _initClass, _classDecs, _dec, _dec2, _dec3, _obj, _dec4, _initProto; const dec = () => {}; +_classDecs = [void 0, dec, void 0, call(), void 0, chain.expr(), void 0, arbitrary + expr, array, array[expr]]; _dec = call(); _dec2 = chain.expr(); _dec3 = arbitrary + expr; _obj = array; _dec4 = _obj[expr]; -_dec5 = call(); -_dec6 = chain.expr(); -_dec7 = arbitrary + expr; -_obj2 = array; -_dec8 = _obj2[expr]; let _Foo; class Foo { static { ({ e: [_initProto], c: [_Foo, _initClass] - } = babelHelpers.applyDecs2305(this, [[[void 0, dec, void 0, _dec5, void 0, _dec6, void 0, _dec7, _obj2, _dec8], 18, "method"]], [void 0, dec, void 0, _dec, void 0, _dec2, void 0, _dec3, _obj, _dec4], 1)); + } = babelHelpers.applyDecs2305(this, [[[void 0, dec, void 0, _dec, void 0, _dec2, void 0, _dec3, _obj, _dec4], 18, "method"]], _classDecs, 1)); } - constructor(...args) { + constructor() { _initProto(this); } #a; method() {} makeClass() { - var _obj3, _dec9, _init_bar; - return _obj3 = this, _dec9 = this.#a, class Nested { + var _obj2, _dec5, _init_bar; + return _obj2 = this, _dec5 = this.#a, class Nested { static { - [_init_bar] = babelHelpers.applyDecs2305(this, [[[_obj3, _dec9], 16, "bar"]], []).e; + [_init_bar] = babelHelpers.applyDecs2305(this, [[[_obj2, _dec5], 16, "bar"]], []).e; } bar = _init_bar(this); }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-ordering--to-es2015/initializers-and-static-blocks/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-ordering--to-es2015/initializers-and-static-blocks/output.js index 4115a4ebb469..5371855f8c53 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-ordering--to-es2015/initializers-and-static-blocks/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-ordering--to-es2015/initializers-and-static-blocks/output.js @@ -155,7 +155,7 @@ new (_B = /*#__PURE__*/new WeakMap(), (_temp = class extends babelHelpers.identi log.push("static:end"); })(), _initClass(); } -}, (_class2 => { +}, (_Foo2 => { var _A = /*#__PURE__*/new WeakMap(); class Foo extends (_ref = (log.push("extends"), Object)) { constructor() { @@ -191,13 +191,13 @@ new (_B = /*#__PURE__*/new WeakMap(), (_temp = class extends babelHelpers.identi babelHelpers.classPrivateFieldSet(Foo, _B, v); } } - _class2 = Foo; + _Foo2 = Foo; (() => { ({ e: [_init_accessor2, _init_accessor, _init_field2, _init_field, _initProto, _initStatic], c: [_Foo, _initClass] - } = babelHelpers.applyDecs2305(_class2, [[[staticMethodDec1, staticMethodDec2], 10, "method"], [[staticGetterDec1, staticGetterDec2], 11, "getter"], [[staticSetterDec1, staticSetterDec2], 12, "getter"], [[staticAccessorDec1, staticAccessorDec2], 9, "accessor"], [[methodDec1, methodDec2], 2, "method"], [[getterDec1, getterDec2], 3, "getter"], [[setterDec1, setterDec2], 4, "setter"], [[accessorDec1, accessorDec2], 1, "accessor"], [[staticFieldDec1, staticFieldDec2], 8, "field"], [[fieldDec1, fieldDec2], 0, "field"]], [classDec1, classDec2], 0, void 0, _ref)); - _initStatic(_class2); + } = babelHelpers.applyDecs2305(_Foo2, [[[staticMethodDec1, staticMethodDec2], 10, "method"], [[staticGetterDec1, staticGetterDec2], 11, "getter"], [[staticSetterDec1, staticSetterDec2], 12, "getter"], [[staticAccessorDec1, staticAccessorDec2], 9, "accessor"], [[methodDec1, methodDec2], 2, "method"], [[getterDec1, getterDec2], 3, "getter"], [[setterDec1, setterDec2], 4, "setter"], [[accessorDec1, accessorDec2], 1, "accessor"], [[staticFieldDec1, staticFieldDec2], 8, "field"], [[fieldDec1, fieldDec2], 0, "field"]], [classDec1, classDec2], 0, void 0, _ref)); + _initStatic(_Foo2); })(); })(), _temp))(); log.push("after"); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/context-name/output.js index 8a4307597361..047e6e33156a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/context-name/output.js @@ -1,4 +1,4 @@ -var _call_a, _computedKey, _initStatic, _class; +var _call_a, _computedKey, _initStatic, _Foo; const logs = []; const dec = (value, context) => { logs.push(context.name); @@ -20,7 +20,7 @@ class Foo { static set [3n](v) {} static set [_computedKey](v) {} } -_class = Foo; +_Foo = Foo; function _set_a(v) { _call_a(this, v); } @@ -29,7 +29,7 @@ var _a = { set: _set_a }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2305(_class, [[dec, 12, "a"], [dec, 12, "a", function (v) {}], [dec, 12, "b"], [dec, 12, "c"], [dec, 12, 0], [dec, 12, 1], [dec, 12, 2n], [dec, 12, 3n], [dec, 12, _computedKey]], []).e; - _initStatic(_class); + [_call_a, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 12, "a"], [dec, 12, "a", function (v) {}], [dec, 12, "b"], [dec, 12, "c"], [dec, 12, 0], [dec, 12, 1], [dec, 12, 2n], [dec, 12, 3n], [dec, 12, _computedKey]], []).e; + _initStatic(_Foo); })(); expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/private/output.js index 43fdfcce76b7..9172ebcb1c87 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/private/output.js @@ -1,8 +1,8 @@ -var _call_a, _initProto, _class; +var _call_a, _initProto, _Foo; const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { - constructor(...args) { + constructor() { babelHelpers.classPrivateFieldInitSpec(this, _a, { get: void 0, set: _set_a @@ -14,10 +14,10 @@ class Foo { babelHelpers.classPrivateFieldSet(this, _a, v); } } -_class = Foo; +_Foo = Foo; function _set_a(v) { _call_a(this, v); } -[_call_a, _initProto] = babelHelpers.applyDecs2305(_class, [[dec, 4, "a", function (v) { +[_call_a, _initProto] = babelHelpers.applyDecs2305(_Foo, [[dec, 4, "a", function (v) { return this.value = v; }]], [], 0, _ => _a.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/public/output.js index ea165c7b44c5..badf4c53dc5a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/public/output.js @@ -1,7 +1,7 @@ -var _initProto, _class; +var _initProto, _Foo; const dec = () => {}; class Foo { - constructor(...args) { + constructor() { babelHelpers.defineProperty(this, "value", 1); _initProto(this); } @@ -12,5 +12,5 @@ class Foo { return this.value = v; } } -_class = Foo; -[_initProto] = babelHelpers.applyDecs2305(_class, [[dec, 4, "a"], [dec, 4, 'b']], []).e; +_Foo = Foo; +[_initProto] = babelHelpers.applyDecs2305(_Foo, [[dec, 4, "a"], [dec, 4, 'b']], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/static-private/output.js index a52681d8f510..5c52ffa5ad96 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/static-private/output.js @@ -1,11 +1,11 @@ -var _call_a, _initStatic, _class; +var _call_a, _initStatic, _Foo; const dec = () => {}; class Foo { static setA(v) { babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); } } -_class = Foo; +_Foo = Foo; function _set_a(v) { _call_a(this, v); } @@ -14,9 +14,9 @@ var _a = { set: _set_a }; (() => { - [_call_a, _initStatic] = babelHelpers.applyDecs2305(_class, [[dec, 12, "a", function (v) { + [_call_a, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 12, "a", function (v) { return this.value = v; }]], []).e; - _initStatic(_class); + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/static-public/output.js index 65eeba8aad2f..cc4e7db7245a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/static-public/output.js @@ -1,4 +1,4 @@ -var _initStatic, _class; +var _initStatic, _Foo; const dec = () => {}; class Foo { static set a(v) { @@ -8,9 +8,9 @@ class Foo { return this.value = v; } } -_class = Foo; +_Foo = Foo; (() => { - [_initStatic] = babelHelpers.applyDecs2305(_class, [[dec, 12, "a"], [dec, 12, 'b']], []).e; - _initStatic(_class); + [_initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 12, "a"], [dec, 12, 'b']], []).e; + _initStatic(_Foo); })(); babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters/private/output.js index 73a6d735335e..1fb330cf5439 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters/private/output.js @@ -6,7 +6,7 @@ class Foo { return this.value = v; }]], [], 0, _ => #a in _).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters/public/output.js index 879016eafc45..20c63ea593af 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters/public/output.js @@ -4,7 +4,7 @@ class Foo { static { [_initProto] = babelHelpers.applyDecs2305(this, [[dec, 4, "a"], [dec, 4, 'b']], []).e; } - constructor(...args) { + constructor() { _initProto(this); } value = 1; diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-destructuring-middle/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-destructuring-middle/output.js index 2cc76f80a790..1e39bb3664e8 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-destructuring-middle/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-destructuring-middle/output.js @@ -1,7 +1,7 @@ -var _class; +var _C; let x, y, z; class C {} -_class = C; +_C = C; var _x = { writable: true, value: void 0 @@ -12,5 +12,5 @@ var _x = { y }, _p, ..._p2] = [{ y: 1 - }, _class], _m = babelHelpers.classStaticPrivateFieldSpecGet(_p, _class, _x), x = _m === void 0 ? y : _m, z = _p2; + }, _C], _m = babelHelpers.classStaticPrivateFieldSpecGet(_p, _C, _x), x = _m === void 0 ? y : _m, z = _p2; })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-only/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-only/output.js index 0981c86b7c59..9a4dff4bea85 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-only/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-only/output.js @@ -1,8 +1,8 @@ -var _class; +var _C; const _excluded = ["0"]; let result; class C {} -_class = C; +_C = C; var _x = { writable: true, value: void 0 @@ -10,7 +10,7 @@ var _x = { (() => { var _p, _m; var x, z; - [..._p] = [_class], _m = babelHelpers.classStaticPrivateFieldSpecGet(_p[0], _class, _x), x = _m === void 0 ? 1 : _m, z = babelHelpers.objectWithoutProperties(_p, _excluded); + [..._p] = [_C], _m = babelHelpers.classStaticPrivateFieldSpecGet(_p[0], _C, _x), x = _m === void 0 ? 1 : _m, z = babelHelpers.objectWithoutProperties(_p, _excluded); result = { x, z diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest/output.js index a19d19c0127a..af2d1e0d1e5b 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest/output.js @@ -1,12 +1,12 @@ -var _class; +var _C; let x, z; class C {} -_class = C; +_C = C; var _x = { writable: true, value: void 0 }; (() => { var _p, _p2, _m; - [_p, ..._p2] = [_class], _m = babelHelpers.classStaticPrivateFieldSpecGet(_p, _class, _x), x = _m === void 0 ? 1 : _m, z = _p2; + [_p, ..._p2] = [_C], _m = babelHelpers.classStaticPrivateFieldSpecGet(_p, _C, _x), x = _m === void 0 ? 1 : _m, z = _p2; })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/basic/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/basic/output.js index 1173f3eaa249..94f8843a8901 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/basic/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/basic/output.js @@ -1,7 +1,7 @@ -var _class; +var _C; let a, x, b; class C {} -_class = C; +_C = C; var _x = { writable: true, value: void 0 @@ -10,7 +10,7 @@ var _x = { var _m; ({ a = 1 - } = _class), _m = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _x), x = _m === void 0 ? 2 : _m, ({ + } = _C), _m = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), x = _m === void 0 ? 2 : _m, ({ b = 3 - } = _class); + } = _C); })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/completion-do-expression/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/completion-do-expression/output.js index 281eb9a6a682..156fcee37319 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/completion-do-expression/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/completion-do-expression/output.js @@ -1,12 +1,12 @@ -var _class; +var _C; var result; class C {} -_class = C; +_C = C; var _x = { writable: true, value: void 0 }; ((_m, _m2) => { var x; - result = (_m = _class, _m2 = babelHelpers.classStaticPrivateFieldSpecGet(_m, _class, _x), x = _m2 === void 0 ? 2 : _m2, _m); + result = (_m = _C, _m2 = babelHelpers.classStaticPrivateFieldSpecGet(_m, _C, _x), x = _m2 === void 0 ? 2 : _m2, _m); })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/member-expression/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/member-expression/output.js index 258822a14d29..8a5c095e639b 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/member-expression/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/member-expression/output.js @@ -1,7 +1,7 @@ -var _class; +var _C; let x; class C {} -_class = C; +_C = C; var _x = { writable: true, value: void 0 @@ -17,5 +17,5 @@ var _z = { (() => { var _p, _p2; let z; - [babelHelpers.classStaticPrivateFieldDestructureSet(_class, _class, _x).value, _p, ..._p2] = [0, _class], x = babelHelpers.classStaticPrivateFieldSpecGet(_p, _class, _x), z = _p2; + [babelHelpers.classStaticPrivateFieldDestructureSet(_C, _C, _x).value, _p, ..._p2] = [0, _C], x = babelHelpers.classStaticPrivateFieldSpecGet(_p, _C, _x), z = _p2; })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested-under-array-pattern/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested-under-array-pattern/output.js index b56614f51de3..dcdb325852db 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested-under-array-pattern/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested-under-array-pattern/output.js @@ -1,8 +1,8 @@ -var _class; +var _C; class C {} -_class = C; +_C = C; function _self() { - return _class; + return _C; } var _x = { writable: true, @@ -16,9 +16,9 @@ var _z = { writable: true, value: void 0 }; -babelHelpers.defineProperty(C, "self", _class); +babelHelpers.defineProperty(C, "self", _C); (() => { var _p, _p2, _p3, _p4, _m; let x, y, z; - [_p, _p2,, _p3] = [_class, _class], x = babelHelpers.classStaticPrivateFieldSpecGet(_p === void 0 ? _class.self : _p, _class, _x), [, _p4] = babelHelpers.classStaticPrivateFieldSpecGet(_p2, _class, _y), _m = babelHelpers.classStaticPrivateFieldSpecGet(_p4 === void 0 ? _class.self : _p4, _class, _z), y = _m === void 0 ? babelHelpers.classStaticPrivateMethodGet(_class, _class, _self).call(_class) : _m, z = _p3 === void 0 ? babelHelpers.classStaticPrivateFieldSpecGet(y, _class, _y) : _p3; + [_p, _p2,, _p3] = [_C, _C], x = babelHelpers.classStaticPrivateFieldSpecGet(_p === void 0 ? _C.self : _p, _C, _x), [, _p4] = babelHelpers.classStaticPrivateFieldSpecGet(_p2, _C, _y), _m = babelHelpers.classStaticPrivateFieldSpecGet(_p4 === void 0 ? _C.self : _p4, _C, _z), y = _m === void 0 ? babelHelpers.classStaticPrivateMethodGet(_C, _C, _self).call(_C) : _m, z = _p3 === void 0 ? babelHelpers.classStaticPrivateFieldSpecGet(y, _C, _y) : _p3; })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested/output.js index b78186f6fa9d..1858785cb047 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested/output.js @@ -1,6 +1,6 @@ -var _class; +var _C; class C {} -_class = C; +_C = C; var _y = { writable: true, value: "y" @@ -14,17 +14,17 @@ var _x = { value: void 0 }; babelHelpers.defineProperty(C, "b", "b"); -babelHelpers.defineProperty(C, "self", _class); +babelHelpers.defineProperty(C, "self", _C); var _self = { writable: true, - value: _class + value: _C }; (() => { var _m, _m2, _m3, _m4, _m5; let cloned, b, y, yy, yy2; - _m = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _x), _m2 = _m === void 0 ? babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _self) : _m, _m3 = _m2[babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _z)], ({ + _m = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), _m2 = _m === void 0 ? babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _self) : _m, _m3 = _m2[babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _z)], ({ b - } = _m3), _m4 = babelHelpers.classStaticPrivateFieldSpecGet(_m3, _class, _x), y = _m4 === void 0 ? (_class.b = "bb", babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _self), _class, _y)) : _m4, _m5 = babelHelpers.classStaticPrivateFieldSpecGet(_m2, _class, _x), yy = _m5 === void 0 ? (delete _class.self, ({ + } = _m3), _m4 = babelHelpers.classStaticPrivateFieldSpecGet(_m3, _C, _x), y = _m4 === void 0 ? (_C.b = "bb", babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _self), _C, _y)) : _m4, _m5 = babelHelpers.classStaticPrivateFieldSpecGet(_m2, _C, _x), yy = _m5 === void 0 ? (delete _C.self, ({ ...cloned - } = _class), babelHelpers.classStaticPrivateFieldSpecSet(_class, _class, _y, "yy")) : _m5, yy2 = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _y); + } = _C), babelHelpers.classStaticPrivateFieldSpecSet(_C, _C, _y, "yy")) : _m5, yy2 = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _y); })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-keys/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-keys/output.js index 0b17fcd5082b..4d5579ca0cd2 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-keys/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-keys/output.js @@ -1,8 +1,8 @@ const _excluded = ["y"]; -var _class; +var _C; let result; class C {} -_class = C; +_C = C; var _x = { writable: true, value: "#x" @@ -14,11 +14,11 @@ var _y = { babelHelpers.defineProperty(C, "a", "a"); babelHelpers.defineProperty(C, "b", "b"); babelHelpers.defineProperty(C, "c", "c"); -(_class2 => { +(_C2 => { let x, y, z; - x = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _x), (_class2 = _class, ({ + x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), (_C2 = _C, ({ y - } = _class2), z = babelHelpers.objectWithoutProperties(_class2, _excluded), _class2); + } = _C2), z = babelHelpers.objectWithoutProperties(_C2, _excluded), _C2); result = { x, y, diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-private-keys/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-private-keys/output.js index 30eb285ee0a4..739d6182c132 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-private-keys/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-private-keys/output.js @@ -1,7 +1,7 @@ -var _class; +var _C; let result; class C {} -_class = C; +_C = C; var _x = { writable: true, value: "#x" @@ -13,9 +13,9 @@ var _y = { babelHelpers.defineProperty(C, "a", "a"); babelHelpers.defineProperty(C, "b", "b"); babelHelpers.defineProperty(C, "c", "c"); -(_class2 => { +(_C2 => { let x, y, z; - x = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _x), y = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _y), (_class2 = _class, ({} = _class2), z = Object.assign({}, (babelHelpers.objectDestructuringEmpty(_class2), _class2)), _class2); + x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), y = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _y), (_C2 = _C, ({} = _C2), z = Object.assign({}, (babelHelpers.objectDestructuringEmpty(_C2), _C2)), _C2); result = { x, y, diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-under-private/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-under-private/output.js index d83c1f9dbe47..e54a7d50a238 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-under-private/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-under-private/output.js @@ -1,20 +1,20 @@ const _excluded = ["y"]; -var _class; +var _C; let result; class C {} -_class = C; +_C = C; babelHelpers.defineProperty(C, "x", "x"); babelHelpers.defineProperty(C, "y", "y"); babelHelpers.defineProperty(C, "z", "z"); var _x = { writable: true, - value: _class + value: _C }; (_babelHelpers$classSt => { var x, y, z; ({ x - } = _class), (_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _x), ({ + } = _C), (_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), ({ y } = _babelHelpers$classSt), z = babelHelpers.objectWithoutProperties(_babelHelpers$classSt, _excluded), _babelHelpers$classSt); result = { diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest/output.js index 8239ceec38e6..4d748da167c4 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest/output.js @@ -1,7 +1,7 @@ -var _class; +var _C; let result; class C {} -_class = C; +_C = C; var _x = { writable: true, value: "#x" @@ -17,10 +17,10 @@ babelHelpers.defineProperty(C, "c", "c"); var _m, _m2; var a, b, x, y, z; ({ - [_m = _class.a]: a - } = _class), x = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _x), ({ - [_m2 = _class.b]: b - } = _class), y = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _y), z = babelHelpers.objectWithoutProperties(_class, [_m, _m2].map(babelHelpers.toPropertyKey)); + [_m = _C.a]: a + } = _C), x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), ({ + [_m2 = _C.b]: b + } = _C), y = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _y), z = babelHelpers.objectWithoutProperties(_C, [_m, _m2].map(babelHelpers.toPropertyKey)); result = { a, b, diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/under-param-initializer/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/under-param-initializer/output.js index b8412883ff27..5978917a684f 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/under-param-initializer/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/under-param-initializer/output.js @@ -1,11 +1,11 @@ -var _m2, _class; +var _m2, _C; let a; class C { static m(r = (_m2 = C, ({ a } = babelHelpers.classStaticPrivateFieldSpecGet(_m2, C, _x)), _m2)) {} } -_class = C; +_C = C; var _x = { writable: true, value: { @@ -16,8 +16,8 @@ var _x = { (() => { var _m; let b; - (function f(r = (_m = _class, ({ + (function f(r = (_m = _C, ({ b - } = babelHelpers.classStaticPrivateFieldSpecGet(_m, _class, _x)), _m)) {})(); + } = babelHelpers.classStaticPrivateFieldSpecGet(_m, _C, _x)), _m)) {})(); })(); C.m(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assumption-objectRestNoSymbols/variable-declaration/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assumption-objectRestNoSymbols/variable-declaration/output.js index 5037fb874850..34af591a3ae1 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assumption-objectRestNoSymbols/variable-declaration/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assumption-objectRestNoSymbols/variable-declaration/output.js @@ -1,7 +1,7 @@ -var _class; +var _C; let result; class C {} -_class = C; +_C = C; var _x = { writable: true, value: "#x" @@ -16,14 +16,14 @@ babelHelpers.defineProperty(C, "c", "c"); (() => { var _m, _m2; var { - [_m = _class.a]: a - } = _class, - x = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _x), + [_m = _C.a]: a + } = _C, + x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), { - [_m2 = _class.b]: b - } = _class, - y = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _y), - z = babelHelpers.objectWithoutPropertiesLoose(_class, [_m, _m2].map(babelHelpers.toPropertyKey)); + [_m2 = _C.b]: b + } = _C, + y = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _y), + z = babelHelpers.objectWithoutPropertiesLoose(_C, [_m, _m2].map(babelHelpers.toPropertyKey)); result = { a, b, diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/catch-param--es2015/no-shadowed-params/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/catch-param--es2015/no-shadowed-params/output.js index d51e13ca3948..43a0d20f3416 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/catch-param--es2015/no-shadowed-params/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/catch-param--es2015/no-shadowed-params/output.js @@ -1,4 +1,4 @@ -var _class; +var _C; var x; var _x = /*#__PURE__*/new WeakMap(); class C { @@ -9,11 +9,11 @@ class C { }); } } -_class = C; +_C = C; (() => { x = "x"; try { - throw new _class(); + throw new _C(); } catch (_e) { let x = babelHelpers.classPrivateFieldGet(_e, _x); } diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs-with-assign/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs-with-assign/output.js index afa726de9108..ecae7ab69a0b 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs-with-assign/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs-with-assign/output.js @@ -1,13 +1,13 @@ -var _class; +var _C; class C {} -_class = C; +_C = C; var _x = { writable: true, value: 42 }; (() => { let x, y; - for (_m = (_m2 = _class, y = babelHelpers.classStaticPrivateFieldSpecGet(_m2, _class, _x), _m2), x = babelHelpers.classStaticPrivateFieldSpecGet(_m, _class, _x), _m;;) { + for (_m = (_m2 = _C, y = babelHelpers.classStaticPrivateFieldSpecGet(_m2, _C, _x), _m2), x = babelHelpers.classStaticPrivateFieldSpecGet(_m, _C, _x), _m;;) { var _m, _m2; break; } diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs/output.js index 06a163afe1c8..70dc9e3d9d44 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs/output.js @@ -1,4 +1,4 @@ -var _class; +var _C; var _x = /*#__PURE__*/new WeakMap(); class C { constructor() { @@ -8,9 +8,9 @@ class C { }); } } -_class = C; +_C = C; (() => { - for (_m = _class, x = babelHelpers.classPrivateFieldGet(_m, _x), _m;;) { + for (_m = _C, x = babelHelpers.classPrivateFieldGet(_m, _x), _m;;) { var _m; break; } diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration-with-assign/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration-with-assign/output.js index 29e129e38515..68d5beb7c986 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration-with-assign/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration-with-assign/output.js @@ -1,13 +1,13 @@ -var _class; +var _C; class C {} -_class = C; +_C = C; var _x = { writable: true, value: 42 }; (() => { let y; - for (let x = babelHelpers.classStaticPrivateFieldSpecGet((_m = _class, y = babelHelpers.classStaticPrivateFieldSpecGet(_m, _class, _x), _m), _class, _x);;) { + for (let x = babelHelpers.classStaticPrivateFieldSpecGet((_m = _C, y = babelHelpers.classStaticPrivateFieldSpecGet(_m, _C, _x), _m), _C, _x);;) { var _m; break; } diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration/output.js index ef865bc59ca1..d9fd6a71f672 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration/output.js @@ -1,12 +1,12 @@ -var _class; +var _C; class C {} -_class = C; +_C = C; var _x = { writable: true, value: void 0 }; (() => { - for (let x = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _x);;) { + for (let x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x);;) { break; } })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs-with-shadowed-block-scoped/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs-with-shadowed-block-scoped/output.js index e016189390d9..09e9cb369ebc 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs-with-shadowed-block-scoped/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs-with-shadowed-block-scoped/output.js @@ -1,6 +1,6 @@ -var _class; +var _C; class C {} -_class = C; +_C = C; babelHelpers.defineProperty(C, "a", "a"); var _x = { writable: true, @@ -9,8 +9,8 @@ var _x = { (() => { var x, a = "a"; - for (const _ref of [_class]) { - x = babelHelpers.classStaticPrivateFieldSpecGet(_ref, _class, _x), ({ + for (const _ref of [_C]) { + x = babelHelpers.classStaticPrivateFieldSpecGet(_ref, _C, _x), ({ [a]: a } = _ref); { diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs/output.js index 104e73cc6663..0f8500fc8b38 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs/output.js @@ -1,4 +1,4 @@ -var _class; +var _C; var _x = /*#__PURE__*/new WeakMap(); class C { constructor() { @@ -8,9 +8,9 @@ class C { }); } } -_class = C; +_C = C; (() => { - for (const _ref of [_class]) { + for (const _ref of [_C]) { x = babelHelpers.classPrivateFieldGet(_ref, _x); ; } diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration-block-scoped/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration-block-scoped/output.js index 1d39975b4762..0f201356dae5 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration-block-scoped/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration-block-scoped/output.js @@ -1,6 +1,6 @@ -var _class; +var _C; class C {} -_class = C; +_C = C; babelHelpers.defineProperty(C, "a", "a"); var _x = { writable: true, @@ -8,8 +8,8 @@ var _x = { }; (() => { const a = "a"; - for (const _ref of [_class]) { - const x = babelHelpers.classStaticPrivateFieldSpecGet(_ref, _class, _x), + for (const _ref of [_C]) { + const x = babelHelpers.classStaticPrivateFieldSpecGet(_ref, _C, _x), { [a]: _ } = _ref; diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration/output.js index c55f118b1423..746bee5ad847 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration/output.js @@ -1,4 +1,4 @@ -var _class; +var _C; var _x = /*#__PURE__*/new WeakMap(); class C { constructor() { @@ -8,9 +8,9 @@ class C { }); } } -_class = C; +_C = C; (() => { - for (const _ref of [_class]) { + for (const _ref of [_C]) { const x = babelHelpers.classPrivateFieldGet(_ref, _x); ; } diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest-only/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest-only/output.js index e989e7821105..1a78f9a5bc11 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest-only/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest-only/output.js @@ -1,15 +1,15 @@ -var _class; +var _C; const _excluded = ["0"]; let result; class C {} -_class = C; +_C = C; var _x = { writable: true, value: void 0 }; (() => { - var [..._p] = [_class], - _m = babelHelpers.classStaticPrivateFieldSpecGet(_p[0], _class, _x), + var [..._p] = [_C], + _m = babelHelpers.classStaticPrivateFieldSpecGet(_p[0], _C, _x), x = _m === void 0 ? 1 : _m, z = babelHelpers.objectWithoutProperties(_p, _excluded); result = { diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest/output.js index 16058f1ab4c4..96ce771b5fb1 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest/output.js @@ -1,13 +1,13 @@ -var _class; +var _C; class C {} -_class = C; +_C = C; var _x = { writable: true, value: void 0 }; (() => { - var [_p, ..._p2] = [_class], - _m = babelHelpers.classStaticPrivateFieldSpecGet(_p, _class, _x), + var [_p, ..._p2] = [_C], + _m = babelHelpers.classStaticPrivateFieldSpecGet(_p, _C, _x), x = _m === void 0 ? 1 : _m, z = _p2; })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/basic/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/basic/output.js index 7056e1df1c3c..a8562edf4b02 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/basic/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/basic/output.js @@ -1,6 +1,6 @@ -var _class; +var _C; class C {} -_class = C; +_C = C; var _x = { writable: true, value: void 0 @@ -8,10 +8,10 @@ var _x = { (() => { var { a = 1 - } = _class, - _m = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _x), + } = _C, + _m = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), x = _m === void 0 ? 2 : _m, { b = 3 - } = _class; + } = _C; })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested-under-array-pattern/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested-under-array-pattern/output.js index 601bfd555baa..b9ef6fd84a3d 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested-under-array-pattern/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested-under-array-pattern/output.js @@ -1,8 +1,8 @@ -var _class; +var _C; class C {} -_class = C; +_C = C; function _self() { - return _class; + return _C; } var _x = { writable: true, @@ -16,12 +16,12 @@ var _z = { writable: true, value: void 0 }; -babelHelpers.defineProperty(C, "self", _class); +babelHelpers.defineProperty(C, "self", _C); (() => { - var [_p, _p2,, _p3] = [_class, _class], - x = babelHelpers.classStaticPrivateFieldSpecGet(_p === void 0 ? _class.self : _p, _class, _x), - [, _p4] = babelHelpers.classStaticPrivateFieldSpecGet(_p2, _class, _y), - _m = babelHelpers.classStaticPrivateFieldSpecGet(_p4 === void 0 ? _class.self : _p4, _class, _z), - y = _m === void 0 ? babelHelpers.classStaticPrivateMethodGet(_class, _class, _self).call(_class) : _m, - z = _p3 === void 0 ? babelHelpers.classStaticPrivateFieldSpecGet(y, _class, _y) : _p3; + var [_p, _p2,, _p3] = [_C, _C], + x = babelHelpers.classStaticPrivateFieldSpecGet(_p === void 0 ? _C.self : _p, _C, _x), + [, _p4] = babelHelpers.classStaticPrivateFieldSpecGet(_p2, _C, _y), + _m = babelHelpers.classStaticPrivateFieldSpecGet(_p4 === void 0 ? _C.self : _p4, _C, _z), + y = _m === void 0 ? babelHelpers.classStaticPrivateMethodGet(_C, _C, _self).call(_C) : _m, + z = _p3 === void 0 ? babelHelpers.classStaticPrivateFieldSpecGet(y, _C, _y) : _p3; })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested/output.js index 5ee4fe1ef455..d6ebcfed64ed 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested/output.js @@ -1,6 +1,6 @@ -var _class; +var _C; class C {} -_class = C; +_C = C; var _y = { writable: true, value: "y" @@ -14,24 +14,24 @@ var _x = { value: void 0 }; babelHelpers.defineProperty(C, "b", "b"); -babelHelpers.defineProperty(C, "self", _class); +babelHelpers.defineProperty(C, "self", _C); var _self = { writable: true, - value: _class + value: _C }; (() => { let cloned; - var _m = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _x), - _m2 = _m === void 0 ? babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _self) : _m, - _m3 = _m2[babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _z)], + var _m = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), + _m2 = _m === void 0 ? babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _self) : _m, + _m3 = _m2[babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _z)], { b } = _m3, - _m4 = babelHelpers.classStaticPrivateFieldSpecGet(_m3, _class, _x), - y = _m4 === void 0 ? (_class.b = "bb", babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _self), _class, _y)) : _m4, - _m5 = babelHelpers.classStaticPrivateFieldSpecGet(_m2, _class, _x), - yy = _m5 === void 0 ? (delete _class.self, ({ + _m4 = babelHelpers.classStaticPrivateFieldSpecGet(_m3, _C, _x), + y = _m4 === void 0 ? (_C.b = "bb", babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _self), _C, _y)) : _m4, + _m5 = babelHelpers.classStaticPrivateFieldSpecGet(_m2, _C, _x), + yy = _m5 === void 0 ? (delete _C.self, ({ ...cloned - } = _class), babelHelpers.classStaticPrivateFieldSpecSet(_class, _class, _y, "yy")) : _m5, - yy2 = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _y); + } = _C), babelHelpers.classStaticPrivateFieldSpecSet(_C, _C, _y, "yy")) : _m5, + yy2 = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _y); })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-keys/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-keys/output.js index b4beccdcb108..2316404a3093 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-keys/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-keys/output.js @@ -1,8 +1,8 @@ const _excluded = ["y"]; -var _class; +var _C; let result; class C {} -_class = C; +_C = C; var _x = { writable: true, value: "#x" @@ -12,11 +12,11 @@ babelHelpers.defineProperty(C, "a", "a"); babelHelpers.defineProperty(C, "b", "b"); babelHelpers.defineProperty(C, "c", "c"); (() => { - var x = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _x), + var x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), { y - } = _class, - z = babelHelpers.objectWithoutProperties(_class, _excluded); + } = _C, + z = babelHelpers.objectWithoutProperties(_C, _excluded); result = { x, y, diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-private-keys/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-private-keys/output.js index 57b680b2e961..bb56c3313406 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-private-keys/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-private-keys/output.js @@ -1,7 +1,7 @@ -var _class; +var _C; let result; class C {} -_class = C; +_C = C; var _x = { writable: true, value: "#x" @@ -14,9 +14,9 @@ babelHelpers.defineProperty(C, "a", "a"); babelHelpers.defineProperty(C, "b", "b"); babelHelpers.defineProperty(C, "c", "c"); (() => { - var x = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _x), - y = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _y), - z = Object.assign({}, (babelHelpers.objectDestructuringEmpty(_class), _class)); + var x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), + y = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _y), + z = Object.assign({}, (babelHelpers.objectDestructuringEmpty(_C), _C)); result = { x, y, diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-under-private/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-under-private/output.js index 2b15f5dace97..d27eb900cee6 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-under-private/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-under-private/output.js @@ -1,20 +1,20 @@ const _excluded = ["y"]; -var _class; +var _C; let result; class C {} -_class = C; +_C = C; babelHelpers.defineProperty(C, "x", "x"); babelHelpers.defineProperty(C, "y", "y"); babelHelpers.defineProperty(C, "z", "z"); var _x = { writable: true, - value: _class + value: _C }; (() => { var { x - } = _class, - _babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _x), + } = _C, + _babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), { y } = _babelHelpers$classSt, diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest/output.js index 11916987f47a..2ae91a53b9d3 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest/output.js @@ -1,7 +1,7 @@ -var _class; +var _C; let result; class C {} -_class = C; +_C = C; var _x = { writable: true, value: "#x" @@ -16,14 +16,14 @@ babelHelpers.defineProperty(C, "c", "c"); (() => { var _m, _m2; var { - [_m = _class.a]: a - } = _class, - x = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _x), + [_m = _C.a]: a + } = _C, + x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), { - [_m2 = _class.b]: b - } = _class, - y = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _y), - z = babelHelpers.objectWithoutProperties(_class, [_m, _m2].map(babelHelpers.toPropertyKey)); + [_m2 = _C.b]: b + } = _C, + y = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _y), + z = babelHelpers.objectWithoutProperties(_C, [_m, _m2].map(babelHelpers.toPropertyKey)); result = { a, b, diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack-double-at/class-decorator/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack-double-at/class-decorator/output.js index 21ffd538f00c..5c9ff2cf73d9 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack-double-at/class-decorator/output.js +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack-double-at/class-decorator/output.js @@ -1,12 +1,12 @@ -var _initClass, _decorated_class, _class; +var _initClass, _decorated_class, _Class; const expectedValue = 42; function decorator(target) { target.decoratorValue = expectedValue; } -const result = ((_class = class { +const result = ((_Class = class { constructor() { this.value = expectedValue; } -}, [_decorated_class, _initClass] = babelHelpers.applyDecs2305(_class, [], [decorator]).c, _initClass()), _decorated_class); +}, [_decorated_class, _initClass] = babelHelpers.applyDecs2305(_Class, [], [decorator]).c, _initClass()), _decorated_class); expect(result.decoratorValue).toBe(expectedValue); expect(new result().value).toBe(expectedValue); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack-double-caret/class-decorator/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack-double-caret/class-decorator/output.js index 21ffd538f00c..5c9ff2cf73d9 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack-double-caret/class-decorator/output.js +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack-double-caret/class-decorator/output.js @@ -1,12 +1,12 @@ -var _initClass, _decorated_class, _class; +var _initClass, _decorated_class, _Class; const expectedValue = 42; function decorator(target) { target.decoratorValue = expectedValue; } -const result = ((_class = class { +const result = ((_Class = class { constructor() { this.value = expectedValue; } -}, [_decorated_class, _initClass] = babelHelpers.applyDecs2305(_class, [], [decorator]).c, _initClass()), _decorated_class); +}, [_decorated_class, _initClass] = babelHelpers.applyDecs2305(_Class, [], [decorator]).c, _initClass()), _decorated_class); expect(result.decoratorValue).toBe(expectedValue); expect(new result().value).toBe(expectedValue); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-before-member-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-before-member-call/output.js index ccddd36305ea..4f6b717c399a 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-before-member-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-before-member-call/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return this; @@ -59,7 +59,7 @@ class Foo { (_getSelf6 = (fn == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.()) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6$self = _getSelf6.self, Foo, _m).call(_getSelf6$self); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 @@ -67,12 +67,12 @@ var _x = { var _m = { writable: true, value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _x); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); } }; var _self = { writable: true, - value: _class + value: _Foo }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/non-block-arrow-func/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/non-block-arrow-func/output.mjs index 791bfd8e53ac..2455bcf8feb1 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/non-block-arrow-func/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/non-block-arrow-func/output.mjs @@ -1,11 +1,11 @@ export default (param => { - var _class; - return _class = class App { + var _App; + return _App = class App { getParam() { return param; } - }, _class.props = { + }, _App.props = { prop1: 'prop1', prop2: 'prop2' - }, _class; + }, _App; }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/regression-T2983/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/regression-T2983/output.mjs index b9965769d705..26f3bce67c3b 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/regression-T2983/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/regression-T2983/output.mjs @@ -1,5 +1,5 @@ -var _class; -call((_class = class {}, _class.test = true, _class)); -export default class _class2 {} -_class2.test = true; +var _Class; +call((_Class = class {}, _Class.test = true, _Class)); +export default class _Class2 {} +_Class2.test = true; ; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/regression-T6719/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/regression-T6719/output.js index 2e1aaa259328..9f427da118ac 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/regression-T6719/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/regression-T6719/output.js @@ -1,10 +1,10 @@ function withContext(ComposedComponent) { - var _class; - return _class = class WithContext extends Component {}, _class.propTypes = { + var _WithContext; + return _WithContext = class WithContext extends Component {}, _WithContext.propTypes = { context: PropTypes.shape({ addCss: PropTypes.func, setTitle: PropTypes.func, setMeta: PropTypes.func }) - }, _class; + }, _WithContext; } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-class-binding/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-class-binding/output.js index 483b083d2219..865940f2b104 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-class-binding/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-class-binding/output.js @@ -1,5 +1,5 @@ -var _class; +var _A; class A {} -_class = A; -A.self = _class; -A.getA = () => _class; +_A = A; +A.self = _A; +A.getA = () => _A; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-infer-name/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-infer-name/output.js index 172c30d29572..77102b5e402d 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-infer-name/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-infer-name/output.js @@ -1,2 +1,2 @@ -var _class; -var Foo = (_class = class Foo {}, _class.num = 0, _class); +var _Class; +var Foo = (_Class = class Foo {}, _Class.num = 0, _Class); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-super/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-super/output.js index bc3d21b92554..14ceb4c548c5 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-super/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-super/output.js @@ -1,8 +1,8 @@ -var _class2; +var _B; class A {} A.prop = 1; class B extends A {} -_class2 = B; +_B = B; B.prop = 2; -B.propA = babelHelpers.get(babelHelpers.getPrototypeOf(_class2), "prop", _class2); -B.getPropA = () => babelHelpers.get(babelHelpers.getPrototypeOf(_class2), "prop", _class2); +B.propA = babelHelpers.get(babelHelpers.getPrototypeOf(_B), "prop", _B); +B.getPropA = () => babelHelpers.get(babelHelpers.getPrototypeOf(_B), "prop", _B); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-this/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-this/output.js index 483b083d2219..865940f2b104 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-this/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-setPublicClassFields/static-this/output.js @@ -1,5 +1,5 @@ -var _class; +var _A; class A {} -_class = A; -A.self = _class; -A.getA = () => _class; +_A = A; +A.self = _A; +A.getA = () => _A; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/nested-class/super-call-in-decorator/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/nested-class/super-call-in-decorator/output.js index 2183b4929db9..9faf165d66c0 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/nested-class/super-call-in-decorator/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/nested-class/super-call-in-decorator/output.js @@ -7,7 +7,7 @@ let Hello = /*#__PURE__*/babelHelpers.createClass(function Hello() { let Outer = /*#__PURE__*/function (_Hello) { babelHelpers.inherits(Outer, _Hello); function Outer() { - var _dec, _init_hello, _class; + var _dec, _init_hello, _Inner; var _this; babelHelpers.classCallCheck(this, Outer); _dec = _this = babelHelpers.callSuper(this, Outer); @@ -15,8 +15,8 @@ let Outer = /*#__PURE__*/function (_Hello) { babelHelpers.classCallCheck(this, Inner); babelHelpers.defineProperty(this, "hello", _init_hello(this)); }); - _class = Inner; - [_init_hello] = babelHelpers.applyDecs2305(_class, [[_dec, 0, "hello"]], []).e; + _Inner = Inner; + [_init_hello] = babelHelpers.applyDecs2305(_Inner, [[_dec, 0, "hello"]], []).e; return babelHelpers.possibleConstructorReturn(_this, new Inner()); } return babelHelpers.createClass(Outer); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/nested-class/super-property-in-decorator/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/nested-class/super-property-in-decorator/output.js index 3ee7c3b3eef5..c5bfc251a4d9 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/nested-class/super-property-in-decorator/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/nested-class/super-property-in-decorator/output.js @@ -15,7 +15,7 @@ let Hello = /*#__PURE__*/function () { let Outer = /*#__PURE__*/function (_Hello) { babelHelpers.inherits(Outer, _Hello); function Outer() { - var _dec, _init_hello, _class; + var _dec, _init_hello, _Inner; var _thisSuper, _this; babelHelpers.classCallCheck(this, Outer); _this = babelHelpers.callSuper(this, Outer); @@ -24,8 +24,8 @@ let Outer = /*#__PURE__*/function (_Hello) { babelHelpers.classCallCheck(this, Inner); babelHelpers.defineProperty(this, "hello", _init_hello(this)); }); - _class = Inner; - [_init_hello] = babelHelpers.applyDecs2305(_class, [[_dec, 0, "hello"]], []).e; + _Inner = Inner; + [_init_hello] = babelHelpers.applyDecs2305(_Inner, [[_dec, 0, "hello"]], []).e; return babelHelpers.possibleConstructorReturn(_this, new Inner()); } return babelHelpers.createClass(Outer); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/class-shadow-builtins/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/class-shadow-builtins/output.mjs index 3cbf7b8d3e93..ed245271f608 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/class-shadow-builtins/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/class-shadow-builtins/output.mjs @@ -1,7 +1,7 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } var _message = /*#__PURE__*/new WeakMap(); -class _TypeError { +class _TypeError2 { constructor() { _classPrivateFieldInitSpec(this, _message, { writable: true, @@ -9,4 +9,4 @@ class _TypeError { }); } } -export { _TypeError as TypeError }; +export { _TypeError2 as TypeError }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/derived/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/derived/output.js index 67a73d612de0..c5fd56cb7119 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/derived/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/derived/output.js @@ -9,10 +9,10 @@ var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() { }); }); var _prop2 = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("prop"); -var Bar = /*#__PURE__*/function (_Foo) { +var Bar = /*#__PURE__*/function (_Foo2) { "use strict"; - babelHelpers.inherits(Bar, _Foo); + babelHelpers.inherits(Bar, _Foo2); function Bar(...args) { var _this; babelHelpers.classCallCheck(this, Bar); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/nested-class-extends-computed-redeclared/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/nested-class-extends-computed-redeclared/output.js index 44aad9fd396b..13428243bc63 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/nested-class-extends-computed-redeclared/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/nested-class-extends-computed-redeclared/output.js @@ -29,15 +29,15 @@ var Foo = /*#__PURE__*/function () { } return babelHelpers.createClass(Nested); }((_foo3 = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("foo"), _babelHelpers$classPr = babelHelpers.classPrivateFieldLooseBase(this, _foo3)[_foo3], /*#__PURE__*/function () { - function _class4() { - babelHelpers.classCallCheck(this, _class4); + function _class() { + babelHelpers.classCallCheck(this, _class); Object.defineProperty(this, _foo3, { writable: true, value: 2 }); this[_babelHelpers$classPr] = 2; } - return babelHelpers.createClass(_class4); + return babelHelpers.createClass(_class); }())); } }]); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/nested-class-extends-computed/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/nested-class-extends-computed/output.js index 590faa44914f..75b0193f4167 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/nested-class-extends-computed/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/nested-class-extends-computed/output.js @@ -28,11 +28,11 @@ var Foo = /*#__PURE__*/function () { } return babelHelpers.createClass(Nested); }((_babelHelpers$classPr = babelHelpers.classPrivateFieldLooseBase(this, _foo)[_foo], /*#__PURE__*/function () { - function _class4() { - babelHelpers.classCallCheck(this, _class4); + function _class() { + babelHelpers.classCallCheck(this, _class); this[_babelHelpers$classPr] = 2; } - return babelHelpers.createClass(_class4); + return babelHelpers.createClass(_class); }())); } }]); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/non-block-arrow-func/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/non-block-arrow-func/output.mjs index 3435d35b051e..09fe2b4a4b9d 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/non-block-arrow-func/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/non-block-arrow-func/output.mjs @@ -1,14 +1,14 @@ export default (param => { - var _class, _props; - return _props = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("props"), (_class = class App { + var _App, _props; + return _props = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("props"), (_App = class App { getParam() { return param; } - }, Object.defineProperty(_class, _props, { + }, Object.defineProperty(_App, _props, { writable: true, value: { prop1: 'prop1', prop2: 'prop2' } - }), _class); + }), _App); }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-member-call-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-member-call-with-transform/output.js index 810feb67f5b6..4e0f9f298538 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-member-call-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-member-call-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _m = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("m"); var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); @@ -62,7 +62,7 @@ class Foo { (_getSelf6 = (_ref22 = fn === null || fn === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(fn().Foo, _self)[_self]) == null || _ref22.getSelf == null ? void 0 : _ref22.getSelf()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(_getSelf6.self, _m)[_m](); } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 @@ -75,7 +75,7 @@ Object.defineProperty(Foo, _m, { }); Object.defineProperty(Foo, _self, { writable: true, - value: _class + value: _Foo }); -Foo.self = _class; +Foo.self = _Foo; Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-member-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-member-call/output.js index 3b227e558cd2..d800709c7991 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-member-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-member-call/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _m = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("m"); var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); @@ -62,7 +62,7 @@ class Foo { (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(fn().Foo, _self)[_self])?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(_getSelf6.self, _m)[_m](); } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 @@ -75,7 +75,7 @@ Object.defineProperty(Foo, _m, { }); Object.defineProperty(Foo, _self, { writable: true, - value: _class + value: _Foo }); -Foo.self = _class; +Foo.self = _Foo; Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-property-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-property-with-transform/output.js index aafabb5efe86..63f265c52a87 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-property-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-property-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); class Foo { @@ -61,14 +61,14 @@ class Foo { (_getSelf6 = (_ref22 = fn === null || fn === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(fn().Foo, _self)[_self]) == null || _ref22.getSelf == null ? void 0 : _ref22.getSelf()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(_getSelf6.self, _x)[_x]; } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 }); Object.defineProperty(Foo, _self, { writable: true, - value: _class + value: _Foo }); -Foo.self = _class; +Foo.self = _Foo; Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-property/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-property/output.js index ce3e90d1f481..8cbea90f536b 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-property/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-before-property/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); class Foo { @@ -61,14 +61,14 @@ class Foo { (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(fn().Foo, _self)[_self])?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(_getSelf6.self, _x)[_x]; } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 }); Object.defineProperty(Foo, _self, { writable: true, - value: _class + value: _Foo }); -Foo.self = _class; +Foo.self = _Foo; Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-delete-property-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-delete-property-with-transform/output.js index 9e900087fe60..f3486b993e34 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-delete-property-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-delete-property-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); class Foo { @@ -53,14 +53,14 @@ class Foo { (_ref20 = fn === null || fn === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(fn().Foo, _self)[_self]) == null || _ref20.getSelf == null || (_ref20 = _ref20.getSelf()) == null || delete _ref20.self.unicorn; } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 }); Object.defineProperty(Foo, _self, { writable: true, - value: _class + value: _Foo }); -Foo.self = _class; +Foo.self = _Foo; Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-delete-property/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-delete-property/output.js index 58b0764c5031..0f3d6555ac02 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-delete-property/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-delete-property/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); class Foo { @@ -53,14 +53,14 @@ class Foo { delete (fn === null || fn === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(fn().Foo, _self)[_self])?.getSelf?.()?.self.unicorn; } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 }); Object.defineProperty(Foo, _self, { writable: true, - value: _class + value: _Foo }); -Foo.self = _class; +Foo.self = _Foo; Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-in-function-param-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-in-function-param-with-transform/output.js index f61e95c88683..dd8a22d327bd 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-in-function-param-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-in-function-param-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _m = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("m"); var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); @@ -43,7 +43,7 @@ class Foo { j(fn); } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 @@ -56,7 +56,7 @@ Object.defineProperty(Foo, _m, { }); Object.defineProperty(Foo, _self, { writable: true, - value: _class + value: _Foo }); -Foo.self = _class; +Foo.self = _Foo; Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-in-function-param/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-in-function-param/output.js index eb8621e08f10..c301418943d7 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-in-function-param/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-in-function-param/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _m = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("m"); var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); @@ -43,7 +43,7 @@ class Foo { j(fn); } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 @@ -56,7 +56,7 @@ Object.defineProperty(Foo, _m, { }); Object.defineProperty(Foo, _self, { writable: true, - value: _class + value: _Foo }); -Foo.self = _class; +Foo.self = _Foo; Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-member-optional-call-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-member-optional-call-with-transform/output.js index 0089014a62dd..173a5e2066a9 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-member-optional-call-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-member-optional-call-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _m = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("m"); var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); @@ -65,7 +65,7 @@ class Foo { (_getSelf6 = (_ref28 = fn === null || fn === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(fn().Foo, _self)[_self]) == null || _ref28.getSelf == null ? void 0 : _ref28.getSelf()) === null || _getSelf6 === void 0 ? void 0 : (_babelHelpers$classPr79 = (_babelHelpers$classPr80 = babelHelpers.classPrivateFieldLooseBase(_getSelf6.self, _m))[_m]) == null ? void 0 : _babelHelpers$classPr79.call(_babelHelpers$classPr80); } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 @@ -78,7 +78,7 @@ Object.defineProperty(Foo, _m, { }); Object.defineProperty(Foo, _self, { writable: true, - value: _class + value: _Foo }); -Foo.self = _class; +Foo.self = _Foo; Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-member-optional-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-member-optional-call/output.js index 7511a0682223..96d27550df89 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-member-optional-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-member-optional-call/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _m = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("m"); var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); @@ -65,7 +65,7 @@ class Foo { (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(fn().Foo, _self)[_self])?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(_getSelf6.self, _m)[_m]?.(); } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 @@ -78,7 +78,7 @@ Object.defineProperty(Foo, _m, { }); Object.defineProperty(Foo, _self, { writable: true, - value: _class + value: _Foo }); -Foo.self = _class; +Foo.self = _Foo; Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-member-call-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-member-call-with-transform/output.js index c933ce298f8f..5616c24d4bc2 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-member-call-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-member-call-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _m = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("m"); var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); @@ -65,7 +65,7 @@ class Foo { (_getSelf$self4 = (_ref26 = fn === null || fn === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(fn().Foo, _self)[_self]) == null || _ref26.getSelf == null || (_ref26 = _ref26.getSelf()) == null ? void 0 : _ref26.self) === null || _getSelf$self4 === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(_getSelf$self4, _m)[_m](); } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 @@ -78,7 +78,7 @@ Object.defineProperty(Foo, _m, { }); Object.defineProperty(Foo, _self, { writable: true, - value: _class + value: _Foo }); -Foo.self = _class; +Foo.self = _Foo; Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-member-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-member-call/output.js index 9ab2f5d7ef74..d0b9237fb4e8 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-member-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-member-call/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _m = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("m"); var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); @@ -65,7 +65,7 @@ class Foo { (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(fn().Foo, _self)[_self])?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(_getSelf6.self, _m)[_m](); } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 @@ -78,7 +78,7 @@ Object.defineProperty(Foo, _m, { }); Object.defineProperty(Foo, _self, { writable: true, - value: _class + value: _Foo }); -Foo.self = _class; +Foo.self = _Foo; Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-property-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-property-with-transform/output.js index ac142ff493a9..e430c5f3a195 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-property-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-property-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); class Foo { @@ -64,14 +64,14 @@ class Foo { (_getSelf$self4 = (_ref26 = fn === null || fn === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(fn().Foo, _self)[_self]) == null || _ref26.getSelf == null || (_ref26 = _ref26.getSelf()) == null ? void 0 : _ref26.self) === null || _getSelf$self4 === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(_getSelf$self4, _x)[_x]; } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 }); Object.defineProperty(Foo, _self, { writable: true, - value: _class + value: _Foo }); -Foo.self = _class; +Foo.self = _Foo; Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-property/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-property/output.js index a042bf3d92f6..c929258a7417 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-property/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/optional-chain-optional-property/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); class Foo { @@ -64,14 +64,14 @@ class Foo { (_getSelf$self4 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(fn().Foo, _self)[_self])?.getSelf?.()?.self) === null || _getSelf$self4 === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(_getSelf$self4, _x)[_x]; } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 }); Object.defineProperty(Foo, _self, { writable: true, - value: _class + value: _Foo }); -Foo.self = _class; +Foo.self = _Foo; Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call-with-transform/output.js index d58dcd3b6ce8..fe34c075eac3 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _m = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("m"); class Foo { @@ -25,12 +25,12 @@ class Foo { ((_fn$Foo$self$getSelf2 = (fn == null || (_fn$Foo$self = fn().Foo.self) == null ? void 0 : _fn$Foo$self.getSelf.bind(_fn$Foo$self))()) === null || _fn$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(_fn$Foo$self$getSelf2, _m)[_m].bind(_fn$Foo$self$getSelf2))(); } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 }); -Foo.self = _class; +Foo.self = _Foo; Object.defineProperty(Foo, _m, { writable: true, value: function () { diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call/output.js index 8369f454c1f2..fc7aacce28eb 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return Foo; @@ -23,16 +23,16 @@ class Foo { ((_fn$Foo$self$getSelf2 = (fn?.().Foo.self?.getSelf)()) === null || _fn$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo$self$getSelf2, Foo, _m).bind(_fn$Foo$self$getSelf2))(); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); var _m = { writable: true, value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _x); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); } }; new Foo().test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/reevaluated/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/reevaluated/output.js index f8067ff6f1ac..a3d600eb9863 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/reevaluated/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/reevaluated/output.js @@ -1,6 +1,6 @@ function classFactory() { - var _class, _foo, _bar; - return _foo = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("foo"), _bar = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("bar"), (_class = class Foo { + var _Foo, _foo, _bar; + return _foo = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("foo"), _bar = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("bar"), (_Foo = class Foo { constructor() { Object.defineProperty(this, _foo, { writable: true, @@ -19,10 +19,10 @@ function classFactory() { static static() { return babelHelpers.classPrivateFieldLooseBase(Foo, _bar)[_bar]; } - }, Object.defineProperty(_class, _bar, { + }, Object.defineProperty(_Foo, _bar, { writable: true, value: "bar" - }), _class); + }), _Foo); } var Foo1 = classFactory(); var Foo2 = classFactory(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-class-binding/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-class-binding/output.js index 9b7ef5bd50ce..98218dc3cbc3 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-class-binding/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-class-binding/output.js @@ -1,4 +1,4 @@ -var _class; +var _A; var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); var _getA = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("getA"); var A = /*#__PURE__*/babelHelpers.createClass(function A() { @@ -6,12 +6,12 @@ var A = /*#__PURE__*/babelHelpers.createClass(function A() { babelHelpers.classCallCheck(this, A); }); -_class = A; +_A = A; Object.defineProperty(A, _self, { writable: true, - value: _class + value: _A }); Object.defineProperty(A, _getA, { writable: true, - value: () => _class + value: () => _A }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-infer-name/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-infer-name/output.js index a9877d1e22b2..9ef2e4598ad6 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-infer-name/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-infer-name/output.js @@ -1,5 +1,5 @@ -var _class, _num; -var Foo = (_num = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("num"), (_class = class Foo {}, Object.defineProperty(_class, _num, { +var _Class, _num; +var Foo = (_num = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("num"), (_Class = class Foo {}, Object.defineProperty(_Class, _num, { writable: true, value: 0 -}), _class)); +}), _Class)); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-this/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-this/output.js index 9b7ef5bd50ce..98218dc3cbc3 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-this/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-this/output.js @@ -1,4 +1,4 @@ -var _class; +var _A; var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); var _getA = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("getA"); var A = /*#__PURE__*/babelHelpers.createClass(function A() { @@ -6,12 +6,12 @@ var A = /*#__PURE__*/babelHelpers.createClass(function A() { babelHelpers.classCallCheck(this, A); }); -_class = A; +_A = A; Object.defineProperty(A, _self, { writable: true, - value: _class + value: _A }); Object.defineProperty(A, _getA, { writable: true, - value: () => _class + value: () => _A }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/class-shadow-builtins/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/private/class-shadow-builtins/output.mjs index 3cbf7b8d3e93..ed245271f608 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/class-shadow-builtins/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/class-shadow-builtins/output.mjs @@ -1,7 +1,7 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } var _message = /*#__PURE__*/new WeakMap(); -class _TypeError { +class _TypeError2 { constructor() { _classPrivateFieldInitSpec(this, _message, { writable: true, @@ -9,4 +9,4 @@ class _TypeError { }); } } -export { _TypeError as TypeError }; +export { _TypeError2 as TypeError }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/derived/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/derived/output.js index 4410b9c9aa26..9fbc6a4d6046 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/derived/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/derived/output.js @@ -9,10 +9,10 @@ var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() { }); }); var _prop2 = /*#__PURE__*/new WeakMap(); -var Bar = /*#__PURE__*/function (_Foo) { +var Bar = /*#__PURE__*/function (_Foo2) { "use strict"; - babelHelpers.inherits(Bar, _Foo); + babelHelpers.inherits(Bar, _Foo2); function Bar(...args) { var _this; babelHelpers.classCallCheck(this, Bar); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed-redeclared/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed-redeclared/output.js index cfee0900e5d3..a948b080dcda 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed-redeclared/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed-redeclared/output.js @@ -29,15 +29,15 @@ var Foo = /*#__PURE__*/function () { } return babelHelpers.createClass(Nested); }((_foo3 = /*#__PURE__*/new WeakMap(), _babelHelpers$classPr = babelHelpers.classPrivateFieldGet(this, _foo3), /*#__PURE__*/function () { - function _class4() { - babelHelpers.classCallCheck(this, _class4); + function _class() { + babelHelpers.classCallCheck(this, _class); babelHelpers.classPrivateFieldInitSpec(this, _foo3, { writable: true, value: 2 }); babelHelpers.defineProperty(this, _babelHelpers$classPr, 2); } - return babelHelpers.createClass(_class4); + return babelHelpers.createClass(_class); }())); } }]); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed/output.js index 9e8c8b37a2d7..08c26eb63308 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed/output.js @@ -28,11 +28,11 @@ var Foo = /*#__PURE__*/function () { } return babelHelpers.createClass(Nested); }((_babelHelpers$classPr = babelHelpers.classPrivateFieldGet(this, _foo), /*#__PURE__*/function () { - function _class4() { - babelHelpers.classCallCheck(this, _class4); + function _class() { + babelHelpers.classCallCheck(this, _class); babelHelpers.defineProperty(this, _babelHelpers$classPr, 2); } - return babelHelpers.createClass(_class4); + return babelHelpers.createClass(_class); }())); } }]); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/non-block-arrow-func/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/private/non-block-arrow-func/output.mjs index 077ead1d13f7..45322b3d9212 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/non-block-arrow-func/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/non-block-arrow-func/output.mjs @@ -1,6 +1,6 @@ export default (param => { - var _class, _props; - return _class = class App { + var _App, _props; + return _App = class App { getParam() { return param; } @@ -10,5 +10,5 @@ export default (param => { prop1: 'prop1', prop2: 'prop2' } - }, _class; + }, _App; }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call-with-transform/output.js index 34cabe072592..8cdb0f349335 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return this; @@ -59,7 +59,7 @@ class Foo { (_getSelf6 = (_ref22 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref22 === void 0 || (_ref22$getSelf = _ref22.getSelf) === null || _ref22$getSelf === void 0 ? void 0 : _ref22$getSelf.call(_ref22)) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6$self = _getSelf6.self, Foo, _m).call(_getSelf6$self); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 @@ -67,12 +67,12 @@ var _x = { var _m = { writable: true, value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _x); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); } }; var _self = { writable: true, - value: _class + value: _Foo }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call/output.js index 41678ab1e8b6..455614306529 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return this; @@ -59,7 +59,7 @@ class Foo { (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6$self = _getSelf6.self, Foo, _m).call(_getSelf6$self); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 @@ -67,12 +67,12 @@ var _x = { var _m = { writable: true, value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _x); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); } }; var _self = { writable: true, - value: _class + value: _Foo }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property-with-transform/output.js index 2ddb108e110e..6dcf301ec31e 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return this; @@ -59,14 +59,14 @@ class Foo { (_getSelf6 = (_ref22 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref22 === void 0 || (_ref22$getSelf = _ref22.getSelf) === null || _ref22$getSelf === void 0 ? void 0 : _ref22$getSelf.call(_ref22)) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6.self, Foo, _x); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 }; var _self = { writable: true, - value: _class + value: _Foo }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property/output.js index 3f882ef2f463..8f8335995f81 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return this; @@ -59,14 +59,14 @@ class Foo { (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6.self, Foo, _x); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 }; var _self = { writable: true, - value: _class + value: _Foo }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-delete-property-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-delete-property-with-transform/output.js index 9e900087fe60..f3486b993e34 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-delete-property-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-delete-property-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self"); class Foo { @@ -53,14 +53,14 @@ class Foo { (_ref20 = fn === null || fn === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(fn().Foo, _self)[_self]) == null || _ref20.getSelf == null || (_ref20 = _ref20.getSelf()) == null || delete _ref20.self.unicorn; } } -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _x, { writable: true, value: 1 }); Object.defineProperty(Foo, _self, { writable: true, - value: _class + value: _Foo }); -Foo.self = _class; +Foo.self = _Foo; Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-delete-property/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-delete-property/output.js index a7378701e77d..9e27a3421ae5 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-delete-property/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-delete-property/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return this; @@ -51,14 +51,14 @@ class Foo { delete (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.()?.self.unicorn; } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 }; var _self = { writable: true, - value: _class + value: _Foo }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param-with-transform/output.js index a287d93b3ef6..e0c1b2177a63 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return this; @@ -40,7 +40,7 @@ class Foo { j(fn); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 @@ -48,12 +48,12 @@ var _x = { var _m = { writable: true, value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _x); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); } }; var _self = { writable: true, - value: _class + value: _Foo }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param/output.js index 5a95bda29743..594b00d5ef50 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return this; @@ -40,7 +40,7 @@ class Foo { j(fn); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 @@ -48,12 +48,12 @@ var _x = { var _m = { writable: true, value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _x); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); } }; var _self = { writable: true, - value: _class + value: _Foo }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call-with-transform/output.js index 34c7c496f968..eaa7a5bc7981 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return this; @@ -62,7 +62,7 @@ class Foo { (_getSelf6 = (_ref28 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref28 === void 0 || (_ref28$getSelf = _ref28.getSelf) === null || _ref28$getSelf === void 0 ? void 0 : _ref28$getSelf.call(_ref28)) === null || _getSelf6 === void 0 ? void 0 : (_babelHelpers$classSt45 = babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6$self = _getSelf6.self, Foo, _m)) === null || _babelHelpers$classSt45 === void 0 ? void 0 : _babelHelpers$classSt45.call(_getSelf6$self); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 @@ -70,12 +70,12 @@ var _x = { var _m = { writable: true, value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _x); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); } }; var _self = { writable: true, - value: _class + value: _Foo }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call/output.js index 13923623cc65..e078940f2ef7 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return this; @@ -62,7 +62,7 @@ class Foo { (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6$self = _getSelf6.self, Foo, _m)?.call(_getSelf6$self); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 @@ -70,12 +70,12 @@ var _x = { var _m = { writable: true, value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _x); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); } }; var _self = { writable: true, - value: _class + value: _Foo }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call-with-transform/output.js index 97fe84e355a2..f3cd8eb3fbd0 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return this; @@ -62,7 +62,7 @@ class Foo { (_getSelf$self4 = (_ref26 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref26 === void 0 || (_ref26$getSelf = _ref26.getSelf) === null || _ref26$getSelf === void 0 || (_ref26$getSelf = _ref26$getSelf.call(_ref26)) === null || _ref26$getSelf === void 0 ? void 0 : _ref26$getSelf.self) === null || _getSelf$self4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self4, Foo, _m).call(_getSelf$self4); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 @@ -70,12 +70,12 @@ var _x = { var _m = { writable: true, value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _x); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); } }; var _self = { writable: true, - value: _class + value: _Foo }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call/output.js index c0b4fa9d649d..ae7668491b76 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return this; @@ -62,7 +62,7 @@ class Foo { (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6$self = _getSelf6.self, Foo, _m).call(_getSelf6$self); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 @@ -70,12 +70,12 @@ var _x = { var _m = { writable: true, value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _x); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); } }; var _self = { writable: true, - value: _class + value: _Foo }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property-with-transform/output.js index a55f348525da..8261ff8e1997 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return this; @@ -62,14 +62,14 @@ class Foo { (_getSelf$self4 = (_ref26 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref26 === void 0 || (_ref26$getSelf = _ref26.getSelf) === null || _ref26$getSelf === void 0 || (_ref26$getSelf = _ref26$getSelf.call(_ref26)) === null || _ref26$getSelf === void 0 ? void 0 : _ref26$getSelf.self) === null || _getSelf$self4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self4, Foo, _x); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 }; var _self = { writable: true, - value: _class + value: _Foo }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property/output.js index 1e0dada2264b..feb200a7d891 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return this; @@ -62,14 +62,14 @@ class Foo { (_getSelf$self4 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.()?.self) === null || _getSelf$self4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self4, Foo, _x); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 }; var _self = { writable: true, - value: _class + value: _Foo }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call-with-transform/output.js index 591a0cb629c7..512bf77b4889 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call-with-transform/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return Foo; @@ -23,16 +23,16 @@ class Foo { ((_fn$Foo$self$getSelf2 = (fn === null || fn === void 0 || (_fn$Foo$self = fn().Foo.self) === null || _fn$Foo$self === void 0 ? void 0 : _fn$Foo$self.getSelf.bind(_fn$Foo$self))()) === null || _fn$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo$self$getSelf2, Foo, _m).bind(_fn$Foo$self$getSelf2))(); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); var _m = { writable: true, value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _x); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); } }; new Foo().test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call/output.js index 8369f454c1f2..fc7aacce28eb 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call/output.js @@ -1,4 +1,4 @@ -var _class; +var _Foo; class Foo { static getSelf() { return Foo; @@ -23,16 +23,16 @@ class Foo { ((_fn$Foo$self$getSelf2 = (fn?.().Foo.self?.getSelf)()) === null || _fn$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo$self$getSelf2, Foo, _m).bind(_fn$Foo$self$getSelf2))(); } } -_class = Foo; +_Foo = Foo; var _x = { writable: true, value: 1 }; -babelHelpers.defineProperty(Foo, "self", _class); +babelHelpers.defineProperty(Foo, "self", _Foo); var _m = { writable: true, value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _x); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); } }; new Foo().test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/reevaluated/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/reevaluated/output.js index 3a3929e1d11b..38ccd0f77493 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/reevaluated/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/reevaluated/output.js @@ -1,6 +1,6 @@ function classFactory() { - var _class, _foo, _bar; - return _foo = /*#__PURE__*/new WeakMap(), (_class = class Foo { + var _Foo, _foo, _bar; + return _foo = /*#__PURE__*/new WeakMap(), (_Foo = class Foo { constructor() { babelHelpers.classPrivateFieldInitSpec(this, _foo, { writable: true, @@ -11,16 +11,16 @@ function classFactory() { return babelHelpers.classPrivateFieldGet(this, _foo); } static() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, _class, _bar); + return babelHelpers.classStaticPrivateFieldSpecGet(Foo, _Foo, _bar); } static instance(inst) { return babelHelpers.classPrivateFieldGet(inst, _foo); } static static() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, _class, _bar); + return babelHelpers.classStaticPrivateFieldSpecGet(Foo, _Foo, _bar); } }, _bar = { writable: true, value: "bar" - }, _class); + }, _Foo); } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T2983/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T2983/output.mjs index 998f18c1d3b3..8e71294e9e74 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T2983/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T2983/output.mjs @@ -1,9 +1,9 @@ -var _class, _test; -call((_class = class {}, _test = { +var _Class, _test; +call((_Class = class {}, _test = { writable: true, value: true -}, _class)); -export default class _class2 {} +}, _Class)); +export default class _Class2 {} var _test2 = { writable: true, value: true diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T6719/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T6719/output.js index 723a617705b4..cd7eb6f2fa27 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T6719/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T6719/output.js @@ -1,6 +1,6 @@ function withContext(ComposedComponent) { - var _class, _propTypes; - return _class = class WithContext extends Component {}, _propTypes = { + var _WithContext, _propTypes; + return _WithContext = class WithContext extends Component {}, _propTypes = { writable: true, value: { context: PropTypes.shape({ @@ -9,5 +9,5 @@ function withContext(ComposedComponent) { setMeta: PropTypes.func }) } - }, _class; + }, _WithContext; } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-class-binding/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-class-binding/output.js index b7f8ea72fbff..6d16dccce1b1 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-class-binding/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-class-binding/output.js @@ -1,15 +1,15 @@ -var _class; +var _A; var A = /*#__PURE__*/babelHelpers.createClass(function A() { "use strict"; babelHelpers.classCallCheck(this, A); }); -_class = A; +_A = A; var _self = { writable: true, - value: _class + value: _A }; var _getA = { writable: true, - value: () => _class + value: () => _A }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-infer-name/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-infer-name/output.js index 4d98e39c8ce7..41ab84325295 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-infer-name/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-infer-name/output.js @@ -1,5 +1,5 @@ -var _class, _num; -var Foo = (_class = class Foo {}, _num = { +var _Class, _num; +var Foo = (_Class = class Foo {}, _num = { writable: true, value: 0 -}, _class); +}, _Class); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-self-field/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-self-field/output.js index ec915ef43b8b..be90a9ed60cb 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-self-field/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-self-field/output.js @@ -1,5 +1,5 @@ -var _class, _x; -var f = (_class = class Foo {}, _x = { +var _Foo, _x; +var f = (_Foo = class Foo {}, _x = { writable: true, - value: _class -}, babelHelpers.defineProperty(_class, "y", _class), _class); + value: _Foo +}, babelHelpers.defineProperty(_Foo, "y", _Foo), _Foo); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-self-method/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-self-method/output.js index ed2a8d690ffb..8b7f2cc6887c 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-self-method/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-self-method/output.js @@ -1,15 +1,15 @@ -var _class; -var f = _class = class Foo {}; +var _Foo; +var f = _Foo = class Foo {}; function _bar() { - return _class; + return _Foo; } function _method() { return function inner() { - return _class; + return _Foo; }; } function _method_shadowed() { - new _class(); + new _Foo(); return function inner() { var Foo = 3; return Foo; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-this/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-this/output.js index b7f8ea72fbff..6d16dccce1b1 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-this/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-this/output.js @@ -1,15 +1,15 @@ -var _class; +var _A; var A = /*#__PURE__*/babelHelpers.createClass(function A() { "use strict"; babelHelpers.classCallCheck(this, A); }); -_class = A; +_A = A; var _self = { writable: true, - value: _class + value: _A }; var _getA = { writable: true, - value: () => _class + value: () => _A }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/class-shadow-builtins/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/class-shadow-builtins/output.mjs index 5f0349304e29..c4bc75b9f7b2 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/class-shadow-builtins/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/class-shadow-builtins/output.mjs @@ -1,9 +1,9 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -class _TypeError { +class _TypeError2 { constructor() { _defineProperty(this, "message", void 0); } } -export { _TypeError as TypeError }; +export { _TypeError2 as TypeError }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/non-block-arrow-func/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/non-block-arrow-func/output.mjs index 87af273ef2de..03a1095b5035 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/non-block-arrow-func/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/non-block-arrow-func/output.mjs @@ -1,6 +1,6 @@ export default (param => { - var _class; - return _class = /*#__PURE__*/function () { + var _App; + return _App = /*#__PURE__*/function () { function App() { babelHelpers.classCallCheck(this, App); } @@ -11,8 +11,8 @@ export default (param => { } }]); return App; - }(), _class.props = { + }(), _App.props = { prop1: 'prop1', prop2: 'prop2' - }, _class; + }, _App; }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/regression-T2983/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/regression-T2983/output.mjs index 9319a9e2912b..0eb89846a0ce 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/regression-T2983/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/regression-T2983/output.mjs @@ -1,7 +1,7 @@ -var _class; -call((_class = /*#__PURE__*/babelHelpers.createClass(function _class() { - babelHelpers.classCallCheck(this, _class); -}), _class.test = true, _class)); +var _Class; +call((_Class = /*#__PURE__*/babelHelpers.createClass(function _Class() { + babelHelpers.classCallCheck(this, _Class); +}), _Class.test = true, _Class)); var _default = /*#__PURE__*/babelHelpers.createClass(function _default() { babelHelpers.classCallCheck(this, _default); }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/regression-T6719/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/regression-T6719/output.js index d6e31273e870..5b18b965fbf1 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/regression-T6719/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/regression-T6719/output.js @@ -1,6 +1,6 @@ function withContext(ComposedComponent) { - var _class; - return _class = /*#__PURE__*/function (_Component) { + var _WithContext; + return _WithContext = /*#__PURE__*/function (_Component) { "use strict"; babelHelpers.inherits(WithContext, _Component); @@ -9,11 +9,11 @@ function withContext(ComposedComponent) { return babelHelpers.callSuper(this, WithContext, arguments); } return babelHelpers.createClass(WithContext); - }(Component), _class.propTypes = { + }(Component), _WithContext.propTypes = { context: PropTypes.shape({ addCss: PropTypes.func, setTitle: PropTypes.func, setMeta: PropTypes.func }) - }, _class; + }, _WithContext; } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-class-binding/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-class-binding/output.js index 448f5bd0588b..1266b29c6019 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-class-binding/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-class-binding/output.js @@ -1,9 +1,9 @@ -var _class; +var _A; var A = /*#__PURE__*/babelHelpers.createClass(function A() { "use strict"; babelHelpers.classCallCheck(this, A); }); -_class = A; -A.self = _class; -A.getA = () => _class; +_A = A; +A.self = _A; +A.getA = () => _A; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-infer-name/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-infer-name/output.js index 47fc119b5b9f..756118b09b14 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-infer-name/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-infer-name/output.js @@ -1,6 +1,6 @@ -var _class; -var Foo = (_class = /*#__PURE__*/babelHelpers.createClass(function Foo() { +var _Class; +var Foo = (_Class = /*#__PURE__*/babelHelpers.createClass(function Foo() { "use strict"; babelHelpers.classCallCheck(this, Foo); -}), _class.num = 0, _class); +}), _Class.num = 0, _Class); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-super/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-super/output.js index 383f5956dd73..ce1604f2b97c 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-super/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-super/output.js @@ -4,10 +4,10 @@ var A = /*#__PURE__*/babelHelpers.createClass(function A() { babelHelpers.classCallCheck(this, A); }); A.prop = 1; -var B = /*#__PURE__*/function (_A) { +var B = /*#__PURE__*/function (_A2) { "use strict"; - babelHelpers.inherits(B, _A); + babelHelpers.inherits(B, _A2); function B() { babelHelpers.classCallCheck(this, B); return babelHelpers.callSuper(this, B, arguments); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-this/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-this/output.js index 448f5bd0588b..1266b29c6019 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-this/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public-loose/static-this/output.js @@ -1,9 +1,9 @@ -var _class; +var _A; var A = /*#__PURE__*/babelHelpers.createClass(function A() { "use strict"; babelHelpers.classCallCheck(this, A); }); -_class = A; -A.self = _class; -A.getA = () => _class; +_A = A; +A.self = _A; +A.getA = () => _A; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public/class-shadow-builtins/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/public/class-shadow-builtins/output.mjs index 5f0349304e29..c4bc75b9f7b2 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public/class-shadow-builtins/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public/class-shadow-builtins/output.mjs @@ -1,9 +1,9 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -class _TypeError { +class _TypeError2 { constructor() { _defineProperty(this, "message", void 0); } } -export { _TypeError as TypeError }; +export { _TypeError2 as TypeError }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public/computed-toPrimitive/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/public/computed-toPrimitive/output.js index 8fa17cce1d5e..f9105610d722 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public/computed-toPrimitive/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public/computed-toPrimitive/output.js @@ -1,122 +1,122 @@ -var _class; +var _Class; var foo = { [Symbol.toPrimitive]: () => "foo" }; -expect((_class = /*#__PURE__*/babelHelpers.createClass(function _class() { +expect((_Class = /*#__PURE__*/babelHelpers.createClass(function _Class() { "use strict"; - babelHelpers.classCallCheck(this, _class); -}), babelHelpers.defineProperty(_class, foo, 0), _class).foo).toBe(0); + babelHelpers.classCallCheck(this, _Class); +}), babelHelpers.defineProperty(_Class, foo, 0), _Class).foo).toBe(0); expect( /*#__PURE__*/function () { "use strict"; - function _class2() { - babelHelpers.classCallCheck(this, _class2); + function _class() { + babelHelpers.classCallCheck(this, _class); } - babelHelpers.createClass(_class2, null, [{ + babelHelpers.createClass(_class, null, [{ key: foo, value: function () { return 0; } }]); - return _class2; + return _class; }().foo()).toBe(0); expect( /*#__PURE__*/function () { "use strict"; - function _class3() { - babelHelpers.classCallCheck(this, _class3); + function _class2() { + babelHelpers.classCallCheck(this, _class2); } - babelHelpers.createClass(_class3, null, [{ + babelHelpers.createClass(_class2, null, [{ key: foo, get: function () { return 0; } }]); - return _class3; + return _class2; }().foo).toBe(0); expect( /*#__PURE__*/function () { "use strict"; - function _class4() { - babelHelpers.classCallCheck(this, _class4); + function _class3() { + babelHelpers.classCallCheck(this, _class3); } - babelHelpers.createClass(_class4, null, [{ + babelHelpers.createClass(_class3, null, [{ key: foo, set: function (v) { return v; } }]); - return _class4; + return _class3; }().foo = 0).toBe(0); expect(new ( /*#__PURE__*/function () { "use strict"; - function _class6() { - babelHelpers.classCallCheck(this, _class6); + function _class4() { + babelHelpers.classCallCheck(this, _class4); babelHelpers.defineProperty(this, foo, 0); } - return babelHelpers.createClass(_class6); + return babelHelpers.createClass(_class4); }())().foo).toBe(0); var arrayLike = { [Symbol.toPrimitive]: () => [] }; expect(() => { - var _class7; - return _class7 = /*#__PURE__*/babelHelpers.createClass(function _class7() { + var _Class3; + return _Class3 = /*#__PURE__*/babelHelpers.createClass(function _Class3() { "use strict"; - babelHelpers.classCallCheck(this, _class7); - }), babelHelpers.defineProperty(_class7, arrayLike, 0), _class7; + babelHelpers.classCallCheck(this, _Class3); + }), babelHelpers.defineProperty(_Class3, arrayLike, 0), _Class3; }).toThrow("@@toPrimitive must return a primitive value."); expect(() => /*#__PURE__*/function () { "use strict"; - function _class8() { - babelHelpers.classCallCheck(this, _class8); + function _class5() { + babelHelpers.classCallCheck(this, _class5); } - babelHelpers.createClass(_class8, null, [{ + babelHelpers.createClass(_class5, null, [{ key: arrayLike, value: function () { return 0; } }]); - return _class8; + return _class5; }()).toThrow("@@toPrimitive must return a primitive value."); expect(() => /*#__PURE__*/function () { "use strict"; - function _class9() { - babelHelpers.classCallCheck(this, _class9); + function _class6() { + babelHelpers.classCallCheck(this, _class6); } - babelHelpers.createClass(_class9, null, [{ + babelHelpers.createClass(_class6, null, [{ key: arrayLike, get: function () { return 0; } }]); - return _class9; + return _class6; }()).toThrow("@@toPrimitive must return a primitive value."); expect(() => /*#__PURE__*/function () { "use strict"; - function _class10() { - babelHelpers.classCallCheck(this, _class10); + function _class7() { + babelHelpers.classCallCheck(this, _class7); } - babelHelpers.createClass(_class10, null, [{ + babelHelpers.createClass(_class7, null, [{ key: arrayLike, set: function (v) { return v; } }]); - return _class10; + return _class7; }()).toThrow("@@toPrimitive must return a primitive value."); expect(() => new ( /*#__PURE__*/function () { "use strict"; - function _class12() { - babelHelpers.classCallCheck(this, _class12); + function _class8() { + babelHelpers.classCallCheck(this, _class8); babelHelpers.defineProperty(this, arrayLike, 0); } - return babelHelpers.createClass(_class12); + return babelHelpers.createClass(_class8); }())()).toThrow("@@toPrimitive must return a primitive value."); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public/computed-without-block/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/public/computed-without-block/output.js index 351c1a9a43c3..f1e46598ac9d 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public/computed-without-block/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public/computed-without-block/output.js @@ -3,10 +3,10 @@ var createClass = k => { return _k = k(), /*#__PURE__*/function () { "use strict"; - function _class2() { - babelHelpers.classCallCheck(this, _class2); + function _class() { + babelHelpers.classCallCheck(this, _class); babelHelpers.defineProperty(this, _k, 2); } - return babelHelpers.createClass(_class2); + return babelHelpers.createClass(_class); }(); }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public/delete-super-property/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/public/delete-super-property/output.js index 659f3fe45998..c1a9f2953de6 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public/delete-super-property/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public/delete-super-property/output.js @@ -1,24 +1,24 @@ new ( /*#__PURE__*/function () { "use strict"; - function _class2() { - babelHelpers.classCallCheck(this, _class2); + function _class() { + babelHelpers.classCallCheck(this, _class); babelHelpers.defineProperty(this, "y", function () { throw new ReferenceError("'delete super.prop' is invalid"); }()); } - return babelHelpers.createClass(_class2); + return babelHelpers.createClass(_class); }())(); new ( /*#__PURE__*/function () { "use strict"; - function _class4() { - babelHelpers.classCallCheck(this, _class4); + function _class2() { + babelHelpers.classCallCheck(this, _class2); babelHelpers.defineProperty(this, "y", (babelHelpers.toPropertyKey(0), function () { throw new ReferenceError("'delete super[expr]' is invalid"); }())); } - return babelHelpers.createClass(_class4); + return babelHelpers.createClass(_class2); }())(); var X1 = /*#__PURE__*/babelHelpers.createClass(function X1() { "use strict"; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public/non-block-arrow-func/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/public/non-block-arrow-func/output.mjs index 6315bc38d9d6..6e81e4664d5c 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public/non-block-arrow-func/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public/non-block-arrow-func/output.mjs @@ -1,6 +1,6 @@ export default (param => { - var _class; - return _class = /*#__PURE__*/function () { + var _App; + return _App = /*#__PURE__*/function () { function App() { babelHelpers.classCallCheck(this, App); } @@ -11,8 +11,8 @@ export default (param => { } }]); return App; - }(), babelHelpers.defineProperty(_class, "props", { + }(), babelHelpers.defineProperty(_App, "props", { prop1: 'prop1', prop2: 'prop2' - }), _class; + }), _App; }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public/regression-T2983/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/public/regression-T2983/output.mjs index 8d7397f261f1..39e095268114 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public/regression-T2983/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public/regression-T2983/output.mjs @@ -1,7 +1,7 @@ -var _class; -call((_class = /*#__PURE__*/babelHelpers.createClass(function _class() { - babelHelpers.classCallCheck(this, _class); -}), babelHelpers.defineProperty(_class, "test", true), _class)); +var _Class; +call((_Class = /*#__PURE__*/babelHelpers.createClass(function _Class() { + babelHelpers.classCallCheck(this, _Class); +}), babelHelpers.defineProperty(_Class, "test", true), _Class)); var _default = /*#__PURE__*/babelHelpers.createClass(function _default() { babelHelpers.classCallCheck(this, _default); }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public/regression-T6719/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/public/regression-T6719/output.js index 0776a29cfb59..61014b0c30a5 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public/regression-T6719/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public/regression-T6719/output.js @@ -1,6 +1,6 @@ function withContext(ComposedComponent) { - var _class; - return _class = /*#__PURE__*/function (_Component) { + var _WithContext; + return _WithContext = /*#__PURE__*/function (_Component) { "use strict"; babelHelpers.inherits(WithContext, _Component); @@ -9,11 +9,11 @@ function withContext(ComposedComponent) { return babelHelpers.callSuper(this, WithContext, arguments); } return babelHelpers.createClass(WithContext); - }(Component), babelHelpers.defineProperty(_class, "propTypes", { + }(Component), babelHelpers.defineProperty(_WithContext, "propTypes", { context: PropTypes.shape({ addCss: PropTypes.func, setTitle: PropTypes.func, setMeta: PropTypes.func }) - }), _class; + }), _WithContext; } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-class-binding/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-class-binding/output.js index fb5d0d7e8628..a6be3d53efb8 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-class-binding/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-class-binding/output.js @@ -1,9 +1,9 @@ -var _class; +var _A; var A = /*#__PURE__*/babelHelpers.createClass(function A() { "use strict"; babelHelpers.classCallCheck(this, A); }); -_class = A; -babelHelpers.defineProperty(A, "self", _class); -babelHelpers.defineProperty(A, "getA", () => _class); +_A = A; +babelHelpers.defineProperty(A, "self", _A); +babelHelpers.defineProperty(A, "getA", () => _A); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-infer-name/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-infer-name/output.js index f130ac9b69ba..caabb36af159 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-infer-name/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-infer-name/output.js @@ -1,6 +1,6 @@ -var _class; -var Foo = (_class = /*#__PURE__*/babelHelpers.createClass(function Foo() { +var _Class; +var Foo = (_Class = /*#__PURE__*/babelHelpers.createClass(function Foo() { "use strict"; babelHelpers.classCallCheck(this, Foo); -}), babelHelpers.defineProperty(_class, "num", 0), _class); +}), babelHelpers.defineProperty(_Class, "num", 0), _Class); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-super/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-super/output.js index 90819fc1b22b..d2d87c966692 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-super/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-super/output.js @@ -1,21 +1,21 @@ -var _class2; +var _B; var A = /*#__PURE__*/babelHelpers.createClass(function A() { "use strict"; babelHelpers.classCallCheck(this, A); }); babelHelpers.defineProperty(A, "prop", 1); -var B = /*#__PURE__*/function (_A) { +var B = /*#__PURE__*/function (_A2) { "use strict"; - babelHelpers.inherits(B, _A); + babelHelpers.inherits(B, _A2); function B() { babelHelpers.classCallCheck(this, B); return babelHelpers.callSuper(this, B, arguments); } return babelHelpers.createClass(B); }(A); -_class2 = B; +_B = B; babelHelpers.defineProperty(B, "prop", 2); -babelHelpers.defineProperty(B, "propA", babelHelpers.get(babelHelpers.getPrototypeOf(_class2), "prop", _class2)); -babelHelpers.defineProperty(B, "getPropA", () => babelHelpers.get(babelHelpers.getPrototypeOf(_class2), "prop", _class2)); +babelHelpers.defineProperty(B, "propA", babelHelpers.get(babelHelpers.getPrototypeOf(_B), "prop", _B)); +babelHelpers.defineProperty(B, "getPropA", () => babelHelpers.get(babelHelpers.getPrototypeOf(_B), "prop", _B)); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-this/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-this/output.js index fb5d0d7e8628..a6be3d53efb8 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-this/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/public/static-this/output.js @@ -1,9 +1,9 @@ -var _class; +var _A; var A = /*#__PURE__*/babelHelpers.createClass(function A() { "use strict"; babelHelpers.classCallCheck(this, A); }); -_class = A; -babelHelpers.defineProperty(A, "self", _class); -babelHelpers.defineProperty(A, "getA", () => _class); +_A = A; +babelHelpers.defineProperty(A, "self", _A); +babelHelpers.defineProperty(A, "getA", () => _A); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/6153/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/6153/output.js index 351a63be84bd..0fa2b6116649 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/6153/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/6153/output.js @@ -1,5 +1,5 @@ (function () { - var _class; + var _Foo; class Foo { constructor() { var _this = this; @@ -8,26 +8,26 @@ }); } } - _class = Foo; + _Foo = Foo; babelHelpers.defineProperty(Foo, "fn", function () { - return console.log(_class); + return console.log(_Foo); }); }); (function () { - var _class2; - return _class2 = class Bar { + var _Bar; + return _Bar = class Bar { constructor() { var _this2 = this; babelHelpers.defineProperty(this, "fn", function () { return console.log(_this2); }); } - }, babelHelpers.defineProperty(_class2, "fn", function () { - return console.log(_class2); - }), _class2; + }, babelHelpers.defineProperty(_Bar, "fn", function () { + return console.log(_Bar); + }), _Bar; }); (function () { - var _class3; + var _Baz; class Baz { constructor(_force) { var _this3 = this; @@ -37,13 +37,13 @@ babelHelpers.defineProperty(this, "force", force); } } - _class3 = Baz; + _Baz = Baz; babelHelpers.defineProperty(Baz, "fn", function () { - return console.log(_class3); + return console.log(_Baz); }); }); var qux = function () { - var _class4; + var _Qux; class Qux { constructor() { var _this4 = this; @@ -52,8 +52,8 @@ var qux = function () { }); } } - _class4 = Qux; + _Qux = Qux; babelHelpers.defineProperty(Qux, "fn", function () { - return console.log(_class4); + return console.log(_Qux); }); }.bind(this); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/6154/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/6154/output.js index a93e976e8e3a..1c1ab9f8f82d 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/6154/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/6154/output.js @@ -1,7 +1,7 @@ var Test = /*#__PURE__*/babelHelpers.createClass(function Test() { "use strict"; - var _class; + var _Other; babelHelpers.classCallCheck(this, Test); var Other = /*#__PURE__*/function (_Test) { babelHelpers.inherits(Other, _Test); @@ -19,8 +19,8 @@ var Test = /*#__PURE__*/babelHelpers.createClass(function Test() { } return babelHelpers.createClass(Other); }(Test); - _class = Other; + _Other = Other; babelHelpers.defineProperty(Other, "a", function () { - return babelHelpers.get(babelHelpers.getPrototypeOf(_class), "test", _class); + return babelHelpers.get(babelHelpers.getPrototypeOf(_Other), "test", _Other); }); }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/8882/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/8882/output.js index d5b411bc3397..5db74a9d0042 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/8882/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/8882/output.js @@ -1,8 +1,8 @@ const classes = []; for (let i = 0; i <= 10; ++i) { - var _class, _bar; + var _A, _bar; let _i; - classes.push((_bar = /*#__PURE__*/new WeakMap(), _i = i, (_class = class A { + classes.push((_bar = /*#__PURE__*/new WeakMap(), _i = i, (_A = class A { constructor() { babelHelpers.defineProperty(this, _i, `computed field ${i}`); babelHelpers.classPrivateFieldInitSpec(this, _bar, { @@ -13,5 +13,5 @@ for (let i = 0; i <= 10; ++i) { getBar() { return babelHelpers.classPrivateFieldGet(this, _bar); } - }, babelHelpers.defineProperty(_class, "foo", `static field ${i}`), _class))); + }, babelHelpers.defineProperty(_A, "foo", `static field ${i}`), _A))); } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/T2983/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/T2983/output.mjs index 9319a9e2912b..0eb89846a0ce 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/T2983/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/T2983/output.mjs @@ -1,7 +1,7 @@ -var _class; -call((_class = /*#__PURE__*/babelHelpers.createClass(function _class() { - babelHelpers.classCallCheck(this, _class); -}), _class.test = true, _class)); +var _Class; +call((_Class = /*#__PURE__*/babelHelpers.createClass(function _Class() { + babelHelpers.classCallCheck(this, _Class); +}), _Class.test = true, _Class)); var _default = /*#__PURE__*/babelHelpers.createClass(function _default() { babelHelpers.classCallCheck(this, _default); }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/T6719/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/T6719/output.js index d6e31273e870..5b18b965fbf1 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/T6719/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/T6719/output.js @@ -1,6 +1,6 @@ function withContext(ComposedComponent) { - var _class; - return _class = /*#__PURE__*/function (_Component) { + var _WithContext; + return _WithContext = /*#__PURE__*/function (_Component) { "use strict"; babelHelpers.inherits(WithContext, _Component); @@ -9,11 +9,11 @@ function withContext(ComposedComponent) { return babelHelpers.callSuper(this, WithContext, arguments); } return babelHelpers.createClass(WithContext); - }(Component), _class.propTypes = { + }(Component), _WithContext.propTypes = { context: PropTypes.shape({ addCss: PropTypes.func, setTitle: PropTypes.func, setMeta: PropTypes.func }) - }, _class; + }, _WithContext; } diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/class-binding/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/class-binding/output.js index 5d59bfd04405..31e50d3a7f80 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/class-binding/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/class-binding/output.js @@ -1,6 +1,6 @@ -var _class; +var _Foo; class Foo {} -_class = Foo; +_Foo = Foo; Foo.bar = 42; -_class.foo = _class.bar; +_Foo.foo = _Foo.bar; expect(Foo.foo).toBe(42); diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/class-declaration/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/class-declaration/output.js index 5d59bfd04405..31e50d3a7f80 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/class-declaration/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/class-declaration/output.js @@ -1,6 +1,6 @@ -var _class; +var _Foo; class Foo {} -_class = Foo; +_Foo = Foo; Foo.bar = 42; -_class.foo = _class.bar; +_Foo.foo = _Foo.bar; expect(Foo.foo).toBe(42); diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/in-class-heritage/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/in-class-heritage/output.js index 44eaaf3c79fd..671cfe951aa2 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/in-class-heritage/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/in-class-heritage/output.js @@ -1,5 +1,5 @@ -var _class, _class2, _class3; -class Foo extends (_class2 = class extends (_class3 = class Base {}, _class3.qux = 21, _class3) {}, _class2.bar = 21, _class2) {} -_class = Foo; -_class.foo = _class.bar + _class.qux; +var _Foo, _Class, _Base; +class Foo extends (_Class = class extends (_Base = class Base {}, _Base.qux = 21, _Base) {}, _Class.bar = 21, _Class) {} +_Foo = Foo; +_Foo.foo = _Foo.bar + _Foo.qux; expect(Foo.foo).toBe(42); diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/multiple-static-initializers/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/multiple-static-initializers/output.js index d169917d551f..395fdebcf58f 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/multiple-static-initializers/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/multiple-static-initializers/output.js @@ -1,14 +1,14 @@ -var _class; +var _Foo; var _bar = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("bar"); class Foo {} -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _bar, { writable: true, value: 21 }); (() => { - _class.foo = babelHelpers.classPrivateFieldLooseBase(_class, _bar)[_bar]; - _class.qux1 = _class.qux; + _Foo.foo = babelHelpers.classPrivateFieldLooseBase(_Foo, _bar)[_bar]; + _Foo.qux1 = _Foo.qux; })(); Foo.qux = 21; -_class.qux2 = _class.qux; +_Foo.qux2 = _Foo.qux; diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/name-conflict/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/name-conflict/output.js index 955752db65f0..219e180e89d7 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/name-conflict/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/name-conflict/output.js @@ -1,12 +1,12 @@ -var _class; +var _Foo; var _ = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("_"); class Foo {} -_class = Foo; +_Foo = Foo; Object.defineProperty(Foo, _, { writable: true, value: 42 }); // static block can not be transformed as `#_` here -_class.foo = babelHelpers.classPrivateFieldLooseBase(_class, _)[_]; +_Foo.foo = babelHelpers.classPrivateFieldLooseBase(_Foo, _)[_]; expect(Foo.foo).toBe(42); diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/preserve-comments/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/preserve-comments/output.js index 3b6485f9b584..e66fa555ca20 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/preserve-comments/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/preserve-comments/output.js @@ -1,18 +1,18 @@ -var _class; +var _C; class C {} -_class = C; +_C = C; /* before 1 */ (() => {})(); /* after 1 */ /* before 2 */ -/* before this.foo */_class.foo = 42; +/* before this.foo */_C.foo = 42; /* after this.foo */ /* after 2 */ /* before 3 */ (() => { /* before this.bar */ - _class.bar = 42; - _class.bar = 42; + _C.bar = 42; + _C.bar = 42; /* after this.bar */ })(); /* after 3 */ diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/super-static-block/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/super-static-block/output.js index e6c7e2ee194f..c9f6df2ed73b 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/super-static-block/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration-loose/super-static-block/output.js @@ -1,6 +1,6 @@ -var _ref, _class, _class2; -class Foo extends (_ref = (_class2 = class _ref {}, _class2.bar = 42, _class2)) {} -_class = Foo; +var _ref, _Foo, _Class; +class Foo extends (_ref = (_Class = class _ref {}, _Class.bar = 42, _Class)) {} +_Foo = Foo; Foo.bar = 21; -_class.foo = _ref.bar; +_Foo.foo = _ref.bar; expect(Foo.foo).toBe(42); diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/class-binding/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/class-binding/output.js index 7a85889b8e08..31db8610d6ff 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/class-binding/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/class-binding/output.js @@ -1,6 +1,6 @@ -var _class; +var _Foo; class Foo {} -_class = Foo; +_Foo = Foo; babelHelpers.defineProperty(Foo, "bar", 42); -_class.foo = _class.bar; +_Foo.foo = _Foo.bar; expect(Foo.foo).toBe(42); diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/class-declaration/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/class-declaration/output.js index 7a85889b8e08..31db8610d6ff 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/class-declaration/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/class-declaration/output.js @@ -1,6 +1,6 @@ -var _class; +var _Foo; class Foo {} -_class = Foo; +_Foo = Foo; babelHelpers.defineProperty(Foo, "bar", 42); -_class.foo = _class.bar; +_Foo.foo = _Foo.bar; expect(Foo.foo).toBe(42); diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/in-class-heritage/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/in-class-heritage/output.js index 44eaaf3c79fd..671cfe951aa2 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/in-class-heritage/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/in-class-heritage/output.js @@ -1,5 +1,5 @@ -var _class, _class2, _class3; -class Foo extends (_class2 = class extends (_class3 = class Base {}, _class3.qux = 21, _class3) {}, _class2.bar = 21, _class2) {} -_class = Foo; -_class.foo = _class.bar + _class.qux; +var _Foo, _Class, _Base; +class Foo extends (_Class = class extends (_Base = class Base {}, _Base.qux = 21, _Base) {}, _Class.bar = 21, _Class) {} +_Foo = Foo; +_Foo.foo = _Foo.bar + _Foo.qux; expect(Foo.foo).toBe(42); diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/multiple-static-initializers/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/multiple-static-initializers/output.js index 9eb6c835ffe8..b4773b70a1c5 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/multiple-static-initializers/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/multiple-static-initializers/output.js @@ -1,13 +1,13 @@ -var _class; +var _Foo; class Foo {} -_class = Foo; +_Foo = Foo; var _bar = { writable: true, value: 21 }; (() => { - _class.foo = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _bar); - _class.qux1 = _class.qux; + _Foo.foo = babelHelpers.classStaticPrivateFieldSpecGet(_Foo, _Foo, _bar); + _Foo.qux1 = _Foo.qux; })(); babelHelpers.defineProperty(Foo, "qux", 21); -_class.qux2 = _class.qux; +_Foo.qux2 = _Foo.qux; diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/name-conflict/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/name-conflict/output.js index 105c6a8ceb52..5b06cac37120 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/name-conflict/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/name-conflict/output.js @@ -1,11 +1,11 @@ -var _class; +var _Foo; class Foo {} -_class = Foo; +_Foo = Foo; var _ = { writable: true, value: 42 }; // static block can not be transformed as `#_` here -_class.foo = babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _); +_Foo.foo = babelHelpers.classStaticPrivateFieldSpecGet(_Foo, _Foo, _); expect(Foo.foo).toBe(42); diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/new-target/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/new-target/output.js index 49ca6da12147..e215b03d9983 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/new-target/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/new-target/output.js @@ -1,7 +1,7 @@ class Base { constructor() { - var _class; - this.Foo = (_class = class {}, _class.foo = void 0, _class); + var _Class; + this.Foo = (_Class = class {}, _Class.foo = void 0, _Class); } } expect(new Base().Foo.foo).toBe(undefined); diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/preserve-comments/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/preserve-comments/output.js index 3b6485f9b584..e66fa555ca20 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/preserve-comments/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/preserve-comments/output.js @@ -1,18 +1,18 @@ -var _class; +var _C; class C {} -_class = C; +_C = C; /* before 1 */ (() => {})(); /* after 1 */ /* before 2 */ -/* before this.foo */_class.foo = 42; +/* before this.foo */_C.foo = 42; /* after this.foo */ /* after 2 */ /* before 3 */ (() => { /* before this.bar */ - _class.bar = 42; - _class.bar = 42; + _C.bar = 42; + _C.bar = 42; /* after this.bar */ })(); /* after 3 */ diff --git a/packages/babel-plugin-transform-class-static-block/test/plugin-ordering.test.js b/packages/babel-plugin-transform-class-static-block/test/plugin-ordering.test.js index 88ed944bac14..2054b0e709e7 100644 --- a/packages/babel-plugin-transform-class-static-block/test/plugin-ordering.test.js +++ b/packages/babel-plugin-transform-class-static-block/test/plugin-ordering.test.js @@ -20,13 +20,13 @@ describe("plugin ordering", () => { plugins: [proposalClassProperties, proposalClassStaticBlock], }).code, ).toMatchInlineSnapshot(` - "var _class; + "var _Foo; function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _toPropertyKey(t) { var i = _toPrimitive(t, \\"string\\"); return \\"symbol\\" == typeof i ? i : String(i); } function _toPrimitive(t, r) { if (\\"object\\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \\"default\\"); if (\\"object\\" != typeof i) return i; throw new TypeError(\\"@@toPrimitive must return a primitive value.\\"); } return (\\"string\\" === r ? String : Number)(t); } class Foo {} - _class = Foo; - _class.foo = _class.bar; + _Foo = Foo; + _Foo.foo = _Foo.bar; _defineProperty(Foo, \\"bar\\", 42);" `); }); diff --git a/packages/babel-plugin-transform-new-target/test/fixtures/general/class-properties-loose/output.js b/packages/babel-plugin-transform-new-target/test/fixtures/general/class-properties-loose/output.js index fe7b6d35912b..87d3f622233c 100644 --- a/packages/babel-plugin-transform-new-target/test/fixtures/general/class-properties-loose/output.js +++ b/packages/babel-plugin-transform-new-target/test/fixtures/general/class-properties-loose/output.js @@ -1,28 +1,28 @@ class Foo { constructor() { var _newtarget = this.constructor, - _class2; + _Class; this.test = function _target() { this instanceof _target ? this.constructor : void 0; }; this.test2 = function () { _newtarget; }; - this.Bar = (_class2 = class { + this.Bar = (_Class = class { constructor() { // should not replace this.q = this.constructor; } // should not replace - }, _class2.p = void 0, _class2.p1 = class { + }, _Class.p = void 0, _Class.p1 = class { constructor() { this.constructor; } - }, _class2.p2 = new function _target2() { + }, _Class.p2 = new function _target2() { this instanceof _target2 ? this.constructor : void 0; - }(), _class2.p3 = function () { + }(), _Class.p3 = function () { void 0; - }, _class2.p4 = function _target3() { + }, _Class.p4 = function _target3() { this instanceof _target3 ? this.constructor : void 0; - }, _class2); + }, _Class); } } diff --git a/packages/babel-plugin-transform-new-target/test/fixtures/general/class-properties/output.js b/packages/babel-plugin-transform-new-target/test/fixtures/general/class-properties/output.js index fd58f68fe97e..26835a100732 100644 --- a/packages/babel-plugin-transform-new-target/test/fixtures/general/class-properties/output.js +++ b/packages/babel-plugin-transform-new-target/test/fixtures/general/class-properties/output.js @@ -1,28 +1,28 @@ class Foo { constructor() { var _newtarget = this.constructor, - _class2; + _Class; babelHelpers.defineProperty(this, "test", function _target() { this instanceof _target ? this.constructor : void 0; }); babelHelpers.defineProperty(this, "test2", function () { _newtarget; }); - this.Bar = (_class2 = class { + this.Bar = (_Class = class { constructor() { // should not replace babelHelpers.defineProperty(this, "q", this.constructor); } // should not replace - }, babelHelpers.defineProperty(_class2, "p", void 0), babelHelpers.defineProperty(_class2, "p1", class { + }, babelHelpers.defineProperty(_Class, "p", void 0), babelHelpers.defineProperty(_Class, "p1", class { constructor() { this.constructor; } - }), babelHelpers.defineProperty(_class2, "p2", new function _target2() { + }), babelHelpers.defineProperty(_Class, "p2", new function _target2() { this instanceof _target2 ? this.constructor : void 0; - }()), babelHelpers.defineProperty(_class2, "p3", function () { + }()), babelHelpers.defineProperty(_Class, "p3", function () { void 0; - }), babelHelpers.defineProperty(_class2, "p4", function _target3() { + }), babelHelpers.defineProperty(_Class, "p4", function _target3() { this instanceof _target3 ? this.constructor : void 0; - }), _class2); + }), _Class); } } diff --git a/packages/babel-plugin-transform-parameters/test/fixtures/parameters/rest-arrow-functions/output.js b/packages/babel-plugin-transform-parameters/test/fixtures/parameters/rest-arrow-functions/output.js index e3166eb35668..8e0a70911fe9 100644 --- a/packages/babel-plugin-transform-parameters/test/fixtures/parameters/rest-arrow-functions/output.js +++ b/packages/babel-plugin-transform-parameters/test/fixtures/parameters/rest-arrow-functions/output.js @@ -33,14 +33,14 @@ var x = function () { return rest; }; var innerclassproperties = function () { - var _class; + var _Class; for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } - return _class = /*#__PURE__*/babelHelpers.createClass(function _class() { + return _Class = /*#__PURE__*/babelHelpers.createClass(function _Class() { "use strict"; - babelHelpers.classCallCheck(this, _class); + babelHelpers.classCallCheck(this, _Class); this.args = args; - }), _class.args = args, _class; + }), _Class.args = args, _Class; }; diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors-loose/class-binding/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors-loose/class-binding/output.js index 7394e6e4695f..a1bf6d5b9bf5 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors-loose/class-binding/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors-loose/class-binding/output.js @@ -1,4 +1,4 @@ -var _class; +var _A; var _getA = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("getA"); class A { constructor() { @@ -8,7 +8,7 @@ class A { }); } } -_class = A; +_A = A; function _get_getA() { - return _class; + return _A; } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors-privateFieldsAsProperties/class-binding/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors-privateFieldsAsProperties/class-binding/output.js index 7394e6e4695f..a1bf6d5b9bf5 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors-privateFieldsAsProperties/class-binding/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors-privateFieldsAsProperties/class-binding/output.js @@ -1,4 +1,4 @@ -var _class; +var _A; var _getA = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("getA"); class A { constructor() { @@ -8,7 +8,7 @@ class A { }); } } -_class = A; +_A = A; function _get_getA() { - return _class; + return _A; } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors-privateFieldsAsSymbols/class-binding/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors-privateFieldsAsSymbols/class-binding/output.js index 6df643012c74..79115a7bd978 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors-privateFieldsAsSymbols/class-binding/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors-privateFieldsAsSymbols/class-binding/output.js @@ -1,4 +1,4 @@ -var _class; +var _A; var _getA = /*#__PURE__*/Symbol("getA"); class A { constructor() { @@ -8,7 +8,7 @@ class A { }); } } -_class = A; +_A = A; function _get_getA() { - return _class; + return _A; } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/class-binding/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/class-binding/output.js index 52ee9648bf9d..4b97010cad95 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/class-binding/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/class-binding/output.js @@ -1,4 +1,4 @@ -var _class; +var _A; var _getA = /*#__PURE__*/new WeakMap(); class A { constructor() { @@ -8,7 +8,7 @@ class A { }); } } -_class = A; +_A = A; function _get_getA() { - return _class; + return _A; } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-loose/class-binding/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-loose/class-binding/output.js index 7aa973c40bc9..f1e7c236e4a7 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-loose/class-binding/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-loose/class-binding/output.js @@ -1,4 +1,4 @@ -var _class; +var _A; var _getA = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("getA"); class A { constructor() { @@ -7,7 +7,7 @@ class A { }); } } -_class = A; +_A = A; function _getA2() { - return _class; + return _A; } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsProperties/class-binding/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsProperties/class-binding/output.js index 7aa973c40bc9..f1e7c236e4a7 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsProperties/class-binding/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsProperties/class-binding/output.js @@ -1,4 +1,4 @@ -var _class; +var _A; var _getA = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("getA"); class A { constructor() { @@ -7,7 +7,7 @@ class A { }); } } -_class = A; +_A = A; function _getA2() { - return _class; + return _A; } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsProperties/super/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsProperties/super/output.js index bc11df8e2453..255c3593a4ed 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsProperties/super/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsProperties/super/output.js @@ -1,4 +1,4 @@ -var _class; +var _Sub; class Base { superMethod() { return 'good'; @@ -19,7 +19,7 @@ class Sub extends Base { return babelHelpers.classPrivateFieldLooseBase(this, _privateMethod)[_privateMethod](); } } -_class = Sub; +_Sub = Sub; function _privateMethod2() { - return babelHelpers.get(babelHelpers.getPrototypeOf(_class.prototype), "superMethod", this).call(this); + return babelHelpers.get(babelHelpers.getPrototypeOf(_Sub.prototype), "superMethod", this).call(this); } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsSymbols/class-binding/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsSymbols/class-binding/output.js index 1cd147394a72..4b35153b2a27 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsSymbols/class-binding/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsSymbols/class-binding/output.js @@ -1,4 +1,4 @@ -var _class; +var _A; var _getA = /*#__PURE__*/Symbol("getA"); class A { constructor() { @@ -7,7 +7,7 @@ class A { }); } } -_class = A; +_A = A; function _getA2() { - return _class; + return _A; } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsSymbols/super/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsSymbols/super/output.js index 050340687e97..28a97b724691 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsSymbols/super/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method-privateFieldsAsSymbols/super/output.js @@ -1,4 +1,4 @@ -var _class; +var _Sub; class Base { superMethod() { return 'good'; @@ -19,7 +19,7 @@ class Sub extends Base { return babelHelpers.classPrivateFieldLooseBase(this, _privateMethod)[_privateMethod](); } } -_class = Sub; +_Sub = Sub; function _privateMethod2() { - return babelHelpers.get(babelHelpers.getPrototypeOf(_class.prototype), "superMethod", this).call(this); + return babelHelpers.get(babelHelpers.getPrototypeOf(_Sub.prototype), "superMethod", this).call(this); } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/class-binding/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/class-binding/output.js index dbdc54a33765..f89142acd7f0 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/class-binding/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/class-binding/output.js @@ -1,11 +1,11 @@ -var _class; +var _A; var _getA = /*#__PURE__*/new WeakSet(); class A { constructor() { babelHelpers.classPrivateMethodInitSpec(this, _getA); } } -_class = A; +_A = A; function _getA2() { - return _class; + return _A; } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/super/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/super/output.js index d99420dc21d2..9b8d42f4c86f 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/super/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/super/output.js @@ -1,4 +1,4 @@ -var _class; +var _Sub; class Base { superMethod() { return 'good'; @@ -17,7 +17,7 @@ class Sub extends Base { return babelHelpers.classPrivateMethodGet(this, _privateMethod, _privateMethod2).call(this); } } -_class = Sub; +_Sub = Sub; function _privateMethod2() { - return babelHelpers.get(babelHelpers.getPrototypeOf(_class.prototype), "superMethod", this).call(this); + return babelHelpers.get(babelHelpers.getPrototypeOf(_Sub.prototype), "superMethod", this).call(this); } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-loose/class-expression/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-loose/class-expression/output.js index a1780023b3c2..57ac6fd69df6 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-loose/class-expression/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-loose/class-expression/output.js @@ -1,9 +1,9 @@ -var _class, _foo; -console.log((_foo = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("foo"), (_class = class A { +var _A, _foo; +console.log((_foo = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("foo"), (_A = class A { method() { babelHelpers.classPrivateFieldLooseBase(this, _foo)[_foo](); } -}, Object.defineProperty(_class, _foo, { +}, Object.defineProperty(_A, _foo, { value: _foo2 -}), _class))); +}), _A))); function _foo2() {} diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsProperties/class-expression/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsProperties/class-expression/output.js index a1780023b3c2..57ac6fd69df6 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsProperties/class-expression/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsProperties/class-expression/output.js @@ -1,9 +1,9 @@ -var _class, _foo; -console.log((_foo = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("foo"), (_class = class A { +var _A, _foo; +console.log((_foo = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("foo"), (_A = class A { method() { babelHelpers.classPrivateFieldLooseBase(this, _foo)[_foo](); } -}, Object.defineProperty(_class, _foo, { +}, Object.defineProperty(_A, _foo, { value: _foo2 -}), _class))); +}), _A))); function _foo2() {} diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsProperties/super/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsProperties/super/output.js index 0f6e8c980131..32d1941604c6 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsProperties/super/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsProperties/super/output.js @@ -1,4 +1,4 @@ -var _class; +var _Sub; class Base { static basePublicStaticMethod() { return 'good'; @@ -13,9 +13,9 @@ class Sub extends Base { babelHelpers.classPrivateFieldLooseBase(Sub, _subStaticPrivateMethod)[_subStaticPrivateMethod](); } } -_class = Sub; +_Sub = Sub; function _subStaticPrivateMethod2() { - return babelHelpers.get(babelHelpers.getPrototypeOf(_class), "basePublicStaticMethod", this).call(this); + return babelHelpers.get(babelHelpers.getPrototypeOf(_Sub), "basePublicStaticMethod", this).call(this); } Object.defineProperty(Sub, _subStaticPrivateMethod, { value: _subStaticPrivateMethod2 diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsProperties/this/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsProperties/this/output.js index c41d9a5718e3..450aac126eb4 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsProperties/this/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsProperties/this/output.js @@ -1,4 +1,4 @@ -var _class; +var _B; class A { static get a() { return 1; @@ -14,9 +14,9 @@ class B extends A { return [babelHelpers.classPrivateFieldLooseBase(this, _getA)[_getA], babelHelpers.classPrivateFieldLooseBase(this, _getB)[_getB]]; } } -_class = B; +_B = B; function _getA2() { - return babelHelpers.get(babelHelpers.getPrototypeOf(_class), "a", this); + return babelHelpers.get(babelHelpers.getPrototypeOf(_B), "a", this); } function _getB2() { return this.b; diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsSymbols/class-expression/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsSymbols/class-expression/output.js index e23ee98c50f4..bc7fcd79016b 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsSymbols/class-expression/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsSymbols/class-expression/output.js @@ -1,9 +1,9 @@ -var _class, _foo; -console.log((_foo = /*#__PURE__*/Symbol("foo"), (_class = class A { +var _A, _foo; +console.log((_foo = /*#__PURE__*/Symbol("foo"), (_A = class A { method() { babelHelpers.classPrivateFieldLooseBase(this, _foo)[_foo](); } -}, Object.defineProperty(_class, _foo, { +}, Object.defineProperty(_A, _foo, { value: _foo2 -}), _class))); +}), _A))); function _foo2() {} diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsSymbols/super/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsSymbols/super/output.js index 2d86bcc66b7e..1cf96936ef77 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsSymbols/super/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsSymbols/super/output.js @@ -1,4 +1,4 @@ -var _class; +var _Sub; class Base { static basePublicStaticMethod() { return 'good'; @@ -13,9 +13,9 @@ class Sub extends Base { babelHelpers.classPrivateFieldLooseBase(Sub, _subStaticPrivateMethod)[_subStaticPrivateMethod](); } } -_class = Sub; +_Sub = Sub; function _subStaticPrivateMethod2() { - return babelHelpers.get(babelHelpers.getPrototypeOf(_class), "basePublicStaticMethod", this).call(this); + return babelHelpers.get(babelHelpers.getPrototypeOf(_Sub), "basePublicStaticMethod", this).call(this); } Object.defineProperty(Sub, _subStaticPrivateMethod, { value: _subStaticPrivateMethod2 diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsSymbols/this/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsSymbols/this/output.js index 33efb9d817e7..bb03e56bf461 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsSymbols/this/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-privateFieldsAsSymbols/this/output.js @@ -1,4 +1,4 @@ -var _class; +var _B; class A { static get a() { return 1; @@ -14,9 +14,9 @@ class B extends A { return [babelHelpers.classPrivateFieldLooseBase(this, _getA)[_getA], babelHelpers.classPrivateFieldLooseBase(this, _getB)[_getB]]; } } -_class = B; +_B = B; function _getA2() { - return babelHelpers.get(babelHelpers.getPrototypeOf(_class), "a", this); + return babelHelpers.get(babelHelpers.getPrototypeOf(_B), "a", this); } function _getB2() { return this.b; diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/class-expression/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/class-expression/output.js index 4804b8127667..691f8c0f8453 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/class-expression/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/class-expression/output.js @@ -1,7 +1,7 @@ -var _class; -console.log(_class = class A { +var _A; +console.log(_A = class A { method() { - babelHelpers.classStaticPrivateMethodGet(this, _class, _foo).call(this); + babelHelpers.classStaticPrivateMethodGet(this, _A, _foo).call(this); } }); function _foo() {} diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/super/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/super/output.js index 694bcebd5037..883461364be6 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/super/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/super/output.js @@ -1,4 +1,4 @@ -var _class; +var _Sub; class Base { static basePublicStaticMethod() { return 'good'; @@ -12,7 +12,7 @@ class Sub extends Base { babelHelpers.classStaticPrivateMethodGet(Sub, Sub, _subStaticPrivateMethod).call(Sub); } } -_class = Sub; +_Sub = Sub; function _subStaticPrivateMethod() { - return babelHelpers.get(babelHelpers.getPrototypeOf(_class), "basePublicStaticMethod", this).call(this); + return babelHelpers.get(babelHelpers.getPrototypeOf(_Sub), "basePublicStaticMethod", this).call(this); } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/tagged-template/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/tagged-template/output.js index 4e171e7eb0bc..10171603af7e 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/tagged-template/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/tagged-template/output.js @@ -1,7 +1,7 @@ -var _class; +var _Foo; class Foo {} -_class = Foo; +_Foo = Foo; function _tag() { - babelHelpers.classStaticPrivateMethodGet(this, _class, _tag).bind(this)``; + babelHelpers.classStaticPrivateMethodGet(this, _Foo, _tag).bind(this)``; } new Foo(); diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/this/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/this/output.js index c43bd10fecb7..8871cf7c9177 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/this/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/this/output.js @@ -1,4 +1,4 @@ -var _class; +var _B; class A { static get a() { return 1; @@ -12,9 +12,9 @@ class B extends A { return [babelHelpers.classStaticPrivateMethodGet(this, B, _getA), babelHelpers.classStaticPrivateMethodGet(this, B, _getB)]; } } -_class = B; +_B = B; function _getA() { - return babelHelpers.get(babelHelpers.getPrototypeOf(_class), "a", this); + return babelHelpers.get(babelHelpers.getPrototypeOf(_B), "a", this); } function _getB() { return this.b; diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/basic/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/basic/output.js index 3e2e2f3f5f70..c6fd0e3c3a2d 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/basic/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/basic/output.js @@ -1,4 +1,4 @@ -var _class; +var _Cl; var _PRIVATE_STATIC_FIELD = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("PRIVATE_STATIC_FIELD"); var _privateStaticFieldValue = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("privateStaticFieldValue"); class Cl { @@ -9,12 +9,12 @@ class Cl { babelHelpers.classPrivateFieldLooseBase(Cl, _privateStaticFieldValue)[_privateStaticFieldValue] = "dank"; } } -_class = Cl; +_Cl = Cl; function _get_privateStaticFieldValue() { - return babelHelpers.classPrivateFieldLooseBase(_class, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD]; + return babelHelpers.classPrivateFieldLooseBase(_Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD]; } function _set_privateStaticFieldValue(newValue) { - babelHelpers.classPrivateFieldLooseBase(_class, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = `Updated: ${newValue}`; + babelHelpers.classPrivateFieldLooseBase(_Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = `Updated: ${newValue}`; } Object.defineProperty(Cl, _privateStaticFieldValue, { get: _get_privateStaticFieldValue, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/destructure-set/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/destructure-set/output.js index 2f1422d88de0..ce3210d7ff28 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/destructure-set/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/destructure-set/output.js @@ -1,4 +1,4 @@ -var _class; +var _C; var _p = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("p"); var _q = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("q"); class C { @@ -6,9 +6,9 @@ class C { [babelHelpers.classPrivateFieldLooseBase(C, _p)[_p]] = [0]; } } -_class = C; +_C = C; function _set_p(v) { - babelHelpers.classPrivateFieldLooseBase(_class, _q)[_q] = v; + babelHelpers.classPrivateFieldLooseBase(_C, _q)[_q] = v; } Object.defineProperty(C, _p, { get: void 0, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/get-only-setter/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/get-only-setter/output.js index 1b95be07f6bc..16a339c1fb54 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/get-only-setter/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/get-only-setter/output.js @@ -1,4 +1,4 @@ -var _class; +var _Cl; var _PRIVATE_STATIC_FIELD = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("PRIVATE_STATIC_FIELD"); var _privateStaticFieldValue = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("privateStaticFieldValue"); class Cl { @@ -6,9 +6,9 @@ class Cl { return babelHelpers.classPrivateFieldLooseBase(Cl, _privateStaticFieldValue)[_privateStaticFieldValue]; } } -_class = Cl; +_Cl = Cl; function _set_privateStaticFieldValue(newValue) { - babelHelpers.classPrivateFieldLooseBase(_class, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = newValue; + babelHelpers.classPrivateFieldLooseBase(_Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = newValue; } Object.defineProperty(Cl, _privateStaticFieldValue, { get: void 0, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/updates/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/updates/output.js index fb33fbeccd01..1d32bdbb3374 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/updates/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-loose/updates/output.js @@ -1,4 +1,4 @@ -var _class; +var _Cl; var _privateField = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("privateField"); var _privateFieldValue = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("privateFieldValue"); class Cl { @@ -27,12 +27,12 @@ class Cl { Cl.publicFieldValue = -(Cl.publicFieldValue ** Cl.publicFieldValue); } } -_class = Cl; +_Cl = Cl; function _get_privateFieldValue() { - return babelHelpers.classPrivateFieldLooseBase(_class, _privateField)[_privateField]; + return babelHelpers.classPrivateFieldLooseBase(_Cl, _privateField)[_privateField]; } function _set_privateFieldValue(newValue) { - babelHelpers.classPrivateFieldLooseBase(_class, _privateField)[_privateField] = newValue; + babelHelpers.classPrivateFieldLooseBase(_Cl, _privateField)[_privateField] = newValue; } Object.defineProperty(Cl, _privateFieldValue, { get: _get_privateFieldValue, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/basic/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/basic/output.js index 3e2e2f3f5f70..c6fd0e3c3a2d 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/basic/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/basic/output.js @@ -1,4 +1,4 @@ -var _class; +var _Cl; var _PRIVATE_STATIC_FIELD = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("PRIVATE_STATIC_FIELD"); var _privateStaticFieldValue = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("privateStaticFieldValue"); class Cl { @@ -9,12 +9,12 @@ class Cl { babelHelpers.classPrivateFieldLooseBase(Cl, _privateStaticFieldValue)[_privateStaticFieldValue] = "dank"; } } -_class = Cl; +_Cl = Cl; function _get_privateStaticFieldValue() { - return babelHelpers.classPrivateFieldLooseBase(_class, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD]; + return babelHelpers.classPrivateFieldLooseBase(_Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD]; } function _set_privateStaticFieldValue(newValue) { - babelHelpers.classPrivateFieldLooseBase(_class, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = `Updated: ${newValue}`; + babelHelpers.classPrivateFieldLooseBase(_Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = `Updated: ${newValue}`; } Object.defineProperty(Cl, _privateStaticFieldValue, { get: _get_privateStaticFieldValue, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/destructure-set/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/destructure-set/output.js index 2f1422d88de0..ce3210d7ff28 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/destructure-set/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/destructure-set/output.js @@ -1,4 +1,4 @@ -var _class; +var _C; var _p = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("p"); var _q = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("q"); class C { @@ -6,9 +6,9 @@ class C { [babelHelpers.classPrivateFieldLooseBase(C, _p)[_p]] = [0]; } } -_class = C; +_C = C; function _set_p(v) { - babelHelpers.classPrivateFieldLooseBase(_class, _q)[_q] = v; + babelHelpers.classPrivateFieldLooseBase(_C, _q)[_q] = v; } Object.defineProperty(C, _p, { get: void 0, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/get-only-setter/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/get-only-setter/output.js index 1b95be07f6bc..16a339c1fb54 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/get-only-setter/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/get-only-setter/output.js @@ -1,4 +1,4 @@ -var _class; +var _Cl; var _PRIVATE_STATIC_FIELD = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("PRIVATE_STATIC_FIELD"); var _privateStaticFieldValue = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("privateStaticFieldValue"); class Cl { @@ -6,9 +6,9 @@ class Cl { return babelHelpers.classPrivateFieldLooseBase(Cl, _privateStaticFieldValue)[_privateStaticFieldValue]; } } -_class = Cl; +_Cl = Cl; function _set_privateStaticFieldValue(newValue) { - babelHelpers.classPrivateFieldLooseBase(_class, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = newValue; + babelHelpers.classPrivateFieldLooseBase(_Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = newValue; } Object.defineProperty(Cl, _privateStaticFieldValue, { get: void 0, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/updates/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/updates/output.js index 68b11be4ec30..0941f126290a 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/updates/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsProperties/updates/output.js @@ -1,4 +1,4 @@ -var _class; +var _Cl; var _privateField = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("privateField"); var _privateFieldValue = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("privateFieldValue"); class Cl { @@ -27,12 +27,12 @@ class Cl { Cl.publicFieldValue = -(Cl.publicFieldValue ** Cl.publicFieldValue); } } -_class = Cl; +_Cl = Cl; function _get_privateFieldValue() { - return babelHelpers.classPrivateFieldLooseBase(_class, _privateField)[_privateField]; + return babelHelpers.classPrivateFieldLooseBase(_Cl, _privateField)[_privateField]; } function _set_privateFieldValue(newValue) { - babelHelpers.classPrivateFieldLooseBase(_class, _privateField)[_privateField] = newValue; + babelHelpers.classPrivateFieldLooseBase(_Cl, _privateField)[_privateField] = newValue; } Object.defineProperty(Cl, _privateFieldValue, { get: _get_privateFieldValue, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/basic/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/basic/output.js index 881a6e532561..5d0c30e1b324 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/basic/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/basic/output.js @@ -1,4 +1,4 @@ -var _class; +var _Cl; var _PRIVATE_STATIC_FIELD = /*#__PURE__*/Symbol("PRIVATE_STATIC_FIELD"); var _privateStaticFieldValue = /*#__PURE__*/Symbol("privateStaticFieldValue"); class Cl { @@ -9,12 +9,12 @@ class Cl { babelHelpers.classPrivateFieldLooseBase(Cl, _privateStaticFieldValue)[_privateStaticFieldValue] = "dank"; } } -_class = Cl; +_Cl = Cl; function _get_privateStaticFieldValue() { - return babelHelpers.classPrivateFieldLooseBase(_class, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD]; + return babelHelpers.classPrivateFieldLooseBase(_Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD]; } function _set_privateStaticFieldValue(newValue) { - babelHelpers.classPrivateFieldLooseBase(_class, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = `Updated: ${newValue}`; + babelHelpers.classPrivateFieldLooseBase(_Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = `Updated: ${newValue}`; } Object.defineProperty(Cl, _privateStaticFieldValue, { get: _get_privateStaticFieldValue, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/destructure-set/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/destructure-set/output.js index 83349c861dcc..475e2731aa2b 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/destructure-set/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/destructure-set/output.js @@ -1,4 +1,4 @@ -var _class; +var _C; var _p = /*#__PURE__*/Symbol("p"); var _q = /*#__PURE__*/Symbol("q"); class C { @@ -6,9 +6,9 @@ class C { [babelHelpers.classPrivateFieldLooseBase(C, _p)[_p]] = [0]; } } -_class = C; +_C = C; function _set_p(v) { - babelHelpers.classPrivateFieldLooseBase(_class, _q)[_q] = v; + babelHelpers.classPrivateFieldLooseBase(_C, _q)[_q] = v; } Object.defineProperty(C, _p, { get: void 0, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/get-only-setter/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/get-only-setter/output.js index d1299b8a96bb..03e35f4e9ae7 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/get-only-setter/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/get-only-setter/output.js @@ -1,4 +1,4 @@ -var _class; +var _Cl; var _PRIVATE_STATIC_FIELD = /*#__PURE__*/Symbol("PRIVATE_STATIC_FIELD"); var _privateStaticFieldValue = /*#__PURE__*/Symbol("privateStaticFieldValue"); class Cl { @@ -6,9 +6,9 @@ class Cl { return babelHelpers.classPrivateFieldLooseBase(Cl, _privateStaticFieldValue)[_privateStaticFieldValue]; } } -_class = Cl; +_Cl = Cl; function _set_privateStaticFieldValue(newValue) { - babelHelpers.classPrivateFieldLooseBase(_class, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = newValue; + babelHelpers.classPrivateFieldLooseBase(_Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = newValue; } Object.defineProperty(Cl, _privateStaticFieldValue, { get: void 0, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/updates/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/updates/output.js index 17e42e95b264..384e2f307ed1 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/updates/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors-privateFieldsAsSymbols/updates/output.js @@ -1,4 +1,4 @@ -var _class; +var _Cl; var _privateField = /*#__PURE__*/Symbol("privateField"); var _privateFieldValue = /*#__PURE__*/Symbol("privateFieldValue"); class Cl { @@ -27,12 +27,12 @@ class Cl { Cl.publicFieldValue = -(Cl.publicFieldValue ** Cl.publicFieldValue); } } -_class = Cl; +_Cl = Cl; function _get_privateFieldValue() { - return babelHelpers.classPrivateFieldLooseBase(_class, _privateField)[_privateField]; + return babelHelpers.classPrivateFieldLooseBase(_Cl, _privateField)[_privateField]; } function _set_privateFieldValue(newValue) { - babelHelpers.classPrivateFieldLooseBase(_class, _privateField)[_privateField] = newValue; + babelHelpers.classPrivateFieldLooseBase(_Cl, _privateField)[_privateField] = newValue; } Object.defineProperty(Cl, _privateFieldValue, { get: _get_privateFieldValue, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/basic/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/basic/output.js index 68b6f6eb0c34..7681b43bd515 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/basic/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/basic/output.js @@ -1,4 +1,4 @@ -var _class; +var _Cl; class Cl { static getValue() { return babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateStaticFieldValue); @@ -7,12 +7,12 @@ class Cl { babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateStaticFieldValue, "dank"); } } -_class = Cl; +_Cl = Cl; function _get_privateStaticFieldValue() { - return babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _PRIVATE_STATIC_FIELD); + return babelHelpers.classStaticPrivateFieldSpecGet(_Cl, _Cl, _PRIVATE_STATIC_FIELD); } function _set_privateStaticFieldValue(newValue) { - babelHelpers.classStaticPrivateFieldSpecSet(_class, _class, _PRIVATE_STATIC_FIELD, `Updated: ${newValue}`); + babelHelpers.classStaticPrivateFieldSpecSet(_Cl, _Cl, _PRIVATE_STATIC_FIELD, `Updated: ${newValue}`); } var _privateStaticFieldValue = { get: _get_privateStaticFieldValue, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/destructure-set/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/destructure-set/output.js index a15ea1c56259..e8f95994bc87 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/destructure-set/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/destructure-set/output.js @@ -1,12 +1,12 @@ -var _class; +var _C; class C { constructor() { [babelHelpers.classStaticPrivateFieldDestructureSet(C, C, _p).value] = [0]; } } -_class = C; +_C = C; function _set_p(v) { - babelHelpers.classStaticPrivateFieldSpecSet(_class, _class, _q, v); + babelHelpers.classStaticPrivateFieldSpecSet(_C, _C, _q, v); } var _p = { get: void 0, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/get-only-setter/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/get-only-setter/output.js index 2151a85c7db3..3f69c5911d45 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/get-only-setter/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/get-only-setter/output.js @@ -1,12 +1,12 @@ -var _class; +var _Cl; class Cl { static getPrivateStaticFieldValue() { return babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateStaticFieldValue); } } -_class = Cl; +_Cl = Cl; function _set_privateStaticFieldValue(newValue) { - babelHelpers.classStaticPrivateFieldSpecSet(_class, _class, _PRIVATE_STATIC_FIELD, newValue); + babelHelpers.classStaticPrivateFieldSpecSet(_Cl, _Cl, _PRIVATE_STATIC_FIELD, newValue); } var _privateStaticFieldValue = { get: void 0, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/set-only-getter/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/set-only-getter/output.js index 2a3e9fe93577..2704eb2d0902 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/set-only-getter/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/set-only-getter/output.js @@ -1,13 +1,13 @@ -var _class; +var _Cl; class Cl { constructor() { babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateFieldValue, 1); [babelHelpers.classStaticPrivateFieldDestructureSet(Cl, Cl, _privateFieldValue).value] = [1]; } } -_class = Cl; +_Cl = Cl; function _get_privateFieldValue() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _privateField); + return babelHelpers.classStaticPrivateFieldSpecGet(this, _Cl, _privateField); } var _privateFieldValue = { get: _get_privateFieldValue, diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/updates/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/updates/output.js index d0c2efa63d70..e7058c8d0fe5 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/updates/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/updates/output.js @@ -1,4 +1,4 @@ -var _class; +var _Cl; class Cl { static publicGetPrivateField() { return babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateFieldValue); @@ -26,12 +26,12 @@ class Cl { Cl.publicFieldValue = -(Cl.publicFieldValue ** Cl.publicFieldValue); } } -_class = Cl; +_Cl = Cl; function _get_privateFieldValue() { - return babelHelpers.classStaticPrivateFieldSpecGet(_class, _class, _privateField); + return babelHelpers.classStaticPrivateFieldSpecGet(_Cl, _Cl, _privateField); } function _set_privateFieldValue(newValue) { - babelHelpers.classStaticPrivateFieldSpecSet(_class, _class, _privateField, newValue); + babelHelpers.classStaticPrivateFieldSpecSet(_Cl, _Cl, _privateField, newValue); } var _privateFieldValue = { get: _get_privateFieldValue, diff --git a/packages/babel-preset-env/test/fixtures/shipped-proposals/new-class-features-firefox-70/output.js b/packages/babel-preset-env/test/fixtures/shipped-proposals/new-class-features-firefox-70/output.js index 81345dcc1340..76dd8dc967cb 100644 --- a/packages/babel-preset-env/test/fixtures/shipped-proposals/new-class-features-firefox-70/output.js +++ b/packages/babel-preset-env/test/fixtures/shipped-proposals/new-class-features-firefox-70/output.js @@ -1,4 +1,4 @@ -var _class; +var _A; var _foo = /*#__PURE__*/new WeakMap(); class A { constructor() { @@ -8,5 +8,5 @@ class A { }); } } -_class = A; -register(_class, _foo.has(babelHelpers.checkInRHS(_class))); +_A = A; +register(_A, _foo.has(babelHelpers.checkInRHS(_A)));