Add additional tests.

This commit is contained in:
Cyrus Najmabadi 2015-04-02 17:50:11 -07:00
parent 7562a34ae8
commit be26d417a3
9 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,7 @@
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,11 @@
//// [classExpressionWithStaticProperties1.ts]
var v = class C { static a = 1; static b = 2 };
//// [classExpressionWithStaticProperties1.js]
var v = (function () {
function C() {
}
C.a = 1;
C.b = 2;
return C;
})();

View File

@ -0,0 +1,7 @@
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,10 @@
//// [classExpressionWithStaticProperties2.ts]
var v = class C { static a = 1; static b };
//// [classExpressionWithStaticProperties2.js]
var v = (function () {
function C() {
}
C.a = 1;
return C;
})();

View File

@ -0,0 +1,7 @@
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,9 @@
//// [classExpressionWithStaticPropertiesES62.ts]
var v = class C { static a = 1; static b };
//// [classExpressionWithStaticPropertiesES62.js]
var v = (_a = class C {
},
_a.a = 1,
_a);
var _a;

View File

@ -0,0 +1 @@
var v = class C { static a = 1; static b = 2 };

View File

@ -0,0 +1 @@
var v = class C { static a = 1; static b };

View File

@ -0,0 +1,2 @@
//@target: es6
var v = class C { static a = 1; static b };