added tests, accepted baselines

This commit is contained in:
Vladimir Matveev
2015-02-17 17:04:31 -08:00
parent e6cfc10acc
commit b4c82c9401
55 changed files with 158 additions and 18 deletions
+8 -8
View File
@@ -1639,7 +1639,7 @@ module ts {
writeEmittedFiles(writer.getText(), /*writeByteOrderMark*/ compilerOptions.emitBOM);
return;
function enterScope(): boolean {
function enterNameScope(): boolean {
var names = currentScopeNames;
currentScopeNames = undefined;
if (names) {
@@ -1649,7 +1649,7 @@ module ts {
return false;
}
function exitScope(popFrame: boolean): void {
function exitNameScope(popFrame: boolean): void {
if (popFrame) {
currentScopeNames = lastFrame.names;
lastFrame = lastFrame.previous;
@@ -3649,7 +3649,7 @@ module ts {
tempVariables = undefined;
tempParameters = undefined;
var popFrame = enterScope()
var popFrame = enterNameScope()
// When targeting ES6, emit arrow function natively in ES6
if (shouldEmitAsArrowFunction(node)) {
@@ -3743,7 +3743,7 @@ module ts {
write(";");
}
exitScope(popFrame);
exitNameScope(popFrame);
tempCount = saveTempCount;
tempVariables = saveTempVariables;
@@ -3956,7 +3956,7 @@ module ts {
tempVariables = undefined;
tempParameters = undefined;
var popFrame = enterScope();
var popFrame = enterNameScope();
// Emit the constructor overload pinned comments
forEach(node.members, member => {
@@ -4019,7 +4019,7 @@ module ts {
emitTrailingComments(ctor);
}
exitScope(popFrame);
exitNameScope(popFrame);
tempCount = saveTempCount;
tempVariables = saveTempVariables;
@@ -4150,11 +4150,11 @@ module ts {
var saveTempVariables = tempVariables;
tempCount = 0;
tempVariables = undefined;
var popFrame = enterScope();
var popFrame = enterNameScope();
emit(node.body);
exitScope(popFrame);
exitNameScope(popFrame);
tempCount = saveTempCount;
tempVariables = saveTempVariables;
}
@@ -2,4 +2,4 @@
let a: number = 1
//// [VariableDeclaration10_es6.js]
var a = 1;
let a = 1;
@@ -4,4 +4,4 @@ let
//// [VariableDeclaration11_es6.js]
"use strict";
var ;
let ;
@@ -2,4 +2,4 @@
const
//// [VariableDeclaration1_es6.js]
var ;
const ;
@@ -2,4 +2,4 @@
const a
//// [VariableDeclaration2_es6.js]
var a;
const a;
@@ -2,4 +2,4 @@
const a = 1
//// [VariableDeclaration3_es6.js]
var a = 1;
const a = 1;
@@ -2,4 +2,4 @@
const a: number
//// [VariableDeclaration4_es6.js]
var a;
const a;
@@ -2,4 +2,4 @@
const a: number = 1
//// [VariableDeclaration5_es6.js]
var a = 1;
const a = 1;
@@ -2,4 +2,4 @@
let a
//// [VariableDeclaration7_es6.js]
var a;
let a;
@@ -2,4 +2,4 @@
let a = 1
//// [VariableDeclaration8_es6.js]
var a = 1;
let a = 1;
@@ -2,4 +2,4 @@
let a: number
//// [VariableDeclaration9_es6.js]
var a;
let a;
@@ -0,0 +1,7 @@
tests/cases/compiler/downlevelLetConst1.ts(1,6): error TS1123: Variable declaration list cannot be empty.
==== tests/cases/compiler/downlevelLetConst1.ts (1 errors) ====
const
!!! error TS1123: Variable declaration list cannot be empty.
@@ -0,0 +1,5 @@
//// [downlevelLetConst1.ts]
const
//// [downlevelLetConst1.js]
var ;
@@ -0,0 +1,5 @@
//// [downlevelLetConst10.ts]
let a: number = 1
//// [downlevelLetConst10.js]
var a = 1;
@@ -0,0 +1,4 @@
=== tests/cases/compiler/downlevelLetConst10.ts ===
let a: number = 1
>a : number
@@ -0,0 +1,8 @@
tests/cases/compiler/downlevelLetConst11.ts(2,4): error TS1123: Variable declaration list cannot be empty.
==== tests/cases/compiler/downlevelLetConst11.ts (1 errors) ====
"use strict";
let
!!! error TS1123: Variable declaration list cannot be empty.
@@ -0,0 +1,7 @@
//// [downlevelLetConst11.ts]
"use strict";
let
//// [downlevelLetConst11.js]
"use strict";
var ;
@@ -0,0 +1,7 @@
tests/cases/compiler/downlevelLetConst2.ts(1,7): error TS1155: 'const' declarations must be initialized
==== tests/cases/compiler/downlevelLetConst2.ts (1 errors) ====
const a
~
!!! error TS1155: 'const' declarations must be initialized
@@ -0,0 +1,5 @@
//// [downlevelLetConst2.ts]
const a
//// [downlevelLetConst2.js]
var a;
@@ -0,0 +1,5 @@
//// [downlevelLetConst3.ts]
const a = 1
//// [downlevelLetConst3.js]
var a = 1;
@@ -0,0 +1,4 @@
=== tests/cases/compiler/downlevelLetConst3.ts ===
const a = 1
>a : number
@@ -0,0 +1,7 @@
tests/cases/compiler/downlevelLetConst4.ts(1,7): error TS1155: 'const' declarations must be initialized
==== tests/cases/compiler/downlevelLetConst4.ts (1 errors) ====
const a: number
~
!!! error TS1155: 'const' declarations must be initialized
@@ -0,0 +1,5 @@
//// [downlevelLetConst4.ts]
const a: number
//// [downlevelLetConst4.js]
var a;
@@ -0,0 +1,5 @@
//// [downlevelLetConst5.ts]
const a: number = 1
//// [downlevelLetConst5.js]
var a = 1;
@@ -0,0 +1,4 @@
=== tests/cases/compiler/downlevelLetConst5.ts ===
const a: number = 1
>a : number
@@ -0,0 +1,7 @@
tests/cases/compiler/downlevelLetConst6.ts(1,1): error TS2304: Cannot find name 'let'.
==== tests/cases/compiler/downlevelLetConst6.ts (1 errors) ====
let
~~~
!!! error TS2304: Cannot find name 'let'.
@@ -0,0 +1,5 @@
//// [downlevelLetConst6.ts]
let
//// [downlevelLetConst6.js]
let;
@@ -0,0 +1,5 @@
//// [downlevelLetConst7.ts]
let a
//// [downlevelLetConst7.js]
var a;
@@ -0,0 +1,4 @@
=== tests/cases/compiler/downlevelLetConst7.ts ===
let a
>a : any
@@ -0,0 +1,5 @@
//// [downlevelLetConst8.ts]
let a = 1
//// [downlevelLetConst8.js]
var a = 1;
@@ -0,0 +1,4 @@
=== tests/cases/compiler/downlevelLetConst8.ts ===
let a = 1
>a : number
@@ -0,0 +1,5 @@
//// [downlevelLetConst9.ts]
let a: number
//// [downlevelLetConst9.js]
var a;
@@ -0,0 +1,4 @@
=== tests/cases/compiler/downlevelLetConst9.ts ===
let a: number
>a : number
@@ -0,0 +1 @@
const
@@ -0,0 +1 @@
let a: number = 1
@@ -0,0 +1,2 @@
"use strict";
let
@@ -0,0 +1 @@
const a
@@ -0,0 +1 @@
const a = 1
@@ -0,0 +1 @@
const a: number
@@ -0,0 +1 @@
const a: number = 1
@@ -0,0 +1 @@
let
@@ -0,0 +1 @@
let a
@@ -0,0 +1 @@
let a = 1
@@ -0,0 +1 @@
let a: number
@@ -1 +1,2 @@
// @target:es6
let a: number = 1
@@ -1,2 +1,3 @@
// @target:es6
"use strict";
let
@@ -1 +1,2 @@
// @target:es6
const
@@ -1 +1,2 @@
// @target:es6
const a
@@ -1 +1,2 @@
// @target:es6
const a = 1
@@ -1 +1,2 @@
// @target:es6
const a: number
@@ -1 +1,2 @@
// @target:es6
const a: number = 1
@@ -1 +1,2 @@
// @target:es6
let
@@ -1 +1,2 @@
// @target:es6
let a
@@ -1 +1,2 @@
// @target:es6
let a = 1
@@ -1 +1,2 @@
// @target:es6
let a: number