Skip to content

Commit 84760c2

Browse files
committed
Accepting new baselines
1 parent 0e8b6df commit 84760c2

22 files changed

+100
-106
lines changed

tests/baselines/reference/APISample_compile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,8 @@ declare module "typescript" {
756756
type ImportSpecifier = ImportOrExportSpecifier;
757757
type ExportSpecifier = ImportOrExportSpecifier;
758758
interface ExportAssignment extends Statement, ModuleElement {
759-
exportName: Identifier;
759+
isExportEquals?: boolean;
760+
expression: Expression;
760761
}
761762
interface FileReference extends TextRange {
762763
fileName: string;

tests/baselines/reference/APISample_compile.types

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,9 +2304,12 @@ declare module "typescript" {
23042304
>Statement : Statement
23052305
>ModuleElement : ModuleElement
23062306

2307-
exportName: Identifier;
2308-
>exportName : Identifier
2309-
>Identifier : Identifier
2307+
isExportEquals?: boolean;
2308+
>isExportEquals : boolean
2309+
2310+
expression: Expression;
2311+
>expression : Expression
2312+
>Expression : Expression
23102313
}
23112314
interface FileReference extends TextRange {
23122315
>FileReference : FileReference

tests/baselines/reference/APISample_linter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,8 @@ declare module "typescript" {
787787
type ImportSpecifier = ImportOrExportSpecifier;
788788
type ExportSpecifier = ImportOrExportSpecifier;
789789
interface ExportAssignment extends Statement, ModuleElement {
790-
exportName: Identifier;
790+
isExportEquals?: boolean;
791+
expression: Expression;
791792
}
792793
interface FileReference extends TextRange {
793794
fileName: string;

tests/baselines/reference/APISample_linter.types

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2450,9 +2450,12 @@ declare module "typescript" {
24502450
>Statement : Statement
24512451
>ModuleElement : ModuleElement
24522452

2453-
exportName: Identifier;
2454-
>exportName : Identifier
2455-
>Identifier : Identifier
2453+
isExportEquals?: boolean;
2454+
>isExportEquals : boolean
2455+
2456+
expression: Expression;
2457+
>expression : Expression
2458+
>Expression : Expression
24562459
}
24572460
interface FileReference extends TextRange {
24582461
>FileReference : FileReference

tests/baselines/reference/APISample_transform.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,8 @@ declare module "typescript" {
788788
type ImportSpecifier = ImportOrExportSpecifier;
789789
type ExportSpecifier = ImportOrExportSpecifier;
790790
interface ExportAssignment extends Statement, ModuleElement {
791-
exportName: Identifier;
791+
isExportEquals?: boolean;
792+
expression: Expression;
792793
}
793794
interface FileReference extends TextRange {
794795
fileName: string;

tests/baselines/reference/APISample_transform.types

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2400,9 +2400,12 @@ declare module "typescript" {
24002400
>Statement : Statement
24012401
>ModuleElement : ModuleElement
24022402

2403-
exportName: Identifier;
2404-
>exportName : Identifier
2405-
>Identifier : Identifier
2403+
isExportEquals?: boolean;
2404+
>isExportEquals : boolean
2405+
2406+
expression: Expression;
2407+
>expression : Expression
2408+
>Expression : Expression
24062409
}
24072410
interface FileReference extends TextRange {
24082411
>FileReference : FileReference

tests/baselines/reference/APISample_watcher.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,8 @@ declare module "typescript" {
825825
type ImportSpecifier = ImportOrExportSpecifier;
826826
type ExportSpecifier = ImportOrExportSpecifier;
827827
interface ExportAssignment extends Statement, ModuleElement {
828-
exportName: Identifier;
828+
isExportEquals?: boolean;
829+
expression: Expression;
829830
}
830831
interface FileReference extends TextRange {
831832
fileName: string;

tests/baselines/reference/APISample_watcher.types

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2573,9 +2573,12 @@ declare module "typescript" {
25732573
>Statement : Statement
25742574
>ModuleElement : ModuleElement
25752575

2576-
exportName: Identifier;
2577-
>exportName : Identifier
2578-
>Identifier : Identifier
2576+
isExportEquals?: boolean;
2577+
>isExportEquals : boolean
2578+
2579+
expression: Expression;
2580+
>expression : Expression
2581+
>Expression : Expression
25792582
}
25802583
interface FileReference extends TextRange {
25812584
>FileReference : FileReference

tests/baselines/reference/exportAssignDottedName.errors.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
tests/cases/conformance/externalModules/foo1.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
2-
tests/cases/conformance/externalModules/foo2.ts(2,14): error TS1005: ';' expected.
3-
tests/cases/conformance/externalModules/foo2.ts(2,15): error TS2304: Cannot find name 'x'.
42

53

6-
==== tests/cases/conformance/externalModules/foo2.ts (2 errors) ====
4+
==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ====
75
import foo1 = require('./foo1');
8-
export = foo1.x; // Error, export assignment must be identifier only
9-
~
10-
!!! error TS1005: ';' expected.
11-
~
12-
!!! error TS2304: Cannot find name 'x'.
6+
export = foo1.x; // Ok
137

148
==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ====
159
export function x(){

tests/baselines/reference/exportAssignDottedName.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function x(){
77

88
//// [foo2.ts]
99
import foo1 = require('./foo1');
10-
export = foo1.x; // Error, export assignment must be identifier only
10+
export = foo1.x; // Ok
1111

1212

1313
//// [foo1.js]
@@ -17,5 +17,4 @@ function x() {
1717
exports.x = x;
1818
//// [foo2.js]
1919
var foo1 = require('./foo1');
20-
x; // Error, export assignment must be identifier only
21-
module.exports = foo1;
20+
module.exports = foo1.x;
Lines changed: 16 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,37 @@
11
tests/cases/conformance/externalModules/foo1.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
2-
tests/cases/conformance/externalModules/foo1.ts(2,10): error TS1003: Identifier expected.
3-
tests/cases/conformance/externalModules/foo2.ts(1,10): error TS1003: Identifier expected.
4-
tests/cases/conformance/externalModules/foo3.ts(1,10): error TS1003: Identifier expected.
5-
tests/cases/conformance/externalModules/foo4.ts(1,10): error TS1003: Identifier expected.
6-
tests/cases/conformance/externalModules/foo6.ts(1,10): error TS1003: Identifier expected.
2+
tests/cases/conformance/externalModules/foo3.ts(1,10): error TS1109: Expression expected.
73
tests/cases/conformance/externalModules/foo6.ts(1,14): error TS1109: Expression expected.
8-
tests/cases/conformance/externalModules/foo7.ts(1,15): error TS1005: ';' expected.
9-
tests/cases/conformance/externalModules/foo8.ts(1,10): error TS1003: Identifier expected.
104

115

12-
==== tests/cases/conformance/externalModules/foo1.ts (2 errors) ====
6+
==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ====
137
var x = 10;
14-
export = typeof x; // Error
15-
~~~~~~~~
8+
export = typeof x; // Ok
9+
~~~~~~~~~~~~~~~~~~
1610
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
17-
~~~~~~
18-
!!! error TS1003: Identifier expected.
1911

20-
==== tests/cases/conformance/externalModules/foo2.ts (1 errors) ====
21-
export = "sausages"; // Error
22-
~~~~~~~~~~
23-
!!! error TS1003: Identifier expected.
12+
==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ====
13+
export = "sausages"; // Ok
2414

2515
==== tests/cases/conformance/externalModules/foo3.ts (1 errors) ====
26-
export = class Foo3 {}; // Error
16+
export = class Foo3 {}; // Error, not an expression
2717
~~~~~
28-
!!! error TS1003: Identifier expected.
18+
!!! error TS1109: Expression expected.
2919

30-
==== tests/cases/conformance/externalModules/foo4.ts (1 errors) ====
31-
export = true; // Error
32-
~~~~
33-
!!! error TS1003: Identifier expected.
20+
==== tests/cases/conformance/externalModules/foo4.ts (0 errors) ====
21+
export = true; // Ok
3422

3523
==== tests/cases/conformance/externalModules/foo5.ts (0 errors) ====
3624
export = undefined; // Valid. undefined is an identifier in JavaScript/TypeScript
3725

38-
==== tests/cases/conformance/externalModules/foo6.ts (2 errors) ====
39-
export = void; // Error
40-
~~~~
41-
!!! error TS1003: Identifier expected.
26+
==== tests/cases/conformance/externalModules/foo6.ts (1 errors) ====
27+
export = void; // Error, void operator requires an argument
4228
~
4329
!!! error TS1109: Expression expected.
4430

45-
==== tests/cases/conformance/externalModules/foo7.ts (1 errors) ====
46-
export = Date || String; // Error
47-
~~
48-
!!! error TS1005: ';' expected.
31+
==== tests/cases/conformance/externalModules/foo7.ts (0 errors) ====
32+
export = Date || String; // Ok
4933

50-
==== tests/cases/conformance/externalModules/foo8.ts (1 errors) ====
51-
export = null; // Error
52-
~~~~
53-
!!! error TS1003: Identifier expected.
34+
==== tests/cases/conformance/externalModules/foo8.ts (0 errors) ====
35+
export = null; // Ok
5436

5537

tests/baselines/reference/exportAssignNonIdentifier.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,51 @@
22

33
//// [foo1.ts]
44
var x = 10;
5-
export = typeof x; // Error
5+
export = typeof x; // Ok
66

77
//// [foo2.ts]
8-
export = "sausages"; // Error
8+
export = "sausages"; // Ok
99

1010
//// [foo3.ts]
11-
export = class Foo3 {}; // Error
11+
export = class Foo3 {}; // Error, not an expression
1212

1313
//// [foo4.ts]
14-
export = true; // Error
14+
export = true; // Ok
1515

1616
//// [foo5.ts]
1717
export = undefined; // Valid. undefined is an identifier in JavaScript/TypeScript
1818

1919
//// [foo6.ts]
20-
export = void; // Error
20+
export = void; // Error, void operator requires an argument
2121

2222
//// [foo7.ts]
23-
export = Date || String; // Error
23+
export = Date || String; // Ok
2424

2525
//// [foo8.ts]
26-
export = null; // Error
26+
export = null; // Ok
2727

2828

2929

3030
//// [foo1.js]
3131
var x = 10;
32-
typeof x; // Error
32+
module.exports = typeof x;
3333
//// [foo2.js]
34-
"sausages"; // Error
34+
module.exports = "sausages";
3535
//// [foo3.js]
3636
var Foo3 = (function () {
3737
function Foo3() {
3838
}
3939
return Foo3;
4040
})();
41-
; // Error
41+
; // Error, not an expression
42+
module.exports = ;
4243
//// [foo4.js]
43-
true; // Error
44+
module.exports = true;
4445
//// [foo5.js]
4546
module.exports = undefined;
4647
//// [foo6.js]
47-
void ; // Error
48+
module.exports = void ;
4849
//// [foo7.js]
49-
|| String; // Error
50-
module.exports = Date;
50+
module.exports = Date || String;
5151
//// [foo8.js]
52-
null; // Error
52+
module.exports = null;

tests/baselines/reference/exportAssignmentWithoutIdentifier1.errors.txt

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

tests/baselines/reference/exportAssignmentWithoutIdentifier1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ function Greeter() {
1515
Greeter.prototype.greet = function () {
1616
//...
1717
};
18-
new Greeter();
18+
module.exports = new Greeter();
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
=== tests/cases/compiler/exportAssignmentWithoutIdentifier1.ts ===
2+
function Greeter() {
3+
>Greeter : () => void
4+
5+
//...
6+
}
7+
Greeter.prototype.greet = function () {
8+
>Greeter.prototype.greet = function () { //...} : () => void
9+
>Greeter.prototype.greet : any
10+
>Greeter.prototype : any
11+
>Greeter : () => void
12+
>prototype : any
13+
>greet : any
14+
>function () { //...} : () => void
15+
16+
//...
17+
}
18+
export = new Greeter();
19+
>new Greeter() : any
20+
>Greeter : () => void
21+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
2-
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts(1,9): error TS1003: Identifier expected.
2+
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts(1,9): error TS1109: Expression expected.
33

44

55
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts (2 errors) ====
66
export =
77
~~~~~~~~
88
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
99

10-
!!! error TS1003: Identifier expected.
10+
!!! error TS1109: Expression expected.

tests/baselines/reference/parserExportAssignment3.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
export =
33

44
//// [parserExportAssignment3.js]
5+
module.exports = ;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
2-
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts(1,10): error TS1003: Identifier expected.
2+
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts(1,10): error TS1109: Expression expected.
33

44

55
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts (2 errors) ====
66
export = ;
77
~~~~~~~~~~
88
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
99
~
10-
!!! error TS1003: Identifier expected.
10+
!!! error TS1109: Expression expected.

tests/baselines/reference/parserExportAssignment4.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
export = ;
33

44
//// [parserExportAssignment4.js]
5+
module.exports = ;
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment5.ts(2,5): error TS1063: An export assignment cannot be used in an internal module.
2-
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment5.ts(2,5): error TS2304: Cannot find name 'A'.
32

43

5-
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment5.ts (2 errors) ====
4+
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment5.ts (1 errors) ====
65
module M {
76
export = A;
87
~~~~~~~~~~~
98
!!! error TS1063: An export assignment cannot be used in an internal module.
10-
~~~~~~~~~~~
11-
!!! error TS2304: Cannot find name 'A'.
129
}

0 commit comments

Comments
 (0)