Update baseline and fix white space

This commit is contained in:
Yui T
2015-01-23 17:28:30 -08:00
parent 593a0992f9
commit 3115288ec5
19 changed files with 65 additions and 67 deletions

View File

@@ -220,7 +220,7 @@ function F() {
const c = 0;
n = c;
}
var F2 = () => {
var F2 = () => {
const c = 0;
n = c;
};
@@ -269,7 +269,7 @@ var o = {
const c = 0;
n = c;
},
f2: () => {
f2: () => {
const c = 0;
n = c;
}

View File

@@ -183,7 +183,7 @@ const c18 = 0;
function F() {
const c19 = 0;
}
var F2 = () => {
var F2 = () => {
const c20 = 0;
};
var F3 = function () {
@@ -223,7 +223,7 @@ var o = {
f() {
const c28 = 0;
},
f2: () => {
f2: () => {
const c29 = 0;
}
};

View File

@@ -9,17 +9,17 @@ foo(() => { return false; });
//// [emitArrowFunctionES6.js]
var f1 = () => {
var f1 = () => {
};
var f2 = (x, y) => {
var f2 = (x, y) => {
};
var f3 = (x, y, ...rest) => {
var f3 = (x, y, ...rest) => {
};
var f4 = (x, y, z = 10) => {
var f4 = (x, y, z = 10) => {
};
function foo(func) {
}
foo(() => { return true; });
foo(() => {
foo(() => { return true; });
foo(() => {
return false;
});

View File

@@ -15,15 +15,15 @@ foo(() => {
//// [emitArrowFunctionThisCapturingES6.js]
var f1 = () => {
var f1 = () => {
this.age = 10;
};
var f2 = (x) => {
var f2 = (x) => {
this.name = x;
};
function foo(func) {
}
foo(() => {
foo(() => {
this.age = 100;
return true;
});

View File

@@ -9,13 +9,13 @@ var y = (function (num = 10, boo = false, ...rest) { })()
var z = (function (num: number, boo = false, ...rest) { })(10)
//// [emitDefaultParametersFunctionExpressionES6.js]
var lambda1 = function (y = "hello") {
var lambda1 = (y = "hello") => {
};
var lambda2 = function (x, y = "hello") {
var lambda2 = (x, y = "hello") => {
};
var lambda3 = function (x, y = "hello", ...rest) {
var lambda3 = (x, y = "hello", ...rest) => {
};
var lambda4 = function (y = "hello", ...rest) {
var lambda4 = (y = "hello", ...rest) => {
};
var x = function (str = "hello", ...rest) {
};

View File

@@ -5,9 +5,9 @@ var funcExp2 = function (...rest) { }
var funcExp3 = (function (...rest) { })()
//// [emitRestParametersFunctionExpressionES6.js]
var funcExp = function (...rest) {
var funcExp = (...rest) => {
};
var funcExp1 = function (X, ...rest) {
var funcExp1 = (X, ...rest) => {
};
var funcExp2 = function (...rest) {
};

View File

@@ -236,7 +236,7 @@ function F() {
let l = 0;
n = l;
}
var F2 = () => {
var F2 = () => {
let l = 0;
n = l;
};
@@ -286,7 +286,7 @@ var o = {
let l = 0;
n = l;
},
f2: () => {
f2: () => {
let l = 0;
n = l;
}

View File

@@ -203,7 +203,7 @@ let l18 = 0;
function F() {
let l19 = 0;
}
var F2 = () => {
var F2 = () => {
let l20 = 0;
};
var F3 = function () {
@@ -243,7 +243,7 @@ var o = {
f() {
let l28 = 0;
},
f2: () => {
f2: () => {
let l29 = 0;
}
};

View File

@@ -25,11 +25,11 @@ var h = tempFun `${ (x => x) } ${ (((x => x))) } ${ undefined }`
function tempFun(tempStrs, g, x) {
return g(x);
}
var a = tempFun `${function (x) { return x; }} ${10}`;
var b = tempFun `${(function (x) { return x; })} ${10}`;
var c = tempFun `${((function (x) { return x; }))} ${10}`;
var d = tempFun `${function (x) { return x; }} ${function (x) { return x; }} ${10}`;
var e = tempFun `${function (x) { return x; }} ${(function (x) { return x; })} ${10}`;
var f = tempFun `${function (x) { return x; }} ${((function (x) { return x; }))} ${10}`;
var g = tempFun `${(function (x) { return x; })} ${(((function (x) { return x; })))} ${10}`;
var h = tempFun `${(function (x) { return x; })} ${(((function (x) { return x; })))} ${undefined}`;
var a = tempFun `${(x) => { return x; }} ${10}`;
var b = tempFun `${((x) => { return x; })} ${10}`;
var c = tempFun `${(((x) => { return x; }))} ${10}`;
var d = tempFun `${(x) => { return x; }} ${(x) => { return x; }} ${10}`;
var e = tempFun `${(x) => { return x; }} ${((x) => { return x; })} ${10}`;
var f = tempFun `${(x) => { return x; }} ${(((x) => { return x; }))} ${10}`;
var g = tempFun `${((x) => { return x; })} ${((((x) => { return x; })))} ${10}`;
var h = tempFun `${((x) => { return x; })} ${((((x) => { return x; })))} ${undefined}`;

View File

@@ -1,4 +1,3 @@
error TS2318: Cannot find global type 'TemplateStringsArray'.
error TS2318: Cannot find global type 'String'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'Object'.
@@ -10,7 +9,6 @@ error TS2318: Cannot find global type 'Array'.
test.ts(3,8): error TS2304: Cannot find name 'Array'.
!!! error TS2318: Cannot find global type 'TemplateStringsArray'.
!!! error TS2318: Cannot find global type 'String'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'Object'.

View File

@@ -1,4 +1,3 @@
error TS2318: Cannot find global type 'TemplateStringsArray'.
error TS2318: Cannot find global type 'String'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'Object'.
@@ -10,7 +9,6 @@ error TS2318: Cannot find global type 'Array'.
test.ts(3,8): error TS2304: Cannot find name 'Array'.
!!! error TS2318: Cannot find global type 'TemplateStringsArray'.
!!! error TS2318: Cannot find global type 'String'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'Object'.

View File

@@ -1,5 +1,6 @@
var _this = this;
// Add a lambda to ensure global 'this' capture is triggered
(() => { return this.window; });
(function () { return _this.window; });
var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }

View File

@@ -1,5 +1,6 @@
var _this = this;
// Add a lambda to ensure global 'this' capture is triggered
(() => { return this.window; });
(function () { return _this.window; });
var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }

View File

@@ -26,28 +26,28 @@ function tempTag1(...rest) {
// Otherwise, the arrow functions' parameters will be typed as 'any',
// and it is an error to invoke an any-typed value with type arguments,
// so this test will error.
tempTag1 `${function (x) {
tempTag1 `${(x) => {
x(undefined);
return x;
}}${10}`;
tempTag1 `${function (x) {
tempTag1 `${(x) => {
x(undefined);
return x;
}}${function (y) {
}}${(y) => {
y(undefined);
return y;
}}${10}`;
tempTag1 `${function (x) {
tempTag1 `${(x) => {
x(undefined);
return x;
}}${function (y) {
}}${(y) => {
y(undefined);
return y;
}}${undefined}`;
tempTag1 `${function (x) {
tempTag1 `${(x) => {
x(undefined);
return x;
}}${function (y) {
}}${(y) => {
y(undefined);
return y;
}}${undefined}`;

View File

@@ -25,18 +25,18 @@ function tempTag2(...rest) {
// Otherwise, the arrow functions' parameters will be typed as 'any',
// and it is an error to invoke an any-typed value with type arguments,
// so this test will error.
tempTag2 `${function (x) {
tempTag2 `${(x) => {
x(undefined);
return x;
}}${0}`;
tempTag2 `${function (x) {
tempTag2 `${(x) => {
x(undefined);
return x;
}}${function (y) {
}}${(y) => {
y(null);
return y;
}}${"hello"}`;
tempTag2 `${function (x) {
tempTag2 `${(x) => {
x(undefined);
return x;
}}${undefined}${"hello"}`;

View File

@@ -111,40 +111,40 @@ someGenerics1b `${3}`;
// Generic tag with argument of function type whose parameter is of type parameter type
function someGenerics2a(strs, n) {
}
someGenerics2a `${(n) => { return n; }}`;
someGenerics2a `${(n) => { return n; }}`;
function someGenerics2b(strs, n) {
}
someGenerics2b `${(n, x) => { return n; }}`;
someGenerics2b `${(n, x) => { return n; }}`;
// Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter
function someGenerics3(strs, producer) {
}
someGenerics3 `${() => { return ''; }}`;
someGenerics3 `${() => { return undefined; }}`;
someGenerics3 `${() => { return 3; }}`;
someGenerics3 `${() => { return ''; }}`;
someGenerics3 `${() => { return undefined; }}`;
someGenerics3 `${() => { return 3; }}`;
// 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type
function someGenerics4(strs, n, f) {
}
someGenerics4 `${4}${() => { return null; }}`;
someGenerics4 `${''}${() => { return 3; }}`;
someGenerics4 `${4}${() => { return null; }}`;
someGenerics4 `${''}${() => { return 3; }}`;
someGenerics4 `${null}${null}`;
// 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type
function someGenerics5(strs, n, f) {
}
someGenerics5 `${4} ${() => { return null; }}`;
someGenerics5 `${''}${() => { return 3; }}`;
someGenerics5 `${4} ${() => { return null; }}`;
someGenerics5 `${''}${() => { return 3; }}`;
someGenerics5 `${null}${null}`;
// Generic tag with multiple arguments of function types that each have parameters of the same generic type
function someGenerics6(strs, a, b, c) {
}
someGenerics6 `${(n) => { return n; }}${(n) => { return n; }}${(n) => { return n; }}`;
someGenerics6 `${(n) => { return n; }}${(n) => { return n; }}${(n) => { return n; }}`;
someGenerics6 `${(n) => { return n; }}${(n) => { return n; }}${(n) => { return n; }}`;
someGenerics6 `${(n) => { return n; }}${(n) => { return n; }}${(n) => { return n; }}`;
someGenerics6 `${(n) => { return n; }}${(n) => { return n; }}${(n) => { return n; }}`;
someGenerics6 `${(n) => { return n; }}${(n) => { return n; }}${(n) => { return n; }}`;
// Generic tag with multiple arguments of function types that each have parameters of different generic type
function someGenerics7(strs, a, b, c) {
}
someGenerics7 `${(n) => { return n; }}${(n) => { return n; }}${(n) => { return n; }}`;
someGenerics7 `${(n) => { return n; }}${(n) => { return n; }}${(n) => { return n; }}`;
someGenerics7 `${(n) => { return n; }}${(n) => { return n; }}${(n) => { return n; }}`;
someGenerics7 `${(n) => { return n; }}${(n) => { return n; }}${(n) => { return n; }}`;
someGenerics7 `${(n) => { return n; }}${(n) => { return n; }}${(n) => { return n; }}`;
someGenerics7 `${(n) => { return n; }}${(n) => { return n; }}${(n) => { return n; }}`;
// Generic tag with argument of generic function type
function someGenerics8(strs, n) {
return n;

View File

@@ -118,5 +118,5 @@ fn4 `${null}${true}`;
function fn5() {
return undefined;
}
fn5 `${(n) => { return n.toFixed(); }}`; // will error; 'n' should have type 'string'.
fn5 `${(n) => { return n.substr(0); }}`;
fn5 `${(n) => { return n.toFixed(); }}`; // will error; 'n' should have type 'string'.
fn5 `${(n) => { return n.substr(0); }}`;

View File

@@ -2,4 +2,4 @@
var x = x => `abc${ x }def`;
//// [templateStringInArrowFunctionES6.js]
var x = (x) => { return `abc${x}def`; };
var x = (x) => { return `abc${x}def`; };

View File

@@ -2,4 +2,4 @@
var x = `abc${ x => x }def`;
//// [templateStringWithEmbeddedArrowFunctionES6.js]
var x = `abc${(x) => { return x; }}def`;
var x = `abc${(x) => { return x; }}def`;