forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: src/compiler/emitter.ts src/compiler/parser.ts src/compiler/program.ts src/services/services.ts tests/cases/unittests/transpile.ts
- Loading branch information
Showing
40 changed files
with
468 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/classMemberWithMissingIdentifier.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
tests/cases/compiler/classMemberWithMissingIdentifier.ts(2,11): error TS1146: Declaration expected. | ||
tests/cases/compiler/classMemberWithMissingIdentifier.ts(2,12): error TS1005: '=' expected. | ||
|
||
|
||
==== tests/cases/compiler/classMemberWithMissingIdentifier.ts (2 errors) ==== | ||
class C { | ||
public {}; | ||
|
||
!!! error TS1146: Declaration expected. | ||
~ | ||
!!! error TS1005: '=' expected. | ||
} |
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/classMemberWithMissingIdentifier.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//// [classMemberWithMissingIdentifier.ts] | ||
class C { | ||
public {}; | ||
} | ||
|
||
//// [classMemberWithMissingIdentifier.js] | ||
var C = (function () { | ||
function C() { | ||
this. = {}; | ||
} | ||
return C; | ||
})(); |
30 changes: 30 additions & 0 deletions
30
tests/baselines/reference/classMemberWithMissingIdentifier2.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,11): error TS1146: Declaration expected. | ||
tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,12): error TS1005: '=' expected. | ||
tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,14): error TS2304: Cannot find name 'name'. | ||
tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,18): error TS1005: ']' expected. | ||
tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,19): error TS2304: Cannot find name 'string'. | ||
tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,25): error TS1005: ',' expected. | ||
tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,26): error TS1136: Property assignment expected. | ||
tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,27): error TS2304: Cannot find name 'VariableDeclaration'. | ||
|
||
|
||
==== tests/cases/compiler/classMemberWithMissingIdentifier2.ts (8 errors) ==== | ||
class C { | ||
public {[name:string]:VariableDeclaration}; | ||
|
||
!!! error TS1146: Declaration expected. | ||
~ | ||
!!! error TS1005: '=' expected. | ||
~~~~ | ||
!!! error TS2304: Cannot find name 'name'. | ||
~ | ||
!!! error TS1005: ']' expected. | ||
~~~~~~ | ||
!!! error TS2304: Cannot find name 'string'. | ||
~ | ||
!!! error TS1005: ',' expected. | ||
~ | ||
!!! error TS1136: Property assignment expected. | ||
~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2304: Cannot find name 'VariableDeclaration'. | ||
} |
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/classMemberWithMissingIdentifier2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//// [classMemberWithMissingIdentifier2.ts] | ||
class C { | ||
public {[name:string]:VariableDeclaration}; | ||
} | ||
|
||
//// [classMemberWithMissingIdentifier2.js] | ||
var C = (function () { | ||
function C() { | ||
this. = (_a = {}, _a[name] = string, _a.VariableDeclaration = VariableDeclaration, _a); | ||
var _a; | ||
} | ||
return C; | ||
})(); |
15 changes: 15 additions & 0 deletions
15
tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//// [exportSpecifierAndExportedMemberDeclaration.ts] | ||
declare module "m2" { | ||
export module X { | ||
interface I { } | ||
} | ||
function Y(); | ||
export { Y as X }; | ||
function Z(): X.I; | ||
} | ||
|
||
declare module "m2" { | ||
function Z2(): X.I; | ||
} | ||
|
||
//// [exportSpecifierAndExportedMemberDeclaration.js] |
27 changes: 27 additions & 0 deletions
27
tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
=== tests/cases/compiler/exportSpecifierAndExportedMemberDeclaration.ts === | ||
declare module "m2" { | ||
export module X { | ||
>X : Symbol(X, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 0, 21), Decl(exportSpecifierAndExportedMemberDeclaration.ts, 5, 12)) | ||
|
||
interface I { } | ||
>I : Symbol(I, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 1, 21)) | ||
} | ||
function Y(); | ||
>Y : Symbol(Y, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 3, 5)) | ||
|
||
export { Y as X }; | ||
>Y : Symbol(X, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 0, 21), Decl(exportSpecifierAndExportedMemberDeclaration.ts, 5, 12)) | ||
>X : Symbol(X, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 0, 21), Decl(exportSpecifierAndExportedMemberDeclaration.ts, 5, 12)) | ||
|
||
function Z(): X.I; | ||
>Z : Symbol(Z, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 5, 22)) | ||
>X : Symbol(X, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 0, 21), Decl(exportSpecifierAndExportedMemberDeclaration.ts, 5, 12)) | ||
>I : Symbol(X.I, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 1, 21)) | ||
} | ||
|
||
declare module "m2" { | ||
function Z2(): X.I; | ||
>Z2 : Symbol(Z2, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 9, 21)) | ||
>X : Symbol(X, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 0, 21), Decl(exportSpecifierAndExportedMemberDeclaration.ts, 5, 12)) | ||
>I : Symbol(X.I, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 1, 21)) | ||
} |
27 changes: 27 additions & 0 deletions
27
tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
=== tests/cases/compiler/exportSpecifierAndExportedMemberDeclaration.ts === | ||
declare module "m2" { | ||
export module X { | ||
>X : () => any | ||
|
||
interface I { } | ||
>I : I | ||
} | ||
function Y(); | ||
>Y : () => any | ||
|
||
export { Y as X }; | ||
>Y : () => any | ||
>X : () => any | ||
|
||
function Z(): X.I; | ||
>Z : () => X.I | ||
>X : any | ||
>I : X.I | ||
} | ||
|
||
declare module "m2" { | ||
function Z2(): X.I; | ||
>Z2 : () => X.I | ||
>X : any | ||
>I : X.I | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/exportSpecifierAndLocalMemberDeclaration.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
tests/cases/compiler/exportSpecifierAndLocalMemberDeclaration.ts(11,20): error TS2503: Cannot find namespace 'X'. | ||
|
||
|
||
==== tests/cases/compiler/exportSpecifierAndLocalMemberDeclaration.ts (1 errors) ==== | ||
declare module "m2" { | ||
module X { | ||
interface I { } | ||
} | ||
function Y(); | ||
export { Y as X }; | ||
function Z(): X.I; | ||
} | ||
|
||
declare module "m2" { | ||
function Z2(): X.I; | ||
~ | ||
!!! error TS2503: Cannot find namespace 'X'. | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/baselines/reference/exportSpecifierAndLocalMemberDeclaration.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//// [exportSpecifierAndLocalMemberDeclaration.ts] | ||
declare module "m2" { | ||
module X { | ||
interface I { } | ||
} | ||
function Y(); | ||
export { Y as X }; | ||
function Z(): X.I; | ||
} | ||
|
||
declare module "m2" { | ||
function Z2(): X.I; | ||
} | ||
|
||
//// [exportSpecifierAndLocalMemberDeclaration.js] |
8 changes: 8 additions & 0 deletions
8
tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//// [exportSpecifierReferencingOuterDeclaration1.ts] | ||
declare module X { export interface bar { } } | ||
declare module "m" { | ||
export { X }; | ||
export function foo(): X.bar; | ||
} | ||
|
||
//// [exportSpecifierReferencingOuterDeclaration1.js] |
14 changes: 14 additions & 0 deletions
14
tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts === | ||
declare module X { export interface bar { } } | ||
>X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 0)) | ||
>bar : Symbol(bar, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 18)) | ||
|
||
declare module "m" { | ||
export { X }; | ||
>X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 2, 12)) | ||
|
||
export function foo(): X.bar; | ||
>foo : Symbol(foo, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 2, 17)) | ||
>X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 0)) | ||
>bar : Symbol(X.bar, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 18)) | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts === | ||
declare module X { export interface bar { } } | ||
>X : any | ||
>bar : bar | ||
|
||
declare module "m" { | ||
export { X }; | ||
>X : any | ||
|
||
export function foo(): X.bar; | ||
>foo : () => X.bar | ||
>X : any | ||
>bar : X.bar | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//// [tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2.ts] //// | ||
|
||
//// [exportSpecifierReferencingOuterDeclaration2_A.ts] | ||
declare module X { export interface bar { } } | ||
|
||
//// [exportSpecifierReferencingOuterDeclaration2_B.ts] | ||
export { X }; | ||
export declare function foo(): X.bar; | ||
|
||
//// [exportSpecifierReferencingOuterDeclaration2_A.js] | ||
//// [exportSpecifierReferencingOuterDeclaration2_B.js] |
Oops, something went wrong.