Merge branch 'master' into always-error-on-property-override-accessor

This commit is contained in:
Nathan Shively-Sanders
2020-05-22 07:41:28 -07:00
75 changed files with 1011 additions and 1336 deletions

View File

@@ -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);

View File

@@ -19,31 +19,27 @@ async function* test(x: Promise<string>) {
//// [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;
}

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);
}
};

View File

@@ -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);
}
};

View File

@@ -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 {};

View File

@@ -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;
});

View File

@@ -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;

View File

@@ -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);
}
};

View File

@@ -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;
});

View File

@@ -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);

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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;

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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;

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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";

View File

@@ -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;

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -113,88 +113,75 @@ module m2 {
}
//// [es6ModuleClassDeclaration.js]
let c = /** @class */ (() => {
class c {
constructor() {
this.x = 10;
this.y = 30;
}
method1() {
}
method2() {
}
static method3() {
}
static method4() {
}
export class c {
constructor() {
this.x = 10;
this.y = 30;
}
c.k = 20;
c.l = 30;
return c;
})();
export { c };
let c2 = /** @class */ (() => {
class c2 {
constructor() {
this.x = 10;
this.y = 30;
}
method1() {
}
method2() {
}
static method3() {
}
static method4() {
}
method1() {
}
c2.k = 20;
c2.l = 30;
return c2;
})();
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) {
let c3 = /** @class */ (() => {
class c3 {
constructor() {
this.x = 10;
this.y = 30;
}
method1() {
}
method2() {
}
static method3() {
}
static method4() {
}
class c3 {
constructor() {
this.x = 10;
this.y = 30;
}
c3.k = 20;
c3.l = 30;
return c3;
})();
method1() {
}
method2() {
}
static method3() {
}
static method4() {
}
}
c3.k = 20;
c3.l = 30;
m1.c3 = c3;
let c4 = /** @class */ (() => {
class c4 {
constructor() {
this.x = 10;
this.y = 30;
}
method1() {
}
method2() {
}
static method3() {
}
static method4() {
}
class c4 {
constructor() {
this.x = 10;
this.y = 30;
}
c4.k = 20;
c4.l = 30;
return c4;
})();
method1() {
}
method2() {
}
static method3() {
}
static method4() {
}
}
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() {
}
class c3 {
constructor() {
this.x = 10;
this.y = 30;
}
c3.k = 20;
c3.l = 30;
return c3;
})();
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() {
}
class c4 {
constructor() {
this.x = 10;
this.y = 30;
}
c4.k = 20;
c4.l = 30;
return c4;
})();
method1() {
}
method2() {
}
static method3() {
}
static method4() {
}
}
c4.k = 20;
c4.l = 30;
new c();
new c2();
new c3();

View File

@@ -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";

View File

@@ -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);
}

View File

@@ -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;
;
}

View File

@@ -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);
;
}

View File

@@ -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);
;
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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; },

View File

@@ -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();

View File

@@ -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 {};

View File

@@ -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();

View File

@@ -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();

View File

@@ -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";

View File

@@ -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
}
}
_foo_1 = new WeakMap(), _bar = new WeakMap();
_bar.set(Parent, 5);
return Parent;
})();
class Child extends Parent {
var _foo, _bar, _foo_1, _bar_1;
class 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.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 = new WeakMap(), _bar = new WeakMap();
_bar.set(Parent, 5);
class Child extends Parent {
constructor() {
super(...arguments);
_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_1 = new WeakMap(), _bar_1 = new WeakMap();

View File

@@ -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
}
}
_foo_1 = new WeakMap(), _bar = new WeakMap();
_bar.set(Parent, 5);
return Parent;
})();
class Child extends Parent {
var _foo, _bar, _foo_1, _bar_1;
class 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.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 = new WeakMap(), _bar = new WeakMap();
_bar.set(Parent, 5);
class Child extends Parent {
constructor() {
super(...arguments);
_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_1 = new WeakMap(), _bar_1 = new WeakMap();
new Parent().accessChildProps();

View File

@@ -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);

View File

@@ -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);

View File

@@ -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]

View File

@@ -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;
}
};
});

View File

@@ -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; }
}

View File

@@ -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 = {}));

View File

@@ -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;

View File

@@ -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 };

View File

@@ -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];

View File

@@ -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];

View File

@@ -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]

View File

@@ -16,16 +16,13 @@ class C {
//// [useBeforeDeclaration_jsx.jsx]
let C = /** @class */ (() => {
class C {
}
C.a = <C.z></C.z>;
C.b = <C.z />;
C.c = <span {...C.x}></span>;
C.d = <span id={C.y}></span>;
C.e = <span>{C.y}</span>;
C.x = {};
C.y = '';
C.z = () => <b></b>;
return C;
})();
class C {
}
C.a = <C.z></C.z>;
C.b = <C.z />;
C.c = <span {...C.x}></span>;
C.d = <span id={C.y}></span>;
C.e = <span>{C.y}</span>;
C.x = {};
C.y = '';
C.z = () => <b></b>;

View File

@@ -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 = '';