From 3115288ec56824117acebe47baadcc6194771227 Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 23 Jan 2015 17:28:30 -0800 Subject: [PATCH] Update baseline and fix white space --- .../reference/constDeclarations-scopes.js | 4 +-- .../constDeclarations-validContexts.js | 4 +-- .../reference/emitArrowFunctionES6.js | 12 ++++---- .../emitArrowFunctionThisCapturingES6.js | 6 ++-- ...tDefaultParametersFunctionExpressionES6.js | 8 ++--- ...emitRestParametersFunctionExpressionES6.js | 4 +-- .../reference/letDeclarations-scopes.js | 4 +-- .../letDeclarations-validContexts.js | 4 +-- .../parenthesizedContexualTyping3.js | 16 +++++----- .../noDefaultLib/amd/noDefaultLib.errors.txt | 2 -- .../noDefaultLib/node/noDefaultLib.errors.txt | 2 -- .../reference/project/prologueEmit/amd/out.js | 3 +- .../project/prologueEmit/node/out.js | 3 +- .../taggedTemplateContextualTyping1.js | 14 ++++----- .../taggedTemplateContextualTyping2.js | 8 ++--- ...TemplateStringsTypeArgumentInferenceES6.js | 30 +++++++++---------- ...plateStringsWithOverloadResolution3_ES6.js | 4 +-- .../templateStringInArrowFunctionES6.js | 2 +- ...plateStringWithEmbeddedArrowFunctionES6.js | 2 +- 19 files changed, 65 insertions(+), 67 deletions(-) diff --git a/tests/baselines/reference/constDeclarations-scopes.js b/tests/baselines/reference/constDeclarations-scopes.js index 1250adcbc47..aa35dc7df76 100644 --- a/tests/baselines/reference/constDeclarations-scopes.js +++ b/tests/baselines/reference/constDeclarations-scopes.js @@ -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; } diff --git a/tests/baselines/reference/constDeclarations-validContexts.js b/tests/baselines/reference/constDeclarations-validContexts.js index 42c13728d86..7c33c4e1446 100644 --- a/tests/baselines/reference/constDeclarations-validContexts.js +++ b/tests/baselines/reference/constDeclarations-validContexts.js @@ -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; } }; diff --git a/tests/baselines/reference/emitArrowFunctionES6.js b/tests/baselines/reference/emitArrowFunctionES6.js index 2f054c97f32..c518a52f629 100644 --- a/tests/baselines/reference/emitArrowFunctionES6.js +++ b/tests/baselines/reference/emitArrowFunctionES6.js @@ -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; }); diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.js b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.js index f8c4426ed55..bf235bc0eef 100644 --- a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.js +++ b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.js @@ -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; }); diff --git a/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.js b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.js index eabb0e1e344..5a49a200c6b 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.js +++ b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.js @@ -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) { }; diff --git a/tests/baselines/reference/emitRestParametersFunctionExpressionES6.js b/tests/baselines/reference/emitRestParametersFunctionExpressionES6.js index 6c79e4956ae..c7851db5e78 100644 --- a/tests/baselines/reference/emitRestParametersFunctionExpressionES6.js +++ b/tests/baselines/reference/emitRestParametersFunctionExpressionES6.js @@ -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) { }; diff --git a/tests/baselines/reference/letDeclarations-scopes.js b/tests/baselines/reference/letDeclarations-scopes.js index 4398aade539..b4910f0ed45 100644 --- a/tests/baselines/reference/letDeclarations-scopes.js +++ b/tests/baselines/reference/letDeclarations-scopes.js @@ -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; } diff --git a/tests/baselines/reference/letDeclarations-validContexts.js b/tests/baselines/reference/letDeclarations-validContexts.js index 01c76c024e6..7347be61325 100644 --- a/tests/baselines/reference/letDeclarations-validContexts.js +++ b/tests/baselines/reference/letDeclarations-validContexts.js @@ -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; } }; diff --git a/tests/baselines/reference/parenthesizedContexualTyping3.js b/tests/baselines/reference/parenthesizedContexualTyping3.js index 69784d14ce4..efff077d331 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping3.js +++ b/tests/baselines/reference/parenthesizedContexualTyping3.js @@ -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}`; diff --git a/tests/baselines/reference/project/noDefaultLib/amd/noDefaultLib.errors.txt b/tests/baselines/reference/project/noDefaultLib/amd/noDefaultLib.errors.txt index a18186f558d..5541c8d7c19 100644 --- a/tests/baselines/reference/project/noDefaultLib/amd/noDefaultLib.errors.txt +++ b/tests/baselines/reference/project/noDefaultLib/amd/noDefaultLib.errors.txt @@ -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'. diff --git a/tests/baselines/reference/project/noDefaultLib/node/noDefaultLib.errors.txt b/tests/baselines/reference/project/noDefaultLib/node/noDefaultLib.errors.txt index a18186f558d..5541c8d7c19 100644 --- a/tests/baselines/reference/project/noDefaultLib/node/noDefaultLib.errors.txt +++ b/tests/baselines/reference/project/noDefaultLib/node/noDefaultLib.errors.txt @@ -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'. diff --git a/tests/baselines/reference/project/prologueEmit/amd/out.js b/tests/baselines/reference/project/prologueEmit/amd/out.js index 635493592a4..b19a07f6490 100644 --- a/tests/baselines/reference/project/prologueEmit/amd/out.js +++ b/tests/baselines/reference/project/prologueEmit/amd/out.js @@ -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; } diff --git a/tests/baselines/reference/project/prologueEmit/node/out.js b/tests/baselines/reference/project/prologueEmit/node/out.js index 635493592a4..b19a07f6490 100644 --- a/tests/baselines/reference/project/prologueEmit/node/out.js +++ b/tests/baselines/reference/project/prologueEmit/node/out.js @@ -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; } diff --git a/tests/baselines/reference/taggedTemplateContextualTyping1.js b/tests/baselines/reference/taggedTemplateContextualTyping1.js index c1ae5c384e4..be8ec812741 100644 --- a/tests/baselines/reference/taggedTemplateContextualTyping1.js +++ b/tests/baselines/reference/taggedTemplateContextualTyping1.js @@ -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}`; diff --git a/tests/baselines/reference/taggedTemplateContextualTyping2.js b/tests/baselines/reference/taggedTemplateContextualTyping2.js index a24de8224f3..387d5f49883 100644 --- a/tests/baselines/reference/taggedTemplateContextualTyping2.js +++ b/tests/baselines/reference/taggedTemplateContextualTyping2.js @@ -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"}`; diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js index 2e30b756823..8e96736e790 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js @@ -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; diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.js b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.js index 99363d21de9..eb7086eadec 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.js +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.js @@ -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); }}`; diff --git a/tests/baselines/reference/templateStringInArrowFunctionES6.js b/tests/baselines/reference/templateStringInArrowFunctionES6.js index 2cb33efe5d6..1dc7b5c9fa1 100644 --- a/tests/baselines/reference/templateStringInArrowFunctionES6.js +++ b/tests/baselines/reference/templateStringInArrowFunctionES6.js @@ -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`; }; diff --git a/tests/baselines/reference/templateStringWithEmbeddedArrowFunctionES6.js b/tests/baselines/reference/templateStringWithEmbeddedArrowFunctionES6.js index 9789c68047f..5d95a9a0079 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedArrowFunctionES6.js +++ b/tests/baselines/reference/templateStringWithEmbeddedArrowFunctionES6.js @@ -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`;