Skip to content

Commit bf60eab

Browse files
author
Yui T
committed
Update tests cases
1 parent 5bab826 commit bf60eab

9 files changed

Lines changed: 153 additions & 18 deletions
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
2-
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,6): error TS1212: Identifier expected. 'public' is a reserved word in strict mode
2+
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,6): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
33
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,6): error TS2304: Cannot find name 'public'.
44

55

@@ -9,7 +9,7 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP
99
~~~~~~~~~
1010
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
1111
~~~~~~
12-
!!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode
12+
!!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
1313
~~~~~~
1414
!!! error TS2304: Cannot find name 'public'.
1515
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts(2,6): error TS1212: Identifier expected. 'public' is a reserved word in strict mode
1+
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts(2,6): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
22
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts(2,6): error TS2304: Cannot find name 'public'.
33

44

55
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts (2 errors) ====
66
class C {
77
[public]() { }
88
~~~~~~
9-
!!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode
9+
!!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
1010
~~~~~~
1111
!!! error TS2304: Cannot find name 'public'.
1212
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName39.ts(3,6): error TS1212: Identifier expected. 'public' is a reserved word in strict mode
1+
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName39.ts(3,6): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
22
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName39.ts(3,6): error TS2304: Cannot find name 'public'.
33

44

@@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP
77
class C {
88
[public]() { }
99
~~~~~~
10-
!!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode
10+
!!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
1111
~~~~~~
1212
!!! error TS2304: Cannot find name 'public'.
1313
}

tests/baselines/reference/strictModeCode1.errors.txt

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
tests/cases/compiler/strictModeCode1.ts(4,17): error TS1213: Identifier expected. 'private' is a reserved word in strict mode. Class definitions are automatically in strict mode.
22
tests/cases/compiler/strictModeCode1.ts(4,26): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
33
tests/cases/compiler/strictModeCode1.ts(4,34): error TS1213: Identifier expected. 'static' is a reserved word in strict mode. Class definitions are automatically in strict mode.
4-
tests/cases/compiler/strictModeCode1.ts(5,9): error TS1212: Identifier expected. 'private' is a reserved word in strict mode
5-
tests/cases/compiler/strictModeCode1.ts(5,19): error TS1212: Identifier expected. 'public' is a reserved word in strict mode
6-
tests/cases/compiler/strictModeCode1.ts(5,28): error TS1212: Identifier expected. 'static' is a reserved word in strict mode
4+
tests/cases/compiler/strictModeCode1.ts(5,9): error TS1213: Identifier expected. 'private' is a reserved word in strict mode. Class definitions are automatically in strict mode.
5+
tests/cases/compiler/strictModeCode1.ts(5,19): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
6+
tests/cases/compiler/strictModeCode1.ts(5,28): error TS1213: Identifier expected. 'static' is a reserved word in strict mode. Class definitions are automatically in strict mode.
77
tests/cases/compiler/strictModeCode1.ts(7,22): error TS1216: Type expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
88
tests/cases/compiler/strictModeCode1.ts(11,24): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
99
tests/cases/compiler/strictModeCode1.ts(11,32): error TS1213: Identifier expected. 'let' is a reserved word in strict mode. Class definitions are automatically in strict mode.
@@ -13,10 +13,17 @@ tests/cases/compiler/strictModeCode1.ts(13,27): error TS1213: Identifier expecte
1313
tests/cases/compiler/strictModeCode1.ts(14,18): error TS1213: Identifier expected. 'let' is a reserved word in strict mode. Class definitions are automatically in strict mode.
1414
tests/cases/compiler/strictModeCode1.ts(21,9): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
1515
tests/cases/compiler/strictModeCode1.ts(21,17): error TS1213: Identifier expected. 'private' is a reserved word in strict mode. Class definitions are automatically in strict mode.
16-
tests/cases/compiler/strictModeCode1.ts(23,20): error TS1212: Identifier expected. 'public' is a reserved word in strict mode
16+
tests/cases/compiler/strictModeCode1.ts(23,20): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
17+
tests/cases/compiler/strictModeCode1.ts(25,20): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
18+
tests/cases/compiler/strictModeCode1.ts(25,20): error TS2304: Cannot find name 'public'.
19+
tests/cases/compiler/strictModeCode1.ts(25,27): error TS1213: Identifier expected. 'private' is a reserved word in strict mode. Class definitions are automatically in strict mode.
20+
tests/cases/compiler/strictModeCode1.ts(26,17): error TS1213: Identifier expected. 'package' is a reserved word in strict mode. Class definitions are automatically in strict mode.
21+
tests/cases/compiler/strictModeCode1.ts(26,17): error TS2304: Cannot find name 'package'.
22+
tests/cases/compiler/strictModeCode1.ts(27,17): error TS1213: Identifier expected. 'package' is a reserved word in strict mode. Class definitions are automatically in strict mode.
23+
tests/cases/compiler/strictModeCode1.ts(27,17): error TS2304: Cannot find name 'package'.
1724

1825

19-
==== tests/cases/compiler/strictModeCode1.ts (16 errors) ====
26+
==== tests/cases/compiler/strictModeCode1.ts (23 errors) ====
2027
interface public { }
2128

2229
class Foo {
@@ -29,11 +36,11 @@ tests/cases/compiler/strictModeCode1.ts(23,20): error TS1212: Identifier expecte
2936
!!! error TS1213: Identifier expected. 'static' is a reserved word in strict mode. Class definitions are automatically in strict mode.
3037
private = public = static;
3138
~~~~~~~
32-
!!! error TS1212: Identifier expected. 'private' is a reserved word in strict mode
39+
!!! error TS1213: Identifier expected. 'private' is a reserved word in strict mode. Class definitions are automatically in strict mode.
3340
~~~~~~
34-
!!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode
41+
!!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
3542
~~~~~~
36-
!!! error TS1212: Identifier expected. 'static' is a reserved word in strict mode
43+
!!! error TS1213: Identifier expected. 'static' is a reserved word in strict mode. Class definitions are automatically in strict mode.
3744
}
3845
public banana(x: public) { }
3946
~~~~~~
@@ -71,4 +78,22 @@ tests/cases/compiler/strictModeCode1.ts(23,20): error TS1212: Identifier expecte
7178

7279
class E implements public { }
7380
~~~~~~
74-
!!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode
81+
!!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
82+
83+
class F implements public.private.B { }
84+
~~~~~~
85+
!!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode.
86+
~~~~~~
87+
!!! error TS2304: Cannot find name 'public'.
88+
~~~~~~~
89+
!!! error TS1213: Identifier expected. 'private' is a reserved word in strict mode. Class definitions are automatically in strict mode.
90+
class G extends package { }
91+
~~~~~~~
92+
!!! error TS1213: Identifier expected. 'package' is a reserved word in strict mode. Class definitions are automatically in strict mode.
93+
~~~~~~~
94+
!!! error TS2304: Cannot find name 'package'.
95+
class H extends package.A { }
96+
~~~~~~~
97+
!!! error TS1213: Identifier expected. 'package' is a reserved word in strict mode. Class definitions are automatically in strict mode.
98+
~~~~~~~
99+
!!! error TS2304: Cannot find name 'package'.

tests/baselines/reference/strictModeCode1.js

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,19 @@ class C {
2121

2222
class D<public, private>{ }
2323

24-
class E implements public { }
24+
class E implements public { }
25+
26+
class F implements public.private.B { }
27+
class G extends package { }
28+
class H extends package.A { }
2529

2630
//// [strictModeCode1.js]
31+
var __extends = this.__extends || function (d, b) {
32+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
33+
function __() { this.constructor = d; }
34+
__.prototype = b.prototype;
35+
d.prototype = new __();
36+
};
2737
var Foo = (function () {
2838
function Foo(private, public, static) {
2939
private = public = static;
@@ -52,3 +62,22 @@ var E = (function () {
5262
}
5363
return E;
5464
})();
65+
var F = (function () {
66+
function F() {
67+
}
68+
return F;
69+
})();
70+
var G = (function (_super) {
71+
__extends(G, _super);
72+
function G() {
73+
_super.apply(this, arguments);
74+
}
75+
return G;
76+
})(package);
77+
var H = (function (_super) {
78+
__extends(H, _super);
79+
function H() {
80+
_super.apply(this, arguments);
81+
}
82+
return H;
83+
})(package.A);

tests/baselines/reference/strictModeCode2.errors.txt

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,26 @@ tests/cases/compiler/strictModeCode2.ts(13,11): error TS1212: Identifier expecte
1717
tests/cases/compiler/strictModeCode2.ts(13,20): error TS1212: Identifier expected. 'public' is a reserved word in strict mode
1818
tests/cases/compiler/strictModeCode2.ts(13,28): error TS1212: Identifier expected. 'package' is a reserved word in strict mode
1919
tests/cases/compiler/strictModeCode2.ts(15,25): error TS9003: 'class' expressions are not currently supported.
20+
tests/cases/compiler/strictModeCode2.ts(17,9): error TS2300: Duplicate identifier 'b'.
21+
tests/cases/compiler/strictModeCode2.ts(17,12): error TS1215: Type expected. 'public' is a reserved word in strict mode
22+
tests/cases/compiler/strictModeCode2.ts(17,12): error TS2304: Cannot find name 'public'.
23+
tests/cases/compiler/strictModeCode2.ts(19,21): error TS1215: Type expected. 'private' is a reserved word in strict mode
24+
tests/cases/compiler/strictModeCode2.ts(19,21): error TS2304: Cannot find name 'private'.
25+
tests/cases/compiler/strictModeCode2.ts(20,22): error TS1215: Type expected. 'private' is a reserved word in strict mode
26+
tests/cases/compiler/strictModeCode2.ts(20,22): error TS2304: Cannot find name 'private'.
27+
tests/cases/compiler/strictModeCode2.ts(20,30): error TS1215: Type expected. 'package' is a reserved word in strict mode
28+
tests/cases/compiler/strictModeCode2.ts(21,22): error TS1215: Type expected. 'private' is a reserved word in strict mode
29+
tests/cases/compiler/strictModeCode2.ts(21,22): error TS2304: Cannot find name 'private'.
30+
tests/cases/compiler/strictModeCode2.ts(21,30): error TS1215: Type expected. 'package' is a reserved word in strict mode
31+
tests/cases/compiler/strictModeCode2.ts(21,38): error TS1215: Type expected. 'protected' is a reserved word in strict mode
32+
tests/cases/compiler/strictModeCode2.ts(22,9): error TS2300: Duplicate identifier 'b'.
33+
tests/cases/compiler/strictModeCode2.ts(22,12): error TS1215: Type expected. 'interface' is a reserved word in strict mode
34+
tests/cases/compiler/strictModeCode2.ts(22,12): error TS2304: Cannot find name 'interface'.
35+
tests/cases/compiler/strictModeCode2.ts(22,22): error TS1215: Type expected. 'package' is a reserved word in strict mode
36+
tests/cases/compiler/strictModeCode2.ts(22,30): error TS1215: Type expected. 'implements' is a reserved word in strict mode
2037

2138

22-
==== tests/cases/compiler/strictModeCode2.ts (19 errors) ====
39+
==== tests/cases/compiler/strictModeCode2.ts (36 errors) ====
2340
let let = 10;
2441

2542
function foo() {
@@ -73,6 +90,47 @@ tests/cases/compiler/strictModeCode2.ts(15,25): error TS9003: 'class' expression
7390
var myClass = class package extends public {}
7491
~~~~~~~
7592
!!! error TS9003: 'class' expressions are not currently supported.
93+
94+
var b: public.bar;
95+
~
96+
!!! error TS2300: Duplicate identifier 'b'.
97+
~~~~~~
98+
!!! error TS1215: Type expected. 'public' is a reserved word in strict mode
99+
~~~~~~
100+
!!! error TS2304: Cannot find name 'public'.
101+
102+
function foo(x: private.x) { }
103+
~~~~~~~
104+
!!! error TS1215: Type expected. 'private' is a reserved word in strict mode
105+
~~~~~~~
106+
!!! error TS2304: Cannot find name 'private'.
107+
function foo1(x: private.package.x) { }
108+
~~~~~~~
109+
!!! error TS1215: Type expected. 'private' is a reserved word in strict mode
110+
~~~~~~~
111+
!!! error TS2304: Cannot find name 'private'.
112+
~~~~~~~
113+
!!! error TS1215: Type expected. 'package' is a reserved word in strict mode
114+
function foo2(x: private.package.protected) { }
115+
~~~~~~~
116+
!!! error TS1215: Type expected. 'private' is a reserved word in strict mode
117+
~~~~~~~
118+
!!! error TS2304: Cannot find name 'private'.
119+
~~~~~~~
120+
!!! error TS1215: Type expected. 'package' is a reserved word in strict mode
121+
~~~~~~~~~
122+
!!! error TS1215: Type expected. 'protected' is a reserved word in strict mode
123+
let b: interface.package.implements.B;
124+
~
125+
!!! error TS2300: Duplicate identifier 'b'.
126+
~~~~~~~~~
127+
!!! error TS1215: Type expected. 'interface' is a reserved word in strict mode
128+
~~~~~~~~~
129+
!!! error TS2304: Cannot find name 'interface'.
130+
~~~~~~~
131+
!!! error TS1215: Type expected. 'package' is a reserved word in strict mode
132+
~~~~~~~~~~
133+
!!! error TS1215: Type expected. 'implements' is a reserved word in strict mode
76134
}
77135

78136

tests/baselines/reference/strictModeCode2.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ function foo() {
1414
barn((private, public, package) => { });
1515

1616
var myClass = class package extends public {}
17+
18+
var b: public.bar;
19+
20+
function foo(x: private.x) { }
21+
function foo1(x: private.package.x) { }
22+
function foo2(x: private.package.protected) { }
23+
let b: interface.package.implements.B;
1724
}
1825

1926

@@ -38,4 +45,9 @@ function foo() {
3845
}
3946
return package;
4047
})(public);
48+
var b;
49+
function foo(x) { }
50+
function foo1(x) { }
51+
function foo2(x) { }
52+
var b;
4153
}

tests/cases/compiler/strictModeCode1.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ class C {
2020

2121
class D<public, private>{ }
2222

23-
class E implements public { }
23+
class E implements public { }
24+
25+
class F implements public.private.B { }
26+
class G extends package { }
27+
class H extends package.A { }

tests/cases/compiler/strictModeCode2.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,12 @@ function foo() {
1313
barn((private, public, package) => { });
1414

1515
var myClass = class package extends public {}
16+
17+
var b: public.bar;
18+
19+
function foo(x: private.x) { }
20+
function foo1(x: private.package.x) { }
21+
function foo2(x: private.package.protected) { }
22+
let b: interface.package.implements.B;
1623
}
1724

0 commit comments

Comments
 (0)