Update tests

This commit is contained in:
Anders Hejlsberg 2016-08-25 16:53:55 -07:00
parent ccbcc119f0
commit f0be591c14
18 changed files with 24 additions and 23 deletions

View File

@ -1,3 +1,3 @@
var x;
var x: any;
x.name = "hello";
var z = x + x;

View File

@ -6,7 +6,7 @@ enum E {
}
function f() {
var a;
var a: any;
var n=3;
var s="";
var b=false;

View File

@ -1,8 +1,9 @@
// @noimplicitany: true
// this should be an error
var x; // error at "x"
declare var foo; // error at "foo"
function func(k) { }; //error at "k"
var x; // no error, control flow typed
var y; // error because captured
declare var foo; // error at "foo"
function func(k) { y }; // error at "k"
func(x);
// this shouldn't be an error

View File

@ -1,6 +1,6 @@
//@target: ES5
module M {
var Symbol;
var Symbol: any;
export class C {
[Symbol.iterator]() { }

View File

@ -1,5 +1,5 @@
//@target: ES5
var Symbol;
var Symbol: any;
class C {
[Symbol.iterator]() { }

View File

@ -1,3 +1,3 @@
//@target: ES6
var v;
var v: any;
for (v++ of []) { }

View File

@ -1,4 +1,4 @@
var value;
var value: any;
// identifiers: variable and parameter
var x1: number;

View File

@ -1,5 +1,5 @@
// expected error for all the LHS of compound assignments (arithmetic and addition)
var value;
var value: any;
// this
class C {

View File

@ -1,7 +1,7 @@
// @target: es5
// Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without ()
var temp;
var temp: any;
delete --temp ** 3;
delete ++temp ** 3;

View File

@ -1,4 +1,4 @@
var value;
var value: any;
// identifiers: variable and parameter
var x1: number;

View File

@ -1,5 +1,5 @@
// expected error for all the LHS of assignments
var value;
var value: any;
// this
class C {

View File

@ -1,7 +1,7 @@
// @allowUnusedLabels: true
// expected error for all the LHS of compound assignments (arithmetic and addition)
var value;
var value: any;
// this
class C {

View File

@ -1,7 +1,7 @@
// -- operator on any type
var ANY: any;
var ANY1;
var ANY1: any;
var ANY2: any[] = ["", ""];
var obj = {x:1,y:null};
class A {

View File

@ -1,5 +1,5 @@
// -- operator on any type
var ANY1;
var ANY1: any;
var ANY2: any[] = ["", ""];
var obj: () => {}
@ -10,7 +10,7 @@ function foo(): any {
}
class A {
public a: any;
static foo() {
static foo(): any {
var a;
return a;
}

View File

@ -1,7 +1,7 @@
// ++ operator on any type
var ANY: any;
var ANY1;
var ANY1: any;
var ANY2: any[] = ["", ""];
var obj = {x:1,y:null};
class A {

View File

@ -1,5 +1,5 @@
// ++ operator on any type
var ANY1;
var ANY1: any;
var ANY2: any[] = [1, 2];
var obj: () => {}
@ -10,7 +10,7 @@ function foo(): any {
}
class A {
public a: any;
static foo() {
static foo(): any {
var a;
return a;
}

View File

@ -1,7 +1,7 @@
// - operator on any type
var ANY: any;
var ANY1;
var ANY1: any;
var ANY2: any[] = ["", ""];
var obj: () => {}
var obj1 = { x: "", y: () => { }};
@ -12,7 +12,7 @@ function foo(): any {
}
class A {
public a: any;
static foo() {
static foo(): any {
var a;
return a;
}

View File

@ -14,7 +14,7 @@ for (var x in fn()) { }
for (var x in /[a-z]/) { }
for (var x in new Date()) { }
var c, d, e;
var c: any, d: any, e: any;
for (var x in c || d) { }
for (var x in e ? c : d) { }