Skip to content

Commit 530f8f9

Browse files
committed
Add additional test-cases for arrow function grammar
As suggested by @DanielRosenwasser
1 parent 411dae1 commit 530f8f9

File tree

3,065 files changed

+97
-23222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,065 files changed

+97
-23222
lines changed

tests/baselines/reference/disallowLineTerminatorBeforeArrow.errors.txt

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(1
88
tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(15,10): error TS1200: Line terminator not permitted before arrow.
99
tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(19,5): error TS1200: Line terminator not permitted before arrow.
1010
tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(21,5): error TS1200: Line terminator not permitted before arrow.
11+
tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(26,40): error TS1200: Line terminator not permitted before arrow.
12+
tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(30,20): error TS1200: Line terminator not permitted before arrow.
13+
tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(35,17): error TS1200: Line terminator not permitted before arrow.
14+
tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(39,20): error TS1200: Line terminator not permitted before arrow.
1115

1216

13-
==== tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts (10 errors) ====
17+
==== tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts (14 errors) ====
1418
var f1 = ()
1519
~~
1620
=> { }
@@ -63,4 +67,35 @@ tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(2
6367
=> { return false; });
6468
~~~~~~~~~~~~~~~~~~~~~~~~
6569
!!! error TS1200: Line terminator not permitted before arrow.
70+
71+
module m {
72+
class City {
73+
constructor(x: number, thing = ()
74+
~~
75+
=> 100) {
76+
~~~~~~~~~~~~~~~~~~
77+
!!! error TS1200: Line terminator not permitted before arrow.
78+
}
79+
80+
public m = ()
81+
~~
82+
=> 2 * 2 * 2
83+
~~~~~~~~~~~~~~~~~~~~~~~~
84+
!!! error TS1200: Line terminator not permitted before arrow.
85+
}
86+
87+
export enum Enum {
88+
claw = (()
89+
~~
90+
=> 10)()
91+
~~~~~~~~~~~~~~~~~
92+
!!! error TS1200: Line terminator not permitted before arrow.
93+
}
94+
95+
export var v = x
96+
~
97+
=> new City(Enum.claw);
98+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99+
!!! error TS1200: Line terminator not permitted before arrow.
100+
}
66101

tests/baselines/reference/disallowLineTerminatorBeforeArrow.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,25 @@ foo(()
2121
=> true);
2222
foo(()
2323
=> { return false; });
24+
25+
module m {
26+
class City {
27+
constructor(x: number, thing = ()
28+
=> 100) {
29+
}
30+
31+
public m = ()
32+
=> 2 * 2 * 2
33+
}
34+
35+
export enum Enum {
36+
claw = (()
37+
=> 10)()
38+
}
39+
40+
export var v = x
41+
=> new City(Enum.claw);
42+
}
2443

2544

2645
//// [disallowLineTerminatorBeforeArrow.js]
@@ -66,3 +85,26 @@ foo(function () {
6685
foo(function () {
6786
return false;
6887
});
88+
var m;
89+
(function (m) {
90+
var City = (function () {
91+
function City(x, thing) {
92+
if (thing === void 0) { thing = function () {
93+
return 100;
94+
}; }
95+
this.m = function () {
96+
return 2 * 2 * 2;
97+
};
98+
}
99+
return City;
100+
})();
101+
(function (Enum) {
102+
Enum[Enum["claw"] = (function () {
103+
return 10;
104+
})()] = "claw";
105+
})(m.Enum || (m.Enum = {}));
106+
var Enum = m.Enum;
107+
m.v = function (x) {
108+
return new City(Enum.claw);
109+
};
110+
})(m || (m = {}));

tests/baselines/reference/projectOutput/baseline/amd/decl.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/baselines/reference/projectOutput/baseline/amd/emit.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/baselines/reference/projectOutput/baseline/node/decl.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/baselines/reference/projectOutput/baseline/node/emit.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/baselines/reference/projectOutput/baseline2/amd/decl.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/baselines/reference/projectOutput/baseline2/amd/dont_emit.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/baselines/reference/projectOutput/baseline2/node/decl.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/baselines/reference/projectOutput/baseline2/node/dont_emit.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/baselines/reference/projectOutput/baseline3/amd/nestedModule.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/baselines/reference/projectOutput/baseline3/node/nestedModule.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/baselines/reference/projectOutput/cantFindTheModule/amd/decl.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/baselines/reference/projectOutput/cantFindTheModule/node/decl.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/baselines/reference/projectOutput/circularReferencing/amd/consume.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/baselines/reference/projectOutput/circularReferencing/amd/decl.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/baselines/reference/projectOutput/circularReferencing/node/consume.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/baselines/reference/projectOutput/circularReferencing/node/decl.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/baselines/reference/projectOutput/circularReferencing2/amd/a.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/baselines/reference/projectOutput/circularReferencing2/amd/b.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

tests/baselines/reference/projectOutput/circularReferencing2/amd/c.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

tests/baselines/reference/projectOutput/circularReferencing2/node/a.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/baselines/reference/projectOutput/circularReferencing2/node/b.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/baselines/reference/projectOutput/circularReferencing2/node/c.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/baselines/reference/projectOutput/declarationsCascadingImports/amd/m4.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/baselines/reference/projectOutput/declarationsCascadingImports/amd/m4.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/baselines/reference/projectOutput/declarationsCascadingImports/amd/useModule.d.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/baselines/reference/projectOutput/declarationsCascadingImports/amd/useModule.js

Whitespace-only changes.

tests/baselines/reference/projectOutput/declarationsCascadingImports/node/m4.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/baselines/reference/projectOutput/declarationsCascadingImports/node/m4.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/baselines/reference/projectOutput/declarationsCascadingImports/node/useModule.d.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/baselines/reference/projectOutput/declarationsCascadingImports/node/useModule.js

Whitespace-only changes.

tests/baselines/reference/projectOutput/declarationsGlobalImport/amd/glo_m4.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/baselines/reference/projectOutput/declarationsGlobalImport/amd/glo_m4.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/baselines/reference/projectOutput/declarationsGlobalImport/amd/useModule.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/baselines/reference/projectOutput/declarationsGlobalImport/amd/useModule.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/baselines/reference/projectOutput/declarationsGlobalImport/node/glo_m4.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)