Accepting new baselines

This commit is contained in:
Anders Hejlsberg 2015-06-18 13:56:21 -07:00
parent 23603a39b8
commit b518dc1e5b
42 changed files with 327 additions and 141 deletions

View file

@ -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.
}

View file

@ -0,0 +1,6 @@
=== tests/cases/compiler/anonymousClassExpression1.ts ===
function f() {
>f : Symbol(f, Decl(anonymousClassExpression1.ts, 0, 0))
return typeof class {} === "function";
}

View file

@ -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
}

View file

@ -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.
}
}

View file

@ -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))
}
}

View file

@ -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
}
}

View file

@ -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.

View file

@ -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))

View file

@ -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

View file

@ -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.

View file

@ -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() {
}

View file

@ -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))

View file

@ -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

View file

@ -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.

View file

@ -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))

View file

@ -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

View file

@ -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.

View file

@ -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))

View file

@ -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

View file

@ -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<X> {
~
!!! error TS9003: 'class' expressions are not currently supported.
f<T>() {
var t: T;
var x: X;
~
!!! error TS2304: Cannot find name 'X'.
return { t, x };
}
}
var v = new m<number>();
return v.f<string>();
}

View file

@ -0,0 +1,36 @@
=== tests/cases/compiler/classExpressionTest2.ts ===
function M() {
>M : Symbol(M, Decl(classExpressionTest2.ts, 0, 0))
var m = class C<X> {
>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<T>() {
>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<number>();
>v : Symbol(v, Decl(classExpressionTest2.ts, 9, 7))
>m : Symbol(m, Decl(classExpressionTest2.ts, 1, 7))
return v.f<string>();
>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))
}

View file

@ -0,0 +1,40 @@
=== tests/cases/compiler/classExpressionTest2.ts ===
function M() {
>M : () => { t: string; x: number; }
var m = class C<X> {
>m : typeof C
>class C<X> { f<T>() { var t: T; var x: X; return { t, x }; } } : typeof C
>C : typeof C
>X : X
f<T>() {
>f : <T>() => { 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<number>();
>v : <number>
>new m<number>() : <number>
>m : typeof C
return v.f<string>();
>v.f<string>() : { t: string; x: number; }
>v.f : <T>() => { t: T; x: number; }
>v : <number>
>f : <T>() => { t: T; x: number; }
}

View file

@ -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;
}

View file

@ -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))
}

View file

@ -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
}

View file

@ -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.

View file

@ -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))

View file

@ -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

View file

@ -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.

View file

@ -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))

View file

@ -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

View file

@ -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.

View file

@ -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))

View file

@ -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

View file

@ -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.

View file

@ -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))

View file

@ -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

View file

@ -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

View file

@ -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.
}

View file

@ -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.

View file

@ -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;
~

View file

@ -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";