From 3cd480ddb6e5aae35d7504de9de5fb8ee4ea8b1d Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 3 Jun 2015 12:05:53 -0700 Subject: [PATCH] Accepted baselines. --- ...reventsParsingAsAmbientExternalModule01.js | 4 ++++ ...tsParsingAsAmbientExternalModule01.symbols | 4 ++++ ...entsParsingAsAmbientExternalModule01.types | 6 +++++ ...arsingAsAmbientExternalModule02.errors.txt | 16 -------------- ...reventsParsingAsAmbientExternalModule02.js | 7 ++++++ ...tsParsingAsAmbientExternalModule02.symbols | 20 +++++++++++++++++ ...entsParsingAsAmbientExternalModule02.types | 22 +++++++++++++++++++ .../asiPreventsParsingAsNamespace01.js | 3 +++ .../asiPreventsParsingAsNamespace01.symbols | 6 +++-- .../asiPreventsParsingAsNamespace01.types | 2 ++ .../asiPreventsParsingAsNamespace02.js | 3 +++ .../asiPreventsParsingAsNamespace02.symbols | 6 +++-- .../asiPreventsParsingAsNamespace02.types | 2 ++ .../asiPreventsParsingAsNamespace03.js | 6 +++++ .../asiPreventsParsingAsNamespace03.symbols | 4 +++- .../asiPreventsParsingAsNamespace03.types | 6 +++-- ...asiPreventsParsingAsNamespace04.errors.txt | 9 -------- .../asiPreventsParsingAsNamespace04.js | 2 +- .../asiPreventsParsingAsNamespace04.symbols | 8 +++++++ .../asiPreventsParsingAsNamespace04.types | 11 ++++++++++ .../asiPreventsParsingAsNamespace05.js | 14 ++++++++++++ .../asiPreventsParsingAsNamespace05.symbols | 20 +++++++++++++---- .../asiPreventsParsingAsNamespace05.types | 19 +++++++++++++--- .../asiPreventsParsingAsTypeAlias01.js | 2 ++ .../asiPreventsParsingAsTypeAlias01.symbols | 9 +++++--- .../asiPreventsParsingAsTypeAlias01.types | 8 +++++-- .../asiPreventsParsingAsTypeAlias02.js | 5 +++++ .../asiPreventsParsingAsTypeAlias02.symbols | 5 ++++- .../asiPreventsParsingAsTypeAlias02.types | 8 +++++-- .../reservedNamesInAliases.errors.txt | 13 ++++++----- .../reference/reservedNamesInAliases.js | 2 ++ .../reference/reservedWords2.errors.txt | 10 ++++----- tests/baselines/reference/reservedWords2.js | 1 + 33 files changed, 205 insertions(+), 58 deletions(-) delete mode 100644 tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.errors.txt create mode 100644 tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.symbols create mode 100644 tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.types delete mode 100644 tests/baselines/reference/asiPreventsParsingAsNamespace04.errors.txt create mode 100644 tests/baselines/reference/asiPreventsParsingAsNamespace04.symbols create mode 100644 tests/baselines/reference/asiPreventsParsingAsNamespace04.types diff --git a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.js b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.js index efd82f27d1f..caf90acae5f 100644 --- a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.js +++ b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.js @@ -11,3 +11,7 @@ module // this is the identifier 'module' //// [asiPreventsParsingAsAmbientExternalModule01.js] var declare; var module; +declare; // this is the identifier 'declare' +module; // this is the identifier 'module' +"my external module"; // this is just a string +{ } // this is a block body diff --git a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.symbols b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.symbols index 87eb8daf7e2..c35432b7ece 100644 --- a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.symbols +++ b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.symbols @@ -7,6 +7,10 @@ var module: string; >module : Symbol(module, Decl(asiPreventsParsingAsAmbientExternalModule01.ts, 2, 3)) declare // this is the identifier 'declare' +>declare : Symbol(declare, Decl(asiPreventsParsingAsAmbientExternalModule01.ts, 1, 3)) + module // this is the identifier 'module' +>module : Symbol(module, Decl(asiPreventsParsingAsAmbientExternalModule01.ts, 2, 3)) + "my external module" // this is just a string { } // this is a block body diff --git a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.types b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.types index 94a2cc8d6a1..3e6aade9a21 100644 --- a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.types +++ b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.types @@ -7,6 +7,12 @@ var module: string; >module : string declare // this is the identifier 'declare' +>declare : number + module // this is the identifier 'module' +>module : string + "my external module" // this is just a string +>"my external module" : string + { } // this is a block body diff --git a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.errors.txt b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.errors.txt deleted file mode 100644 index 3064b137a19..00000000000 --- a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.errors.txt +++ /dev/null @@ -1,16 +0,0 @@ -tests/cases/conformance/externalModules/asiPreventsParsingAsAmbientExternalModule02.ts(8,5): error TS2435: Ambient modules cannot be nested in other modules. - - -==== tests/cases/conformance/externalModules/asiPreventsParsingAsAmbientExternalModule02.ts (1 errors) ==== - - var declare: number; - var module: string; - - module container { - declare // this is the identifier 'declare' - module // this is the identifier 'module' - "my external module" // this is just a string - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. - { } // this is a block body - } \ No newline at end of file diff --git a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.js b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.js index 444b4b392c9..20e2693ba7f 100644 --- a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.js +++ b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.js @@ -13,3 +13,10 @@ module container { //// [asiPreventsParsingAsAmbientExternalModule02.js] var declare; var module; +var container; +(function (container) { + declare; // this is the identifier 'declare' + module; // this is the identifier 'module' + "my external module"; // this is just a string + { } // this is a block body +})(container || (container = {})); diff --git a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.symbols b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.symbols new file mode 100644 index 00000000000..ed97f39fc11 --- /dev/null +++ b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/externalModules/asiPreventsParsingAsAmbientExternalModule02.ts === + +var declare: number; +>declare : Symbol(declare, Decl(asiPreventsParsingAsAmbientExternalModule02.ts, 1, 3)) + +var module: string; +>module : Symbol(module, Decl(asiPreventsParsingAsAmbientExternalModule02.ts, 2, 3)) + +module container { +>container : Symbol(container, Decl(asiPreventsParsingAsAmbientExternalModule02.ts, 2, 19)) + + declare // this is the identifier 'declare' +>declare : Symbol(declare, Decl(asiPreventsParsingAsAmbientExternalModule02.ts, 1, 3)) + + module // this is the identifier 'module' +>module : Symbol(module, Decl(asiPreventsParsingAsAmbientExternalModule02.ts, 2, 3)) + + "my external module" // this is just a string + { } // this is a block body +} diff --git a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.types b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.types new file mode 100644 index 00000000000..67671853993 --- /dev/null +++ b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.types @@ -0,0 +1,22 @@ +=== tests/cases/conformance/externalModules/asiPreventsParsingAsAmbientExternalModule02.ts === + +var declare: number; +>declare : number + +var module: string; +>module : string + +module container { +>container : typeof container + + declare // this is the identifier 'declare' +>declare : number + + module // this is the identifier 'module' +>module : string + + "my external module" // this is just a string +>"my external module" : string + + { } // this is a block body +} diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace01.js b/tests/baselines/reference/asiPreventsParsingAsNamespace01.js index eed9769da69..282d9dd1c7c 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace01.js +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace01.js @@ -10,3 +10,6 @@ n // this is the identifier 'n' //// [asiPreventsParsingAsNamespace01.js] var namespace; var n; +namespace; // this is the identifier 'namespace' +n; // this is the identifier 'n' +{ } // this is a block body diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace01.symbols b/tests/baselines/reference/asiPreventsParsingAsNamespace01.symbols index a2494904bed..b196d733352 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace01.symbols +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace01.symbols @@ -4,10 +4,12 @@ var namespace: number; >namespace : Symbol(namespace, Decl(asiPreventsParsingAsNamespace01.ts, 1, 3)) var n: string; ->n : Symbol(n, Decl(asiPreventsParsingAsNamespace01.ts, 2, 3), Decl(asiPreventsParsingAsNamespace01.ts, 2, 14)) +>n : Symbol(n, Decl(asiPreventsParsingAsNamespace01.ts, 2, 3)) namespace // this is the identifier 'namespace' +>namespace : Symbol(namespace, Decl(asiPreventsParsingAsNamespace01.ts, 1, 3)) + n // this is the identifier 'n' ->n : Symbol(n, Decl(asiPreventsParsingAsNamespace01.ts, 2, 3), Decl(asiPreventsParsingAsNamespace01.ts, 2, 14)) +>n : Symbol(n, Decl(asiPreventsParsingAsNamespace01.ts, 2, 3)) { } // this is a block body diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace01.types b/tests/baselines/reference/asiPreventsParsingAsNamespace01.types index 87044c58066..417a96dbed4 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace01.types +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace01.types @@ -7,6 +7,8 @@ var n: string; >n : string namespace // this is the identifier 'namespace' +>namespace : number + n // this is the identifier 'n' >n : string diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace02.js b/tests/baselines/reference/asiPreventsParsingAsNamespace02.js index de2bdfa8a9e..514a026dc78 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace02.js +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace02.js @@ -10,3 +10,6 @@ m // this is the identifier 'm' //// [asiPreventsParsingAsNamespace02.js] var module; var m; +module; // this is the identifier 'namespace' +m; // this is the identifier 'm' +{ } // this is a block body diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace02.symbols b/tests/baselines/reference/asiPreventsParsingAsNamespace02.symbols index 70024a8de62..a3bb37c73bc 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace02.symbols +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace02.symbols @@ -4,10 +4,12 @@ var module: number; >module : Symbol(module, Decl(asiPreventsParsingAsNamespace02.ts, 1, 3)) var m: string; ->m : Symbol(m, Decl(asiPreventsParsingAsNamespace02.ts, 2, 3), Decl(asiPreventsParsingAsNamespace02.ts, 2, 14)) +>m : Symbol(m, Decl(asiPreventsParsingAsNamespace02.ts, 2, 3)) module // this is the identifier 'namespace' +>module : Symbol(module, Decl(asiPreventsParsingAsNamespace02.ts, 1, 3)) + m // this is the identifier 'm' ->m : Symbol(m, Decl(asiPreventsParsingAsNamespace02.ts, 2, 3), Decl(asiPreventsParsingAsNamespace02.ts, 2, 14)) +>m : Symbol(m, Decl(asiPreventsParsingAsNamespace02.ts, 2, 3)) { } // this is a block body diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace02.types b/tests/baselines/reference/asiPreventsParsingAsNamespace02.types index 8f6dec87a00..e9e1433be7a 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace02.types +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace02.types @@ -7,6 +7,8 @@ var m: string; >m : string module // this is the identifier 'namespace' +>module : number + m // this is the identifier 'm' >m : string diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace03.js b/tests/baselines/reference/asiPreventsParsingAsNamespace03.js index 6d8b8970977..3c27694f5ce 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace03.js +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace03.js @@ -12,3 +12,9 @@ namespace container { //// [asiPreventsParsingAsNamespace03.js] var namespace; var n; +var container; +(function (container) { + namespace; // this is the identifier 'namespace' + n; // this is the identifier 'n' + { } // this is a block body +})(container || (container = {})); diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace03.symbols b/tests/baselines/reference/asiPreventsParsingAsNamespace03.symbols index 8dfa30c17a4..e77d012a1bf 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace03.symbols +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace03.symbols @@ -10,8 +10,10 @@ namespace container { >container : Symbol(container, Decl(asiPreventsParsingAsNamespace03.ts, 2, 14)) namespace // this is the identifier 'namespace' +>namespace : Symbol(namespace, Decl(asiPreventsParsingAsNamespace03.ts, 1, 3)) + n // this is the identifier 'n' ->n : Symbol(n, Decl(asiPreventsParsingAsNamespace03.ts, 4, 21)) +>n : Symbol(n, Decl(asiPreventsParsingAsNamespace03.ts, 2, 3)) { } // this is a block body } diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace03.types b/tests/baselines/reference/asiPreventsParsingAsNamespace03.types index 37423757159..f119a789e11 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace03.types +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace03.types @@ -7,11 +7,13 @@ var n: string; >n : string namespace container { ->container : any +>container : typeof container namespace // this is the identifier 'namespace' +>namespace : number + n // this is the identifier 'n' ->n : any +>n : string { } // this is a block body } diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace04.errors.txt b/tests/baselines/reference/asiPreventsParsingAsNamespace04.errors.txt deleted file mode 100644 index d0a6be446aa..00000000000 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace04.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace04.ts(3,8): error TS1003: Identifier expected. - - -==== tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace04.ts (1 errors) ==== - - let module = 10; - module in {} - ~~ -!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace04.js b/tests/baselines/reference/asiPreventsParsingAsNamespace04.js index bcd8975d46d..704c8893e76 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace04.js +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace04.js @@ -5,4 +5,4 @@ module in {} //// [asiPreventsParsingAsNamespace04.js] var module = 10; - in {}; +module in {}; diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace04.symbols b/tests/baselines/reference/asiPreventsParsingAsNamespace04.symbols new file mode 100644 index 00000000000..60d1f8fcc48 --- /dev/null +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace04.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace04.ts === + +let module = 10; +>module : Symbol(module, Decl(asiPreventsParsingAsNamespace04.ts, 1, 3)) + +module in {} +>module : Symbol(module, Decl(asiPreventsParsingAsNamespace04.ts, 1, 3)) + diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace04.types b/tests/baselines/reference/asiPreventsParsingAsNamespace04.types new file mode 100644 index 00000000000..3fa2a448cf9 --- /dev/null +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace04.types @@ -0,0 +1,11 @@ +=== tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace04.ts === + +let module = 10; +>module : number +>10 : number + +module in {} +>module in {} : boolean +>module : number +>{} : {} + diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace05.js b/tests/baselines/reference/asiPreventsParsingAsNamespace05.js index 0a525179d2d..35f557328c0 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace05.js +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace05.js @@ -1,6 +1,9 @@ //// [asiPreventsParsingAsNamespace05.ts] let namespace = 10; +namespace a.b { + export let c = 20; +} namespace a.b.c @@ -9,3 +12,14 @@ a.b.c //// [asiPreventsParsingAsNamespace05.js] var namespace = 10; +var a; +(function (a) { + var b; + (function (b) { + b.c = 20; + })(b = a.b || (a.b = {})); +})(a || (a = {})); +namespace; +a.b.c; +{ +} diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace05.symbols b/tests/baselines/reference/asiPreventsParsingAsNamespace05.symbols index 65125806b61..47f05862b0a 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace05.symbols +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace05.symbols @@ -3,10 +3,22 @@ let namespace = 10; >namespace : Symbol(namespace, Decl(asiPreventsParsingAsNamespace05.ts, 1, 3)) -namespace -a.b.c +namespace a.b { >a : Symbol(a, Decl(asiPreventsParsingAsNamespace05.ts, 1, 19)) ->b : Symbol(b, Decl(asiPreventsParsingAsNamespace05.ts, 4, 2)) ->c : Symbol(c, Decl(asiPreventsParsingAsNamespace05.ts, 4, 4)) +>b : Symbol(b, Decl(asiPreventsParsingAsNamespace05.ts, 2, 12)) + + export let c = 20; +>c : Symbol(c, Decl(asiPreventsParsingAsNamespace05.ts, 3, 14)) +} + +namespace +>namespace : Symbol(namespace, Decl(asiPreventsParsingAsNamespace05.ts, 1, 3)) + +a.b.c +>a.b.c : Symbol(a.b.c, Decl(asiPreventsParsingAsNamespace05.ts, 3, 14)) +>a.b : Symbol(a.b, Decl(asiPreventsParsingAsNamespace05.ts, 2, 12)) +>a : Symbol(a, Decl(asiPreventsParsingAsNamespace05.ts, 1, 19)) +>b : Symbol(a.b, Decl(asiPreventsParsingAsNamespace05.ts, 2, 12)) +>c : Symbol(a.b.c, Decl(asiPreventsParsingAsNamespace05.ts, 3, 14)) { } diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace05.types b/tests/baselines/reference/asiPreventsParsingAsNamespace05.types index f17ad1f2a1e..515147c1096 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace05.types +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace05.types @@ -4,10 +4,23 @@ let namespace = 10; >namespace : number >10 : number +namespace a.b { +>a : typeof a +>b : typeof b + + export let c = 20; +>c : number +>20 : number +} + namespace +>namespace : number + a.b.c ->a : any ->b : any ->c : any +>a.b.c : number +>a.b : typeof a.b +>a : typeof a +>b : typeof a.b +>c : number { } diff --git a/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.js b/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.js index 33e3895fab4..b05988290cb 100644 --- a/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.js +++ b/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.js @@ -11,3 +11,5 @@ Foo = string; var type; var string; var Foo; +type; +Foo = string; diff --git a/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.symbols b/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.symbols index d11c9ff5c13..fa82d53ac70 100644 --- a/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.symbols +++ b/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.symbols @@ -7,9 +7,12 @@ var string; >string : Symbol(string, Decl(asiPreventsParsingAsTypeAlias01.ts, 2, 3)) var Foo; ->Foo : Symbol(Foo, Decl(asiPreventsParsingAsTypeAlias01.ts, 3, 3), Decl(asiPreventsParsingAsTypeAlias01.ts, 3, 8)) +>Foo : Symbol(Foo, Decl(asiPreventsParsingAsTypeAlias01.ts, 3, 3)) type -Foo = string; ->Foo : Symbol(Foo, Decl(asiPreventsParsingAsTypeAlias01.ts, 3, 3), Decl(asiPreventsParsingAsTypeAlias01.ts, 3, 8)) +>type : Symbol(type, Decl(asiPreventsParsingAsTypeAlias01.ts, 1, 3)) + +Foo = string; +>Foo : Symbol(Foo, Decl(asiPreventsParsingAsTypeAlias01.ts, 3, 3)) +>string : Symbol(string, Decl(asiPreventsParsingAsTypeAlias01.ts, 2, 3)) diff --git a/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.types b/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.types index d112022afa4..7492a698e3a 100644 --- a/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.types +++ b/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.types @@ -10,6 +10,10 @@ var Foo; >Foo : any type -Foo = string; ->Foo : string +>type : any + +Foo = string; +>Foo = string : any +>Foo : any +>string : any diff --git a/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.js b/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.js index 4a8298b2bdf..eae9898c8d4 100644 --- a/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.js +++ b/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.js @@ -13,3 +13,8 @@ namespace container { var type; var string; var Foo; +var container; +(function (container) { + type; + Foo = string; +})(container || (container = {})); diff --git a/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.symbols b/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.symbols index 0da88560109..4b83dba4c5d 100644 --- a/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.symbols +++ b/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.symbols @@ -13,6 +13,9 @@ namespace container { >container : Symbol(container, Decl(asiPreventsParsingAsTypeAlias02.ts, 3, 8)) type +>type : Symbol(type, Decl(asiPreventsParsingAsTypeAlias02.ts, 1, 3)) + Foo = string; ->Foo : Symbol(Foo, Decl(asiPreventsParsingAsTypeAlias02.ts, 5, 21)) +>Foo : Symbol(Foo, Decl(asiPreventsParsingAsTypeAlias02.ts, 3, 3)) +>string : Symbol(string, Decl(asiPreventsParsingAsTypeAlias02.ts, 2, 3)) } diff --git a/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.types b/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.types index 4af0721ec24..1e6c7a8caf1 100644 --- a/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.types +++ b/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.types @@ -10,9 +10,13 @@ var Foo; >Foo : any namespace container { ->container : any +>container : typeof container type +>type : any + Foo = string; ->Foo : string +>Foo = string : any +>Foo : any +>string : any } diff --git a/tests/baselines/reference/reservedNamesInAliases.errors.txt b/tests/baselines/reference/reservedNamesInAliases.errors.txt index 277e06111c4..5c17158053e 100644 --- a/tests/baselines/reference/reservedNamesInAliases.errors.txt +++ b/tests/baselines/reference/reservedNamesInAliases.errors.txt @@ -2,12 +2,13 @@ tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(2,6): error tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(3,6): error TS2457: Type alias name cannot be 'number' tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(4,6): error TS2457: Type alias name cannot be 'boolean' tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(5,6): error TS2457: Type alias name cannot be 'string' -tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,6): error TS1003: Identifier expected. -tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,11): error TS1005: ';' expected. +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,1): error TS2304: Cannot find name 'type'. +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,6): error TS1005: ';' expected. +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,11): error TS1109: Expression expected. tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,13): error TS2304: Cannot find name 'I'. -==== tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts (7 errors) ==== +==== tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts (8 errors) ==== interface I {} type any = I; ~~~ @@ -22,9 +23,11 @@ tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,13): error ~~~~~~ !!! error TS2457: Type alias name cannot be 'string' type void = I; + ~~~~ +!!! error TS2304: Cannot find name 'type'. ~~~~ -!!! error TS1003: Identifier expected. - ~ !!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. ~ !!! error TS2304: Cannot find name 'I'. \ No newline at end of file diff --git a/tests/baselines/reference/reservedNamesInAliases.js b/tests/baselines/reference/reservedNamesInAliases.js index 773cc3ca84a..4ebc3bdb95f 100644 --- a/tests/baselines/reference/reservedNamesInAliases.js +++ b/tests/baselines/reference/reservedNamesInAliases.js @@ -7,4 +7,6 @@ type string = I; type void = I; //// [reservedNamesInAliases.js] +type; +void ; I; diff --git a/tests/baselines/reference/reservedWords2.errors.txt b/tests/baselines/reference/reservedWords2.errors.txt index 471eef4710a..090b2d0d43e 100644 --- a/tests/baselines/reference/reservedWords2.errors.txt +++ b/tests/baselines/reference/reservedWords2.errors.txt @@ -13,8 +13,8 @@ tests/cases/compiler/reservedWords2.ts(4,12): error TS1109: Expression expected. tests/cases/compiler/reservedWords2.ts(5,9): error TS2300: Duplicate identifier '(Missing)'. tests/cases/compiler/reservedWords2.ts(5,10): error TS1003: Identifier expected. tests/cases/compiler/reservedWords2.ts(5,18): error TS1005: '=>' expected. -tests/cases/compiler/reservedWords2.ts(6,7): error TS2300: Duplicate identifier '(Missing)'. -tests/cases/compiler/reservedWords2.ts(6,8): error TS1003: Identifier expected. +tests/cases/compiler/reservedWords2.ts(6,1): error TS2304: Cannot find name 'module'. +tests/cases/compiler/reservedWords2.ts(6,8): error TS1005: ';' expected. tests/cases/compiler/reservedWords2.ts(7,11): error TS2300: Duplicate identifier '(Missing)'. tests/cases/compiler/reservedWords2.ts(7,11): error TS1005: ':' expected. tests/cases/compiler/reservedWords2.ts(7,19): error TS2300: Duplicate identifier '(Missing)'. @@ -68,10 +68,10 @@ tests/cases/compiler/reservedWords2.ts(10,6): error TS1003: Identifier expected. ~ !!! error TS1005: '=>' expected. module void {} - -!!! error TS2300: Duplicate identifier '(Missing)'. + ~~~~~~ +!!! error TS2304: Cannot find name 'module'. ~~~~ -!!! error TS1003: Identifier expected. +!!! error TS1005: ';' expected. var {while, return} = { while: 1, return: 2 }; !!! error TS2300: Duplicate identifier '(Missing)'. diff --git a/tests/baselines/reference/reservedWords2.js b/tests/baselines/reference/reservedWords2.js index 6d5a5f530c5..fb90a718ec3 100644 --- a/tests/baselines/reference/reservedWords2.js +++ b/tests/baselines/reference/reservedWords2.js @@ -23,6 +23,7 @@ var ; typeof ; 10; throw function () { }; +module; void {}; var _a = { while: 1, return: 2 }, = _a.while, = _a.return; var _b = { this: 1, switch: { continue: 2 } }, = _b.this, = _b.switch.continue;