From b518dc1e5b3126390d14a34236748c6ba6778502 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 18 Jun 2015 13:56:21 -0700 Subject: [PATCH] Accepting new baselines --- .../anonymousClassExpression1.errors.txt | 9 ----- .../anonymousClassExpression1.symbols | 6 +++ .../reference/anonymousClassExpression1.types | 10 +++++ .../reference/classExpression.errors.txt | 24 ----------- .../reference/classExpression.symbols | 23 +++++++++++ .../baselines/reference/classExpression.types | 27 +++++++++++++ .../reference/classExpression1.errors.txt | 7 ---- .../reference/classExpression1.symbols | 5 +++ .../reference/classExpression1.types | 6 +++ .../reference/classExpression2.errors.txt | 8 ---- tests/baselines/reference/classExpression2.js | 5 +++ .../reference/classExpression2.symbols | 9 +++++ .../reference/classExpression2.types | 10 +++++ .../reference/classExpressionES61.errors.txt | 7 ---- .../reference/classExpressionES61.symbols | 5 +++ .../reference/classExpressionES61.types | 6 +++ .../reference/classExpressionES62.errors.txt | 8 ---- .../reference/classExpressionES62.symbols | 9 +++++ .../reference/classExpressionES62.types | 10 +++++ .../reference/classExpressionTest2.errors.txt | 21 ---------- .../reference/classExpressionTest2.symbols | 36 +++++++++++++++++ .../reference/classExpressionTest2.types | 40 +++++++++++++++++++ ...solutionOfNamespaceOfSameName01.errors.txt | 14 ------- ...hResolutionOfNamespaceOfSameName01.symbols | 18 +++++++++ ...ithResolutionOfNamespaceOfSameName01.types | 19 +++++++++ ...ExpressionWithStaticProperties1.errors.txt | 7 ---- ...assExpressionWithStaticProperties1.symbols | 7 ++++ ...classExpressionWithStaticProperties1.types | 10 +++++ ...ExpressionWithStaticProperties2.errors.txt | 7 ---- ...assExpressionWithStaticProperties2.symbols | 7 ++++ ...classExpressionWithStaticProperties2.types | 9 +++++ ...ressionWithStaticPropertiesES61.errors.txt | 7 ---- ...ExpressionWithStaticPropertiesES61.symbols | 7 ++++ ...ssExpressionWithStaticPropertiesES61.types | 10 +++++ ...ressionWithStaticPropertiesES62.errors.txt | 7 ---- ...ExpressionWithStaticPropertiesES62.symbols | 7 ++++ ...ssExpressionWithStaticPropertiesES62.types | 9 +++++ .../exportAssignNonIdentifier.errors.txt | 5 +-- .../reference/generatorTypeCheck55.errors.txt | 11 +++-- .../reference/generatorTypeCheck56.errors.txt | 5 +-- .../strictModeReservedWord.errors.txt | 6 +-- .../reference/strictModeReservedWord.js | 5 +++ 42 files changed, 327 insertions(+), 141 deletions(-) delete mode 100644 tests/baselines/reference/anonymousClassExpression1.errors.txt create mode 100644 tests/baselines/reference/anonymousClassExpression1.symbols create mode 100644 tests/baselines/reference/anonymousClassExpression1.types delete mode 100644 tests/baselines/reference/classExpression.errors.txt create mode 100644 tests/baselines/reference/classExpression.symbols create mode 100644 tests/baselines/reference/classExpression.types delete mode 100644 tests/baselines/reference/classExpression1.errors.txt create mode 100644 tests/baselines/reference/classExpression1.symbols create mode 100644 tests/baselines/reference/classExpression1.types delete mode 100644 tests/baselines/reference/classExpression2.errors.txt create mode 100644 tests/baselines/reference/classExpression2.symbols create mode 100644 tests/baselines/reference/classExpression2.types delete mode 100644 tests/baselines/reference/classExpressionES61.errors.txt create mode 100644 tests/baselines/reference/classExpressionES61.symbols create mode 100644 tests/baselines/reference/classExpressionES61.types delete mode 100644 tests/baselines/reference/classExpressionES62.errors.txt create mode 100644 tests/baselines/reference/classExpressionES62.symbols create mode 100644 tests/baselines/reference/classExpressionES62.types delete mode 100644 tests/baselines/reference/classExpressionTest2.errors.txt create mode 100644 tests/baselines/reference/classExpressionTest2.symbols create mode 100644 tests/baselines/reference/classExpressionTest2.types delete mode 100644 tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.errors.txt create mode 100644 tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.symbols create mode 100644 tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.types delete mode 100644 tests/baselines/reference/classExpressionWithStaticProperties1.errors.txt create mode 100644 tests/baselines/reference/classExpressionWithStaticProperties1.symbols create mode 100644 tests/baselines/reference/classExpressionWithStaticProperties1.types delete mode 100644 tests/baselines/reference/classExpressionWithStaticProperties2.errors.txt create mode 100644 tests/baselines/reference/classExpressionWithStaticProperties2.symbols create mode 100644 tests/baselines/reference/classExpressionWithStaticProperties2.types delete mode 100644 tests/baselines/reference/classExpressionWithStaticPropertiesES61.errors.txt create mode 100644 tests/baselines/reference/classExpressionWithStaticPropertiesES61.symbols create mode 100644 tests/baselines/reference/classExpressionWithStaticPropertiesES61.types delete mode 100644 tests/baselines/reference/classExpressionWithStaticPropertiesES62.errors.txt create mode 100644 tests/baselines/reference/classExpressionWithStaticPropertiesES62.symbols create mode 100644 tests/baselines/reference/classExpressionWithStaticPropertiesES62.types diff --git a/tests/baselines/reference/anonymousClassExpression1.errors.txt b/tests/baselines/reference/anonymousClassExpression1.errors.txt deleted file mode 100644 index db4c5b4ce3..0000000000 --- a/tests/baselines/reference/anonymousClassExpression1.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -tests/cases/compiler/anonymousClassExpression1.ts(2,19): error TS9003: 'class' expressions are not currently supported. - - -==== tests/cases/compiler/anonymousClassExpression1.ts (1 errors) ==== - function f() { - return typeof class {} === "function"; - ~~~~~ -!!! error TS9003: 'class' expressions are not currently supported. - } \ No newline at end of file diff --git a/tests/baselines/reference/anonymousClassExpression1.symbols b/tests/baselines/reference/anonymousClassExpression1.symbols new file mode 100644 index 0000000000..114bfc9609 --- /dev/null +++ b/tests/baselines/reference/anonymousClassExpression1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/anonymousClassExpression1.ts === +function f() { +>f : Symbol(f, Decl(anonymousClassExpression1.ts, 0, 0)) + + return typeof class {} === "function"; +} diff --git a/tests/baselines/reference/anonymousClassExpression1.types b/tests/baselines/reference/anonymousClassExpression1.types new file mode 100644 index 0000000000..1e38399f01 --- /dev/null +++ b/tests/baselines/reference/anonymousClassExpression1.types @@ -0,0 +1,10 @@ +=== tests/cases/compiler/anonymousClassExpression1.ts === +function f() { +>f : () => boolean + + return typeof class {} === "function"; +>typeof class {} === "function" : boolean +>typeof class {} : string +>class {} : typeof (Anonymous class) +>"function" : string +} diff --git a/tests/baselines/reference/classExpression.errors.txt b/tests/baselines/reference/classExpression.errors.txt deleted file mode 100644 index c8266d0e87..0000000000 --- a/tests/baselines/reference/classExpression.errors.txt +++ /dev/null @@ -1,24 +0,0 @@ -tests/cases/conformance/classes/classExpression.ts(1,15): error TS9003: 'class' expressions are not currently supported. -tests/cases/conformance/classes/classExpression.ts(5,16): error TS9003: 'class' expressions are not currently supported. -tests/cases/conformance/classes/classExpression.ts(10,19): error TS9003: 'class' expressions are not currently supported. - - -==== tests/cases/conformance/classes/classExpression.ts (3 errors) ==== - var x = class C { - ~ -!!! error TS9003: 'class' expressions are not currently supported. - } - - var y = { - foo: class C2 { - ~~ -!!! error TS9003: 'class' expressions are not currently supported. - } - } - - module M { - var z = class C4 { - ~~ -!!! error TS9003: 'class' expressions are not currently supported. - } - } \ No newline at end of file diff --git a/tests/baselines/reference/classExpression.symbols b/tests/baselines/reference/classExpression.symbols new file mode 100644 index 0000000000..f4d4423649 --- /dev/null +++ b/tests/baselines/reference/classExpression.symbols @@ -0,0 +1,23 @@ +=== tests/cases/conformance/classes/classExpression.ts === +var x = class C { +>x : Symbol(x, Decl(classExpression.ts, 0, 3)) +>C : Symbol(C, Decl(classExpression.ts, 0, 7)) +} + +var y = { +>y : Symbol(y, Decl(classExpression.ts, 3, 3)) + + foo: class C2 { +>foo : Symbol(foo, Decl(classExpression.ts, 3, 9)) +>C2 : Symbol(C2, Decl(classExpression.ts, 4, 8)) + } +} + +module M { +>M : Symbol(M, Decl(classExpression.ts, 6, 1)) + + var z = class C4 { +>z : Symbol(z, Decl(classExpression.ts, 9, 7)) +>C4 : Symbol(C4, Decl(classExpression.ts, 9, 11)) + } +} diff --git a/tests/baselines/reference/classExpression.types b/tests/baselines/reference/classExpression.types new file mode 100644 index 0000000000..1c55ce8954 --- /dev/null +++ b/tests/baselines/reference/classExpression.types @@ -0,0 +1,27 @@ +=== tests/cases/conformance/classes/classExpression.ts === +var x = class C { +>x : typeof C +>class C {} : typeof C +>C : typeof C +} + +var y = { +>y : { foo: typeof C2; } +>{ foo: class C2 { }} : { foo: typeof C2; } + + foo: class C2 { +>foo : typeof C2 +>class C2 { } : typeof C2 +>C2 : typeof C2 + } +} + +module M { +>M : typeof M + + var z = class C4 { +>z : typeof C4 +>class C4 { } : typeof C4 +>C4 : typeof C4 + } +} diff --git a/tests/baselines/reference/classExpression1.errors.txt b/tests/baselines/reference/classExpression1.errors.txt deleted file mode 100644 index 9d7d14d857..0000000000 --- a/tests/baselines/reference/classExpression1.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -tests/cases/conformance/classes/classExpressions/classExpression1.ts(1,15): error TS9003: 'class' expressions are not currently supported. - - -==== tests/cases/conformance/classes/classExpressions/classExpression1.ts (1 errors) ==== - var v = class C {}; - ~ -!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpression1.symbols b/tests/baselines/reference/classExpression1.symbols new file mode 100644 index 0000000000..8d3bad269b --- /dev/null +++ b/tests/baselines/reference/classExpression1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/classes/classExpressions/classExpression1.ts === +var v = class C {}; +>v : Symbol(v, Decl(classExpression1.ts, 0, 3)) +>C : Symbol(C, Decl(classExpression1.ts, 0, 7)) + diff --git a/tests/baselines/reference/classExpression1.types b/tests/baselines/reference/classExpression1.types new file mode 100644 index 0000000000..4bea318311 --- /dev/null +++ b/tests/baselines/reference/classExpression1.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/classes/classExpressions/classExpression1.ts === +var v = class C {}; +>v : typeof C +>class C {} : typeof C +>C : typeof C + diff --git a/tests/baselines/reference/classExpression2.errors.txt b/tests/baselines/reference/classExpression2.errors.txt deleted file mode 100644 index e2f3ccd77c..0000000000 --- a/tests/baselines/reference/classExpression2.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -tests/cases/conformance/classes/classExpressions/classExpression2.ts(2,15): error TS9003: 'class' expressions are not currently supported. - - -==== tests/cases/conformance/classes/classExpressions/classExpression2.ts (1 errors) ==== - class D { } - var v = class C extends D {}; - ~ -!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpression2.js b/tests/baselines/reference/classExpression2.js index 4220b88fb1..f74bb8bd5e 100644 --- a/tests/baselines/reference/classExpression2.js +++ b/tests/baselines/reference/classExpression2.js @@ -3,6 +3,11 @@ class D { } var v = class C extends D {}; //// [classExpression2.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; var D = (function () { function D() { } diff --git a/tests/baselines/reference/classExpression2.symbols b/tests/baselines/reference/classExpression2.symbols new file mode 100644 index 0000000000..11c78a2cad --- /dev/null +++ b/tests/baselines/reference/classExpression2.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/classes/classExpressions/classExpression2.ts === +class D { } +>D : Symbol(D, Decl(classExpression2.ts, 0, 0)) + +var v = class C extends D {}; +>v : Symbol(v, Decl(classExpression2.ts, 1, 3)) +>C : Symbol(C, Decl(classExpression2.ts, 1, 7)) +>D : Symbol(D, Decl(classExpression2.ts, 0, 0)) + diff --git a/tests/baselines/reference/classExpression2.types b/tests/baselines/reference/classExpression2.types new file mode 100644 index 0000000000..4dd6595fb4 --- /dev/null +++ b/tests/baselines/reference/classExpression2.types @@ -0,0 +1,10 @@ +=== tests/cases/conformance/classes/classExpressions/classExpression2.ts === +class D { } +>D : D + +var v = class C extends D {}; +>v : typeof C +>class C extends D {} : typeof C +>C : typeof C +>D : D + diff --git a/tests/baselines/reference/classExpressionES61.errors.txt b/tests/baselines/reference/classExpressionES61.errors.txt deleted file mode 100644 index abaa5ab893..0000000000 --- a/tests/baselines/reference/classExpressionES61.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -tests/cases/conformance/es6/classExpressions/classExpressionES61.ts(1,15): error TS9003: 'class' expressions are not currently supported. - - -==== tests/cases/conformance/es6/classExpressions/classExpressionES61.ts (1 errors) ==== - var v = class C {}; - ~ -!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionES61.symbols b/tests/baselines/reference/classExpressionES61.symbols new file mode 100644 index 0000000000..1f49229fbc --- /dev/null +++ b/tests/baselines/reference/classExpressionES61.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/classExpressions/classExpressionES61.ts === +var v = class C {}; +>v : Symbol(v, Decl(classExpressionES61.ts, 0, 3)) +>C : Symbol(C, Decl(classExpressionES61.ts, 0, 7)) + diff --git a/tests/baselines/reference/classExpressionES61.types b/tests/baselines/reference/classExpressionES61.types new file mode 100644 index 0000000000..e04570308e --- /dev/null +++ b/tests/baselines/reference/classExpressionES61.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/classExpressions/classExpressionES61.ts === +var v = class C {}; +>v : typeof C +>class C {} : typeof C +>C : typeof C + diff --git a/tests/baselines/reference/classExpressionES62.errors.txt b/tests/baselines/reference/classExpressionES62.errors.txt deleted file mode 100644 index 1e28367a17..0000000000 --- a/tests/baselines/reference/classExpressionES62.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -tests/cases/conformance/es6/classExpressions/classExpressionES62.ts(2,15): error TS9003: 'class' expressions are not currently supported. - - -==== tests/cases/conformance/es6/classExpressions/classExpressionES62.ts (1 errors) ==== - class D { } - var v = class C extends D {}; - ~ -!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionES62.symbols b/tests/baselines/reference/classExpressionES62.symbols new file mode 100644 index 0000000000..18e1a48ca3 --- /dev/null +++ b/tests/baselines/reference/classExpressionES62.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/classExpressions/classExpressionES62.ts === +class D { } +>D : Symbol(D, Decl(classExpressionES62.ts, 0, 0)) + +var v = class C extends D {}; +>v : Symbol(v, Decl(classExpressionES62.ts, 1, 3)) +>C : Symbol(C, Decl(classExpressionES62.ts, 1, 7)) +>D : Symbol(D, Decl(classExpressionES62.ts, 0, 0)) + diff --git a/tests/baselines/reference/classExpressionES62.types b/tests/baselines/reference/classExpressionES62.types new file mode 100644 index 0000000000..8bb4e1a39f --- /dev/null +++ b/tests/baselines/reference/classExpressionES62.types @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/classExpressions/classExpressionES62.ts === +class D { } +>D : D + +var v = class C extends D {}; +>v : typeof C +>class C extends D {} : typeof C +>C : typeof C +>D : D + diff --git a/tests/baselines/reference/classExpressionTest2.errors.txt b/tests/baselines/reference/classExpressionTest2.errors.txt deleted file mode 100644 index 424eb59061..0000000000 --- a/tests/baselines/reference/classExpressionTest2.errors.txt +++ /dev/null @@ -1,21 +0,0 @@ -tests/cases/compiler/classExpressionTest2.ts(2,19): error TS9003: 'class' expressions are not currently supported. -tests/cases/compiler/classExpressionTest2.ts(5,20): error TS2304: Cannot find name 'X'. - - -==== tests/cases/compiler/classExpressionTest2.ts (2 errors) ==== - function M() { - var m = class C { - ~ -!!! error TS9003: 'class' expressions are not currently supported. - f() { - var t: T; - var x: X; - ~ -!!! error TS2304: Cannot find name 'X'. - return { t, x }; - } - } - - var v = new m(); - return v.f(); - } \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionTest2.symbols b/tests/baselines/reference/classExpressionTest2.symbols new file mode 100644 index 0000000000..62143cf0b9 --- /dev/null +++ b/tests/baselines/reference/classExpressionTest2.symbols @@ -0,0 +1,36 @@ +=== tests/cases/compiler/classExpressionTest2.ts === +function M() { +>M : Symbol(M, Decl(classExpressionTest2.ts, 0, 0)) + + var m = class C { +>m : Symbol(m, Decl(classExpressionTest2.ts, 1, 7)) +>C : Symbol(C, Decl(classExpressionTest2.ts, 1, 11)) +>X : Symbol(X, Decl(classExpressionTest2.ts, 1, 20)) + + f() { +>f : Symbol(C.f, Decl(classExpressionTest2.ts, 1, 24)) +>T : Symbol(T, Decl(classExpressionTest2.ts, 2, 10)) + + var t: T; +>t : Symbol(t, Decl(classExpressionTest2.ts, 3, 15)) +>T : Symbol(T, Decl(classExpressionTest2.ts, 2, 10)) + + var x: X; +>x : Symbol(x, Decl(classExpressionTest2.ts, 4, 15)) +>X : Symbol(X, Decl(classExpressionTest2.ts, 1, 20)) + + return { t, x }; +>t : Symbol(t, Decl(classExpressionTest2.ts, 5, 20)) +>x : Symbol(x, Decl(classExpressionTest2.ts, 5, 23)) + } + } + + var v = new m(); +>v : Symbol(v, Decl(classExpressionTest2.ts, 9, 7)) +>m : Symbol(m, Decl(classExpressionTest2.ts, 1, 7)) + + return v.f(); +>v.f : Symbol(C.f, Decl(classExpressionTest2.ts, 1, 24)) +>v : Symbol(v, Decl(classExpressionTest2.ts, 9, 7)) +>f : Symbol(C.f, Decl(classExpressionTest2.ts, 1, 24)) +} diff --git a/tests/baselines/reference/classExpressionTest2.types b/tests/baselines/reference/classExpressionTest2.types new file mode 100644 index 0000000000..5586b451d3 --- /dev/null +++ b/tests/baselines/reference/classExpressionTest2.types @@ -0,0 +1,40 @@ +=== tests/cases/compiler/classExpressionTest2.ts === +function M() { +>M : () => { t: string; x: number; } + + var m = class C { +>m : typeof C +>class C { f() { var t: T; var x: X; return { t, x }; } } : typeof C +>C : typeof C +>X : X + + f() { +>f : () => { t: T; x: X; } +>T : T + + var t: T; +>t : T +>T : T + + var x: X; +>x : X +>X : X + + return { t, x }; +>{ t, x } : { t: T; x: X; } +>t : T +>x : X + } + } + + var v = new m(); +>v : +>new m() : +>m : typeof C + + return v.f(); +>v.f() : { t: string; x: number; } +>v.f : () => { t: T; x: number; } +>v : +>f : () => { t: T; x: number; } +} diff --git a/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.errors.txt b/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.errors.txt deleted file mode 100644 index 8edc1d8f74..0000000000 --- a/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -tests/cases/compiler/classExpressionWithResolutionOfNamespaceOfSameName01.ts(6,15): error TS9003: 'class' expressions are not currently supported. - - -==== tests/cases/compiler/classExpressionWithResolutionOfNamespaceOfSameName01.ts (1 errors) ==== - namespace C { - export interface type { - } - } - - var x = class C { - ~ -!!! error TS9003: 'class' expressions are not currently supported. - prop: C.type; - } \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.symbols b/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.symbols new file mode 100644 index 0000000000..fcd4f0388d --- /dev/null +++ b/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/classExpressionWithResolutionOfNamespaceOfSameName01.ts === +namespace C { +>C : Symbol(C, Decl(classExpressionWithResolutionOfNamespaceOfSameName01.ts, 0, 0)) + + export interface type { +>type : Symbol(type, Decl(classExpressionWithResolutionOfNamespaceOfSameName01.ts, 0, 13)) + } +} + +var x = class C { +>x : Symbol(x, Decl(classExpressionWithResolutionOfNamespaceOfSameName01.ts, 5, 3)) +>C : Symbol(C, Decl(classExpressionWithResolutionOfNamespaceOfSameName01.ts, 5, 7)) + + prop: C.type; +>prop : Symbol(C.prop, Decl(classExpressionWithResolutionOfNamespaceOfSameName01.ts, 5, 17)) +>C : Symbol(C, Decl(classExpressionWithResolutionOfNamespaceOfSameName01.ts, 0, 0)) +>type : Symbol(C.type, Decl(classExpressionWithResolutionOfNamespaceOfSameName01.ts, 0, 13)) +} diff --git a/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.types b/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.types new file mode 100644 index 0000000000..643cf65d2e --- /dev/null +++ b/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.types @@ -0,0 +1,19 @@ +=== tests/cases/compiler/classExpressionWithResolutionOfNamespaceOfSameName01.ts === +namespace C { +>C : any + + export interface type { +>type : type + } +} + +var x = class C { +>x : typeof C +>class C { prop: C.type;} : typeof C +>C : typeof C + + prop: C.type; +>prop : C.type +>C : any +>type : C.type +} diff --git a/tests/baselines/reference/classExpressionWithStaticProperties1.errors.txt b/tests/baselines/reference/classExpressionWithStaticProperties1.errors.txt deleted file mode 100644 index 28e42dd33f..0000000000 --- a/tests/baselines/reference/classExpressionWithStaticProperties1.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -tests/cases/compiler/classExpressionWithStaticProperties1.ts(1,15): error TS9003: 'class' expressions are not currently supported. - - -==== tests/cases/compiler/classExpressionWithStaticProperties1.ts (1 errors) ==== - var v = class C { static a = 1; static b = 2 }; - ~ -!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithStaticProperties1.symbols b/tests/baselines/reference/classExpressionWithStaticProperties1.symbols new file mode 100644 index 0000000000..d4c811daeb --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/classExpressionWithStaticProperties1.ts === +var v = class C { static a = 1; static b = 2 }; +>v : Symbol(v, Decl(classExpressionWithStaticProperties1.ts, 0, 3)) +>C : Symbol(C, Decl(classExpressionWithStaticProperties1.ts, 0, 7)) +>a : Symbol(C.a, Decl(classExpressionWithStaticProperties1.ts, 0, 17)) +>b : Symbol(C.b, Decl(classExpressionWithStaticProperties1.ts, 0, 31)) + diff --git a/tests/baselines/reference/classExpressionWithStaticProperties1.types b/tests/baselines/reference/classExpressionWithStaticProperties1.types new file mode 100644 index 0000000000..b014f78abf --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties1.types @@ -0,0 +1,10 @@ +=== tests/cases/compiler/classExpressionWithStaticProperties1.ts === +var v = class C { static a = 1; static b = 2 }; +>v : typeof C +>class C { static a = 1; static b = 2 } : typeof C +>C : typeof C +>a : number +>1 : number +>b : number +>2 : number + diff --git a/tests/baselines/reference/classExpressionWithStaticProperties2.errors.txt b/tests/baselines/reference/classExpressionWithStaticProperties2.errors.txt deleted file mode 100644 index 9a915f7019..0000000000 --- a/tests/baselines/reference/classExpressionWithStaticProperties2.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -tests/cases/compiler/classExpressionWithStaticProperties2.ts(1,15): error TS9003: 'class' expressions are not currently supported. - - -==== tests/cases/compiler/classExpressionWithStaticProperties2.ts (1 errors) ==== - var v = class C { static a = 1; static b }; - ~ -!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithStaticProperties2.symbols b/tests/baselines/reference/classExpressionWithStaticProperties2.symbols new file mode 100644 index 0000000000..480123a1c3 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/classExpressionWithStaticProperties2.ts === +var v = class C { static a = 1; static b }; +>v : Symbol(v, Decl(classExpressionWithStaticProperties2.ts, 0, 3)) +>C : Symbol(C, Decl(classExpressionWithStaticProperties2.ts, 0, 7)) +>a : Symbol(C.a, Decl(classExpressionWithStaticProperties2.ts, 0, 17)) +>b : Symbol(C.b, Decl(classExpressionWithStaticProperties2.ts, 0, 31)) + diff --git a/tests/baselines/reference/classExpressionWithStaticProperties2.types b/tests/baselines/reference/classExpressionWithStaticProperties2.types new file mode 100644 index 0000000000..9bfd673235 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties2.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/classExpressionWithStaticProperties2.ts === +var v = class C { static a = 1; static b }; +>v : typeof C +>class C { static a = 1; static b } : typeof C +>C : typeof C +>a : number +>1 : number +>b : any + diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES61.errors.txt b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.errors.txt deleted file mode 100644 index bc015a3d8f..0000000000 --- a/tests/baselines/reference/classExpressionWithStaticPropertiesES61.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -tests/cases/compiler/classExpressionWithStaticPropertiesES61.ts(1,15): error TS9003: 'class' expressions are not currently supported. - - -==== tests/cases/compiler/classExpressionWithStaticPropertiesES61.ts (1 errors) ==== - var v = class C { static a = 1; static b = 2 }; - ~ -!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES61.symbols b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.symbols new file mode 100644 index 0000000000..c5f53e19bf --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/classExpressionWithStaticPropertiesES61.ts === +var v = class C { static a = 1; static b = 2 }; +>v : Symbol(v, Decl(classExpressionWithStaticPropertiesES61.ts, 0, 3)) +>C : Symbol(C, Decl(classExpressionWithStaticPropertiesES61.ts, 0, 7)) +>a : Symbol(C.a, Decl(classExpressionWithStaticPropertiesES61.ts, 0, 17)) +>b : Symbol(C.b, Decl(classExpressionWithStaticPropertiesES61.ts, 0, 31)) + diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES61.types b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.types new file mode 100644 index 0000000000..02c385b752 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.types @@ -0,0 +1,10 @@ +=== tests/cases/compiler/classExpressionWithStaticPropertiesES61.ts === +var v = class C { static a = 1; static b = 2 }; +>v : typeof C +>class C { static a = 1; static b = 2 } : typeof C +>C : typeof C +>a : number +>1 : number +>b : number +>2 : number + diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.errors.txt b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.errors.txt deleted file mode 100644 index bed4b2c01a..0000000000 --- a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts(1,15): error TS9003: 'class' expressions are not currently supported. - - -==== tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts (1 errors) ==== - var v = class C { static a = 1; static b }; - ~ -!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.symbols b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.symbols new file mode 100644 index 0000000000..be57a289f5 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts === +var v = class C { static a = 1; static b }; +>v : Symbol(v, Decl(classExpressionWithStaticPropertiesES62.ts, 0, 3)) +>C : Symbol(C, Decl(classExpressionWithStaticPropertiesES62.ts, 0, 7)) +>a : Symbol(C.a, Decl(classExpressionWithStaticPropertiesES62.ts, 0, 17)) +>b : Symbol(C.b, Decl(classExpressionWithStaticPropertiesES62.ts, 0, 31)) + diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.types b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.types new file mode 100644 index 0000000000..e8ded1422f --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts === +var v = class C { static a = 1; static b }; +>v : typeof C +>class C { static a = 1; static b } : typeof C +>C : typeof C +>a : number +>1 : number +>b : any + diff --git a/tests/baselines/reference/exportAssignNonIdentifier.errors.txt b/tests/baselines/reference/exportAssignNonIdentifier.errors.txt index 09e86ec12c..c3d58c9b36 100644 --- a/tests/baselines/reference/exportAssignNonIdentifier.errors.txt +++ b/tests/baselines/reference/exportAssignNonIdentifier.errors.txt @@ -1,5 +1,4 @@ tests/cases/conformance/externalModules/foo1.ts(2,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. -tests/cases/conformance/externalModules/foo3.ts(1,16): error TS9003: 'class' expressions are not currently supported. tests/cases/conformance/externalModules/foo6.ts(1,14): error TS1109: Expression expected. @@ -12,10 +11,8 @@ tests/cases/conformance/externalModules/foo6.ts(1,14): error TS1109: Expression ==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ==== export = "sausages"; // Ok -==== tests/cases/conformance/externalModules/foo3.ts (1 errors) ==== +==== tests/cases/conformance/externalModules/foo3.ts (0 errors) ==== export = class Foo3 {}; // Error, not an expression - ~~~~ -!!! error TS9003: 'class' expressions are not currently supported. ==== tests/cases/conformance/externalModules/foo4.ts (0 errors) ==== export = true; // Ok diff --git a/tests/baselines/reference/generatorTypeCheck55.errors.txt b/tests/baselines/reference/generatorTypeCheck55.errors.txt index 0846d1c28a..854c1801ef 100644 --- a/tests/baselines/reference/generatorTypeCheck55.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck55.errors.txt @@ -1,9 +1,12 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck55.ts(2,19): error TS9003: 'class' expressions are not currently supported. +tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck55.ts(2,29): error TS2507: Type 'any' is not a constructor function type. +tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck55.ts(2,30): error TS1163: A 'yield' expression is only allowed in a generator body. -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck55.ts (1 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck55.ts (2 errors) ==== function* g() { var x = class C extends (yield) {}; - ~ -!!! error TS9003: 'class' expressions are not currently supported. + ~~~~~~~ +!!! error TS2507: Type 'any' is not a constructor function type. + ~~~~~ +!!! error TS1163: A 'yield' expression is only allowed in a generator body. } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck56.errors.txt b/tests/baselines/reference/generatorTypeCheck56.errors.txt index 99e3b00de4..2096193580 100644 --- a/tests/baselines/reference/generatorTypeCheck56.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck56.errors.txt @@ -1,12 +1,9 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck56.ts(2,19): error TS9003: 'class' expressions are not currently supported. tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck56.ts(3,11): error TS1163: A 'yield' expression is only allowed in a generator body. -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck56.ts (2 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck56.ts (1 errors) ==== function* g() { var x = class C { - ~ -!!! error TS9003: 'class' expressions are not currently supported. *[yield 0]() { ~~~~~ !!! error TS1163: A 'yield' expression is only allowed in a generator body. diff --git a/tests/baselines/reference/strictModeReservedWord.errors.txt b/tests/baselines/reference/strictModeReservedWord.errors.txt index b6e9161ce7..6f6a387429 100644 --- a/tests/baselines/reference/strictModeReservedWord.errors.txt +++ b/tests/baselines/reference/strictModeReservedWord.errors.txt @@ -17,8 +17,8 @@ tests/cases/compiler/strictModeReservedWord.ts(13,11): error TS1212: Identifier tests/cases/compiler/strictModeReservedWord.ts(13,20): error TS1212: Identifier expected. 'public' is a reserved word in strict mode tests/cases/compiler/strictModeReservedWord.ts(13,28): error TS1212: Identifier expected. 'package' is a reserved word in strict mode tests/cases/compiler/strictModeReservedWord.ts(15,25): error TS1213: Identifier expected. 'package' is a reserved word in strict mode. Class definitions are automatically in strict mode. -tests/cases/compiler/strictModeReservedWord.ts(15,25): error TS9003: 'class' expressions are not currently supported. tests/cases/compiler/strictModeReservedWord.ts(15,41): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/compiler/strictModeReservedWord.ts(15,41): error TS2507: Type 'number' is not a constructor function type. tests/cases/compiler/strictModeReservedWord.ts(17,9): error TS2300: Duplicate identifier 'b'. tests/cases/compiler/strictModeReservedWord.ts(17,12): error TS1212: Identifier expected. 'public' is a reserved word in strict mode tests/cases/compiler/strictModeReservedWord.ts(17,12): error TS2503: Cannot find namespace 'public'. @@ -95,10 +95,10 @@ tests/cases/compiler/strictModeReservedWord.ts(24,5): error TS2349: Cannot invok var myClass = class package extends public {} ~~~~~~~ !!! error TS1213: Identifier expected. 'package' is a reserved word in strict mode. Class definitions are automatically in strict mode. - ~~~~~~~ -!!! error TS9003: 'class' expressions are not currently supported. ~~~~~~ !!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. + ~~~~~~ +!!! error TS2507: Type 'number' is not a constructor function type. var b: public.bar; ~ diff --git a/tests/baselines/reference/strictModeReservedWord.js b/tests/baselines/reference/strictModeReservedWord.js index 9be21b20ae..bec159dee6 100644 --- a/tests/baselines/reference/strictModeReservedWord.js +++ b/tests/baselines/reference/strictModeReservedWord.js @@ -28,6 +28,11 @@ function foo() { //// [strictModeReservedWord.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; var let = 10; function foo() { "use strict";