diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 7f848685aec36..1e70dcc0d9f72 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -23,10 +23,11 @@ namespace ts { IsNamedExternalExport = 1 << 4, IsDefaultExternalExport = 1 << 5, IsDerivedClass = 1 << 6, + UseImmediatelyInvokedFunctionExpression = 1 << 7, HasAnyDecorators = HasConstructorDecorators | HasMemberDecorators, NeedsName = HasStaticInitializedProperties | HasMemberDecorators, - UseImmediatelyInvokedFunctionExpression = HasAnyDecorators | HasStaticInitializedProperties, + MayNeedImmediatelyInvokedFunctionExpression = HasAnyDecorators | HasStaticInitializedProperties, IsExported = IsExportOfNamespace | IsDefaultExternalExport | IsNamedExternalExport, } @@ -595,6 +596,7 @@ namespace ts { if (isExportOfNamespace(node)) facts |= ClassFacts.IsExportOfNamespace; else if (isDefaultExternalModuleExport(node)) facts |= ClassFacts.IsDefaultExternalExport; else if (isNamedExternalModuleExport(node)) facts |= ClassFacts.IsNamedExternalExport; + if (languageVersion <= ScriptTarget.ES5 && (facts & ClassFacts.MayNeedImmediatelyInvokedFunctionExpression)) facts |= ClassFacts.UseImmediatelyInvokedFunctionExpression; return facts; } @@ -665,12 +667,6 @@ namespace ts { const iife = createImmediatelyInvokedArrowFunction(statements); setEmitFlags(iife, EmitFlags.TypeScriptClassWrapper); - // Class comment is already added by the ES2015 transform when targeting ES5 or below. - // Only add if targetting ES2015+ to prevent duplicates - if (languageVersion > ScriptTarget.ES5) { - addSyntheticLeadingComment(iife, SyntaxKind.MultiLineCommentTrivia, "* @class "); - } - const varStatement = createVariableStatement( /*modifiers*/ undefined, createVariableDeclarationList([ @@ -679,7 +675,7 @@ namespace ts { /*type*/ undefined, iife ) - ], languageVersion > ScriptTarget.ES5 ? NodeFlags.Let : undefined) + ]) ); setOriginalNode(varStatement, node); diff --git a/tests/baselines/reference/awaitAndYieldInProperty.js b/tests/baselines/reference/awaitAndYieldInProperty.js index 238666278a8f1..73c04a612c2d0 100644 --- a/tests/baselines/reference/awaitAndYieldInProperty.js +++ b/tests/baselines/reference/awaitAndYieldInProperty.js @@ -19,31 +19,27 @@ async function* test(x: Promise) { //// [awaitAndYieldInProperty.js] async function* test(x) { - var _a, _b, _c, _d, _e; - let C = /** @class */ (() => { - var _e, _f, _g, _h; - class C { + var _a, _b, _c, _d, _e, _f, _g, _h, _j; + class C { + constructor() { + this[_a] = await x; + this[_c] = yield 2; + } + } + _a = await x, _b = await x, _c = yield 1, _d = yield 3; + C[_b] = await x; + C[_d] = yield 4; + return _j = class { constructor() { this[_e] = await x; this[_g] = yield 2; } - } - _e = await x, _f = await x, _g = yield 1, _h = yield 3; - C[_f] = await x; - C[_h] = yield 4; - return C; - })(); - return _e = class { - constructor() { - this[_a] = await x; - this[_c] = yield 2; - } }, - _a = await x, - _b = await x, - _c = yield 1, - _d = yield 3, - _e[_b] = await x, - _e[_d] = yield 4, - _e; + _e = await x, + _f = await x, + _g = yield 1, + _h = yield 3, + _j[_f] = await x, + _j[_h] = yield 4, + _j; } diff --git a/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInItself.js b/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInItself.js index 0d5cc7e784553..b3a3d25a81935 100644 --- a/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInItself.js +++ b/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInItself.js @@ -4,9 +4,6 @@ class C3 { } //// [classDeclarationCheckUsedBeforeDefinitionInItself.js] -let C3 = /** @class */ (() => { - class C3 { - } - C3.intance = new C3(); // ok - return C3; -})(); +class C3 { +} +C3.intance = new C3(); // ok diff --git a/tests/baselines/reference/computedPropertyNames12_ES6.js b/tests/baselines/reference/computedPropertyNames12_ES6.js index 9a0e26d1e24f3..f56dbf287a8c6 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES6.js +++ b/tests/baselines/reference/computedPropertyNames12_ES6.js @@ -17,19 +17,16 @@ class C { } //// [computedPropertyNames12_ES6.js] +var _a, _b, _c; var s; var n; var a; -let C = /** @class */ (() => { - var _a, _b, _c; - class C { - constructor() { - this[_a] = n; - this[_b] = 2; - this[`hello bye`] = 0; - } +class C { + constructor() { + this[_a] = n; + this[_b] = 2; + this[`hello bye`] = 0; } - _a = n, s + s, _b = s + n, +s, _c = `hello ${a} bye`; - C[_c] = 0; - return C; -})(); +} +_a = n, s + s, _b = s + n, +s, _c = `hello ${a} bye`; +C[_c] = 0; diff --git a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.js b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.js index fcff09585fbfe..9f0407588a83e 100644 --- a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.js +++ b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.js @@ -11,16 +11,13 @@ class C { } //// [computedPropertyNamesWithStaticProperty.js] -let C = /** @class */ (() => { - class C { - get [C.staticProp]() { - return "hello"; - } - set [C.staticProp](x) { - var y = x; - } - [C.staticProp]() { } +class C { + get [C.staticProp]() { + return "hello"; } - C.staticProp = 10; - return C; -})(); + set [C.staticProp](x) { + var y = x; + } + [C.staticProp]() { } +} +C.staticProp = 10; diff --git a/tests/baselines/reference/decoratedClassExportsCommonJS1.js b/tests/baselines/reference/decoratedClassExportsCommonJS1.js index a040f754ebc95..2bcf0f9acda31 100644 --- a/tests/baselines/reference/decoratedClassExportsCommonJS1.js +++ b/tests/baselines/reference/decoratedClassExportsCommonJS1.js @@ -14,16 +14,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; +var Testing123_1; Object.defineProperty(exports, "__esModule", { value: true }); exports.Testing123 = void 0; -let Testing123 = /** @class */ (() => { - var Testing123_1; - let Testing123 = Testing123_1 = class Testing123 { - }; - Testing123.prop1 = Testing123_1.prop0; - Testing123 = Testing123_1 = __decorate([ - Something({ v: () => Testing123_1 }) - ], Testing123); - return Testing123; -})(); +let Testing123 = Testing123_1 = class Testing123 { +}; +Testing123.prop1 = Testing123_1.prop0; +Testing123 = Testing123_1 = __decorate([ + Something({ v: () => Testing123_1 }) +], Testing123); exports.Testing123 = Testing123; diff --git a/tests/baselines/reference/decoratedClassExportsCommonJS2.js b/tests/baselines/reference/decoratedClassExportsCommonJS2.js index 2c0b6ee33193c..a19595f6c1202 100644 --- a/tests/baselines/reference/decoratedClassExportsCommonJS2.js +++ b/tests/baselines/reference/decoratedClassExportsCommonJS2.js @@ -12,15 +12,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; +var Testing123_1; Object.defineProperty(exports, "__esModule", { value: true }); exports.Testing123 = void 0; -let Testing123 = /** @class */ (() => { - var Testing123_1; - let Testing123 = Testing123_1 = class Testing123 { - }; - Testing123 = Testing123_1 = __decorate([ - Something({ v: () => Testing123_1 }) - ], Testing123); - return Testing123; -})(); +let Testing123 = Testing123_1 = class Testing123 { +}; +Testing123 = Testing123_1 = __decorate([ + Something({ v: () => Testing123_1 }) +], Testing123); exports.Testing123 = Testing123; diff --git a/tests/baselines/reference/decoratedClassExportsSystem1.js b/tests/baselines/reference/decoratedClassExportsSystem1.js index 8d26dfb9a4e5b..844a87fe0930b 100644 --- a/tests/baselines/reference/decoratedClassExportsSystem1.js +++ b/tests/baselines/reference/decoratedClassExportsSystem1.js @@ -16,21 +16,17 @@ System.register([], function (exports_1, context_1) { else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var Testing123; + var Testing123_1, Testing123; var __moduleName = context_1 && context_1.id; return { setters: [], execute: function () { - Testing123 = /** @class */ (() => { - var Testing123_1; - let Testing123 = Testing123_1 = class Testing123 { - }; - Testing123.prop1 = Testing123_1.prop0; - Testing123 = Testing123_1 = __decorate([ - Something({ v: () => Testing123_1 }) - ], Testing123); - return Testing123; - })(); + Testing123 = Testing123_1 = class Testing123 { + }; + Testing123.prop1 = Testing123_1.prop0; + Testing123 = Testing123_1 = __decorate([ + Something({ v: () => Testing123_1 }) + ], Testing123); exports_1("Testing123", Testing123); } }; diff --git a/tests/baselines/reference/decoratedClassExportsSystem2.js b/tests/baselines/reference/decoratedClassExportsSystem2.js index cc26df71f033a..a9458e125b325 100644 --- a/tests/baselines/reference/decoratedClassExportsSystem2.js +++ b/tests/baselines/reference/decoratedClassExportsSystem2.js @@ -13,20 +13,16 @@ System.register([], function (exports_1, context_1) { else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var Testing123; + var Testing123_1, Testing123; var __moduleName = context_1 && context_1.id; return { setters: [], execute: function () { - Testing123 = /** @class */ (() => { - var Testing123_1; - let Testing123 = Testing123_1 = class Testing123 { - }; - Testing123 = Testing123_1 = __decorate([ - Something({ v: () => Testing123_1 }) - ], Testing123); - return Testing123; - })(); + Testing123 = Testing123_1 = class Testing123 { + }; + Testing123 = Testing123_1 = __decorate([ + Something({ v: () => Testing123_1 }) + ], Testing123); exports_1("Testing123", Testing123); } }; diff --git a/tests/baselines/reference/decoratedClassFromExternalModule.js b/tests/baselines/reference/decoratedClassFromExternalModule.js index fc81b9c73beaf..c40cd3f691e34 100644 --- a/tests/baselines/reference/decoratedClassFromExternalModule.js +++ b/tests/baselines/reference/decoratedClassFromExternalModule.js @@ -17,14 +17,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, return c > 3 && r && Object.defineProperty(target, key, r), r; }; function decorate(target) { } -let Decorated = /** @class */ (() => { - let Decorated = class Decorated { - }; - Decorated = __decorate([ - decorate - ], Decorated); - return Decorated; -})(); +let Decorated = class Decorated { +}; +Decorated = __decorate([ + decorate +], Decorated); export default Decorated; //// [undecorated.js] export {}; diff --git a/tests/baselines/reference/decoratedDefaultExportsGetExportedAmd.js b/tests/baselines/reference/decoratedDefaultExportsGetExportedAmd.js index 5772bdade2003..dadaa5ed6df1b 100644 --- a/tests/baselines/reference/decoratedDefaultExportsGetExportedAmd.js +++ b/tests/baselines/reference/decoratedDefaultExportsGetExportedAmd.js @@ -24,14 +24,11 @@ define(["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var decorator; - let Foo = /** @class */ (() => { - let Foo = class Foo { - }; - Foo = __decorate([ - decorator - ], Foo); - return Foo; - })(); + let Foo = class Foo { + }; + Foo = __decorate([ + decorator + ], Foo); exports.default = Foo; }); //// [b.js] @@ -45,13 +42,10 @@ define(["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var decorator; - let default_1 = /** @class */ (() => { - let default_1 = class { - }; - default_1 = __decorate([ - decorator - ], default_1); - return default_1; - })(); + let default_1 = class { + }; + default_1 = __decorate([ + decorator + ], default_1); exports.default = default_1; }); diff --git a/tests/baselines/reference/decoratedDefaultExportsGetExportedCommonjs.js b/tests/baselines/reference/decoratedDefaultExportsGetExportedCommonjs.js index 51a3144eb91f2..f6c7b7cbc8b80 100644 --- a/tests/baselines/reference/decoratedDefaultExportsGetExportedCommonjs.js +++ b/tests/baselines/reference/decoratedDefaultExportsGetExportedCommonjs.js @@ -23,14 +23,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, }; Object.defineProperty(exports, "__esModule", { value: true }); var decorator; -let Foo = /** @class */ (() => { - let Foo = class Foo { - }; - Foo = __decorate([ - decorator - ], Foo); - return Foo; -})(); +let Foo = class Foo { +}; +Foo = __decorate([ + decorator +], Foo); exports.default = Foo; //// [b.js] "use strict"; @@ -42,12 +39,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, }; Object.defineProperty(exports, "__esModule", { value: true }); var decorator; -let default_1 = /** @class */ (() => { - let default_1 = class { - }; - default_1 = __decorate([ - decorator - ], default_1); - return default_1; -})(); +let default_1 = class { +}; +default_1 = __decorate([ + decorator +], default_1); exports.default = default_1; diff --git a/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.js b/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.js index 2c92aa2a6c372..63290f4176a2b 100644 --- a/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.js +++ b/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.js @@ -26,14 +26,11 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - Foo = /** @class */ (() => { - let Foo = class Foo { - }; - Foo = __decorate([ - decorator - ], Foo); - return Foo; - })(); + Foo = class Foo { + }; + Foo = __decorate([ + decorator + ], Foo); exports_1("default", Foo); } }; @@ -52,14 +49,11 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - default_1 = /** @class */ (() => { - let default_1 = class { - }; - default_1 = __decorate([ - decorator - ], default_1); - return default_1; - })(); + default_1 = class { + }; + default_1 = __decorate([ + decorator + ], default_1); exports_1("default", default_1); } }; diff --git a/tests/baselines/reference/decoratedDefaultExportsGetExportedUmd.js b/tests/baselines/reference/decoratedDefaultExportsGetExportedUmd.js index f8c2160559e40..beb5fa26755ef 100644 --- a/tests/baselines/reference/decoratedDefaultExportsGetExportedUmd.js +++ b/tests/baselines/reference/decoratedDefaultExportsGetExportedUmd.js @@ -32,14 +32,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var decorator; - let Foo = /** @class */ (() => { - let Foo = class Foo { - }; - Foo = __decorate([ - decorator - ], Foo); - return Foo; - })(); + let Foo = class Foo { + }; + Foo = __decorate([ + decorator + ], Foo); exports.default = Foo; }); //// [b.js] @@ -61,13 +58,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var decorator; - let default_1 = /** @class */ (() => { - let default_1 = class { - }; - default_1 = __decorate([ - decorator - ], default_1); - return default_1; - })(); + let default_1 = class { + }; + default_1 = __decorate([ + decorator + ], default_1); exports.default = default_1; }); diff --git a/tests/baselines/reference/decoratorMetadataPromise.js b/tests/baselines/reference/decoratorMetadataPromise.js index d724e048afda0..41bb42e27328e 100644 --- a/tests/baselines/reference/decoratorMetadataPromise.js +++ b/tests/baselines/reference/decoratorMetadataPromise.js @@ -30,33 +30,30 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -let A = /** @class */ (() => { - class A { - foo() { - return __awaiter(this, void 0, void 0, function* () { }); - } - bar() { - return __awaiter(this, void 0, void 0, function* () { return 0; }); - } - baz(n) { return n; } +class A { + foo() { + return __awaiter(this, void 0, void 0, function* () { }); } - __decorate([ - decorator, - __metadata("design:type", Function), - __metadata("design:paramtypes", []), - __metadata("design:returntype", Promise) - ], A.prototype, "foo", null); - __decorate([ - decorator, - __metadata("design:type", Function), - __metadata("design:paramtypes", []), - __metadata("design:returntype", Promise) - ], A.prototype, "bar", null); - __decorate([ - decorator, - __metadata("design:type", Function), - __metadata("design:paramtypes", [Promise]), - __metadata("design:returntype", Promise) - ], A.prototype, "baz", null); - return A; -})(); + bar() { + return __awaiter(this, void 0, void 0, function* () { return 0; }); + } + baz(n) { return n; } +} +__decorate([ + decorator, + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], A.prototype, "foo", null); +__decorate([ + decorator, + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], A.prototype, "bar", null); +__decorate([ + decorator, + __metadata("design:type", Function), + __metadata("design:paramtypes", [Promise]), + __metadata("design:returntype", Promise) +], A.prototype, "baz", null); diff --git a/tests/baselines/reference/decoratorOnClass1.es6.js b/tests/baselines/reference/decoratorOnClass1.es6.js index 6e2f74e995780..7a02b9f5cd877 100644 --- a/tests/baselines/reference/decoratorOnClass1.es6.js +++ b/tests/baselines/reference/decoratorOnClass1.es6.js @@ -14,12 +14,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let C = /** @class */ (() => { - let C = class C { - }; - C = __decorate([ - dec - ], C); - return C; -})(); +let C = class C { +}; +C = __decorate([ + dec +], C); let c = new C(); diff --git a/tests/baselines/reference/decoratorOnClass2.es6.js b/tests/baselines/reference/decoratorOnClass2.es6.js index 6946945df6267..d1258af98b90f 100644 --- a/tests/baselines/reference/decoratorOnClass2.es6.js +++ b/tests/baselines/reference/decoratorOnClass2.es6.js @@ -14,13 +14,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let C = /** @class */ (() => { - let C = class C { - }; - C = __decorate([ - dec - ], C); - return C; -})(); +let C = class C { +}; +C = __decorate([ + dec +], C); export { C }; let c = new C(); diff --git a/tests/baselines/reference/decoratorOnClass3.es6.js b/tests/baselines/reference/decoratorOnClass3.es6.js index 4cdfc3e6865de..a6b1d6e258997 100644 --- a/tests/baselines/reference/decoratorOnClass3.es6.js +++ b/tests/baselines/reference/decoratorOnClass3.es6.js @@ -14,13 +14,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let C = /** @class */ (() => { - let C = class C { - }; - C = __decorate([ - dec - ], C); - return C; -})(); +let C = class C { +}; +C = __decorate([ + dec +], C); export default C; let c = new C(); diff --git a/tests/baselines/reference/decoratorOnClass4.es6.js b/tests/baselines/reference/decoratorOnClass4.es6.js index 915f91f8721b0..0435c822da6bc 100644 --- a/tests/baselines/reference/decoratorOnClass4.es6.js +++ b/tests/baselines/reference/decoratorOnClass4.es6.js @@ -12,12 +12,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let default_1 = /** @class */ (() => { - let default_1 = class { - }; - default_1 = __decorate([ - dec - ], default_1); - return default_1; -})(); +let default_1 = class { +}; +default_1 = __decorate([ + dec +], default_1); export default default_1; diff --git a/tests/baselines/reference/decoratorOnClass5.es6.js b/tests/baselines/reference/decoratorOnClass5.es6.js index 0c9fa643ebe03..b1c45cbce312c 100644 --- a/tests/baselines/reference/decoratorOnClass5.es6.js +++ b/tests/baselines/reference/decoratorOnClass5.es6.js @@ -16,15 +16,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let C = /** @class */ (() => { - var C_1; - let C = C_1 = class C { - static x() { return C_1.y; } - }; - C.y = 1; - C = C_1 = __decorate([ - dec - ], C); - return C; -})(); +var C_1; +let C = C_1 = class C { + static x() { return C_1.y; } +}; +C.y = 1; +C = C_1 = __decorate([ + dec +], C); let c = new C(); diff --git a/tests/baselines/reference/decoratorOnClass6.es6.js b/tests/baselines/reference/decoratorOnClass6.es6.js index e54247c0246c3..f9d8d2f419929 100644 --- a/tests/baselines/reference/decoratorOnClass6.es6.js +++ b/tests/baselines/reference/decoratorOnClass6.es6.js @@ -16,16 +16,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let C = /** @class */ (() => { - var C_1; - let C = C_1 = class C { - static x() { return C_1.y; } - }; - C.y = 1; - C = C_1 = __decorate([ - dec - ], C); - return C; -})(); +var C_1; +let C = C_1 = class C { + static x() { return C_1.y; } +}; +C.y = 1; +C = C_1 = __decorate([ + dec +], C); export { C }; let c = new C(); diff --git a/tests/baselines/reference/decoratorOnClass7.es6.js b/tests/baselines/reference/decoratorOnClass7.es6.js index 105ce5f5ef35e..aefc9536a878c 100644 --- a/tests/baselines/reference/decoratorOnClass7.es6.js +++ b/tests/baselines/reference/decoratorOnClass7.es6.js @@ -16,16 +16,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let C = /** @class */ (() => { - var C_1; - let C = C_1 = class C { - static x() { return C_1.y; } - }; - C.y = 1; - C = C_1 = __decorate([ - dec - ], C); - return C; -})(); +var C_1; +let C = C_1 = class C { + static x() { return C_1.y; } +}; +C.y = 1; +C = C_1 = __decorate([ + dec +], C); export default C; let c = new C(); diff --git a/tests/baselines/reference/decoratorOnClass8.es6.js b/tests/baselines/reference/decoratorOnClass8.es6.js index 7b91f4d266b24..88dd41e7b6065 100644 --- a/tests/baselines/reference/decoratorOnClass8.es6.js +++ b/tests/baselines/reference/decoratorOnClass8.es6.js @@ -13,13 +13,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let default_1 = /** @class */ (() => { - let default_1 = class default_1 { - }; - default_1.y = 1; - default_1 = __decorate([ - dec - ], default_1); - return default_1; -})(); +let default_1 = class default_1 { +}; +default_1.y = 1; +default_1 = __decorate([ + dec +], default_1); export default default_1; diff --git a/tests/baselines/reference/decoratorOnClassAccessor1.es6.js b/tests/baselines/reference/decoratorOnClassAccessor1.es6.js index 6b010f8a1b033..484005b7a3680 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor1.es6.js +++ b/tests/baselines/reference/decoratorOnClassAccessor1.es6.js @@ -12,13 +12,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let default_1 = /** @class */ (() => { - class default_1 { - get accessor() { return 1; } - } - __decorate([ - dec - ], default_1.prototype, "accessor", null); - return default_1; -})(); -export default default_1; +export default class default_1 { + get accessor() { return 1; } +} +__decorate([ + dec +], default_1.prototype, "accessor", null); diff --git a/tests/baselines/reference/decoratorOnClassMethod1.es6.js b/tests/baselines/reference/decoratorOnClassMethod1.es6.js index ffdac44708e6d..6c518ae805ee0 100644 --- a/tests/baselines/reference/decoratorOnClassMethod1.es6.js +++ b/tests/baselines/reference/decoratorOnClassMethod1.es6.js @@ -12,13 +12,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let default_1 = /** @class */ (() => { - class default_1 { - method() { } - } - __decorate([ - dec - ], default_1.prototype, "method", null); - return default_1; -})(); -export default default_1; +export default class default_1 { + method() { } +} +__decorate([ + dec +], default_1.prototype, "method", null); diff --git a/tests/baselines/reference/decoratorOnClassMethod13.js b/tests/baselines/reference/decoratorOnClassMethod13.js index 9bc4d1e45ab57..e8a913070fcea 100644 --- a/tests/baselines/reference/decoratorOnClassMethod13.js +++ b/tests/baselines/reference/decoratorOnClassMethod13.js @@ -13,16 +13,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let C = /** @class */ (() => { - class C { - ["1"]() { } - ["b"]() { } - } - __decorate([ - dec - ], C.prototype, "1", null); - __decorate([ - dec - ], C.prototype, "b", null); - return C; -})(); +class C { + ["1"]() { } + ["b"]() { } +} +__decorate([ + dec +], C.prototype, "1", null); +__decorate([ + dec +], C.prototype, "b", null); diff --git a/tests/baselines/reference/decoratorOnClassMethod4.js b/tests/baselines/reference/decoratorOnClassMethod4.js index f719fb309931a..c68cca5d3a04f 100644 --- a/tests/baselines/reference/decoratorOnClassMethod4.js +++ b/tests/baselines/reference/decoratorOnClassMethod4.js @@ -12,12 +12,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let C = /** @class */ (() => { - class C { - ["method"]() { } - } - __decorate([ - dec - ], C.prototype, "method", null); - return C; -})(); +class C { + ["method"]() { } +} +__decorate([ + dec +], C.prototype, "method", null); diff --git a/tests/baselines/reference/decoratorOnClassMethod5.js b/tests/baselines/reference/decoratorOnClassMethod5.js index d3985ad6904e4..c89ebc6bb38e3 100644 --- a/tests/baselines/reference/decoratorOnClassMethod5.js +++ b/tests/baselines/reference/decoratorOnClassMethod5.js @@ -12,12 +12,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let C = /** @class */ (() => { - class C { - ["method"]() { } - } - __decorate([ - dec() - ], C.prototype, "method", null); - return C; -})(); +class C { + ["method"]() { } +} +__decorate([ + dec() +], C.prototype, "method", null); diff --git a/tests/baselines/reference/decoratorOnClassMethod6.js b/tests/baselines/reference/decoratorOnClassMethod6.js index a436f1a7ec95e..45f5eeddb8129 100644 --- a/tests/baselines/reference/decoratorOnClassMethod6.js +++ b/tests/baselines/reference/decoratorOnClassMethod6.js @@ -12,12 +12,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let C = /** @class */ (() => { - class C { - ["method"]() { } - } - __decorate([ - dec - ], C.prototype, "method", null); - return C; -})(); +class C { + ["method"]() { } +} +__decorate([ + dec +], C.prototype, "method", null); diff --git a/tests/baselines/reference/decoratorOnClassMethod7.js b/tests/baselines/reference/decoratorOnClassMethod7.js index 0777661051512..dc92364cd89eb 100644 --- a/tests/baselines/reference/decoratorOnClassMethod7.js +++ b/tests/baselines/reference/decoratorOnClassMethod7.js @@ -12,12 +12,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let C = /** @class */ (() => { - class C { - ["method"]() { } - } - __decorate([ - dec - ], C.prototype, "method", null); - return C; -})(); +class C { + ["method"]() { } +} +__decorate([ + dec +], C.prototype, "method", null); diff --git a/tests/baselines/reference/decoratorOnClassMethodParameter1.es6.js b/tests/baselines/reference/decoratorOnClassMethodParameter1.es6.js index 9d249d8bdf304..b58c69150e5e8 100644 --- a/tests/baselines/reference/decoratorOnClassMethodParameter1.es6.js +++ b/tests/baselines/reference/decoratorOnClassMethodParameter1.es6.js @@ -15,13 +15,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; -let default_1 = /** @class */ (() => { - class default_1 { - method(p) { } - } - __decorate([ - __param(0, dec) - ], default_1.prototype, "method", null); - return default_1; -})(); -export default default_1; +export default class default_1 { + method(p) { } +} +__decorate([ + __param(0, dec) +], default_1.prototype, "method", null); diff --git a/tests/baselines/reference/decoratorOnClassProperty1.es6.js b/tests/baselines/reference/decoratorOnClassProperty1.es6.js index 17ef5044de986..81b72acf47811 100644 --- a/tests/baselines/reference/decoratorOnClassProperty1.es6.js +++ b/tests/baselines/reference/decoratorOnClassProperty1.es6.js @@ -12,12 +12,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let default_1 = /** @class */ (() => { - class default_1 { - } - __decorate([ - dec - ], default_1.prototype, "prop", void 0); - return default_1; -})(); -export default default_1; +export default class default_1 { +} +__decorate([ + dec +], default_1.prototype, "prop", void 0); diff --git a/tests/baselines/reference/decoratorsOnComputedProperties.js b/tests/baselines/reference/decoratorsOnComputedProperties.js index cdaead9ec259f..3f0444b310aaa 100644 --- a/tests/baselines/reference/decoratorsOnComputedProperties.js +++ b/tests/baselines/reference/decoratorsOnComputedProperties.js @@ -197,282 +197,262 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, return c > 3 && r && Object.defineProperty(target, key, r), r; }; var _a, _b, _c, _d; -var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0; +var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21; function x(o, k) { } let i = 0; function foo() { return ++i + ""; } const fieldNameA = "fieldName1"; const fieldNameB = "fieldName2"; const fieldNameC = "fieldName3"; -let A = /** @class */ (() => { - var _a, _b, _c, _d; - class A { - constructor() { - this["property2"] = 2; - this[Symbol.iterator] = null; - this["property4"] = 2; - this[Symbol.match] = null; - this[_b] = null; - this[_d] = null; - } +class A { + constructor() { + this["property2"] = 2; + this[Symbol.iterator] = null; + this["property4"] = 2; + this[Symbol.match] = null; + this[_f] = null; + this[_h] = null; } - foo(), _a = foo(), _b = foo(), _c = fieldNameB, _d = fieldNameC; - __decorate([ - x - ], A.prototype, "property", void 0); - __decorate([ - x - ], A.prototype, Symbol.toStringTag, void 0); - __decorate([ - x - ], A.prototype, "property2", void 0); - __decorate([ - x - ], A.prototype, Symbol.iterator, void 0); - __decorate([ - x - ], A.prototype, _a, void 0); - __decorate([ - x - ], A.prototype, _b, void 0); - __decorate([ - x - ], A.prototype, _c, void 0); - __decorate([ - x - ], A.prototype, _d, void 0); - return A; -})(); +} +foo(), _e = foo(), _f = foo(), _g = fieldNameB, _h = fieldNameC; +__decorate([ + x +], A.prototype, "property", void 0); +__decorate([ + x +], A.prototype, Symbol.toStringTag, void 0); +__decorate([ + x +], A.prototype, "property2", void 0); +__decorate([ + x +], A.prototype, Symbol.iterator, void 0); +__decorate([ + x +], A.prototype, _e, void 0); +__decorate([ + x +], A.prototype, _f, void 0); +__decorate([ + x +], A.prototype, _g, void 0); +__decorate([ + x +], A.prototype, _h, void 0); void (_a = class B { constructor() { this["property2"] = 2; this[Symbol.iterator] = null; this["property4"] = 2; this[Symbol.match] = null; - this[_f] = null; - this[_h] = null; + this[_k] = null; + this[_m] = null; } }, foo(), - _e = foo(), - _f = foo(), - _g = fieldNameB, - _h = fieldNameC, + _j = foo(), + _k = foo(), + _l = fieldNameB, + _m = fieldNameC, _a); -let C = /** @class */ (() => { - var _a, _b, _c, _d; - class C { - constructor() { - this["property2"] = 2; - this[Symbol.iterator] = null; - this["property4"] = 2; - this[Symbol.match] = null; - this[_b] = null; - this[_d] = null; - } - [(foo(), _a = foo(), _b = foo(), _c = fieldNameB, _d = fieldNameC, "some" + "method")]() { } +class C { + constructor() { + this["property2"] = 2; + this[Symbol.iterator] = null; + this["property4"] = 2; + this[Symbol.match] = null; + this[_p] = null; + this[_r] = null; } - __decorate([ - x - ], C.prototype, "property", void 0); - __decorate([ - x - ], C.prototype, Symbol.toStringTag, void 0); - __decorate([ - x - ], C.prototype, "property2", void 0); - __decorate([ - x - ], C.prototype, Symbol.iterator, void 0); - __decorate([ - x - ], C.prototype, _a, void 0); - __decorate([ - x - ], C.prototype, _b, void 0); - __decorate([ - x - ], C.prototype, _c, void 0); - __decorate([ - x - ], C.prototype, _d, void 0); - return C; -})(); + [(foo(), _o = foo(), _p = foo(), _q = fieldNameB, _r = fieldNameC, "some" + "method")]() { } +} +__decorate([ + x +], C.prototype, "property", void 0); +__decorate([ + x +], C.prototype, Symbol.toStringTag, void 0); +__decorate([ + x +], C.prototype, "property2", void 0); +__decorate([ + x +], C.prototype, Symbol.iterator, void 0); +__decorate([ + x +], C.prototype, _o, void 0); +__decorate([ + x +], C.prototype, _p, void 0); +__decorate([ + x +], C.prototype, _q, void 0); +__decorate([ + x +], C.prototype, _r, void 0); void class D { constructor() { this["property2"] = 2; this[Symbol.iterator] = null; this["property4"] = 2; this[Symbol.match] = null; - this[_k] = null; - this[_m] = null; + this[_t] = null; + this[_v] = null; } - [(foo(), _j = foo(), _k = foo(), _l = fieldNameB, _m = fieldNameC, "some" + "method")]() { } + [(foo(), _s = foo(), _t = foo(), _u = fieldNameB, _v = fieldNameC, "some" + "method")]() { } }; -let E = /** @class */ (() => { - var _a, _b, _c, _d; - class E { - constructor() { - this["property2"] = 2; - this[Symbol.iterator] = null; - this["property4"] = 2; - this[Symbol.match] = null; - this[_b] = null; - this[_d] = null; - } - [(foo(), _a = foo(), _b = foo(), "some" + "method")]() { } +class E { + constructor() { + this["property2"] = 2; + this[Symbol.iterator] = null; + this["property4"] = 2; + this[Symbol.match] = null; + this[_x] = null; + this[_z] = null; } - _c = fieldNameB, _d = fieldNameC; - __decorate([ - x - ], E.prototype, "property", void 0); - __decorate([ - x - ], E.prototype, Symbol.toStringTag, void 0); - __decorate([ - x - ], E.prototype, "property2", void 0); - __decorate([ - x - ], E.prototype, Symbol.iterator, void 0); - __decorate([ - x - ], E.prototype, _a, void 0); - __decorate([ - x - ], E.prototype, _b, void 0); - __decorate([ - x - ], E.prototype, _c, void 0); - __decorate([ - x - ], E.prototype, _d, void 0); - return E; -})(); + [(foo(), _w = foo(), _x = foo(), "some" + "method")]() { } +} +_y = fieldNameB, _z = fieldNameC; +__decorate([ + x +], E.prototype, "property", void 0); +__decorate([ + x +], E.prototype, Symbol.toStringTag, void 0); +__decorate([ + x +], E.prototype, "property2", void 0); +__decorate([ + x +], E.prototype, Symbol.iterator, void 0); +__decorate([ + x +], E.prototype, _w, void 0); +__decorate([ + x +], E.prototype, _x, void 0); +__decorate([ + x +], E.prototype, _y, void 0); +__decorate([ + x +], E.prototype, _z, void 0); void (_b = class F { constructor() { this["property2"] = 2; this[Symbol.iterator] = null; this["property4"] = 2; this[Symbol.match] = null; - this[_p] = null; - this[_r] = null; + this[_1] = null; + this[_3] = null; } - [(foo(), _o = foo(), _p = foo(), "some" + "method")]() { } + [(foo(), _0 = foo(), _1 = foo(), "some" + "method")]() { } }, - _q = fieldNameB, - _r = fieldNameC, + _2 = fieldNameB, + _3 = fieldNameC, _b); -let G = /** @class */ (() => { - var _a, _b, _c, _d; - class G { - constructor() { - this["property2"] = 2; - this[Symbol.iterator] = null; - this["property4"] = 2; - this[Symbol.match] = null; - this[_b] = null; - this[_d] = null; - } - [(foo(), _a = foo(), _b = foo(), "some" + "method")]() { } - [(_c = fieldNameB, "some" + "method2")]() { } +class G { + constructor() { + this["property2"] = 2; + this[Symbol.iterator] = null; + this["property4"] = 2; + this[Symbol.match] = null; + this[_5] = null; + this[_7] = null; } - _d = fieldNameC; - __decorate([ - x - ], G.prototype, "property", void 0); - __decorate([ - x - ], G.prototype, Symbol.toStringTag, void 0); - __decorate([ - x - ], G.prototype, "property2", void 0); - __decorate([ - x - ], G.prototype, Symbol.iterator, void 0); - __decorate([ - x - ], G.prototype, _a, void 0); - __decorate([ - x - ], G.prototype, _b, void 0); - __decorate([ - x - ], G.prototype, _c, void 0); - __decorate([ - x - ], G.prototype, _d, void 0); - return G; -})(); + [(foo(), _4 = foo(), _5 = foo(), "some" + "method")]() { } + [(_6 = fieldNameB, "some" + "method2")]() { } +} +_7 = fieldNameC; +__decorate([ + x +], G.prototype, "property", void 0); +__decorate([ + x +], G.prototype, Symbol.toStringTag, void 0); +__decorate([ + x +], G.prototype, "property2", void 0); +__decorate([ + x +], G.prototype, Symbol.iterator, void 0); +__decorate([ + x +], G.prototype, _4, void 0); +__decorate([ + x +], G.prototype, _5, void 0); +__decorate([ + x +], G.prototype, _6, void 0); +__decorate([ + x +], G.prototype, _7, void 0); void (_c = class H { constructor() { this["property2"] = 2; this[Symbol.iterator] = null; this["property4"] = 2; this[Symbol.match] = null; - this[_t] = null; - this[_v] = null; + this[_9] = null; + this[_11] = null; } - [(foo(), _s = foo(), _t = foo(), "some" + "method")]() { } - [(_u = fieldNameB, "some" + "method2")]() { } + [(foo(), _8 = foo(), _9 = foo(), "some" + "method")]() { } + [(_10 = fieldNameB, "some" + "method2")]() { } }, - _v = fieldNameC, + _11 = fieldNameC, _c); -let I = /** @class */ (() => { - var _a, _b, _c, _d, _e; - class I { - constructor() { - this["property2"] = 2; - this[Symbol.iterator] = null; - this["property4"] = 2; - this[Symbol.match] = null; - this[_b] = null; - this[_e] = null; - } - [(foo(), _a = foo(), _b = foo(), _c = "some" + "method")]() { } - [(_d = fieldNameB, "some" + "method2")]() { } +class I { + constructor() { + this["property2"] = 2; + this[Symbol.iterator] = null; + this["property4"] = 2; + this[Symbol.match] = null; + this[_13] = null; + this[_16] = null; } - _e = fieldNameC; - __decorate([ - x - ], I.prototype, "property", void 0); - __decorate([ - x - ], I.prototype, Symbol.toStringTag, void 0); - __decorate([ - x - ], I.prototype, "property2", void 0); - __decorate([ - x - ], I.prototype, Symbol.iterator, void 0); - __decorate([ - x - ], I.prototype, _a, void 0); - __decorate([ - x - ], I.prototype, _b, void 0); - __decorate([ - x - ], I.prototype, _c, null); - __decorate([ - x - ], I.prototype, _d, void 0); - __decorate([ - x - ], I.prototype, _e, void 0); - return I; -})(); + [(foo(), _12 = foo(), _13 = foo(), _14 = "some" + "method")]() { } + [(_15 = fieldNameB, "some" + "method2")]() { } +} +_16 = fieldNameC; +__decorate([ + x +], I.prototype, "property", void 0); +__decorate([ + x +], I.prototype, Symbol.toStringTag, void 0); +__decorate([ + x +], I.prototype, "property2", void 0); +__decorate([ + x +], I.prototype, Symbol.iterator, void 0); +__decorate([ + x +], I.prototype, _12, void 0); +__decorate([ + x +], I.prototype, _13, void 0); +__decorate([ + x +], I.prototype, _14, null); +__decorate([ + x +], I.prototype, _15, void 0); +__decorate([ + x +], I.prototype, _16, void 0); void (_d = class J { constructor() { this["property2"] = 2; this[Symbol.iterator] = null; this["property4"] = 2; this[Symbol.match] = null; - this[_x] = null; - this[_0] = null; + this[_18] = null; + this[_21] = null; } - [(foo(), _w = foo(), _x = foo(), _y = "some" + "method")]() { } - [(_z = fieldNameB, "some" + "method2")]() { } + [(foo(), _17 = foo(), _18 = foo(), _19 = "some" + "method")]() { } + [(_20 = fieldNameB, "some" + "method2")]() { } }, - _0 = fieldNameC, + _21 = fieldNameC, _d); diff --git a/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.js b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.js index 337dc8d03f743..961bd4041cdf8 100644 --- a/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.js +++ b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.js @@ -15,22 +15,19 @@ class B { } //// [emitClassDeclarationWithLiteralPropertyNameInES6.js] -let B = /** @class */ (() => { - class B { - constructor() { - this["hello"] = 10; - this[0b110] = "world"; - this[0o23534] = "WORLD"; - this[20] = "twenty"; - } - "foo"() { } - 0b1110() { } - 11() { } - interface() { } +class B { + constructor() { + this["hello"] = 10; + this[0b110] = "world"; + this[0o23534] = "WORLD"; + this[20] = "twenty"; } - B["hi"] = 10000; - B[22] = "twenty-two"; - B[0b101] = "binary"; - B[0o3235] = "octal"; - return B; -})(); + "foo"() { } + 0b1110() { } + 11() { } + interface() { } +} +B["hi"] = 10000; +B[22] = "twenty-two"; +B[0b101] = "binary"; +B[0o3235] = "octal"; diff --git a/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.js b/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.js index 7d0b9e7e95c86..8e0bf3de06bcd 100644 --- a/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.js +++ b/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.js @@ -10,18 +10,12 @@ class D { //// [emitClassDeclarationWithStaticPropertyAssignmentInES6.js] -let C = /** @class */ (() => { - class C { +class C { +} +C.z = "Foo"; +class D { + constructor() { + this.x = 20000; } - C.z = "Foo"; - return C; -})(); -let D = /** @class */ (() => { - class D { - constructor() { - this.x = 20000; - } - } - D.b = true; - return D; -})(); +} +D.b = true; diff --git a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=amd).js b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=amd).js index a3df54b013305..88eca9180fb56 100644 --- a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=amd).js +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=amd).js @@ -18,14 +18,11 @@ define(["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.A = void 0; - let A = /** @class */ (() => { - let A = class A { - }; - A = __decorate([ - dec - ], A); - return A; - })(); + let A = class A { + }; + A = __decorate([ + dec + ], A); exports.A = A; const o = { a: 1 }; const y = Object.assign({}, o); diff --git a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=commonjs).js b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=commonjs).js index 649c3769e8b18..8aed6c9347aa2 100644 --- a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=commonjs).js +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=commonjs).js @@ -17,14 +17,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, }; Object.defineProperty(exports, "__esModule", { value: true }); exports.A = void 0; -let A = /** @class */ (() => { - let A = class A { - }; - A = __decorate([ - dec - ], A); - return A; -})(); +let A = class A { +}; +A = __decorate([ + dec +], A); exports.A = A; const o = { a: 1 }; const y = Object.assign({}, o); diff --git a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=es2020).js b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=es2020).js index a8e82719015ea..74b96c362b390 100644 --- a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=es2020).js +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=es2020).js @@ -14,14 +14,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let A = /** @class */ (() => { - let A = class A { - }; - A = __decorate([ - dec - ], A); - return A; -})(); +let A = class A { +}; +A = __decorate([ + dec +], A); export { A }; const o = { a: 1 }; const y = Object.assign({}, o); diff --git a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=es6).js b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=es6).js index a8e82719015ea..74b96c362b390 100644 --- a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=es6).js +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=es6).js @@ -14,14 +14,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let A = /** @class */ (() => { - let A = class A { - }; - A = __decorate([ - dec - ], A); - return A; -})(); +let A = class A { +}; +A = __decorate([ + dec +], A); export { A }; const o = { a: 1 }; const y = Object.assign({}, o); diff --git a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=esnext).js b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=esnext).js index a8e82719015ea..74b96c362b390 100644 --- a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=esnext).js +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=esnext).js @@ -14,14 +14,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let A = /** @class */ (() => { - let A = class A { - }; - A = __decorate([ - dec - ], A); - return A; -})(); +let A = class A { +}; +A = __decorate([ + dec +], A); export { A }; const o = { a: 1 }; const y = Object.assign({}, o); diff --git a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=none).js b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=none).js index 649c3769e8b18..8aed6c9347aa2 100644 --- a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=none).js +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=none).js @@ -17,14 +17,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, }; Object.defineProperty(exports, "__esModule", { value: true }); exports.A = void 0; -let A = /** @class */ (() => { - let A = class A { - }; - A = __decorate([ - dec - ], A); - return A; -})(); +let A = class A { +}; +A = __decorate([ + dec +], A); exports.A = A; const o = { a: 1 }; const y = Object.assign({}, o); diff --git a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=system).js b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=system).js index 399428ad01502..8c40955c2cad4 100644 --- a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=system).js +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=system).js @@ -21,14 +21,11 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - A = /** @class */ (() => { - let A = class A { - }; - A = __decorate([ - dec - ], A); - return A; - })(); + A = class A { + }; + A = __decorate([ + dec + ], A); exports_1("A", A); o = { a: 1 }; y = Object.assign({}, o); diff --git a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=umd).js b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=umd).js index 4353b548749ba..a2c276ad248b5 100644 --- a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=umd).js +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=umd).js @@ -26,14 +26,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.A = void 0; - let A = /** @class */ (() => { - let A = class A { - }; - A = __decorate([ - dec - ], A); - return A; - })(); + let A = class A { + }; + A = __decorate([ + dec + ], A); exports.A = A; const o = { a: 1 }; const y = Object.assign({}, o); diff --git a/tests/baselines/reference/es6ModuleClassDeclaration.js b/tests/baselines/reference/es6ModuleClassDeclaration.js index d0dbc29e7daa1..a228739abbfb7 100644 --- a/tests/baselines/reference/es6ModuleClassDeclaration.js +++ b/tests/baselines/reference/es6ModuleClassDeclaration.js @@ -113,8 +113,43 @@ module m2 { } //// [es6ModuleClassDeclaration.js] -let c = /** @class */ (() => { - class c { +export class c { + constructor() { + this.x = 10; + this.y = 30; + } + method1() { + } + method2() { + } + static method3() { + } + static method4() { + } +} +c.k = 20; +c.l = 30; +class c2 { + constructor() { + this.x = 10; + this.y = 30; + } + method1() { + } + method2() { + } + static method3() { + } + static method4() { + } +} +c2.k = 20; +c2.l = 30; +new c(); +new c2(); +export var m1; +(function (m1) { + class c3 { constructor() { this.x = 10; this.y = 30; @@ -128,13 +163,10 @@ let c = /** @class */ (() => { static method4() { } } - c.k = 20; - c.l = 30; - return c; -})(); -export { c }; -let c2 = /** @class */ (() => { - class c2 { + c3.k = 20; + c3.l = 30; + m1.c3 = c3; + class c4 { constructor() { this.x = 10; this.y = 30; @@ -148,53 +180,8 @@ let c2 = /** @class */ (() => { static method4() { } } - c2.k = 20; - c2.l = 30; - return c2; -})(); -new c(); -new c2(); -export var m1; -(function (m1) { - let c3 = /** @class */ (() => { - class c3 { - constructor() { - this.x = 10; - this.y = 30; - } - method1() { - } - method2() { - } - static method3() { - } - static method4() { - } - } - c3.k = 20; - c3.l = 30; - return c3; - })(); - m1.c3 = c3; - let c4 = /** @class */ (() => { - class c4 { - constructor() { - this.x = 10; - this.y = 30; - } - method1() { - } - method2() { - } - static method3() { - } - static method4() { - } - } - c4.k = 20; - c4.l = 30; - return c4; - })(); + c4.k = 20; + c4.l = 30; new c(); new c2(); new c3(); @@ -202,45 +189,39 @@ export var m1; })(m1 || (m1 = {})); var m2; (function (m2) { - let c3 = /** @class */ (() => { - class c3 { - constructor() { - this.x = 10; - this.y = 30; - } - method1() { - } - method2() { - } - static method3() { - } - static method4() { - } - } - c3.k = 20; - c3.l = 30; - return c3; - })(); + class c3 { + constructor() { + this.x = 10; + this.y = 30; + } + method1() { + } + method2() { + } + static method3() { + } + static method4() { + } + } + c3.k = 20; + c3.l = 30; m2.c3 = c3; - let c4 = /** @class */ (() => { - class c4 { - constructor() { - this.x = 10; - this.y = 30; - } - method1() { - } - method2() { - } - static method3() { - } - static method4() { - } - } - c4.k = 20; - c4.l = 30; - return c4; - })(); + class c4 { + constructor() { + this.x = 10; + this.y = 30; + } + method1() { + } + method2() { + } + static method3() { + } + static method4() { + } + } + c4.k = 20; + c4.l = 30; new c(); new c2(); new c3(); diff --git a/tests/baselines/reference/exportDefaultClassWithStaticPropertyAssignmentsInES6.js b/tests/baselines/reference/exportDefaultClassWithStaticPropertyAssignmentsInES6.js index 6e0bdb295a168..3acb89b8696d7 100644 --- a/tests/baselines/reference/exportDefaultClassWithStaticPropertyAssignmentsInES6.js +++ b/tests/baselines/reference/exportDefaultClassWithStaticPropertyAssignmentsInES6.js @@ -4,10 +4,6 @@ export default class { } //// [exportDefaultClassWithStaticPropertyAssignmentsInES6.js] -let default_1 = /** @class */ (() => { - class default_1 { - } - default_1.z = "Foo"; - return default_1; -})(); -export default default_1; +export default class default_1 { +} +default_1.z = "Foo"; diff --git a/tests/baselines/reference/generatorTypeCheck39.js b/tests/baselines/reference/generatorTypeCheck39.js index 73b1416c82f3f..1e0009d24ed7c 100644 --- a/tests/baselines/reference/generatorTypeCheck39.js +++ b/tests/baselines/reference/generatorTypeCheck39.js @@ -20,15 +20,12 @@ function decorator(x) { return y => { }; } function* g() { - let C = /** @class */ (() => { - let C = class C { - constructor() { - this.x = yield 0; - } - }; - C = __decorate([ - decorator(yield 0) - ], C); - return C; - })(); + let C = class C { + constructor() { + this.x = yield 0; + } + }; + C = __decorate([ + decorator(yield 0) + ], C); } diff --git a/tests/baselines/reference/generatorTypeCheck58.js b/tests/baselines/reference/generatorTypeCheck58.js index c969eb9ba7bbf..925fc2b76d26d 100644 --- a/tests/baselines/reference/generatorTypeCheck58.js +++ b/tests/baselines/reference/generatorTypeCheck58.js @@ -7,11 +7,8 @@ function* g() { //// [generatorTypeCheck58.js] function* g() { - let C = /** @class */ (() => { - class C { - } - C.x = yield 0; - return C; - })(); + class C { + } + C.x = yield 0; ; } diff --git a/tests/baselines/reference/generatorTypeCheck59.js b/tests/baselines/reference/generatorTypeCheck59.js index 8b1dfbd777c03..8fd32e7730a98 100644 --- a/tests/baselines/reference/generatorTypeCheck59.js +++ b/tests/baselines/reference/generatorTypeCheck59.js @@ -14,14 +14,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, return c > 3 && r && Object.defineProperty(target, key, r), r; }; function* g() { - let C = /** @class */ (() => { - class C { - m() { } - } - __decorate([ - (yield "") - ], C.prototype, "m", null); - return C; - })(); + class C { + m() { } + } + __decorate([ + (yield "") + ], C.prototype, "m", null); ; } diff --git a/tests/baselines/reference/generatorTypeCheck61.js b/tests/baselines/reference/generatorTypeCheck61.js index bd095dd2478b5..9cc157f26840d 100644 --- a/tests/baselines/reference/generatorTypeCheck61.js +++ b/tests/baselines/reference/generatorTypeCheck61.js @@ -12,13 +12,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, return c > 3 && r && Object.defineProperty(target, key, r), r; }; function* g() { - let C = /** @class */ (() => { - let C = class C { - }; - C = __decorate([ - (yield 0) - ], C); - return C; - })(); + let C = class C { + }; + C = __decorate([ + (yield 0) + ], C); ; } diff --git a/tests/baselines/reference/importHelpersES6.js b/tests/baselines/reference/importHelpersES6.js index df12fb0c0502f..9eb0e980c0f8c 100644 --- a/tests/baselines/reference/importHelpersES6.js +++ b/tests/baselines/reference/importHelpersES6.js @@ -19,14 +19,11 @@ export declare function __awaiter(thisArg: any, _arguments: any, P: Function, ge //// [a.js] import { __decorate } from "tslib"; -let A = /** @class */ (() => { - let A = class A { - }; - A = __decorate([ - dec - ], A); - return A; -})(); +let A = class A { +}; +A = __decorate([ + dec +], A); export { A }; const o = { a: 1 }; const y = Object.assign({}, o); diff --git a/tests/baselines/reference/importHelpersWithLocalCollisions(module=amd).js b/tests/baselines/reference/importHelpersWithLocalCollisions(module=amd).js index 03555272af53c..9f58b4b0da402 100644 --- a/tests/baselines/reference/importHelpersWithLocalCollisions(module=amd).js +++ b/tests/baselines/reference/importHelpersWithLocalCollisions(module=amd).js @@ -22,14 +22,11 @@ define(["require", "exports", "tslib"], function (require, exports, tslib_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.A = void 0; - let A = /** @class */ (() => { - let A = class A { - }; - A = tslib_1.__decorate([ - dec - ], A); - return A; - })(); + let A = class A { + }; + A = tslib_1.__decorate([ + dec + ], A); exports.A = A; const o = { a: 1 }; const y = Object.assign({}, o); diff --git a/tests/baselines/reference/importHelpersWithLocalCollisions(module=commonjs).js b/tests/baselines/reference/importHelpersWithLocalCollisions(module=commonjs).js index 9ac221eb0642a..8924252bf891d 100644 --- a/tests/baselines/reference/importHelpersWithLocalCollisions(module=commonjs).js +++ b/tests/baselines/reference/importHelpersWithLocalCollisions(module=commonjs).js @@ -22,14 +22,11 @@ export declare function __awaiter(thisArg: any, _arguments: any, P: Function, ge Object.defineProperty(exports, "__esModule", { value: true }); exports.A = void 0; const tslib_1 = require("tslib"); -let A = /** @class */ (() => { - let A = class A { - }; - A = tslib_1.__decorate([ - dec - ], A); - return A; -})(); +let A = class A { +}; +A = tslib_1.__decorate([ + dec +], A); exports.A = A; const o = { a: 1 }; const y = Object.assign({}, o); diff --git a/tests/baselines/reference/importHelpersWithLocalCollisions(module=es2015).js b/tests/baselines/reference/importHelpersWithLocalCollisions(module=es2015).js index 0f029ca44fa87..ba22069c306f2 100644 --- a/tests/baselines/reference/importHelpersWithLocalCollisions(module=es2015).js +++ b/tests/baselines/reference/importHelpersWithLocalCollisions(module=es2015).js @@ -19,14 +19,11 @@ export declare function __awaiter(thisArg: any, _arguments: any, P: Function, ge //// [a.js] import { __decorate as __decorate_1 } from "tslib"; -let A = /** @class */ (() => { - let A = class A { - }; - A = __decorate_1([ - dec - ], A); - return A; -})(); +let A = class A { +}; +A = __decorate_1([ + dec +], A); export { A }; const o = { a: 1 }; const y = Object.assign({}, o); diff --git a/tests/baselines/reference/importHelpersWithLocalCollisions(module=system).js b/tests/baselines/reference/importHelpersWithLocalCollisions(module=system).js index 1ebf0c245bacf..fb10d64b45af3 100644 --- a/tests/baselines/reference/importHelpersWithLocalCollisions(module=system).js +++ b/tests/baselines/reference/importHelpersWithLocalCollisions(module=system).js @@ -29,14 +29,11 @@ System.register(["tslib"], function (exports_1, context_1) { } ], execute: function () { - A = /** @class */ (() => { - let A = class A { - }; - A = tslib_1.__decorate([ - dec - ], A); - return A; - })(); + A = class A { + }; + A = tslib_1.__decorate([ + dec + ], A); exports_1("A", A); o = { a: 1 }; y = Object.assign({}, o); diff --git a/tests/baselines/reference/invalidNewTarget.es6.js b/tests/baselines/reference/invalidNewTarget.es6.js index f77704edd759d..ed1b2cc1592a8 100644 --- a/tests/baselines/reference/invalidNewTarget.es6.js +++ b/tests/baselines/reference/invalidNewTarget.es6.js @@ -27,23 +27,20 @@ const O = { //// [invalidNewTarget.es6.js] const a = new.target; const b = () => new.target; -let C = /** @class */ (() => { - class C { - constructor() { - this.f = () => new.target; - } - [new.target]() { } - c() { return new.target; } - get d() { return new.target; } - set e(_) { _ = new.target; } - static [new.target]() { } - static g() { return new.target; } - static get h() { return new.target; } - static set i(_) { _ = new.target; } +class C { + constructor() { + this.f = () => new.target; } - C.j = () => new.target; - return C; -})(); + [new.target]() { } + c() { return new.target; } + get d() { return new.target; } + set e(_) { _ = new.target; } + static [new.target]() { } + static g() { return new.target; } + static get h() { return new.target; } + static set i(_) { _ = new.target; } +} +C.j = () => new.target; const O = { [new.target]: undefined, k() { return new.target; }, diff --git a/tests/baselines/reference/newTarget.es6.js b/tests/baselines/reference/newTarget.es6.js index a209735d51573..2bd95ff9f9871 100644 --- a/tests/baselines/reference/newTarget.es6.js +++ b/tests/baselines/reference/newTarget.es6.js @@ -33,17 +33,14 @@ const O = { //// [newTarget.es6.js] -let A = /** @class */ (() => { - class A { - constructor() { - this.d = function () { return new.target; }; - const a = new.target; - const b = () => new.target; - } +class A { + constructor() { + this.d = function () { return new.target; }; + const a = new.target; + const b = () => new.target; } - A.c = function () { return new.target; }; - return A; -})(); +} +A.c = function () { return new.target; }; class B extends A { constructor() { super(); diff --git a/tests/baselines/reference/potentiallyUncalledDecorators.js b/tests/baselines/reference/potentiallyUncalledDecorators.js index 29c4199cd858e..f958fcb28b3d7 100644 --- a/tests/baselines/reference/potentiallyUncalledDecorators.js +++ b/tests/baselines/reference/potentiallyUncalledDecorators.js @@ -85,136 +85,106 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -let FooComponent = /** @class */ (() => { - class FooComponent { +class FooComponent { +} +__decorate([ + Input +], FooComponent.prototype, "foo", void 0); +class Person { +} +__decorate([ + tracked +], Person.prototype, "person", void 0); +class MultiplyByTwo { + get multiplied() { + return this.args.number * 2; } - __decorate([ - Input - ], FooComponent.prototype, "foo", void 0); - return FooComponent; -})(); -let Person = /** @class */ (() => { - class Person { - } - __decorate([ - tracked - ], Person.prototype, "person", void 0); - return Person; -})(); -let MultiplyByTwo = /** @class */ (() => { - class MultiplyByTwo { - get multiplied() { - return this.args.number * 2; - } - } - __decorate([ - tracked('args') - ], MultiplyByTwo.prototype, "multiplied", null); - return MultiplyByTwo; -})(); -let A = /** @class */ (() => { - let A = class A { - bar() { } - }; - __decorate([ - noArgs - ], A.prototype, "foo", void 0); - __decorate([ - noArgs - ], A.prototype, "bar", null); - A = __decorate([ - noArgs - ], A); - return A; -})(); -let B = /** @class */ (() => { - let B = class B { - bar() { } - }; - __decorate([ - allRest - ], B.prototype, "foo", void 0); - __decorate([ - allRest - ], B.prototype, "bar", null); - B = __decorate([ - allRest - ], B); - return B; -})(); -let C = /** @class */ (() => { - let C = class C { - bar() { } - }; - __decorate([ - oneOptional - ], C.prototype, "foo", void 0); - __decorate([ - oneOptional - ], C.prototype, "bar", null); - C = __decorate([ - oneOptional - ], C); - return C; -})(); -let D = /** @class */ (() => { - let D = class D { - bar() { } - }; - __decorate([ - twoOptional - ], D.prototype, "foo", void 0); - __decorate([ - twoOptional - ], D.prototype, "bar", null); - D = __decorate([ - twoOptional - ], D); - return D; -})(); -let E = /** @class */ (() => { - let E = class E { - bar() { } - }; - __decorate([ - threeOptional - ], E.prototype, "foo", void 0); - __decorate([ - threeOptional - ], E.prototype, "bar", null); - E = __decorate([ - threeOptional - ], E); - return E; -})(); -let F = /** @class */ (() => { - let F = class F { - bar() { } - }; - __decorate([ - oneOptionalWithRest - ], F.prototype, "foo", void 0); - __decorate([ - oneOptionalWithRest - ], F.prototype, "bar", null); - F = __decorate([ - oneOptionalWithRest - ], F); - return F; -})(); -let G = /** @class */ (() => { - let G = class G { - bar() { } - }; - __decorate([ - anyDec - ], G.prototype, "foo", void 0); - __decorate([ - anyDec - ], G.prototype, "bar", null); - G = __decorate([ - anyDec - ], G); - return G; -})(); +} +__decorate([ + tracked('args') +], MultiplyByTwo.prototype, "multiplied", null); +let A = class A { + bar() { } +}; +__decorate([ + noArgs +], A.prototype, "foo", void 0); +__decorate([ + noArgs +], A.prototype, "bar", null); +A = __decorate([ + noArgs +], A); +let B = class B { + bar() { } +}; +__decorate([ + allRest +], B.prototype, "foo", void 0); +__decorate([ + allRest +], B.prototype, "bar", null); +B = __decorate([ + allRest +], B); +let C = class C { + bar() { } +}; +__decorate([ + oneOptional +], C.prototype, "foo", void 0); +__decorate([ + oneOptional +], C.prototype, "bar", null); +C = __decorate([ + oneOptional +], C); +let D = class D { + bar() { } +}; +__decorate([ + twoOptional +], D.prototype, "foo", void 0); +__decorate([ + twoOptional +], D.prototype, "bar", null); +D = __decorate([ + twoOptional +], D); +let E = class E { + bar() { } +}; +__decorate([ + threeOptional +], E.prototype, "foo", void 0); +__decorate([ + threeOptional +], E.prototype, "bar", null); +E = __decorate([ + threeOptional +], E); +let F = class F { + bar() { } +}; +__decorate([ + oneOptionalWithRest +], F.prototype, "foo", void 0); +__decorate([ + oneOptionalWithRest +], F.prototype, "bar", null); +F = __decorate([ + oneOptionalWithRest +], F); +let G = class G { + bar() { } +}; +__decorate([ + anyDec +], G.prototype, "foo", void 0); +__decorate([ + anyDec +], G.prototype, "bar", null); +G = __decorate([ + anyDec +], G); export {}; diff --git a/tests/baselines/reference/privateNameAndStaticInitializer(target=es2015).js b/tests/baselines/reference/privateNameAndStaticInitializer(target=es2015).js index 0d03cc006e8c0..caeb43d15a3e9 100644 --- a/tests/baselines/reference/privateNameAndStaticInitializer(target=es2015).js +++ b/tests/baselines/reference/privateNameAndStaticInitializer(target=es2015).js @@ -8,15 +8,12 @@ class A { //// [privateNameAndStaticInitializer.js] -let A = /** @class */ (() => { - var _foo, _prop; - class A { - constructor() { - _foo.set(this, 1); - _prop.set(this, 2); - } +var _foo, _prop; +class A { + constructor() { + _foo.set(this, 1); + _prop.set(this, 2); } - _foo = new WeakMap(), _prop = new WeakMap(); - A.inst = new A(); - return A; -})(); +} +_foo = new WeakMap(), _prop = new WeakMap(); +A.inst = new A(); diff --git a/tests/baselines/reference/privateNameAndStaticInitializer(target=esnext).js b/tests/baselines/reference/privateNameAndStaticInitializer(target=esnext).js index b5c90411438f1..3387d0b4d1a52 100644 --- a/tests/baselines/reference/privateNameAndStaticInitializer(target=esnext).js +++ b/tests/baselines/reference/privateNameAndStaticInitializer(target=esnext).js @@ -8,15 +8,12 @@ class A { //// [privateNameAndStaticInitializer.js] -let A = /** @class */ (() => { - class A { - constructor() { - this.#foo = 1; - this.#prop = 2; - } - #foo; - #prop; +class A { + constructor() { + this.#foo = 1; + this.#prop = 2; } - A.inst = new A(); - return A; -})(); + #foo; + #prop; +} +A.inst = new A(); diff --git a/tests/baselines/reference/privateNameFieldsESNext.js b/tests/baselines/reference/privateNameFieldsESNext.js index dfa84989314fa..acc37caa3cc8f 100644 --- a/tests/baselines/reference/privateNameFieldsESNext.js +++ b/tests/baselines/reference/privateNameFieldsESNext.js @@ -21,29 +21,26 @@ class C { //// [privateNameFieldsESNext.js] -let C = /** @class */ (() => { - class C { - constructor() { - this.a = 123; - this.#a = 10; - this.c = "hello"; - this.#something = () => 1234; - } - #a; - #b; - method() { - console.log(this.#a); - this.#a = "hello"; - console.log(this.#b); - } - static #m; - static #x; - static test() { - console.log(this.#m); - console.log(this.#x = "test"); - } - #something; +class C { + constructor() { + this.a = 123; + this.#a = 10; + this.c = "hello"; + this.#something = () => 1234; } - C.#m = "test"; - return C; -})(); + #a; + #b; + method() { + console.log(this.#a); + this.#a = "hello"; + console.log(this.#b); + } + static #m; + static #x; + static test() { + console.log(this.#m); + console.log(this.#x = "test"); + } + #something; +} +C.#m = "test"; diff --git a/tests/baselines/reference/privateNamesConstructorChain-1.js b/tests/baselines/reference/privateNamesConstructorChain-1.js index 87ee524349529..dfba142f9aa53 100644 --- a/tests/baselines/reference/privateNamesConstructorChain-1.js +++ b/tests/baselines/reference/privateNamesConstructorChain-1.js @@ -21,27 +21,23 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function ( } return privateMap.get(receiver); }; -var _foo, _bar; -let Parent = /** @class */ (() => { - var _foo_1, _bar; - class Parent { - constructor() { - _foo_1.set(this, 3); - } - accessChildProps() { - __classPrivateFieldGet(new Child(), _foo_1); // OK (`#foo` was added when `Parent`'s constructor was called on `child`) - __classPrivateFieldGet(Child, _bar); // Error: not found - } +var _foo, _bar, _foo_1, _bar_1; +class Parent { + constructor() { + _foo.set(this, 3); + } + accessChildProps() { + __classPrivateFieldGet(new Child(), _foo); // OK (`#foo` was added when `Parent`'s constructor was called on `child`) + __classPrivateFieldGet(Child, _bar); // Error: not found } - _foo_1 = new WeakMap(), _bar = new WeakMap(); - _bar.set(Parent, 5); - return Parent; -})(); +} +_foo = new WeakMap(), _bar = new WeakMap(); +_bar.set(Parent, 5); class Child extends Parent { constructor() { super(...arguments); - _foo.set(this, "foo"); // OK (Child's #foo does not conflict, as `Parent`'s `#foo` is not accessible) - _bar.set(this, "bar"); // OK + _foo_1.set(this, "foo"); // OK (Child's #foo does not conflict, as `Parent`'s `#foo` is not accessible) + _bar_1.set(this, "bar"); // OK } } -_foo = new WeakMap(), _bar = new WeakMap(); +_foo_1 = new WeakMap(), _bar_1 = new WeakMap(); diff --git a/tests/baselines/reference/privateNamesConstructorChain-2.js b/tests/baselines/reference/privateNamesConstructorChain-2.js index a6e6e88c65505..0d0069a47a9ad 100644 --- a/tests/baselines/reference/privateNamesConstructorChain-2.js +++ b/tests/baselines/reference/privateNamesConstructorChain-2.js @@ -23,28 +23,24 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function ( } return privateMap.get(receiver); }; -var _foo, _bar; -let Parent = /** @class */ (() => { - var _foo_1, _bar; - class Parent { - constructor() { - _foo_1.set(this, 3); - } - accessChildProps() { - __classPrivateFieldGet(new Child(), _foo_1); // OK (`#foo` was added when `Parent`'s constructor was called on `child`) - __classPrivateFieldGet(Child, _bar); // Error: not found - } +var _foo, _bar, _foo_1, _bar_1; +class Parent { + constructor() { + _foo.set(this, 3); + } + accessChildProps() { + __classPrivateFieldGet(new Child(), _foo); // OK (`#foo` was added when `Parent`'s constructor was called on `child`) + __classPrivateFieldGet(Child, _bar); // Error: not found } - _foo_1 = new WeakMap(), _bar = new WeakMap(); - _bar.set(Parent, 5); - return Parent; -})(); +} +_foo = new WeakMap(), _bar = new WeakMap(); +_bar.set(Parent, 5); class Child extends Parent { constructor() { super(...arguments); - _foo.set(this, "foo"); // OK (Child's #foo does not conflict, as `Parent`'s `#foo` is not accessible) - _bar.set(this, "bar"); // OK + _foo_1.set(this, "foo"); // OK (Child's #foo does not conflict, as `Parent`'s `#foo` is not accessible) + _bar_1.set(this, "bar"); // OK } } -_foo = new WeakMap(), _bar = new WeakMap(); +_foo_1 = new WeakMap(), _bar_1 = new WeakMap(); new Parent().accessChildProps(); diff --git a/tests/baselines/reference/privateNamesInNestedClasses-2.js b/tests/baselines/reference/privateNamesInNestedClasses-2.js index edf6658baf426..896beb6308339 100644 --- a/tests/baselines/reference/privateNamesInNestedClasses-2.js +++ b/tests/baselines/reference/privateNamesInNestedClasses-2.js @@ -24,25 +24,22 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function ( } return privateMap.get(receiver); }; -let A = /** @class */ (() => { - var _x; - class A { - constructor() { - var _x_1; - class B { - constructor() { - _x_1.set(this, 5); - class C { - constructor() { - __classPrivateFieldGet(A, _x_1); // error - } +var _x; +class A { + constructor() { + var _x_1; + class B { + constructor() { + _x_1.set(this, 5); + class C { + constructor() { + __classPrivateFieldGet(A, _x_1); // error } } } - _x_1 = new WeakMap(); } + _x_1 = new WeakMap(); } - _x = new WeakMap(); - _x.set(A, 5); - return A; -})(); +} +_x = new WeakMap(); +_x.set(A, 5); diff --git a/tests/baselines/reference/privateNamesUnique-3.js b/tests/baselines/reference/privateNamesUnique-3.js index 2ba6381a234ec..9575d6d89c57d 100644 --- a/tests/baselines/reference/privateNamesUnique-3.js +++ b/tests/baselines/reference/privateNamesUnique-3.js @@ -21,28 +21,21 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function ( } return privateMap.get(receiver); }; -let A = /** @class */ (() => { - var _foo, _foo_1; - class A { - constructor() { - _foo_1.set(this, 1); - // because static and instance private names - // share the same lexical scope - // https://tc39.es/proposal-class-fields/#prod-ClassBody - } +var _foo, _foo_1, _foo_2; +class A { + constructor() { + _foo_1.set(this, 1); + // because static and instance private names + // share the same lexical scope + // https://tc39.es/proposal-class-fields/#prod-ClassBody } - _foo = new WeakMap(), _foo_1 = new WeakMap(); - _foo_1.set(A, true); // error (duplicate) - return A; -})(); -let B = /** @class */ (() => { - var _foo; - class B { - test(x) { - __classPrivateFieldGet(x, _foo); // error (#foo is a static property on B, not an instance property) - } +} +_foo = new WeakMap(), _foo_1 = new WeakMap(); +_foo_1.set(A, true); // error (duplicate) +class B { + test(x) { + __classPrivateFieldGet(x, _foo_2); // error (#foo is a static property on B, not an instance property) } - _foo = new WeakMap(); - _foo.set(B, true); - return B; -})(); +} +_foo_2 = new WeakMap(); +_foo_2.set(B, true); diff --git a/tests/baselines/reference/symbolDeclarationEmit11.js b/tests/baselines/reference/symbolDeclarationEmit11.js index 88520763dafb8..b0cd9cfddbd5b 100644 --- a/tests/baselines/reference/symbolDeclarationEmit11.js +++ b/tests/baselines/reference/symbolDeclarationEmit11.js @@ -7,15 +7,12 @@ class C { } //// [symbolDeclarationEmit11.js] -let C = /** @class */ (() => { - class C { - static [Symbol.isConcatSpreadable]() { } - static get [Symbol.toPrimitive]() { return ""; } - static set [Symbol.toPrimitive](x) { } - } - C[Symbol.iterator] = 0; - return C; -})(); +class C { + static [Symbol.isConcatSpreadable]() { } + static get [Symbol.toPrimitive]() { return ""; } + static set [Symbol.toPrimitive](x) { } +} +C[Symbol.iterator] = 0; //// [symbolDeclarationEmit11.d.ts] diff --git a/tests/baselines/reference/systemModuleTargetES6.js b/tests/baselines/reference/systemModuleTargetES6.js index b3231e22752ad..0df2835683e82 100644 --- a/tests/baselines/reference/systemModuleTargetES6.js +++ b/tests/baselines/reference/systemModuleTargetES6.js @@ -32,14 +32,11 @@ System.register([], function (exports_1, context_1) { MyClass = class MyClass { }; exports_1("MyClass", MyClass); - MyClass2 = /** @class */ (() => { - class MyClass2 { - static getInstance() { return MyClass2.value; } - } - MyClass2.value = 42; - return MyClass2; - })(); + MyClass2 = class MyClass2 { + static getInstance() { return MyClass2.value; } + }; exports_1("MyClass2", MyClass2); + MyClass2.value = 42; } }; }); diff --git a/tests/baselines/reference/thisInClassBodyStaticESNext.js b/tests/baselines/reference/thisInClassBodyStaticESNext.js index 6ad51b36a7385..7f061b12a4149 100644 --- a/tests/baselines/reference/thisInClassBodyStaticESNext.js +++ b/tests/baselines/reference/thisInClassBodyStaticESNext.js @@ -11,13 +11,10 @@ class Foo { //// [thisInClassBodyStaticESNext.js] // all are allowed with es-compliant class field emit -let Foo = /** @class */ (() => { - class Foo { - x = this; - static t = this; - static at = () => this; - static ft = function () { return this; }; - static mt() { return this; } - } - return Foo; -})(); +class Foo { + x = this; + static t = this; + static at = () => this; + static ft = function () { return this; }; + static mt() { return this; } +} diff --git a/tests/baselines/reference/transformApi/transformsCorrectly.rewrittenNamespaceFollowingClass.js b/tests/baselines/reference/transformApi/transformsCorrectly.rewrittenNamespaceFollowingClass.js index 93cf7f8788380..3f2dd6cdb56fb 100644 --- a/tests/baselines/reference/transformApi/transformsCorrectly.rewrittenNamespaceFollowingClass.js +++ b/tests/baselines/reference/transformApi/transformsCorrectly.rewrittenNamespaceFollowingClass.js @@ -1,12 +1,9 @@ -let C = /** @class */ (() => { - class C { - constructor() { - this.foo = 10; - } +class C { + constructor() { + this.foo = 10; } - C.bar = 20; - return C; -})(); +} +C.bar = 20; (function (C) { C.x = 10; })(C || (C = {})); diff --git a/tests/baselines/reference/transformApi/transformsCorrectly.transformAddCommentToProperties.js b/tests/baselines/reference/transformApi/transformsCorrectly.transformAddCommentToProperties.js index 6a7d3c0d77f90..d5f27d7148c6e 100644 --- a/tests/baselines/reference/transformApi/transformsCorrectly.transformAddCommentToProperties.js +++ b/tests/baselines/reference/transformApi/transformsCorrectly.transformAddCommentToProperties.js @@ -1,16 +1,12 @@ /*comment*/ -let Clazz = /** @class */ (() => { +class Clazz { /*comment*/ - class Clazz { + constructor(/*comment*/ + field = 1) { + this.field = field; /*comment*/ - constructor(/*comment*/ - field = 1) { - this.field = field; - /*comment*/ - this.instanceProp = 2; - } + this.instanceProp = 2; } - /*comment*/ - Clazz.staticProp = 1; - return Clazz; -})(); +} +/*comment*/ +Clazz.staticProp = 1; diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js b/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js index ce2e4c8addf56..dcb283b1626cc 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js @@ -38,15 +38,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, return c > 3 && r && Object.defineProperty(target, key, r), r; }; import './b'; -let A = /** @class */ (() => { - let A = class A { - constructor(p) { } - }; - A = __decorate([ - ((_) => { }) - ], A); - return A; -})(); +let A = class A { + constructor(p) { } +}; +A = __decorate([ + ((_) => { }) +], A); export { A }; @@ -170,16 +167,13 @@ var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; import { B } from './b'; -let A = /** @class */ (() => { - let A = class A { - constructor(p) { } - }; - A = __decorate([ - ((_) => { }), - __metadata("design:paramtypes", [B]) - ], A); - return A; -})(); +let A = class A { + constructor(p) { } +}; +A = __decorate([ + ((_) => { }), + __metadata("design:paramtypes", [B]) +], A); export { A }; diff --git a/tests/baselines/reference/uniqueSymbols.js b/tests/baselines/reference/uniqueSymbols.js index 70372d894baed..54f59e8e217b6 100644 --- a/tests/baselines/reference/uniqueSymbols.js +++ b/tests/baselines/reference/uniqueSymbols.js @@ -314,18 +314,15 @@ async function* asyncGenFuncYieldConstCall() { yield constCall; } async function* asyncGenFuncYieldLetCall() { yield letCall; } async function* asyncGenFuncYieldVarCall() { yield varCall; } // classes -let C = /** @class */ (() => { - class C { - constructor() { - this.readonlyCall = Symbol(); - this.readwriteCall = Symbol(); - } +class C { + constructor() { + this.readonlyCall = Symbol(); + this.readwriteCall = Symbol(); } - C.readonlyStaticCall = Symbol(); - C.readonlyStaticTypeAndCall = Symbol(); - C.readwriteStaticCall = Symbol(); - return C; -})(); +} +C.readonlyStaticCall = Symbol(); +C.readonlyStaticTypeAndCall = Symbol(); +C.readwriteStaticCall = Symbol(); const constInitToCReadonlyStaticCall = C.readonlyStaticCall; const constInitToCReadonlyStaticType = C.readonlyStaticType; const constInitToCReadonlyStaticTypeAndCall = C.readonlyStaticTypeAndCall; @@ -373,30 +370,27 @@ const o2 = { method5(p = s) { return p; }, }; // property initializers -let C0 = /** @class */ (() => { - class C0 { - constructor() { - this.a = s; - this.b = N.s; - this.c = N["s"]; - this.d = s; - this.e = N.s; - this.f = N["s"]; - } - method1() { return s; } - async method2() { return s; } - async *method3() { yield s; } - *method4() { yield s; } - method5(p = s) { return p; } +class C0 { + constructor() { + this.a = s; + this.b = N.s; + this.c = N["s"]; + this.d = s; + this.e = N.s; + this.f = N["s"]; } - C0.a = s; - C0.b = N.s; - C0.c = N["s"]; - C0.d = s; - C0.e = N.s; - C0.f = N["s"]; - return C0; -})(); + method1() { return s; } + async method2() { return s; } + async *method3() { yield s; } + *method4() { yield s; } + method5(p = s) { return p; } +} +C0.a = s; +C0.b = N.s; +C0.c = N["s"]; +C0.d = s; +C0.e = N.s; +C0.f = N["s"]; // non-widening positions // element access o[s]; diff --git a/tests/baselines/reference/uniqueSymbolsDeclarations.js b/tests/baselines/reference/uniqueSymbolsDeclarations.js index 5f9223ef2b322..15342a0bd97fc 100644 --- a/tests/baselines/reference/uniqueSymbolsDeclarations.js +++ b/tests/baselines/reference/uniqueSymbolsDeclarations.js @@ -282,18 +282,15 @@ async function* asyncGenFuncYieldConstCall() { yield constCall; } async function* asyncGenFuncYieldLetCall() { yield letCall; } async function* asyncGenFuncYieldVarCall() { yield varCall; } // classes -let C = /** @class */ (() => { - class C { - constructor() { - this.readonlyCall = Symbol(); - this.readwriteCall = Symbol(); - } +class C { + constructor() { + this.readonlyCall = Symbol(); + this.readwriteCall = Symbol(); } - C.readonlyStaticCall = Symbol(); - C.readonlyStaticTypeAndCall = Symbol(); - C.readwriteStaticCall = Symbol(); - return C; -})(); +} +C.readonlyStaticCall = Symbol(); +C.readonlyStaticTypeAndCall = Symbol(); +C.readwriteStaticCall = Symbol(); const constInitToCReadonlyStaticCall = C.readonlyStaticCall; const constInitToCReadonlyStaticType = C.readonlyStaticType; const constInitToCReadonlyStaticTypeAndCall = C.readonlyStaticTypeAndCall; @@ -341,30 +338,27 @@ const o2 = { method5(p = s) { return p; } }; // property initializers -let C0 = /** @class */ (() => { - class C0 { - constructor() { - this.a = s; - this.b = N.s; - this.c = N["s"]; - this.d = s; - this.e = N.s; - this.f = N["s"]; - } - method1() { return s; } - async method2() { return s; } - async *method3() { yield s; } - *method4() { yield s; } - method5(p = s) { return p; } +class C0 { + constructor() { + this.a = s; + this.b = N.s; + this.c = N["s"]; + this.d = s; + this.e = N.s; + this.f = N["s"]; } - C0.a = s; - C0.b = N.s; - C0.c = N["s"]; - C0.d = s; - C0.e = N.s; - C0.f = N["s"]; - return C0; -})(); + method1() { return s; } + async method2() { return s; } + async *method3() { yield s; } + *method4() { yield s; } + method5(p = s) { return p; } +} +C0.a = s; +C0.b = N.s; +C0.c = N["s"]; +C0.d = s; +C0.e = N.s; +C0.f = N["s"]; // non-widening positions // element access o[s]; diff --git a/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.js b/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.js index 2ff4da1f22acc..88d29c6a68430 100644 --- a/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.js +++ b/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.js @@ -27,28 +27,25 @@ class C { //// [uniqueSymbolsDeclarationsInJs-out.js] // classes -let C = /** @class */ (() => { - class C { - constructor() { - /** - * @readonly - */ - this.readonlyCall = Symbol(); - this.readwriteCall = Symbol(); - } +class C { + constructor() { + /** + * @readonly + */ + this.readonlyCall = Symbol(); + this.readwriteCall = Symbol(); } - /** - * @readonly - */ - C.readonlyStaticCall = Symbol(); - /** - * @type {unique symbol} - * @readonly - */ - C.readonlyStaticTypeAndCall = Symbol(); - C.readwriteStaticCall = Symbol(); - return C; -})(); +} +/** + * @readonly + */ +C.readonlyStaticCall = Symbol(); +/** + * @type {unique symbol} + * @readonly + */ +C.readonlyStaticTypeAndCall = Symbol(); +C.readwriteStaticCall = Symbol(); //// [uniqueSymbolsDeclarationsInJs-out.d.ts] diff --git a/tests/baselines/reference/useBeforeDeclaration_jsx.js b/tests/baselines/reference/useBeforeDeclaration_jsx.js index 7f443a826c5f7..e95bf25464413 100644 --- a/tests/baselines/reference/useBeforeDeclaration_jsx.js +++ b/tests/baselines/reference/useBeforeDeclaration_jsx.js @@ -16,16 +16,13 @@ class C { //// [useBeforeDeclaration_jsx.jsx] -let C = /** @class */ (() => { - class C { - } - C.a = ; - C.b = ; - C.c = ; - C.d = ; - C.e = {C.y}; - C.x = {}; - C.y = ''; - C.z = () => ; - return C; -})(); +class C { +} +C.a = ; +C.b = ; +C.c = ; +C.d = ; +C.e = {C.y}; +C.x = {}; +C.y = ''; +C.z = () => ; diff --git a/tests/baselines/reference/useBeforeDeclaration_propertyAssignment.js b/tests/baselines/reference/useBeforeDeclaration_propertyAssignment.js index d3ab479be50be..4ee81065518e1 100644 --- a/tests/baselines/reference/useBeforeDeclaration_propertyAssignment.js +++ b/tests/baselines/reference/useBeforeDeclaration_propertyAssignment.js @@ -25,16 +25,13 @@ export class C { this.c = { c: this.b }; } } -let D = /** @class */ (() => { - class D { - } - D.A = class extends D.B { - [D.D]() { } // should be an error - }; - D.B = class { - }; - D.C = Object.assign({ [D.D]: 1 }, { get [D.D]() { return 0; } } // should be an error - ); - D.D = ''; - return D; -})(); +class D { +} +D.A = class extends D.B { + [D.D]() { } // should be an error +}; +D.B = class { +}; +D.C = Object.assign({ [D.D]: 1 }, { get [D.D]() { return 0; } } // should be an error +); +D.D = '';