Skip to content

Commit b1b0a82

Browse files
committed
Add baselines
1 parent c5e6913 commit b1b0a82

File tree

4 files changed

+146
-0
lines changed

4 files changed

+146
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
tests/cases/conformance/classes/constructorDeclarations/quotedConstructors.ts(2,5): error TS96000: Quoted constructors have previously been interpreted as methods, which is incorrect. In TypeScript 3.6, they will be correctly parsed as constructors. In the meantime, consider using 'constructor()' to write a constructor, or '["constructor"]()' to write a method.
2+
tests/cases/conformance/classes/constructorDeclarations/quotedConstructors.ts(6,5): error TS96000: Quoted constructors have previously been interpreted as methods, which is incorrect. In TypeScript 3.6, they will be correctly parsed as constructors. In the meantime, consider using 'constructor()' to write a constructor, or '["constructor"]()' to write a method.
3+
tests/cases/conformance/classes/constructorDeclarations/quotedConstructors.ts(14,5): error TS96000: Quoted constructors have previously been interpreted as methods, which is incorrect. In TypeScript 3.6, they will be correctly parsed as constructors. In the meantime, consider using 'constructor()' to write a constructor, or '["constructor"]()' to write a method.
4+
5+
6+
==== tests/cases/conformance/classes/constructorDeclarations/quotedConstructors.ts (3 errors) ====
7+
class C {
8+
"constructor"() {} // Error in 3.5
9+
~~~~~~~~~~~~~
10+
!!! error TS96000: Quoted constructors have previously been interpreted as methods, which is incorrect. In TypeScript 3.6, they will be correctly parsed as constructors. In the meantime, consider using 'constructor()' to write a constructor, or '["constructor"]()' to write a method.
11+
}
12+
13+
class D {
14+
'constructor'() {} // Error in 3.5
15+
~~~~~~~~~~~~~
16+
!!! error TS96000: Quoted constructors have previously been interpreted as methods, which is incorrect. In TypeScript 3.6, they will be correctly parsed as constructors. In the meantime, consider using 'constructor()' to write a constructor, or '["constructor"]()' to write a method.
17+
}
18+
19+
class E {
20+
['constructor']() {}
21+
}
22+
23+
new class {
24+
"constructor"() {} // Error in 3.5
25+
~~~~~~~~~~~~~
26+
!!! error TS96000: Quoted constructors have previously been interpreted as methods, which is incorrect. In TypeScript 3.6, they will be correctly parsed as constructors. In the meantime, consider using 'constructor()' to write a constructor, or '["constructor"]()' to write a method.
27+
};
28+
29+
var o = { "constructor"() {} };
30+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//// [quotedConstructors.ts]
2+
class C {
3+
"constructor"() {} // Error in 3.5
4+
}
5+
6+
class D {
7+
'constructor'() {} // Error in 3.5
8+
}
9+
10+
class E {
11+
['constructor']() {}
12+
}
13+
14+
new class {
15+
"constructor"() {} // Error in 3.5
16+
};
17+
18+
var o = { "constructor"() {} };
19+
20+
21+
//// [quotedConstructors.js]
22+
var C = /** @class */ (function () {
23+
function C() {
24+
}
25+
C.prototype["constructor"] = function () { }; // Error in 3.5
26+
return C;
27+
}());
28+
var D = /** @class */ (function () {
29+
function D() {
30+
}
31+
D.prototype['constructor'] = function () { }; // Error in 3.5
32+
return D;
33+
}());
34+
var E = /** @class */ (function () {
35+
function E() {
36+
}
37+
E.prototype['constructor'] = function () { };
38+
return E;
39+
}());
40+
new /** @class */ (function () {
41+
function class_1() {
42+
}
43+
class_1.prototype["constructor"] = function () { }; // Error in 3.5
44+
return class_1;
45+
}());
46+
var o = { "constructor": function () { } };
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
=== tests/cases/conformance/classes/constructorDeclarations/quotedConstructors.ts ===
2+
class C {
3+
>C : Symbol(C, Decl(quotedConstructors.ts, 0, 0))
4+
5+
"constructor"() {} // Error in 3.5
6+
>"constructor" : Symbol(C["constructor"], Decl(quotedConstructors.ts, 0, 9))
7+
}
8+
9+
class D {
10+
>D : Symbol(D, Decl(quotedConstructors.ts, 2, 1))
11+
12+
'constructor'() {} // Error in 3.5
13+
>'constructor' : Symbol(D['constructor'], Decl(quotedConstructors.ts, 4, 9))
14+
}
15+
16+
class E {
17+
>E : Symbol(E, Decl(quotedConstructors.ts, 6, 1))
18+
19+
['constructor']() {}
20+
>['constructor'] : Symbol(E['constructor'], Decl(quotedConstructors.ts, 8, 9))
21+
>'constructor' : Symbol(E['constructor'], Decl(quotedConstructors.ts, 8, 9))
22+
}
23+
24+
new class {
25+
"constructor"() {} // Error in 3.5
26+
>"constructor" : Symbol((Anonymous class)["constructor"], Decl(quotedConstructors.ts, 12, 11))
27+
28+
};
29+
30+
var o = { "constructor"() {} };
31+
>o : Symbol(o, Decl(quotedConstructors.ts, 16, 3))
32+
>"constructor" : Symbol("constructor", Decl(quotedConstructors.ts, 16, 9))
33+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
=== tests/cases/conformance/classes/constructorDeclarations/quotedConstructors.ts ===
2+
class C {
3+
>C : C
4+
5+
"constructor"() {} // Error in 3.5
6+
>"constructor" : () => void
7+
}
8+
9+
class D {
10+
>D : D
11+
12+
'constructor'() {} // Error in 3.5
13+
>'constructor' : () => void
14+
}
15+
16+
class E {
17+
>E : E
18+
19+
['constructor']() {}
20+
>['constructor'] : () => void
21+
>'constructor' : "constructor"
22+
}
23+
24+
new class {
25+
>new class { "constructor"() {} // Error in 3.5} : (Anonymous class)
26+
>class { "constructor"() {} // Error in 3.5} : typeof (Anonymous class)
27+
28+
"constructor"() {} // Error in 3.5
29+
>"constructor" : () => void
30+
31+
};
32+
33+
var o = { "constructor"() {} };
34+
>o : { "constructor"(): void; }
35+
>{ "constructor"() {} } : { "constructor"(): void; }
36+
>"constructor" : () => void
37+

0 commit comments

Comments
 (0)