mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Combine ES5/ESNext into one test
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
//// [defineProperty.ts]
|
||||
var x: "p" = "p"
|
||||
class A {
|
||||
a = this.y
|
||||
b
|
||||
["computed"] = 13
|
||||
;[x] = 14
|
||||
m() { }
|
||||
constructor(public readonly y: number) { }
|
||||
z = this.y
|
||||
declare notEmitted;
|
||||
}
|
||||
class B {
|
||||
}
|
||||
class C extends B {
|
||||
z = this.ka
|
||||
constructor(public ka: number) {
|
||||
super()
|
||||
}
|
||||
ki = this.ka
|
||||
}
|
||||
|
||||
|
||||
//// [defineProperty.js]
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var _a;
|
||||
var x = "p";
|
||||
var A = /** @class */ (function () {
|
||||
function A(y) {
|
||||
Object.defineProperty(this, "y", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: y
|
||||
});
|
||||
Object.defineProperty(this, "a", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: this.y
|
||||
});
|
||||
Object.defineProperty(this, "b", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: void 0
|
||||
});
|
||||
Object.defineProperty(this, "computed", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: 13
|
||||
});
|
||||
Object.defineProperty(this, _a, {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: 14
|
||||
});
|
||||
Object.defineProperty(this, "z", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: this.y
|
||||
});
|
||||
}
|
||||
Object.defineProperty(A.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: function () { }
|
||||
});
|
||||
return A;
|
||||
}());
|
||||
_a = x;
|
||||
var B = /** @class */ (function () {
|
||||
function B() {
|
||||
}
|
||||
return B;
|
||||
}());
|
||||
var C = /** @class */ (function (_super) {
|
||||
__extends(C, _super);
|
||||
function C(ka) {
|
||||
var _this = _super.call(this) || this;
|
||||
Object.defineProperty(_this, "ka", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: ka
|
||||
});
|
||||
Object.defineProperty(_this, "z", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: _this.ka
|
||||
});
|
||||
Object.defineProperty(_this, "ki", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: _this.ka
|
||||
});
|
||||
return _this;
|
||||
}
|
||||
return C;
|
||||
}(B));
|
||||
@@ -0,0 +1,65 @@
|
||||
=== tests/cases/conformance/classes/propertyMemberDeclarations/defineProperty.ts ===
|
||||
var x: "p" = "p"
|
||||
>x : Symbol(x, Decl(defineProperty.ts, 0, 3))
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(defineProperty.ts, 0, 16))
|
||||
|
||||
a = this.y
|
||||
>a : Symbol(A.a, Decl(defineProperty.ts, 1, 9))
|
||||
>this.y : Symbol(A.y, Decl(defineProperty.ts, 7, 16))
|
||||
>this : Symbol(A, Decl(defineProperty.ts, 0, 16))
|
||||
>y : Symbol(A.y, Decl(defineProperty.ts, 7, 16))
|
||||
|
||||
b
|
||||
>b : Symbol(A.b, Decl(defineProperty.ts, 2, 14))
|
||||
|
||||
["computed"] = 13
|
||||
>["computed"] : Symbol(A["computed"], Decl(defineProperty.ts, 3, 5))
|
||||
>"computed" : Symbol(A["computed"], Decl(defineProperty.ts, 3, 5))
|
||||
|
||||
;[x] = 14
|
||||
>[x] : Symbol(A[x], Decl(defineProperty.ts, 5, 5))
|
||||
>x : Symbol(x, Decl(defineProperty.ts, 0, 3))
|
||||
|
||||
m() { }
|
||||
>m : Symbol(A.m, Decl(defineProperty.ts, 5, 13))
|
||||
|
||||
constructor(public readonly y: number) { }
|
||||
>y : Symbol(A.y, Decl(defineProperty.ts, 7, 16))
|
||||
|
||||
z = this.y
|
||||
>z : Symbol(A.z, Decl(defineProperty.ts, 7, 46))
|
||||
>this.y : Symbol(A.y, Decl(defineProperty.ts, 7, 16))
|
||||
>this : Symbol(A, Decl(defineProperty.ts, 0, 16))
|
||||
>y : Symbol(A.y, Decl(defineProperty.ts, 7, 16))
|
||||
|
||||
declare notEmitted;
|
||||
>notEmitted : Symbol(A.notEmitted, Decl(defineProperty.ts, 8, 14))
|
||||
}
|
||||
class B {
|
||||
>B : Symbol(B, Decl(defineProperty.ts, 10, 1))
|
||||
}
|
||||
class C extends B {
|
||||
>C : Symbol(C, Decl(defineProperty.ts, 12, 1))
|
||||
>B : Symbol(B, Decl(defineProperty.ts, 10, 1))
|
||||
|
||||
z = this.ka
|
||||
>z : Symbol(C.z, Decl(defineProperty.ts, 13, 19))
|
||||
>this.ka : Symbol(C.ka, Decl(defineProperty.ts, 15, 16))
|
||||
>this : Symbol(C, Decl(defineProperty.ts, 12, 1))
|
||||
>ka : Symbol(C.ka, Decl(defineProperty.ts, 15, 16))
|
||||
|
||||
constructor(public ka: number) {
|
||||
>ka : Symbol(C.ka, Decl(defineProperty.ts, 15, 16))
|
||||
|
||||
super()
|
||||
>super : Symbol(B, Decl(defineProperty.ts, 10, 1))
|
||||
}
|
||||
ki = this.ka
|
||||
>ki : Symbol(C.ki, Decl(defineProperty.ts, 17, 5))
|
||||
>this.ka : Symbol(C.ka, Decl(defineProperty.ts, 15, 16))
|
||||
>this : Symbol(C, Decl(defineProperty.ts, 12, 1))
|
||||
>ka : Symbol(C.ka, Decl(defineProperty.ts, 15, 16))
|
||||
}
|
||||
|
||||
+11
-3
@@ -1,4 +1,4 @@
|
||||
=== tests/cases/conformance/classes/propertyMemberDeclarations/definePropertyESNext.ts ===
|
||||
=== tests/cases/conformance/classes/propertyMemberDeclarations/defineProperty.ts ===
|
||||
var x: "p" = "p"
|
||||
>x : "p"
|
||||
>"p" : "p"
|
||||
@@ -6,9 +6,11 @@ var x: "p" = "p"
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
a = 12
|
||||
a = this.y
|
||||
>a : number
|
||||
>12 : 12
|
||||
>this.y : number
|
||||
>this : this
|
||||
>y : number
|
||||
|
||||
b
|
||||
>b : any
|
||||
@@ -29,6 +31,12 @@ class A {
|
||||
constructor(public readonly y: number) { }
|
||||
>y : number
|
||||
|
||||
z = this.y
|
||||
>z : number
|
||||
>this.y : number
|
||||
>this : this
|
||||
>y : number
|
||||
|
||||
declare notEmitted;
|
||||
>notEmitted : any
|
||||
}
|
||||
+6
-4
@@ -1,12 +1,13 @@
|
||||
//// [definePropertyESNext.ts]
|
||||
//// [defineProperty.ts]
|
||||
var x: "p" = "p"
|
||||
class A {
|
||||
a = 12
|
||||
a = this.y
|
||||
b
|
||||
["computed"] = 13
|
||||
;[x] = 14
|
||||
m() { }
|
||||
constructor(public readonly y: number) { }
|
||||
z = this.y
|
||||
declare notEmitted;
|
||||
}
|
||||
class B {
|
||||
@@ -20,11 +21,11 @@ class C extends B {
|
||||
}
|
||||
|
||||
|
||||
//// [definePropertyESNext.js]
|
||||
//// [defineProperty.js]
|
||||
var x = "p";
|
||||
class A {
|
||||
y;
|
||||
a = 12;
|
||||
a = this.y;
|
||||
b;
|
||||
["computed"] = 13;
|
||||
[x] = 14;
|
||||
@@ -32,6 +33,7 @@ class A {
|
||||
constructor(y) {
|
||||
this.y = y;
|
||||
}
|
||||
z = this.y;
|
||||
}
|
||||
class B {
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
=== tests/cases/conformance/classes/propertyMemberDeclarations/defineProperty.ts ===
|
||||
var x: "p" = "p"
|
||||
>x : Symbol(x, Decl(defineProperty.ts, 0, 3))
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(defineProperty.ts, 0, 16))
|
||||
|
||||
a = this.y
|
||||
>a : Symbol(A.a, Decl(defineProperty.ts, 1, 9))
|
||||
>this.y : Symbol(A.y, Decl(defineProperty.ts, 7, 16))
|
||||
>this : Symbol(A, Decl(defineProperty.ts, 0, 16))
|
||||
>y : Symbol(A.y, Decl(defineProperty.ts, 7, 16))
|
||||
|
||||
b
|
||||
>b : Symbol(A.b, Decl(defineProperty.ts, 2, 14))
|
||||
|
||||
["computed"] = 13
|
||||
>["computed"] : Symbol(A["computed"], Decl(defineProperty.ts, 3, 5))
|
||||
>"computed" : Symbol(A["computed"], Decl(defineProperty.ts, 3, 5))
|
||||
|
||||
;[x] = 14
|
||||
>[x] : Symbol(A[x], Decl(defineProperty.ts, 5, 5))
|
||||
>x : Symbol(x, Decl(defineProperty.ts, 0, 3))
|
||||
|
||||
m() { }
|
||||
>m : Symbol(A.m, Decl(defineProperty.ts, 5, 13))
|
||||
|
||||
constructor(public readonly y: number) { }
|
||||
>y : Symbol(A.y, Decl(defineProperty.ts, 7, 16))
|
||||
|
||||
z = this.y
|
||||
>z : Symbol(A.z, Decl(defineProperty.ts, 7, 46))
|
||||
>this.y : Symbol(A.y, Decl(defineProperty.ts, 7, 16))
|
||||
>this : Symbol(A, Decl(defineProperty.ts, 0, 16))
|
||||
>y : Symbol(A.y, Decl(defineProperty.ts, 7, 16))
|
||||
|
||||
declare notEmitted;
|
||||
>notEmitted : Symbol(A.notEmitted, Decl(defineProperty.ts, 8, 14))
|
||||
}
|
||||
class B {
|
||||
>B : Symbol(B, Decl(defineProperty.ts, 10, 1))
|
||||
}
|
||||
class C extends B {
|
||||
>C : Symbol(C, Decl(defineProperty.ts, 12, 1))
|
||||
>B : Symbol(B, Decl(defineProperty.ts, 10, 1))
|
||||
|
||||
z = this.ka
|
||||
>z : Symbol(C.z, Decl(defineProperty.ts, 13, 19))
|
||||
>this.ka : Symbol(C.ka, Decl(defineProperty.ts, 15, 16))
|
||||
>this : Symbol(C, Decl(defineProperty.ts, 12, 1))
|
||||
>ka : Symbol(C.ka, Decl(defineProperty.ts, 15, 16))
|
||||
|
||||
constructor(public ka: number) {
|
||||
>ka : Symbol(C.ka, Decl(defineProperty.ts, 15, 16))
|
||||
|
||||
super()
|
||||
>super : Symbol(B, Decl(defineProperty.ts, 10, 1))
|
||||
}
|
||||
ki = this.ka
|
||||
>ki : Symbol(C.ki, Decl(defineProperty.ts, 17, 5))
|
||||
>this.ka : Symbol(C.ka, Decl(defineProperty.ts, 15, 16))
|
||||
>this : Symbol(C, Decl(defineProperty.ts, 12, 1))
|
||||
>ka : Symbol(C.ka, Decl(defineProperty.ts, 15, 16))
|
||||
}
|
||||
|
||||
+29
-3
@@ -1,4 +1,4 @@
|
||||
=== tests/cases/conformance/classes/propertyMemberDeclarations/definePropertyES5.ts ===
|
||||
=== tests/cases/conformance/classes/propertyMemberDeclarations/defineProperty.ts ===
|
||||
var x: "p" = "p"
|
||||
>x : "p"
|
||||
>"p" : "p"
|
||||
@@ -37,7 +37,33 @@ class A {
|
||||
>this : this
|
||||
>y : number
|
||||
|
||||
declare notEmitted: boolean;
|
||||
>notEmitted : boolean
|
||||
declare notEmitted;
|
||||
>notEmitted : any
|
||||
}
|
||||
class B {
|
||||
>B : B
|
||||
}
|
||||
class C extends B {
|
||||
>C : C
|
||||
>B : B
|
||||
|
||||
z = this.ka
|
||||
>z : number
|
||||
>this.ka : number
|
||||
>this : this
|
||||
>ka : number
|
||||
|
||||
constructor(public ka: number) {
|
||||
>ka : number
|
||||
|
||||
super()
|
||||
>super() : void
|
||||
>super : typeof B
|
||||
}
|
||||
ki = this.ka
|
||||
>ki : number
|
||||
>this.ka : number
|
||||
>this : this
|
||||
>ka : number
|
||||
}
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
//// [definePropertyES5.ts]
|
||||
var x: "p" = "p"
|
||||
class A {
|
||||
a = this.y
|
||||
b
|
||||
["computed"] = 13
|
||||
;[x] = 14
|
||||
m() { }
|
||||
constructor(public readonly y: number) { }
|
||||
z = this.y
|
||||
declare notEmitted: boolean;
|
||||
}
|
||||
|
||||
|
||||
//// [definePropertyES5.js]
|
||||
var _a;
|
||||
var x = "p";
|
||||
var A = /** @class */ (function () {
|
||||
function A(y) {
|
||||
Object.defineProperty(this, "y", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: y
|
||||
});
|
||||
Object.defineProperty(this, "a", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: this.y
|
||||
});
|
||||
Object.defineProperty(this, "b", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: void 0
|
||||
});
|
||||
Object.defineProperty(this, "computed", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: 13
|
||||
});
|
||||
Object.defineProperty(this, _a, {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: 14
|
||||
});
|
||||
Object.defineProperty(this, "z", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: this.y
|
||||
});
|
||||
}
|
||||
Object.defineProperty(A.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: function () { }
|
||||
});
|
||||
return A;
|
||||
}());
|
||||
_a = x;
|
||||
@@ -1,40 +0,0 @@
|
||||
=== tests/cases/conformance/classes/propertyMemberDeclarations/definePropertyES5.ts ===
|
||||
var x: "p" = "p"
|
||||
>x : Symbol(x, Decl(definePropertyES5.ts, 0, 3))
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(definePropertyES5.ts, 0, 16))
|
||||
|
||||
a = this.y
|
||||
>a : Symbol(A.a, Decl(definePropertyES5.ts, 1, 9))
|
||||
>this.y : Symbol(A.y, Decl(definePropertyES5.ts, 7, 16))
|
||||
>this : Symbol(A, Decl(definePropertyES5.ts, 0, 16))
|
||||
>y : Symbol(A.y, Decl(definePropertyES5.ts, 7, 16))
|
||||
|
||||
b
|
||||
>b : Symbol(A.b, Decl(definePropertyES5.ts, 2, 14))
|
||||
|
||||
["computed"] = 13
|
||||
>["computed"] : Symbol(A["computed"], Decl(definePropertyES5.ts, 3, 5))
|
||||
>"computed" : Symbol(A["computed"], Decl(definePropertyES5.ts, 3, 5))
|
||||
|
||||
;[x] = 14
|
||||
>[x] : Symbol(A[x], Decl(definePropertyES5.ts, 5, 5))
|
||||
>x : Symbol(x, Decl(definePropertyES5.ts, 0, 3))
|
||||
|
||||
m() { }
|
||||
>m : Symbol(A.m, Decl(definePropertyES5.ts, 5, 13))
|
||||
|
||||
constructor(public readonly y: number) { }
|
||||
>y : Symbol(A.y, Decl(definePropertyES5.ts, 7, 16))
|
||||
|
||||
z = this.y
|
||||
>z : Symbol(A.z, Decl(definePropertyES5.ts, 7, 46))
|
||||
>this.y : Symbol(A.y, Decl(definePropertyES5.ts, 7, 16))
|
||||
>this : Symbol(A, Decl(definePropertyES5.ts, 0, 16))
|
||||
>y : Symbol(A.y, Decl(definePropertyES5.ts, 7, 16))
|
||||
|
||||
declare notEmitted: boolean;
|
||||
>notEmitted : Symbol(A.notEmitted, Decl(definePropertyES5.ts, 8, 14))
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
=== tests/cases/conformance/classes/propertyMemberDeclarations/definePropertyESNext.ts ===
|
||||
var x: "p" = "p"
|
||||
>x : Symbol(x, Decl(definePropertyESNext.ts, 0, 3))
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(definePropertyESNext.ts, 0, 16))
|
||||
|
||||
a = 12
|
||||
>a : Symbol(A.a, Decl(definePropertyESNext.ts, 1, 9))
|
||||
|
||||
b
|
||||
>b : Symbol(A.b, Decl(definePropertyESNext.ts, 2, 10))
|
||||
|
||||
["computed"] = 13
|
||||
>["computed"] : Symbol(A["computed"], Decl(definePropertyESNext.ts, 3, 5))
|
||||
>"computed" : Symbol(A["computed"], Decl(definePropertyESNext.ts, 3, 5))
|
||||
|
||||
;[x] = 14
|
||||
>[x] : Symbol(A[x], Decl(definePropertyESNext.ts, 5, 5))
|
||||
>x : Symbol(x, Decl(definePropertyESNext.ts, 0, 3))
|
||||
|
||||
m() { }
|
||||
>m : Symbol(A.m, Decl(definePropertyESNext.ts, 5, 13))
|
||||
|
||||
constructor(public readonly y: number) { }
|
||||
>y : Symbol(A.y, Decl(definePropertyESNext.ts, 7, 16))
|
||||
|
||||
declare notEmitted;
|
||||
>notEmitted : Symbol(A.notEmitted, Decl(definePropertyESNext.ts, 7, 46))
|
||||
}
|
||||
class B {
|
||||
>B : Symbol(B, Decl(definePropertyESNext.ts, 9, 1))
|
||||
}
|
||||
class C extends B {
|
||||
>C : Symbol(C, Decl(definePropertyESNext.ts, 11, 1))
|
||||
>B : Symbol(B, Decl(definePropertyESNext.ts, 9, 1))
|
||||
|
||||
z = this.ka
|
||||
>z : Symbol(C.z, Decl(definePropertyESNext.ts, 12, 19))
|
||||
>this.ka : Symbol(C.ka, Decl(definePropertyESNext.ts, 14, 16))
|
||||
>this : Symbol(C, Decl(definePropertyESNext.ts, 11, 1))
|
||||
>ka : Symbol(C.ka, Decl(definePropertyESNext.ts, 14, 16))
|
||||
|
||||
constructor(public ka: number) {
|
||||
>ka : Symbol(C.ka, Decl(definePropertyESNext.ts, 14, 16))
|
||||
|
||||
super()
|
||||
>super : Symbol(B, Decl(definePropertyESNext.ts, 9, 1))
|
||||
}
|
||||
ki = this.ka
|
||||
>ki : Symbol(C.ki, Decl(definePropertyESNext.ts, 16, 5))
|
||||
>this.ka : Symbol(C.ka, Decl(definePropertyESNext.ts, 14, 16))
|
||||
>this : Symbol(C, Decl(definePropertyESNext.ts, 11, 1))
|
||||
>ka : Symbol(C.ka, Decl(definePropertyESNext.ts, 14, 16))
|
||||
}
|
||||
|
||||
+3
-2
@@ -1,13 +1,14 @@
|
||||
// @target: esnext
|
||||
// @target: es5, esnext
|
||||
// @useDefineForClassFields: true
|
||||
var x: "p" = "p"
|
||||
class A {
|
||||
a = 12
|
||||
a = this.y
|
||||
b
|
||||
["computed"] = 13
|
||||
;[x] = 14
|
||||
m() { }
|
||||
constructor(public readonly y: number) { }
|
||||
z = this.y
|
||||
declare notEmitted;
|
||||
}
|
||||
class B {
|
||||
@@ -1,13 +0,0 @@
|
||||
// @target: es5
|
||||
// @useDefineForClassFields: true
|
||||
var x: "p" = "p"
|
||||
class A {
|
||||
a = this.y
|
||||
b
|
||||
["computed"] = 13
|
||||
;[x] = 14
|
||||
m() { }
|
||||
constructor(public readonly y: number) { }
|
||||
z = this.y
|
||||
declare notEmitted: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user