From 436baafc7207e272964d6b221564095c742b9e73 Mon Sep 17 00:00:00 2001 From: Yui T Date: Tue, 6 Jan 2015 18:00:59 -0800 Subject: [PATCH 01/23] Add default target in compiler option of project runner --- src/harness/projectsRunner.ts | 5 +++-- .../project/noDefaultLib/amd/noDefaultLib.errors.txt | 2 ++ .../project/noDefaultLib/node/noDefaultLib.errors.txt | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 52467fdffd6..4bb9969d8bc 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -164,7 +164,8 @@ class ProjectRunner extends RunnerBase { mapRoot: testCase.resolveMapRoot && testCase.mapRoot ? ts.sys.resolvePath(testCase.mapRoot) : testCase.mapRoot, sourceRoot: testCase.resolveSourceRoot && testCase.sourceRoot ? ts.sys.resolvePath(testCase.sourceRoot) : testCase.sourceRoot, module: moduleKind, - noResolve: testCase.noResolve + noResolve: testCase.noResolve, + target: ts.ScriptTarget.ES6 }; } @@ -186,7 +187,7 @@ class ProjectRunner extends RunnerBase { function createCompilerHost(): ts.CompilerHost { return { getSourceFile, - getDefaultLibFilename: options => options.target === ts.ScriptTarget.ES6 ? "lib.es6.d.ts" : "lib.d.ts", + getDefaultLibFilename: options => Harness.Compiler.defaultLibFileName, writeFile, getCurrentDirectory, getCanonicalFileName: Harness.Compiler.getCanonicalFileName, diff --git a/tests/baselines/reference/project/noDefaultLib/amd/noDefaultLib.errors.txt b/tests/baselines/reference/project/noDefaultLib/amd/noDefaultLib.errors.txt index 5541c8d7c19..a18186f558d 100644 --- a/tests/baselines/reference/project/noDefaultLib/amd/noDefaultLib.errors.txt +++ b/tests/baselines/reference/project/noDefaultLib/amd/noDefaultLib.errors.txt @@ -1,3 +1,4 @@ +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'. @@ -9,6 +10,7 @@ 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 5541c8d7c19..a18186f558d 100644 --- a/tests/baselines/reference/project/noDefaultLib/node/noDefaultLib.errors.txt +++ b/tests/baselines/reference/project/noDefaultLib/node/noDefaultLib.errors.txt @@ -1,3 +1,4 @@ +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'. @@ -9,6 +10,7 @@ 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'. From b0ea40164ce3595d9dd61305dd021c282d48c433 Mon Sep 17 00:00:00 2001 From: Yui T Date: Tue, 6 Jan 2015 18:18:37 -0800 Subject: [PATCH 02/23] Emit Arrow function natively in ES6 --- src/compiler/emitter.ts | 16 +++++++++- src/harness/projectsRunner.ts | 2 +- .../reference/constDeclarations-scopes.js | 4 +-- .../constDeclarations-validContexts.js | 4 +-- .../reference/letDeclarations-scopes.js | 4 +-- .../letDeclarations-validContexts.js | 4 +-- .../reference/project/prologueEmit/amd/out.js | 2 +- .../project/prologueEmit/node/out.js | 2 +- ...TemplateStringsTypeArgumentInferenceES6.js | 30 +++++++++---------- ...plateStringsWithOverloadResolution3_ES6.js | 4 +-- .../templateStringInArrowFunctionES6.js | 2 +- ...plateStringWithEmbeddedArrowFunctionES6.js | 2 +- 12 files changed, 45 insertions(+), 31 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 237f3ab509a..6a8216f7a30 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3219,7 +3219,15 @@ module ts { // Methods will emit the comments as part of emitting method declaration emitLeadingComments(node); } - write("function "); + + if (node.kind !== SyntaxKind.ArrowFunction) { + write("function "); + } + else if (node.kind === SyntaxKind.ArrowFunction && compilerOptions.target < ScriptTarget.ES6) { + // When targeting ES6, emit arrow function natively in ES6 by omitting function keyword and using fat arrow instead + write("function "); + } + if (node.kind === SyntaxKind.FunctionDeclaration || (node.kind === SyntaxKind.FunctionExpression && node.name)) { emit(node.name); } @@ -3258,6 +3266,12 @@ module ts { tempVariables = undefined; tempParameters = undefined; emitSignatureParameters(node); + + // When targeting ES6, emit arrow function natively in ES6 + if (node.kind === SyntaxKind.ArrowFunction && compilerOptions.target >= ScriptTarget.ES6) { + write(" => "); + } + write(" {"); scopeEmitStart(node); increaseIndent(); diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 4bb9969d8bc..cbef1a2e718 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -165,7 +165,7 @@ class ProjectRunner extends RunnerBase { sourceRoot: testCase.resolveSourceRoot && testCase.sourceRoot ? ts.sys.resolvePath(testCase.sourceRoot) : testCase.sourceRoot, module: moduleKind, noResolve: testCase.noResolve, - target: ts.ScriptTarget.ES6 + target: ts.ScriptTarget.Latest }; } diff --git a/tests/baselines/reference/constDeclarations-scopes.js b/tests/baselines/reference/constDeclarations-scopes.js index aa1d59aee81..1250adcbc47 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 = function () { +var F2 = () => { const c = 0; n = c; }; @@ -269,7 +269,7 @@ var o = { const c = 0; n = c; }, - f2: function () { + f2: () => { const c = 0; n = c; } diff --git a/tests/baselines/reference/constDeclarations-validContexts.js b/tests/baselines/reference/constDeclarations-validContexts.js index 8be43633d70..42c13728d86 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 = function () { +var F2 = () => { const c20 = 0; }; var F3 = function () { @@ -223,7 +223,7 @@ var o = { f() { const c28 = 0; }, - f2: function () { + f2: () => { const c29 = 0; } }; diff --git a/tests/baselines/reference/letDeclarations-scopes.js b/tests/baselines/reference/letDeclarations-scopes.js index d0f70693d7c..4398aade539 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 = function () { +var F2 = () => { let l = 0; n = l; }; @@ -286,7 +286,7 @@ var o = { let l = 0; n = l; }, - f2: function () { + f2: () => { let l = 0; n = l; } diff --git a/tests/baselines/reference/letDeclarations-validContexts.js b/tests/baselines/reference/letDeclarations-validContexts.js index fe9ed903bf5..01c76c024e6 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 = function () { +var F2 = () => { let l20 = 0; }; var F3 = function () { @@ -243,7 +243,7 @@ var o = { f() { let l28 = 0; }, - f2: function () { + f2: () => { let l29 = 0; } }; diff --git a/tests/baselines/reference/project/prologueEmit/amd/out.js b/tests/baselines/reference/project/prologueEmit/amd/out.js index b19a07f6490..56a81d99acf 100644 --- a/tests/baselines/reference/project/prologueEmit/amd/out.js +++ b/tests/baselines/reference/project/prologueEmit/amd/out.js @@ -1,6 +1,6 @@ var _this = this; // Add a lambda to ensure global 'this' capture is triggered -(function () { return _this.window; }); +(() => { 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 b19a07f6490..56a81d99acf 100644 --- a/tests/baselines/reference/project/prologueEmit/node/out.js +++ b/tests/baselines/reference/project/prologueEmit/node/out.js @@ -1,6 +1,6 @@ var _this = this; // Add a lambda to ensure global 'this' capture is triggered -(function () { return _this.window; }); +(() => { 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/taggedTemplateStringsTypeArgumentInferenceES6.js b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js index b88eadfd80b..2e30b756823 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 `${function (n) { return n; }}`; +someGenerics2a `${(n) => { return n; }}`; function someGenerics2b(strs, n) { } -someGenerics2b `${function (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 `${function () { return ''; }}`; -someGenerics3 `${function () { return undefined; }}`; -someGenerics3 `${function () { 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}${function () { return null; }}`; -someGenerics4 `${''}${function () { 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} ${function () { return null; }}`; -someGenerics5 `${''}${function () { 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 `${function (n) { return n; }}${function (n) { return n; }}${function (n) { return n; }}`; -someGenerics6 `${function (n) { return n; }}${function (n) { return n; }}${function (n) { return n; }}`; -someGenerics6 `${function (n) { return n; }}${function (n) { return n; }}${function (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 `${function (n) { return n; }}${function (n) { return n; }}${function (n) { return n; }}`; -someGenerics7 `${function (n) { return n; }}${function (n) { return n; }}${function (n) { return n; }}`; -someGenerics7 `${function (n) { return n; }}${function (n) { return n; }}${function (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 48af9403a79..99363d21de9 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 `${function (n) { return n.toFixed(); }}`; // will error; 'n' should have type 'string'. -fn5 `${function (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 633b96e9da4..2cb33efe5d6 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 = function (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 f6f068aaa37..9789c68047f 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${function (x) { return x; }}def`; +var x = `abc${(x) => { return x; }}def`; From 7d0fc6225610a1038a8d1712c52590981ce3b714 Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 7 Jan 2015 11:54:12 -0800 Subject: [PATCH 03/23] Emit this binding natively in es6 --- src/compiler/checker.ts | 6 +++++- src/compiler/emitter.ts | 24 +++++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f8c4caa9630..7a4d808e023 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4824,7 +4824,11 @@ module ts { // Now skip arrow functions to get the "real" owner of 'this'. if (container.kind === SyntaxKind.ArrowFunction) { container = getThisContainer(container, /* includeArrowFunctions */ false); - needToCaptureLexicalThis = true; + + // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code + if (compilerOptions.target < ScriptTarget.ES6) { + needToCaptureLexicalThis = true; + } } switch (container.kind) { diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 6a8216f7a30..2e8502c8859 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3210,6 +3210,13 @@ module ts { emitTrailingComments(node); } + function isES6ArrowFunction(node: FunctionLikeDeclaration): boolean { + if (node.kind === SyntaxKind.ArrowFunction && compilerOptions.target >= ScriptTarget.ES6) { + return true; + } + return false; + } + function emitFunctionDeclaration(node: FunctionLikeDeclaration) { if (nodeIsMissing(node.body)) { return emitPinnedOrTripleSlashComments(node); @@ -3220,11 +3227,9 @@ module ts { emitLeadingComments(node); } - if (node.kind !== SyntaxKind.ArrowFunction) { - write("function "); - } - else if (node.kind === SyntaxKind.ArrowFunction && compilerOptions.target < ScriptTarget.ES6) { - // When targeting ES6, emit arrow function natively in ES6 by omitting function keyword and using fat arrow instead + // For targeting below es6, emit functions-like declaration including arrow function using function keyword. + // When targeting ES6, emit arrow function natively in ES6 by omitting function keyword and using fat arrow instead + if (!isES6ArrowFunction(node)) { write("function "); } @@ -3268,7 +3273,7 @@ module ts { emitSignatureParameters(node); // When targeting ES6, emit arrow function natively in ES6 - if (node.kind === SyntaxKind.ArrowFunction && compilerOptions.target >= ScriptTarget.ES6) { + if (isES6ArrowFunction(node)) { write(" => "); } @@ -3283,7 +3288,12 @@ module ts { startIndex = emitDirectivePrologues((node.body).statements, /*startWithNewLine*/ true); } var outPos = writer.getTextPos(); - emitCaptureThisForNodeIfNecessary(node); + + // In ES6, fat arrow function lexically binds this value. Therefore, when targeting es6, we can omit capturing of "this" in the fat arrow function + if (!isES6ArrowFunction(node)) { + emitCaptureThisForNodeIfNecessary(node); + } + emitDefaultValueAssignments(node); emitRestParameter(node); if (node.body.kind !== SyntaxKind.Block && outPos === writer.getTextPos()) { From cb48a5e110713ab1d7c53e5207720d467a05c11d Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 7 Jan 2015 11:54:22 -0800 Subject: [PATCH 04/23] Add testcases --- .../baselines/reference/emitArrowFunction.js | 29 ++++++++++++ .../reference/emitArrowFunction.types | 39 ++++++++++++++++ .../reference/emitArrowFunctionES6.js | 25 +++++++++++ .../reference/emitArrowFunctionES6.types | 39 ++++++++++++++++ .../emitArrowFunctionThisCapturing.js | 30 +++++++++++++ .../emitArrowFunctionThisCapturing.types | 44 +++++++++++++++++++ .../emitArrowFunctionThisCapturingES6.js | 29 ++++++++++++ .../emitArrowFunctionThisCapturingES6.types | 44 +++++++++++++++++++ .../reference/project/prologueEmit/amd/out.js | 3 +- .../project/prologueEmit/node/out.js | 3 +- .../es6/arrowFunction/emitArrowFunction.ts | 8 ++++ .../es6/arrowFunction/emitArrowFunctionES6.ts | 8 ++++ .../emitArrowFunctionThisCapturing.ts | 14 ++++++ .../emitArrowFunctionThisCapturingES6.ts | 14 ++++++ 14 files changed, 325 insertions(+), 4 deletions(-) create mode 100644 tests/baselines/reference/emitArrowFunction.js create mode 100644 tests/baselines/reference/emitArrowFunction.types create mode 100644 tests/baselines/reference/emitArrowFunctionES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionES6.types create mode 100644 tests/baselines/reference/emitArrowFunctionThisCapturing.js create mode 100644 tests/baselines/reference/emitArrowFunctionThisCapturing.types create mode 100644 tests/baselines/reference/emitArrowFunctionThisCapturingES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionThisCapturingES6.types create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunction.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionThisCapturing.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionThisCapturingES6.ts diff --git a/tests/baselines/reference/emitArrowFunction.js b/tests/baselines/reference/emitArrowFunction.js new file mode 100644 index 00000000000..1c00a7579b6 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunction.js @@ -0,0 +1,29 @@ +//// [emitArrowFunction.ts] +var f1 = () => { } +var f2 = (x: string, y: string) => { } +var f3 = (x: string, y: number, ...rest) => { } +var f4 = (x: string, y: number, z = 10) => { } +function foo(func: () => boolean) { } +foo(() => true); +foo(() => { return false; }); + +//// [emitArrowFunction.js] +var f1 = function () { +}; +var f2 = function (x, y) { +}; +var f3 = function (x, y) { + var rest = []; + for (var _i = 2; _i < arguments.length; _i++) { + rest[_i - 2] = arguments[_i]; + } +}; +var f4 = function (x, y, z) { + if (z === void 0) { z = 10; } +}; +function foo(func) { +} +foo(function () { return true; }); +foo(function () { + return false; +}); diff --git a/tests/baselines/reference/emitArrowFunction.types b/tests/baselines/reference/emitArrowFunction.types new file mode 100644 index 00000000000..030ed0cde60 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunction.types @@ -0,0 +1,39 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunction.ts === +var f1 = () => { } +>f1 : () => void +>() => { } : () => void + +var f2 = (x: string, y: string) => { } +>f2 : (x: string, y: string) => void +>(x: string, y: string) => { } : (x: string, y: string) => void +>x : string +>y : string + +var f3 = (x: string, y: number, ...rest) => { } +>f3 : (x: string, y: number, ...rest: any[]) => void +>(x: string, y: number, ...rest) => { } : (x: string, y: number, ...rest: any[]) => void +>x : string +>y : number +>rest : any[] + +var f4 = (x: string, y: number, z = 10) => { } +>f4 : (x: string, y: number, z?: number) => void +>(x: string, y: number, z = 10) => { } : (x: string, y: number, z?: number) => void +>x : string +>y : number +>z : number + +function foo(func: () => boolean) { } +>foo : (func: () => boolean) => void +>func : () => boolean + +foo(() => true); +>foo(() => true) : void +>foo : (func: () => boolean) => void +>() => true : () => boolean + +foo(() => { return false; }); +>foo(() => { return false; }) : void +>foo : (func: () => boolean) => void +>() => { return false; } : () => boolean + diff --git a/tests/baselines/reference/emitArrowFunctionES6.js b/tests/baselines/reference/emitArrowFunctionES6.js new file mode 100644 index 00000000000..2f054c97f32 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionES6.js @@ -0,0 +1,25 @@ +//// [emitArrowFunctionES6.ts] +var f1 = () => { } +var f2 = (x: string, y: string) => { } +var f3 = (x: string, y: number, ...rest) => { } +var f4 = (x: string, y: number, z=10) => { } +function foo(func: () => boolean) { } +foo(() => true); +foo(() => { return false; }); + + +//// [emitArrowFunctionES6.js] +var f1 = () => { +}; +var f2 = (x, y) => { +}; +var f3 = (x, y, ...rest) => { +}; +var f4 = (x, y, z = 10) => { +}; +function foo(func) { +} +foo(() => { return true; }); +foo(() => { + return false; +}); diff --git a/tests/baselines/reference/emitArrowFunctionES6.types b/tests/baselines/reference/emitArrowFunctionES6.types new file mode 100644 index 00000000000..1f0c1941bdb --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionES6.types @@ -0,0 +1,39 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionES6.ts === +var f1 = () => { } +>f1 : () => void +>() => { } : () => void + +var f2 = (x: string, y: string) => { } +>f2 : (x: string, y: string) => void +>(x: string, y: string) => { } : (x: string, y: string) => void +>x : string +>y : string + +var f3 = (x: string, y: number, ...rest) => { } +>f3 : (x: string, y: number, ...rest: any[]) => void +>(x: string, y: number, ...rest) => { } : (x: string, y: number, ...rest: any[]) => void +>x : string +>y : number +>rest : any[] + +var f4 = (x: string, y: number, z=10) => { } +>f4 : (x: string, y: number, z?: number) => void +>(x: string, y: number, z=10) => { } : (x: string, y: number, z?: number) => void +>x : string +>y : number +>z : number + +function foo(func: () => boolean) { } +>foo : (func: () => boolean) => void +>func : () => boolean + +foo(() => true); +>foo(() => true) : void +>foo : (func: () => boolean) => void +>() => true : () => boolean + +foo(() => { return false; }); +>foo(() => { return false; }) : void +>foo : (func: () => boolean) => void +>() => { return false; } : () => boolean + diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturing.js b/tests/baselines/reference/emitArrowFunctionThisCapturing.js new file mode 100644 index 00000000000..25d9f7f100b --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionThisCapturing.js @@ -0,0 +1,30 @@ +//// [emitArrowFunctionThisCapturing.ts] +var f1 = () => { + this.age = 10 +}; + +var f2 = (x: string) => { + this.name = x +} + +function foo(func: () => boolean) { } +foo(() => { + this.age = 100; + return true; +}); + + +//// [emitArrowFunctionThisCapturing.js] +var _this = this; +var f1 = function () { + _this.age = 10; +}; +var f2 = function (x) { + _this.name = x; +}; +function foo(func) { +} +foo(function () { + _this.age = 100; + return true; +}); diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturing.types b/tests/baselines/reference/emitArrowFunctionThisCapturing.types new file mode 100644 index 00000000000..433f38e5ecc --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionThisCapturing.types @@ -0,0 +1,44 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionThisCapturing.ts === +var f1 = () => { +>f1 : () => void +>() => { this.age = 10} : () => void + + this.age = 10 +>this.age = 10 : number +>this.age : any +>this : any +>age : any + +}; + +var f2 = (x: string) => { +>f2 : (x: string) => void +>(x: string) => { this.name = x} : (x: string) => void +>x : string + + this.name = x +>this.name = x : string +>this.name : any +>this : any +>name : any +>x : string +} + +function foo(func: () => boolean) { } +>foo : (func: () => boolean) => void +>func : () => boolean + +foo(() => { +>foo(() => { this.age = 100; return true;}) : void +>foo : (func: () => boolean) => void +>() => { this.age = 100; return true;} : () => boolean + + this.age = 100; +>this.age = 100 : number +>this.age : any +>this : any +>age : any + + return true; +}); + diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.js b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.js new file mode 100644 index 00000000000..f8c4426ed55 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.js @@ -0,0 +1,29 @@ +//// [emitArrowFunctionThisCapturingES6.ts] +var f1 = () => { + this.age = 10 +}; + +var f2 = (x: string) => { + this.name = x +} + +function foo(func: () => boolean){ } +foo(() => { + this.age = 100; + return true; +}); + + +//// [emitArrowFunctionThisCapturingES6.js] +var f1 = () => { + this.age = 10; +}; +var f2 = (x) => { + this.name = x; +}; +function foo(func) { +} +foo(() => { + this.age = 100; + return true; +}); diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types new file mode 100644 index 00000000000..989130ef280 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types @@ -0,0 +1,44 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionThisCapturingES6.ts === +var f1 = () => { +>f1 : () => void +>() => { this.age = 10} : () => void + + this.age = 10 +>this.age = 10 : number +>this.age : any +>this : any +>age : any + +}; + +var f2 = (x: string) => { +>f2 : (x: string) => void +>(x: string) => { this.name = x} : (x: string) => void +>x : string + + this.name = x +>this.name = x : string +>this.name : any +>this : any +>name : any +>x : string +} + +function foo(func: () => boolean){ } +>foo : (func: () => boolean) => void +>func : () => boolean + +foo(() => { +>foo(() => { this.age = 100; return true;}) : void +>foo : (func: () => boolean) => void +>() => { this.age = 100; return true;} : () => boolean + + this.age = 100; +>this.age = 100 : number +>this.age : any +>this : any +>age : any + + return true; +}); + diff --git a/tests/baselines/reference/project/prologueEmit/amd/out.js b/tests/baselines/reference/project/prologueEmit/amd/out.js index 56a81d99acf..635493592a4 100644 --- a/tests/baselines/reference/project/prologueEmit/amd/out.js +++ b/tests/baselines/reference/project/prologueEmit/amd/out.js @@ -1,6 +1,5 @@ -var _this = this; // Add a lambda to ensure global 'this' capture is triggered -(() => { return _this.window; }); +(() => { 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 56a81d99acf..635493592a4 100644 --- a/tests/baselines/reference/project/prologueEmit/node/out.js +++ b/tests/baselines/reference/project/prologueEmit/node/out.js @@ -1,6 +1,5 @@ -var _this = this; // Add a lambda to ensure global 'this' capture is triggered -(() => { return _this.window; }); +(() => { 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/cases/conformance/es6/arrowFunction/emitArrowFunction.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunction.ts new file mode 100644 index 00000000000..cace55c05fb --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunction.ts @@ -0,0 +1,8 @@ +// @target:es5 +var f1 = () => { } +var f2 = (x: string, y: string) => { } +var f3 = (x: string, y: number, ...rest) => { } +var f4 = (x: string, y: number, z = 10) => { } +function foo(func: () => boolean) { } +foo(() => true); +foo(() => { return false; }); \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionES6.ts new file mode 100644 index 00000000000..d56d07c6c4e --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionES6.ts @@ -0,0 +1,8 @@ +// @target:es6 +var f1 = () => { } +var f2 = (x: string, y: string) => { } +var f3 = (x: string, y: number, ...rest) => { } +var f4 = (x: string, y: number, z=10) => { } +function foo(func: () => boolean) { } +foo(() => true); +foo(() => { return false; }); diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionThisCapturing.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionThisCapturing.ts new file mode 100644 index 00000000000..e098874fc55 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionThisCapturing.ts @@ -0,0 +1,14 @@ +// @target:es5 +var f1 = () => { + this.age = 10 +}; + +var f2 = (x: string) => { + this.name = x +} + +function foo(func: () => boolean) { } +foo(() => { + this.age = 100; + return true; +}); diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionThisCapturingES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionThisCapturingES6.ts new file mode 100644 index 00000000000..64d816dc2c6 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionThisCapturingES6.ts @@ -0,0 +1,14 @@ +// @target:es6 +var f1 = () => { + this.age = 10 +}; + +var f2 = (x: string) => { + this.name = x +} + +function foo(func: () => boolean){ } +foo(() => { + this.age = 100; + return true; +}); From ba239c5812aff528db3b080270a2bd4ad6bb12fe Mon Sep 17 00:00:00 2001 From: Yui T Date: Thu, 15 Jan 2015 17:12:44 -0800 Subject: [PATCH 05/23] Address code review --- src/compiler/emitter.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 2e8502c8859..9670b62af1b 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3211,10 +3211,7 @@ module ts { } function isES6ArrowFunction(node: FunctionLikeDeclaration): boolean { - if (node.kind === SyntaxKind.ArrowFunction && compilerOptions.target >= ScriptTarget.ES6) { - return true; - } - return false; + return node.kind === SyntaxKind.ArrowFunction && compilerOptions.target >= ScriptTarget.ES6; } function emitFunctionDeclaration(node: FunctionLikeDeclaration) { @@ -3289,11 +3286,7 @@ module ts { } var outPos = writer.getTextPos(); - // In ES6, fat arrow function lexically binds this value. Therefore, when targeting es6, we can omit capturing of "this" in the fat arrow function - if (!isES6ArrowFunction(node)) { - emitCaptureThisForNodeIfNecessary(node); - } - + emitCaptureThisForNodeIfNecessary(node); emitDefaultValueAssignments(node); emitRestParameter(node); if (node.body.kind !== SyntaxKind.Block && outPos === writer.getTextPos()) { From de9547cc9e6134d83f790f0314346236cfca1dbd Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 23 Jan 2015 17:08:08 -0800 Subject: [PATCH 06/23] Update type checking for lexical binding due to merge with master --- src/compiler/checker.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f3f90b633ab..fd93858c24a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4832,9 +4832,12 @@ module ts { container = getThisContainer(container, /* includeArrowFunctions */ false); // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code - if (compilerOptions.target < ScriptTarget.ES6) { - needToCaptureLexicalThis = true; + if (compilerOptions.target >= ScriptTarget.ES6) { + needToCaptureLexicalThis = false; } + else { + needToCaptureLexicalThis = true; + } } switch (container.kind) { From 593a0992f91e77201a44cc291314b9f02cad29a0 Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 23 Jan 2015 17:28:12 -0800 Subject: [PATCH 07/23] Update emitter due to merge with master --- src/compiler/emitter.ts | 2 +- src/harness/projectsRunner.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 61d60aebf3a..db13a2c03cd 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3300,7 +3300,7 @@ module ts { // When targeting ES6, emit arrow function natively in ES6 if (isES6ArrowFunction(node)) { - write(" => "); + write(" =>"); } write(" {"); diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index cbef1a2e718..9b16e93d8eb 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -164,8 +164,7 @@ class ProjectRunner extends RunnerBase { mapRoot: testCase.resolveMapRoot && testCase.mapRoot ? ts.sys.resolvePath(testCase.mapRoot) : testCase.mapRoot, sourceRoot: testCase.resolveSourceRoot && testCase.sourceRoot ? ts.sys.resolvePath(testCase.sourceRoot) : testCase.sourceRoot, module: moduleKind, - noResolve: testCase.noResolve, - target: ts.ScriptTarget.Latest + noResolve: testCase.noResolve }; } From 3115288ec56824117acebe47baadcc6194771227 Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 23 Jan 2015 17:28:30 -0800 Subject: [PATCH 08/23] 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`; From f219a2de254b1569a0e47e180c3d1b20c0c5d72a Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 26 Jan 2015 19:00:38 -0800 Subject: [PATCH 09/23] Address code review; preserve users non-parenthesis --- src/compiler/emitter.ts | 22 +++++++++++++++++-- src/compiler/parser.ts | 3 +++ src/compiler/types.ts | 2 ++ .../reference/emitArrowFunctionsAsIs.js | 13 +++++++++++ .../reference/emitArrowFunctionsAsIs.types | 17 ++++++++++++++ .../reference/emitArrowFunctionsAsIsES6.js | 13 +++++++++++ .../reference/emitArrowFunctionsAsIsES6.types | 17 ++++++++++++++ .../parenthesizedContexualTyping3.js | 16 +++++++------- .../taggedTemplateContextualTyping1.js | 10 ++++----- .../taggedTemplateContextualTyping2.js | 8 +++---- ...TemplateStringsTypeArgumentInferenceES6.js | 8 +++---- .../templateStringInArrowFunctionES6.js | 2 +- ...plateStringWithEmbeddedArrowFunctionES6.js | 2 +- .../arrowFunction/emitArrowFunctionsAsIs.ts | 5 +++++ .../emitArrowFunctionsAsIsES6.ts | 5 +++++ 15 files changed, 118 insertions(+), 25 deletions(-) create mode 100644 tests/baselines/reference/emitArrowFunctionsAsIs.js create mode 100644 tests/baselines/reference/emitArrowFunctionsAsIs.types create mode 100644 tests/baselines/reference/emitArrowFunctionsAsIsES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionsAsIsES6.types create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionsAsIs.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionsAsIsES6.ts diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index db13a2c03cd..afd493bc8f1 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3289,6 +3289,21 @@ module ts { decreaseIndent(); } + function emitSignatureParametersES6(node: FunctionLikeDeclaration) { + // Check the node's parameters whether it contains flags indicating that it has no parenthesis around the parameters + // Preserver no-parenthesis + if (node && node.flags & NodeFlags.SimpleArrowFunction) { + increaseIndent(); + var parameters = node.parameters; + var omitCount = languageVersion < ScriptTarget.ES6 && hasRestParameters(node) ? 1 : 0; + emitList(parameters, 0, parameters.length - omitCount, /*multiLine*/ false, /*trailingComma*/ false); + decreaseIndent(); + } + else { + emitSignatureParameters(node); + } + } + function emitSignatureAndBody(node: FunctionLikeDeclaration) { var saveTempCount = tempCount; var saveTempVariables = tempVariables; @@ -3296,12 +3311,15 @@ module ts { tempCount = 0; tempVariables = undefined; tempParameters = undefined; - emitSignatureParameters(node); // When targeting ES6, emit arrow function natively in ES6 if (isES6ArrowFunction(node)) { - write(" =>"); + emitSignatureParametersES6(node); + write(" =>"); } + else { + emitSignatureParameters(node); + } write(" {"); scopeEmitStart(node); diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 5ae44e5ff39..82fa5f2c579 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2883,6 +2883,9 @@ module ts { node.parameters = >[parameter]; node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; + // Add node flags for simple arrow function(no parenthesis around parameters) + // so that in emit state we can check this flag and preserve users original text + node.flags |= NodeFlags.SimpleArrowFunction; parseExpected(SyntaxKind.EqualsGreaterThanToken); node.body = parseArrowFunctionExpressionBody(); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index b8c842641d7..fb1f2d8d5be 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -293,6 +293,8 @@ module ts { Const = 0x00001000, // Variable declaration OctalLiteral = 0x00002000, + SimpleArrowFunction = 0x00004000, // Arrow function without parenthesized parameters + Modifier = Export | Ambient | Public | Private | Protected | Static, AccessibilityModifier = Public | Private | Protected, BlockScoped = Let | Const diff --git a/tests/baselines/reference/emitArrowFunctionsAsIs.js b/tests/baselines/reference/emitArrowFunctionsAsIs.js new file mode 100644 index 00000000000..ee8347dda3e --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionsAsIs.js @@ -0,0 +1,13 @@ +//// [emitArrowFunctionsAsIs.ts] +var arrow1 = a => { }; +var arrow2 = (a) => { }; + +var arrow3 = (a, b) => { }; + +//// [emitArrowFunctionsAsIs.js] +var arrow1 = function (a) { +}; +var arrow2 = function (a) { +}; +var arrow3 = function (a, b) { +}; diff --git a/tests/baselines/reference/emitArrowFunctionsAsIs.types b/tests/baselines/reference/emitArrowFunctionsAsIs.types new file mode 100644 index 00000000000..36dae7e9c5a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionsAsIs.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionsAsIs.ts === +var arrow1 = a => { }; +>arrow1 : (a: any) => void +>a => { } : (a: any) => void +>a : any + +var arrow2 = (a) => { }; +>arrow2 : (a: any) => void +>(a) => { } : (a: any) => void +>a : any + +var arrow3 = (a, b) => { }; +>arrow3 : (a: any, b: any) => void +>(a, b) => { } : (a: any, b: any) => void +>a : any +>b : any + diff --git a/tests/baselines/reference/emitArrowFunctionsAsIsES6.js b/tests/baselines/reference/emitArrowFunctionsAsIsES6.js new file mode 100644 index 00000000000..021e048ed88 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionsAsIsES6.js @@ -0,0 +1,13 @@ +//// [emitArrowFunctionsAsIsES6.ts] +var arrow1 = a => { }; +var arrow2 = (a) => { }; + +var arrow3 = (a, b) => { }; + +//// [emitArrowFunctionsAsIsES6.js] +var arrow1 = a => { +}; +var arrow2 = (a) => { +}; +var arrow3 = (a, b) => { +}; diff --git a/tests/baselines/reference/emitArrowFunctionsAsIsES6.types b/tests/baselines/reference/emitArrowFunctionsAsIsES6.types new file mode 100644 index 00000000000..4073355d259 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionsAsIsES6.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionsAsIsES6.ts === +var arrow1 = a => { }; +>arrow1 : (a: any) => void +>a => { } : (a: any) => void +>a : any + +var arrow2 = (a) => { }; +>arrow2 : (a: any) => void +>(a) => { } : (a: any) => void +>a : any + +var arrow3 = (a, b) => { }; +>arrow3 : (a: any, b: any) => void +>(a, b) => { } : (a: any, b: any) => void +>a : any +>b : any + diff --git a/tests/baselines/reference/parenthesizedContexualTyping3.js b/tests/baselines/reference/parenthesizedContexualTyping3.js index efff077d331..cc6dbd44f88 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 `${(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}`; +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/taggedTemplateContextualTyping1.js b/tests/baselines/reference/taggedTemplateContextualTyping1.js index be8ec812741..173d0f56bb7 100644 --- a/tests/baselines/reference/taggedTemplateContextualTyping1.js +++ b/tests/baselines/reference/taggedTemplateContextualTyping1.js @@ -26,18 +26,18 @@ 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 `${(x) => { +tempTag1 `${x => { x(undefined); return x; }}${10}`; -tempTag1 `${(x) => { +tempTag1 `${x => { x(undefined); return x; -}}${(y) => { +}}${y => { y(undefined); return y; }}${10}`; -tempTag1 `${(x) => { +tempTag1 `${x => { x(undefined); return x; }}${(y) => { @@ -47,7 +47,7 @@ tempTag1 `${(x) => { tempTag1 `${(x) => { x(undefined); return x; -}}${(y) => { +}}${y => { y(undefined); return y; }}${undefined}`; diff --git a/tests/baselines/reference/taggedTemplateContextualTyping2.js b/tests/baselines/reference/taggedTemplateContextualTyping2.js index 387d5f49883..1eed600da4c 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 `${(x) => { +tempTag2 `${x => { x(undefined); return x; }}${0}`; -tempTag2 `${(x) => { +tempTag2 `${x => { x(undefined); return x; -}}${(y) => { +}}${y => { y(null); return y; }}${"hello"}`; -tempTag2 `${(x) => { +tempTag2 `${x => { x(undefined); return x; }}${undefined}${"hello"}`; diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js index 8e96736e790..da39703931c 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js @@ -136,14 +136,14 @@ 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; }}`; // 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; }}`; // Generic tag with argument of generic function type function someGenerics8(strs, n) { diff --git a/tests/baselines/reference/templateStringInArrowFunctionES6.js b/tests/baselines/reference/templateStringInArrowFunctionES6.js index 1dc7b5c9fa1..11dd7a82fe3 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 5d95a9a0079..3dd7e4c11e4 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`; diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionsAsIs.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionsAsIs.ts new file mode 100644 index 00000000000..1366fff90a1 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionsAsIs.ts @@ -0,0 +1,5 @@ +// @target:ES5 +var arrow1 = a => { }; +var arrow2 = (a) => { }; + +var arrow3 = (a, b) => { }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionsAsIsES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionsAsIsES6.ts new file mode 100644 index 00000000000..01331ededf9 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionsAsIsES6.ts @@ -0,0 +1,5 @@ +// @target:ES6 +var arrow1 = a => { }; +var arrow2 = (a) => { }; + +var arrow3 = (a, b) => { }; \ No newline at end of file From 2e2559b0974d1424a0d7e987cf1086f0445e5f29 Mon Sep 17 00:00:00 2001 From: Yui T Date: Tue, 27 Jan 2015 14:27:51 -0800 Subject: [PATCH 10/23] Update tests baseline from merging with master --- tests/baselines/reference/computedPropertyNames29.js | 5 ++--- tests/baselines/reference/computedPropertyNames3.js | 2 +- tests/baselines/reference/computedPropertyNames30.js | 2 +- tests/baselines/reference/computedPropertyNames31.js | 2 +- .../reference/computedPropertyNamesContextualType1.js | 2 +- .../reference/computedPropertyNamesContextualType2.js | 2 +- .../reference/computedPropertyNamesContextualType3.js | 2 +- .../reference/computedPropertyNamesContextualType6.js | 2 +- .../reference/computedPropertyNamesContextualType7.js | 2 +- 9 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/baselines/reference/computedPropertyNames29.js b/tests/baselines/reference/computedPropertyNames29.js index dc45746c63c..94e83f34629 100644 --- a/tests/baselines/reference/computedPropertyNames29.js +++ b/tests/baselines/reference/computedPropertyNames29.js @@ -15,10 +15,9 @@ var C = (function () { function C() { } C.prototype.bar = function () { - var _this = this; - (function () { + (() => { var obj = { - [_this.bar()]() { + [this.bar()]() { } // needs capture }; }); diff --git a/tests/baselines/reference/computedPropertyNames3.js b/tests/baselines/reference/computedPropertyNames3.js index fbd76bf48fc..969bbf96d86 100644 --- a/tests/baselines/reference/computedPropertyNames3.js +++ b/tests/baselines/reference/computedPropertyNames3.js @@ -16,7 +16,7 @@ var C = (function () { } C.prototype[0 + 1] = function () { }; - C[function () { + C[() => { }] = function () { }; Object.defineProperty(C.prototype, delete id, { diff --git a/tests/baselines/reference/computedPropertyNames30.js b/tests/baselines/reference/computedPropertyNames30.js index c10ba51316d..608531ffb5b 100644 --- a/tests/baselines/reference/computedPropertyNames30.js +++ b/tests/baselines/reference/computedPropertyNames30.js @@ -31,7 +31,7 @@ var C = (function (_super) { __extends(C, _super); function C() { _super.call(this); - (function () { + (() => { var obj = { // Ideally, we would capture this. But the reference is // illegal, and not capturing this is consistent with diff --git a/tests/baselines/reference/computedPropertyNames31.js b/tests/baselines/reference/computedPropertyNames31.js index bf75ac2be74..9a31b80e346 100644 --- a/tests/baselines/reference/computedPropertyNames31.js +++ b/tests/baselines/reference/computedPropertyNames31.js @@ -37,7 +37,7 @@ var C = (function (_super) { } C.prototype.foo = function () { var _this = this; - (function () { + (() => { var obj = { [_super.prototype.bar.call(_this)]() { } // needs capture diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1.js b/tests/baselines/reference/computedPropertyNamesContextualType1.js index d7704c8c377..82429be9c40 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType1.js @@ -14,5 +14,5 @@ var o = { ["" + 0](y) { return y.length; }, - ["" + 1]: function (y) { return y.length; } + ["" + 1]: y => { return y.length; } }; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2.js b/tests/baselines/reference/computedPropertyNamesContextualType2.js index 7b9f98402f5..028e797be18 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType2.js @@ -14,5 +14,5 @@ var o = { [+"foo"](y) { return y.length; }, - [+"bar"]: function (y) { return y.length; } + [+"bar"]: y => { return y.length; } }; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3.js b/tests/baselines/reference/computedPropertyNamesContextualType3.js index f5b2c71bc18..944bb3595d4 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType3.js @@ -13,5 +13,5 @@ var o = { [+"foo"](y) { return y.length; }, - [+"bar"]: function (y) { return y.length; } + [+"bar"]: y => { return y.length; } }; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6.js b/tests/baselines/reference/computedPropertyNamesContextualType6.js index 5d0cc149b2c..a92958871d9 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType6.js @@ -16,7 +16,7 @@ foo({ //// [computedPropertyNamesContextualType6.js] foo({ p: "", - 0: function () { + 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7.js b/tests/baselines/reference/computedPropertyNamesContextualType7.js index 74030be6f2a..00103bc76db 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType7.js @@ -16,7 +16,7 @@ foo({ //// [computedPropertyNamesContextualType7.js] foo({ p: "", - 0: function () { + 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, From ca3c1ed543cb4fb0f8d71181d03d2c41ed35f1e9 Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 28 Jan 2015 16:10:15 -0800 Subject: [PATCH 11/23] Address the issue that arrow function doesn't have arguments objects --- src/compiler/checker.ts | 10 + .../diagnosticInformationMap.generated.ts | 1 + src/compiler/diagnosticMessages.json | 3818 +++++++++-------- src/harness/harness.ts | 2 +- src/harness/loggedIO.ts | 2 +- 5 files changed, 1924 insertions(+), 1909 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ba271e72687..fdad2277f0a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4836,6 +4836,16 @@ module ts { function checkIdentifier(node: Identifier): Type { var symbol = getResolvedSymbol(node); + // As noted in ECMAScript 6 language spec, arrow functions never have an arguments objects. + // Although in down-level emit of arrow function, we emit it using function expression which means that + // arguments objects will be inner bound while emitting arrow function natively in ES6, arguments objects + // will be bound to non-arrow function that contain this arrow function. This results in inconsistent bahaviour. + // To avoid that we will give an error to users if they use arguments objects in arrow function so that they + // can explicitly bound arguments objects + if (symbol === argumentsSymbol && getContainingFunction(node).kind === SyntaxKind.ArrowFunction) { + error(node, Diagnostics.An_argument_object_has_different_behaviour_across_Javascript_versions_Use_function_expression_or_rest_parameters_instead); + } + if (symbol.flags & SymbolFlags.Import) { var symbolLinks = getSymbolLinks(symbol); if (!symbolLinks.referenced) { diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index f333520733e..5f9c0a2d4fc 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -452,5 +452,6 @@ module ts { You_cannot_rename_this_element: { code: 8000, category: DiagnosticCategory.Error, key: "You cannot rename this element." }, yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported.", isEarly: true }, Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported.", isEarly: true }, + An_argument_object_has_different_behaviour_across_Javascript_versions_Use_function_expression_or_rest_parameters_instead: { code: 9002, category: DiagnosticCategory.Error, key: "An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead" }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 49ee8eebcd9..b5763adf47e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1,1912 +1,1916 @@ { - "Unterminated string literal.": { - "category": "Error", - "code": 1002 - }, - "Identifier expected.": { - "category": "Error", - "code": 1003 - }, - "'{0}' expected.": { - "category": "Error", - "code": 1005, - "isEarly": true - }, - "A file cannot have a reference to itself.": { - "category": "Error", - "code": 1006 - }, - "Trailing comma not allowed.": { - "category": "Error", - "code": 1009, - "isEarly": true - }, - "'*/' expected.": { - "category": "Error", - "code": 1010 - }, - "Unexpected token.": { - "category": "Error", - "code": 1012 - }, - "Catch clause parameter cannot have a type annotation.": { - "category": "Error", - "code": 1013, - "isEarly": true - }, - "A rest parameter must be last in a parameter list.": { - "category": "Error", - "code": 1014, - "isEarly": true - }, - "Parameter cannot have question mark and initializer.": { - "category": "Error", - "code": 1015, - "isEarly": true - }, - "A required parameter cannot follow an optional parameter.": { - "category": "Error", - "code": 1016, - "isEarly": true - }, - "An index signature cannot have a rest parameter.": { - "category": "Error", - "code": 1017, - "isEarly": true - }, - "An index signature parameter cannot have an accessibility modifier.": { - "category": "Error", - "code": 1018, - "isEarly": true - }, - "An index signature parameter cannot have a question mark.": { - "category": "Error", - "code": 1019, - "isEarly": true - }, - "An index signature parameter cannot have an initializer.": { - "category": "Error", - "code": 1020, - "isEarly": true - }, - "An index signature must have a type annotation.": { - "category": "Error", - "code": 1021, - "isEarly": true - }, - "An index signature parameter must have a type annotation.": { - "category": "Error", - "code": 1022, - "isEarly": true - }, - "An index signature parameter type must be 'string' or 'number'.": { - "category": "Error", - "code": 1023, - "isEarly": true - }, - "A class or interface declaration can only have one 'extends' clause.": { - "category": "Error", - "code": 1024 - }, - "An 'extends' clause must precede an 'implements' clause.": { - "category": "Error", - "code": 1025 - }, - "A class can only extend a single class.": { - "category": "Error", - "code": 1026 - }, - "A class declaration can only have one 'implements' clause.": { - "category": "Error", - "code": 1027 - }, - "Accessibility modifier already seen.": { - "category": "Error", - "code": 1028, - "isEarly": true - }, - "'{0}' modifier must precede '{1}' modifier.": { - "category": "Error", - "code": 1029, - "isEarly": true - }, - "'{0}' modifier already seen.": { - "category": "Error", - "code": 1030, - "isEarly": true - }, - "'{0}' modifier cannot appear on a class element.": { - "category": "Error", - "code": 1031, - "isEarly": true - }, - "An interface declaration cannot have an 'implements' clause.": { - "category": "Error", - "code": 1032 - }, - "'super' must be followed by an argument list or member access.": { - "category": "Error", - "code": 1034 - }, - "Only ambient modules can use quoted names.": { - "category": "Error", - "code": 1035, - "isEarly": true - }, - "Statements are not allowed in ambient contexts.": { - "category": "Error", - "code": 1036, - "isEarly": true - }, - "A 'declare' modifier cannot be used in an already ambient context.": { - "category": "Error", - "code": 1038, - "isEarly": true - }, - "Initializers are not allowed in ambient contexts.": { - "category": "Error", - "code": 1039, - "isEarly": true - }, - "'{0}' modifier cannot appear on a module element.": { - "category": "Error", - "code": 1044, - "isEarly": true - }, - "A 'declare' modifier cannot be used with an interface declaration.": { - "category": "Error", - "code": 1045, - "isEarly": true - }, - "A 'declare' modifier is required for a top level declaration in a .d.ts file.": { - "category": "Error", - "code": 1046 - }, - "A rest parameter cannot be optional.": { - "category": "Error", - "code": 1047, - "isEarly": true - }, - "A rest parameter cannot have an initializer.": { - "category": "Error", - "code": 1048, - "isEarly": true - }, - "A 'set' accessor must have exactly one parameter.": { - "category": "Error", - "code": 1049, - "isEarly": true - }, - "A 'set' accessor cannot have an optional parameter.": { - "category": "Error", - "code": 1051, - "isEarly": true - }, - "A 'set' accessor parameter cannot have an initializer.": { - "category": "Error", - "code": 1052, - "isEarly": true - }, - "A 'set' accessor cannot have rest parameter.": { - "category": "Error", - "code": 1053, - "isEarly": true - }, - "A 'get' accessor cannot have parameters.": { - "category": "Error", - "code": 1054, - "isEarly": true - }, - "Accessors are only available when targeting ECMAScript 5 and higher.": { - "category": "Error", - "code": 1056, - "isEarly": true - }, - "Enum member must have initializer.": { - "category": "Error", - "code": 1061, - "isEarly": true - }, - "An export assignment cannot be used in an internal module.": { - "category": "Error", - "code": 1063, - "isEarly": true - }, - "Ambient enum elements can only have integer literal initializers.": { - "category": "Error", - "code": 1066, - "isEarly": true - }, - "Unexpected token. A constructor, method, accessor, or property was expected.": { - "category": "Error", - "code": 1068 - }, - "A 'declare' modifier cannot be used with an import declaration.": { - "category": "Error", - "code": 1079, - "isEarly": true - }, - "Invalid 'reference' directive syntax.": { - "category": "Error", - "code": 1084 - }, - "Octal literals are not available when targeting ECMAScript 5 and higher.": { - "category": "Error", - "code": 1085, - "isEarly": true - }, - "An accessor cannot be declared in an ambient context.": { - "category": "Error", - "code": 1086, - "isEarly": true - }, - "'{0}' modifier cannot appear on a constructor declaration.": { - "category": "Error", - "code": 1089, - "isEarly": true - }, - "'{0}' modifier cannot appear on a parameter.": { - "category": "Error", - "code": 1090, - "isEarly": true - }, - "Only a single variable declaration is allowed in a 'for...in' statement.": { - "category": "Error", - "code": 1091, - "isEarly": true - }, - "Type parameters cannot appear on a constructor declaration.": { - "category": "Error", - "code": 1092, - "isEarly": true - }, - "Type annotation cannot appear on a constructor declaration.": { - "category": "Error", - "code": 1093, - "isEarly": true - }, - "An accessor cannot have type parameters.": { - "category": "Error", - "code": 1094, - "isEarly": true - }, - "A 'set' accessor cannot have a return type annotation.": { - "category": "Error", - "code": 1095, - "isEarly": true - }, - "An index signature must have exactly one parameter.": { - "category": "Error", - "code": 1096, - "isEarly": true - }, - "'{0}' list cannot be empty.": { - "category": "Error", - "code": 1097, - "isEarly": true - }, - "Type parameter list cannot be empty.": { - "category": "Error", - "code": 1098, - "isEarly": true - }, - "Type argument list cannot be empty.": { - "category": "Error", - "code": 1099, - "isEarly": true - }, - "Invalid use of '{0}' in strict mode.": { - "category": "Error", - "code": 1100, - "isEarly": true - }, - "'with' statements are not allowed in strict mode.": { - "category": "Error", - "code": 1101, - "isEarly": true - }, - "'delete' cannot be called on an identifier in strict mode.": { - "category": "Error", - "code": 1102, - "isEarly": true - }, - "A 'continue' statement can only be used within an enclosing iteration statement.": { - "category": "Error", - "code": 1104, - "isEarly": true - }, - "A 'break' statement can only be used within an enclosing iteration or switch statement.": { - "category": "Error", - "code": 1105, - "isEarly": true - }, - "Jump target cannot cross function boundary.": { - "category": "Error", - "code": 1107, - "isEarly": true - }, - "A 'return' statement can only be used within a function body.": { - "category": "Error", - "code": 1108, - "isEarly": true - }, - "Expression expected.": { - "category": "Error", - "code": 1109, - "isEarly": true - }, - "Type expected.": { - "category": "Error", - "code": 1110, - "isEarly": true - }, - "A class member cannot be declared optional.": { - "category": "Error", - "code": 1112, - "isEarly": true - }, - "A 'default' clause cannot appear more than once in a 'switch' statement.": { - "category": "Error", - "code": 1113, - "isEarly": true - }, - "Duplicate label '{0}'": { - "category": "Error", - "code": 1114, - "isEarly": true - }, - "A 'continue' statement can only jump to a label of an enclosing iteration statement.": { - "category": "Error", - "code": 1115, - "isEarly": true - }, - "A 'break' statement can only jump to a label of an enclosing statement.": { - "category": "Error", - "code": 1116, - "isEarly": true - }, - "An object literal cannot have multiple properties with the same name in strict mode.": { - "category": "Error", - "code": 1117, - "isEarly": true - }, - "An object literal cannot have multiple get/set accessors with the same name.": { - "category": "Error", - "code": 1118, - "isEarly": true - }, - "An object literal cannot have property and accessor with the same name.": { - "category": "Error", - "code": 1119, - "isEarly": true - }, - "An export assignment cannot have modifiers.": { - "category": "Error", - "code": 1120, - "isEarly": true - }, - "Octal literals are not allowed in strict mode.": { - "category": "Error", - "code": 1121, - "isEarly": true - }, - "A tuple type element list cannot be empty.": { - "category": "Error", - "code": 1122, - "isEarly": true - }, - "Variable declaration list cannot be empty.": { - "category": "Error", - "code": 1123, - "isEarly": true - }, - "Digit expected.": { - "category": "Error", - "code": 1124 - }, - "Hexadecimal digit expected.": { - "category": "Error", - "code": 1125 - }, - "Unexpected end of text.": { - "category": "Error", - "code": 1126 - }, - "Invalid character.": { - "category": "Error", - "code": 1127 - }, - "Declaration or statement expected.": { - "category": "Error", - "code": 1128 - }, - "Statement expected.": { - "category": "Error", - "code": 1129 - }, - "'case' or 'default' expected.": { - "category": "Error", - "code": 1130 - }, - "Property or signature expected.": { - "category": "Error", - "code": 1131 - }, - "Enum member expected.": { - "category": "Error", - "code": 1132 - }, - "Type reference expected.": { - "category": "Error", - "code": 1133 - }, - "Variable declaration expected.": { - "category": "Error", - "code": 1134 - }, - "Argument expression expected.": { - "category": "Error", - "code": 1135, - "isEarly": true - }, - "Property assignment expected.": { - "category": "Error", - "code": 1136 - }, - "Expression or comma expected.": { - "category": "Error", - "code": 1137 - }, - "Parameter declaration expected.": { - "category": "Error", - "code": 1138 - }, - "Type parameter declaration expected.": { - "category": "Error", - "code": 1139 - }, - "Type argument expected.": { - "category": "Error", - "code": 1140 - }, - "String literal expected.": { - "category": "Error", - "code": 1141, - "isEarly": true - }, - "Line break not permitted here.": { - "category": "Error", - "code": 1142, - "isEarly": true - }, - "'{' or ';' expected.": { - "category": "Error", - "code": 1144 - }, - "Modifiers not permitted on index signature members.": { - "category": "Error", - "code": 1145, - "isEarly": true - }, - "Declaration expected.": { - "category": "Error", - "code": 1146 - }, - "Import declarations in an internal module cannot reference an external module.": { - "category": "Error", - "code": 1147, - "isEarly": true - }, - "Cannot compile external modules unless the '--module' flag is provided.": { - "category": "Error", - "code": 1148 - }, - "Filename '{0}' differs from already included filename '{1}' only in casing": { - "category": "Error", - "code": 1149 - }, - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": { - "category": "Error", - "code": 1150, - "isEarly": true - }, - "'var', 'let' or 'const' expected.": { - "category": "Error", - "code": 1152 - }, - "'let' declarations are only available when targeting ECMAScript 6 and higher.": { - "category": "Error", - "code": 1153, - "isEarly": true - }, - "'const' declarations are only available when targeting ECMAScript 6 and higher.": { - "category": "Error", - "code": 1154, - "isEarly": true - }, - "'const' declarations must be initialized": { - "category": "Error", - "code": 1155, - "isEarly": true - }, - "'const' declarations can only be declared inside a block.": { - "category": "Error", - "code": 1156, - "isEarly": true - }, - "'let' declarations can only be declared inside a block.": { - "category": "Error", - "code": 1157, - "isEarly": true - }, - "Tagged templates are only available when targeting ECMAScript 6 and higher.": { - "category": "Error", - "code": 1159, - "isEarly": true - }, - "Unterminated template literal.": { - "category": "Error", - "code": 1160 - }, - "Unterminated regular expression literal.": { - "category": "Error", - "code": 1161 - }, - "An object member cannot be declared optional.": { - "category": "Error", - "code": 1162, - "isEarly": true - }, - "'yield' expression must be contained_within a generator declaration.": { - "category": "Error", - "code": 1163, - "isEarly": true - }, - "Computed property names are not allowed in enums.": { - "category": "Error", - "code": 1164, - "isEarly": true - }, - "Computed property names are not allowed in an ambient context.": { - "category": "Error", - "code": 1165, - "isEarly": true - }, - "Computed property names are not allowed in class property declarations.": { - "category": "Error", - "code": 1166, - "isEarly": true - }, - "Computed property names are only available when targeting ECMAScript 6 and higher.": { - "category": "Error", - "code": 1167, - "isEarly": true - }, - "Computed property names are not allowed in method overloads.": { - "category": "Error", - "code": 1168, - "isEarly": true - }, - "Computed property names are not allowed in interfaces.": { - "category": "Error", - "code": 1169, - "isEarly": true - }, - "Computed property names are not allowed in type literals.": { - "category": "Error", - "code": 1170, - "isEarly": true - }, - "A comma expression is not allowed in a computed property name.": { - "category": "Error", - "code": 1171 - }, - "'extends' clause already seen.": { - "category": "Error", - "code": 1172, - "isEarly": true - }, - "'extends' clause must precede 'implements' clause.": { - "category": "Error", - "code": 1173, - "isEarly": true - }, - "Classes can only extend a single class.": { - "category": "Error", - "code": 1174, - "isEarly": true - }, - "'implements' clause already seen.": { - "category": "Error", - "code": 1175, - "isEarly": true - }, - "Interface declaration cannot have 'implements' clause.": { - "category": "Error", - "code": 1176, - "isEarly": true - }, - "Binary digit expected.": { - "category": "Error", - "code": 1177 - }, - "Octal digit expected.": { - "category": "Error", - "code": 1178 - }, - "Unexpected token. '{' expected.": { - "category": "Error", - "code": 1179 - }, - "Property destructuring pattern expected.": { - "category": "Error", - "code": 1180 - }, - "Array element destructuring pattern expected.": { - "category": "Error", - "code": 1181 - }, - "A destructuring declaration must have an initializer.": { - "category": "Error", - "code": 1182, - "isEarly": true - }, - "Destructuring declarations are not allowed in ambient contexts.": { - "category": "Error", - "code": 1183, - "isEarly": true - }, - "An implementation cannot be declared in ambient contexts.": { - "category": "Error", - "code": 1184, - "isEarly": true - }, - "Modifiers cannot appear here.": { - "category": "Error", - "code": 1184 - }, - "Merge conflict marker encountered.": { - "category": "Error", - "code": 1185 - }, - "A rest element cannot have an initializer.": { - "category": "Error", - "code": 1186 - }, - "A parameter property may not be a binding pattern.": { - "category": "Error", - "code": 1187 - }, + "Unterminated string literal.": { + "category": "Error", + "code": 1002 + }, + "Identifier expected.": { + "category": "Error", + "code": 1003 + }, + "'{0}' expected.": { + "category": "Error", + "code": 1005, + "isEarly": true + }, + "A file cannot have a reference to itself.": { + "category": "Error", + "code": 1006 + }, + "Trailing comma not allowed.": { + "category": "Error", + "code": 1009, + "isEarly": true + }, + "'*/' expected.": { + "category": "Error", + "code": 1010 + }, + "Unexpected token.": { + "category": "Error", + "code": 1012 + }, + "Catch clause parameter cannot have a type annotation.": { + "category": "Error", + "code": 1013, + "isEarly": true + }, + "A rest parameter must be last in a parameter list.": { + "category": "Error", + "code": 1014, + "isEarly": true + }, + "Parameter cannot have question mark and initializer.": { + "category": "Error", + "code": 1015, + "isEarly": true + }, + "A required parameter cannot follow an optional parameter.": { + "category": "Error", + "code": 1016, + "isEarly": true + }, + "An index signature cannot have a rest parameter.": { + "category": "Error", + "code": 1017, + "isEarly": true + }, + "An index signature parameter cannot have an accessibility modifier.": { + "category": "Error", + "code": 1018, + "isEarly": true + }, + "An index signature parameter cannot have a question mark.": { + "category": "Error", + "code": 1019, + "isEarly": true + }, + "An index signature parameter cannot have an initializer.": { + "category": "Error", + "code": 1020, + "isEarly": true + }, + "An index signature must have a type annotation.": { + "category": "Error", + "code": 1021, + "isEarly": true + }, + "An index signature parameter must have a type annotation.": { + "category": "Error", + "code": 1022, + "isEarly": true + }, + "An index signature parameter type must be 'string' or 'number'.": { + "category": "Error", + "code": 1023, + "isEarly": true + }, + "A class or interface declaration can only have one 'extends' clause.": { + "category": "Error", + "code": 1024 + }, + "An 'extends' clause must precede an 'implements' clause.": { + "category": "Error", + "code": 1025 + }, + "A class can only extend a single class.": { + "category": "Error", + "code": 1026 + }, + "A class declaration can only have one 'implements' clause.": { + "category": "Error", + "code": 1027 + }, + "Accessibility modifier already seen.": { + "category": "Error", + "code": 1028, + "isEarly": true + }, + "'{0}' modifier must precede '{1}' modifier.": { + "category": "Error", + "code": 1029, + "isEarly": true + }, + "'{0}' modifier already seen.": { + "category": "Error", + "code": 1030, + "isEarly": true + }, + "'{0}' modifier cannot appear on a class element.": { + "category": "Error", + "code": 1031, + "isEarly": true + }, + "An interface declaration cannot have an 'implements' clause.": { + "category": "Error", + "code": 1032 + }, + "'super' must be followed by an argument list or member access.": { + "category": "Error", + "code": 1034 + }, + "Only ambient modules can use quoted names.": { + "category": "Error", + "code": 1035, + "isEarly": true + }, + "Statements are not allowed in ambient contexts.": { + "category": "Error", + "code": 1036, + "isEarly": true + }, + "A 'declare' modifier cannot be used in an already ambient context.": { + "category": "Error", + "code": 1038, + "isEarly": true + }, + "Initializers are not allowed in ambient contexts.": { + "category": "Error", + "code": 1039, + "isEarly": true + }, + "'{0}' modifier cannot appear on a module element.": { + "category": "Error", + "code": 1044, + "isEarly": true + }, + "A 'declare' modifier cannot be used with an interface declaration.": { + "category": "Error", + "code": 1045, + "isEarly": true + }, + "A 'declare' modifier is required for a top level declaration in a .d.ts file.": { + "category": "Error", + "code": 1046 + }, + "A rest parameter cannot be optional.": { + "category": "Error", + "code": 1047, + "isEarly": true + }, + "A rest parameter cannot have an initializer.": { + "category": "Error", + "code": 1048, + "isEarly": true + }, + "A 'set' accessor must have exactly one parameter.": { + "category": "Error", + "code": 1049, + "isEarly": true + }, + "A 'set' accessor cannot have an optional parameter.": { + "category": "Error", + "code": 1051, + "isEarly": true + }, + "A 'set' accessor parameter cannot have an initializer.": { + "category": "Error", + "code": 1052, + "isEarly": true + }, + "A 'set' accessor cannot have rest parameter.": { + "category": "Error", + "code": 1053, + "isEarly": true + }, + "A 'get' accessor cannot have parameters.": { + "category": "Error", + "code": 1054, + "isEarly": true + }, + "Accessors are only available when targeting ECMAScript 5 and higher.": { + "category": "Error", + "code": 1056, + "isEarly": true + }, + "Enum member must have initializer.": { + "category": "Error", + "code": 1061, + "isEarly": true + }, + "An export assignment cannot be used in an internal module.": { + "category": "Error", + "code": 1063, + "isEarly": true + }, + "Ambient enum elements can only have integer literal initializers.": { + "category": "Error", + "code": 1066, + "isEarly": true + }, + "Unexpected token. A constructor, method, accessor, or property was expected.": { + "category": "Error", + "code": 1068 + }, + "A 'declare' modifier cannot be used with an import declaration.": { + "category": "Error", + "code": 1079, + "isEarly": true + }, + "Invalid 'reference' directive syntax.": { + "category": "Error", + "code": 1084 + }, + "Octal literals are not available when targeting ECMAScript 5 and higher.": { + "category": "Error", + "code": 1085, + "isEarly": true + }, + "An accessor cannot be declared in an ambient context.": { + "category": "Error", + "code": 1086, + "isEarly": true + }, + "'{0}' modifier cannot appear on a constructor declaration.": { + "category": "Error", + "code": 1089, + "isEarly": true + }, + "'{0}' modifier cannot appear on a parameter.": { + "category": "Error", + "code": 1090, + "isEarly": true + }, + "Only a single variable declaration is allowed in a 'for...in' statement.": { + "category": "Error", + "code": 1091, + "isEarly": true + }, + "Type parameters cannot appear on a constructor declaration.": { + "category": "Error", + "code": 1092, + "isEarly": true + }, + "Type annotation cannot appear on a constructor declaration.": { + "category": "Error", + "code": 1093, + "isEarly": true + }, + "An accessor cannot have type parameters.": { + "category": "Error", + "code": 1094, + "isEarly": true + }, + "A 'set' accessor cannot have a return type annotation.": { + "category": "Error", + "code": 1095, + "isEarly": true + }, + "An index signature must have exactly one parameter.": { + "category": "Error", + "code": 1096, + "isEarly": true + }, + "'{0}' list cannot be empty.": { + "category": "Error", + "code": 1097, + "isEarly": true + }, + "Type parameter list cannot be empty.": { + "category": "Error", + "code": 1098, + "isEarly": true + }, + "Type argument list cannot be empty.": { + "category": "Error", + "code": 1099, + "isEarly": true + }, + "Invalid use of '{0}' in strict mode.": { + "category": "Error", + "code": 1100, + "isEarly": true + }, + "'with' statements are not allowed in strict mode.": { + "category": "Error", + "code": 1101, + "isEarly": true + }, + "'delete' cannot be called on an identifier in strict mode.": { + "category": "Error", + "code": 1102, + "isEarly": true + }, + "A 'continue' statement can only be used within an enclosing iteration statement.": { + "category": "Error", + "code": 1104, + "isEarly": true + }, + "A 'break' statement can only be used within an enclosing iteration or switch statement.": { + "category": "Error", + "code": 1105, + "isEarly": true + }, + "Jump target cannot cross function boundary.": { + "category": "Error", + "code": 1107, + "isEarly": true + }, + "A 'return' statement can only be used within a function body.": { + "category": "Error", + "code": 1108, + "isEarly": true + }, + "Expression expected.": { + "category": "Error", + "code": 1109, + "isEarly": true + }, + "Type expected.": { + "category": "Error", + "code": 1110, + "isEarly": true + }, + "A class member cannot be declared optional.": { + "category": "Error", + "code": 1112, + "isEarly": true + }, + "A 'default' clause cannot appear more than once in a 'switch' statement.": { + "category": "Error", + "code": 1113, + "isEarly": true + }, + "Duplicate label '{0}'": { + "category": "Error", + "code": 1114, + "isEarly": true + }, + "A 'continue' statement can only jump to a label of an enclosing iteration statement.": { + "category": "Error", + "code": 1115, + "isEarly": true + }, + "A 'break' statement can only jump to a label of an enclosing statement.": { + "category": "Error", + "code": 1116, + "isEarly": true + }, + "An object literal cannot have multiple properties with the same name in strict mode.": { + "category": "Error", + "code": 1117, + "isEarly": true + }, + "An object literal cannot have multiple get/set accessors with the same name.": { + "category": "Error", + "code": 1118, + "isEarly": true + }, + "An object literal cannot have property and accessor with the same name.": { + "category": "Error", + "code": 1119, + "isEarly": true + }, + "An export assignment cannot have modifiers.": { + "category": "Error", + "code": 1120, + "isEarly": true + }, + "Octal literals are not allowed in strict mode.": { + "category": "Error", + "code": 1121, + "isEarly": true + }, + "A tuple type element list cannot be empty.": { + "category": "Error", + "code": 1122, + "isEarly": true + }, + "Variable declaration list cannot be empty.": { + "category": "Error", + "code": 1123, + "isEarly": true + }, + "Digit expected.": { + "category": "Error", + "code": 1124 + }, + "Hexadecimal digit expected.": { + "category": "Error", + "code": 1125 + }, + "Unexpected end of text.": { + "category": "Error", + "code": 1126 + }, + "Invalid character.": { + "category": "Error", + "code": 1127 + }, + "Declaration or statement expected.": { + "category": "Error", + "code": 1128 + }, + "Statement expected.": { + "category": "Error", + "code": 1129 + }, + "'case' or 'default' expected.": { + "category": "Error", + "code": 1130 + }, + "Property or signature expected.": { + "category": "Error", + "code": 1131 + }, + "Enum member expected.": { + "category": "Error", + "code": 1132 + }, + "Type reference expected.": { + "category": "Error", + "code": 1133 + }, + "Variable declaration expected.": { + "category": "Error", + "code": 1134 + }, + "Argument expression expected.": { + "category": "Error", + "code": 1135, + "isEarly": true + }, + "Property assignment expected.": { + "category": "Error", + "code": 1136 + }, + "Expression or comma expected.": { + "category": "Error", + "code": 1137 + }, + "Parameter declaration expected.": { + "category": "Error", + "code": 1138 + }, + "Type parameter declaration expected.": { + "category": "Error", + "code": 1139 + }, + "Type argument expected.": { + "category": "Error", + "code": 1140 + }, + "String literal expected.": { + "category": "Error", + "code": 1141, + "isEarly": true + }, + "Line break not permitted here.": { + "category": "Error", + "code": 1142, + "isEarly": true + }, + "'{' or ';' expected.": { + "category": "Error", + "code": 1144 + }, + "Modifiers not permitted on index signature members.": { + "category": "Error", + "code": 1145, + "isEarly": true + }, + "Declaration expected.": { + "category": "Error", + "code": 1146 + }, + "Import declarations in an internal module cannot reference an external module.": { + "category": "Error", + "code": 1147, + "isEarly": true + }, + "Cannot compile external modules unless the '--module' flag is provided.": { + "category": "Error", + "code": 1148 + }, + "Filename '{0}' differs from already included filename '{1}' only in casing": { + "category": "Error", + "code": 1149 + }, + "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": { + "category": "Error", + "code": 1150, + "isEarly": true + }, + "'var', 'let' or 'const' expected.": { + "category": "Error", + "code": 1152 + }, + "'let' declarations are only available when targeting ECMAScript 6 and higher.": { + "category": "Error", + "code": 1153, + "isEarly": true + }, + "'const' declarations are only available when targeting ECMAScript 6 and higher.": { + "category": "Error", + "code": 1154, + "isEarly": true + }, + "'const' declarations must be initialized": { + "category": "Error", + "code": 1155, + "isEarly": true + }, + "'const' declarations can only be declared inside a block.": { + "category": "Error", + "code": 1156, + "isEarly": true + }, + "'let' declarations can only be declared inside a block.": { + "category": "Error", + "code": 1157, + "isEarly": true + }, + "Tagged templates are only available when targeting ECMAScript 6 and higher.": { + "category": "Error", + "code": 1159, + "isEarly": true + }, + "Unterminated template literal.": { + "category": "Error", + "code": 1160 + }, + "Unterminated regular expression literal.": { + "category": "Error", + "code": 1161 + }, + "An object member cannot be declared optional.": { + "category": "Error", + "code": 1162, + "isEarly": true + }, + "'yield' expression must be contained_within a generator declaration.": { + "category": "Error", + "code": 1163, + "isEarly": true + }, + "Computed property names are not allowed in enums.": { + "category": "Error", + "code": 1164, + "isEarly": true + }, + "Computed property names are not allowed in an ambient context.": { + "category": "Error", + "code": 1165, + "isEarly": true + }, + "Computed property names are not allowed in class property declarations.": { + "category": "Error", + "code": 1166, + "isEarly": true + }, + "Computed property names are only available when targeting ECMAScript 6 and higher.": { + "category": "Error", + "code": 1167, + "isEarly": true + }, + "Computed property names are not allowed in method overloads.": { + "category": "Error", + "code": 1168, + "isEarly": true + }, + "Computed property names are not allowed in interfaces.": { + "category": "Error", + "code": 1169, + "isEarly": true + }, + "Computed property names are not allowed in type literals.": { + "category": "Error", + "code": 1170, + "isEarly": true + }, + "A comma expression is not allowed in a computed property name.": { + "category": "Error", + "code": 1171 + }, + "'extends' clause already seen.": { + "category": "Error", + "code": 1172, + "isEarly": true + }, + "'extends' clause must precede 'implements' clause.": { + "category": "Error", + "code": 1173, + "isEarly": true + }, + "Classes can only extend a single class.": { + "category": "Error", + "code": 1174, + "isEarly": true + }, + "'implements' clause already seen.": { + "category": "Error", + "code": 1175, + "isEarly": true + }, + "Interface declaration cannot have 'implements' clause.": { + "category": "Error", + "code": 1176, + "isEarly": true + }, + "Binary digit expected.": { + "category": "Error", + "code": 1177 + }, + "Octal digit expected.": { + "category": "Error", + "code": 1178 + }, + "Unexpected token. '{' expected.": { + "category": "Error", + "code": 1179 + }, + "Property destructuring pattern expected.": { + "category": "Error", + "code": 1180 + }, + "Array element destructuring pattern expected.": { + "category": "Error", + "code": 1181 + }, + "A destructuring declaration must have an initializer.": { + "category": "Error", + "code": 1182, + "isEarly": true + }, + "Destructuring declarations are not allowed in ambient contexts.": { + "category": "Error", + "code": 1183, + "isEarly": true + }, + "An implementation cannot be declared in ambient contexts.": { + "category": "Error", + "code": 1184, + "isEarly": true + }, + "Modifiers cannot appear here.": { + "category": "Error", + "code": 1184 + }, + "Merge conflict marker encountered.": { + "category": "Error", + "code": 1185 + }, + "A rest element cannot have an initializer.": { + "category": "Error", + "code": 1186 + }, + "A parameter property may not be a binding pattern.": { + "category": "Error", + "code": 1187 + }, - "Duplicate identifier '{0}'.": { - "category": "Error", - "code": 2300 - }, - "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.": { - "category": "Error", - "code": 2301 - }, - "Static members cannot reference class type parameters.": { - "category": "Error", - "code": 2302 - }, - "Circular definition of import alias '{0}'.": { - "category": "Error", - "code": 2303 - }, - "Cannot find name '{0}'.": { - "category": "Error", - "code": 2304 - }, - "Module '{0}' has no exported member '{1}'.": { - "category": "Error", - "code": 2305 - }, - "File '{0}' is not an external module.": { - "category": "Error", - "code": 2306 - }, - "Cannot find external module '{0}'.": { - "category": "Error", - "code": 2307 - }, - "A module cannot have more than one export assignment.": { - "category": "Error", - "code": 2308 - }, - "An export assignment cannot be used in a module with other exported elements.": { - "category": "Error", - "code": 2309 - }, - "Type '{0}' recursively references itself as a base type.": { - "category": "Error", - "code": 2310 - }, - "A class may only extend another class.": { - "category": "Error", - "code": 2311 - }, - "An interface may only extend a class or another interface.": { - "category": "Error", - "code": 2312 - }, - "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.": { - "category": "Error", - "code": 2313 - }, - "Generic type '{0}' requires {1} type argument(s).": { - "category": "Error", - "code": 2314 - }, - "Type '{0}' is not generic.": { - "category": "Error", - "code": 2315 - }, - "Global type '{0}' must be a class or interface type.": { - "category": "Error", - "code": 2316 - }, - "Global type '{0}' must have {1} type parameter(s).": { - "category": "Error", - "code": 2317 - }, - "Cannot find global type '{0}'.": { - "category": "Error", - "code": 2318 - }, - "Named properties '{0}' of types '{1}' and '{2}' are not identical.": { - "category": "Error", - "code": 2319 - }, - "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'.": { - "category": "Error", - "code": 2320 - }, - "Excessive stack depth comparing types '{0}' and '{1}'.": { - "category": "Error", - "code": 2321 - }, - "Type '{0}' is not assignable to type '{1}'.": { - "category": "Error", - "code": 2322 - }, - "Property '{0}' is missing in type '{1}'.": { - "category": "Error", - "code": 2324 - }, - "Property '{0}' is private in type '{1}' but not in type '{2}'.": { - "category": "Error", - "code": 2325 - }, - "Types of property '{0}' are incompatible.": { - "category": "Error", - "code": 2326 - }, - "Property '{0}' is optional in type '{1}' but required in type '{2}'.": { - "category": "Error", - "code": 2327 - }, - "Types of parameters '{0}' and '{1}' are incompatible.": { - "category": "Error", - "code": 2328 - }, - "Index signature is missing in type '{0}'.": { - "category": "Error", - "code": 2329 - }, - "Index signatures are incompatible.": { - "category": "Error", - "code": 2330 - }, - "'this' cannot be referenced in a module body.": { - "category": "Error", - "code": 2331 - }, - "'this' cannot be referenced in current location.": { - "category": "Error", - "code": 2332 - }, - "'this' cannot be referenced in constructor arguments.": { - "category": "Error", - "code": 2333 - }, - "'this' cannot be referenced in a static property initializer.": { - "category": "Error", - "code": 2334 - }, - "'super' can only be referenced in a derived class.": { - "category": "Error", - "code": 2335 - }, - "'super' cannot be referenced in constructor arguments.": { - "category": "Error", - "code": 2336 - }, - "Super calls are not permitted outside constructors or in nested functions inside constructors": { - "category": "Error", - "code": 2337 - }, - "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class": { - "category": "Error", - "code": 2338 - }, - "Property '{0}' does not exist on type '{1}'.": { - "category": "Error", - "code": 2339 - }, - "Only public and protected methods of the base class are accessible via the 'super' keyword": { - "category": "Error", - "code": 2340 - }, - "Property '{0}' is private and only accessible within class '{1}'.": { - "category": "Error", - "code": 2341 - }, - "An index expression argument must be of type 'string', 'number', or 'any'.": { - "category": "Error", - "code": 2342 - }, - "Type '{0}' does not satisfy the constraint '{1}'.": { - "category": "Error", - "code": 2344 - }, - "Argument of type '{0}' is not assignable to parameter of type '{1}'.": { - "category": "Error", - "code": 2345 - }, - "Supplied parameters do not match any signature of call target.": { - "category": "Error", - "code": 2346 - }, - "Untyped function calls may not accept type arguments.": { - "category": "Error", - "code": 2347 - }, - "Value of type '{0}' is not callable. Did you mean to include 'new'?": { - "category": "Error", - "code": 2348 - }, - "Cannot invoke an expression whose type lacks a call signature.": { - "category": "Error", - "code": 2349 - }, - "Only a void function can be called with the 'new' keyword.": { - "category": "Error", - "code": 2350 - }, - "Cannot use 'new' with an expression whose type lacks a call or construct signature.": { - "category": "Error", - "code": 2351 - }, - "Neither type '{0}' nor type '{1}' is assignable to the other.": { - "category": "Error", - "code": 2352 - }, - "No best common type exists among return expressions.": { - "category": "Error", - "code": 2354 - }, - "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.": { - "category": "Error", - "code": 2355 - }, - "An arithmetic operand must be of type 'any', 'number' or an enum type.": { - "category": "Error", - "code": 2356 - }, - "The operand of an increment or decrement operator must be a variable, property or indexer.": { - "category": "Error", - "code": 2357 - }, - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": { - "category": "Error", - "code": 2358 - }, - "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.": { - "category": "Error", - "code": 2359 - }, - "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.": { - "category": "Error", - "code": 2360 - }, - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter": { - "category": "Error", - "code": 2361 - }, - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { - "category": "Error", - "code": 2362 - }, - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { - "category": "Error", - "code": 2363 - }, - "Invalid left-hand side of assignment expression.": { - "category": "Error", - "code": 2364 - }, - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": { - "category": "Error", - "code": 2365 - }, - "Type parameter name cannot be '{0}'": { - "category": "Error", - "code": 2368 - }, - "A parameter property is only allowed in a constructor implementation.": { - "category": "Error", - "code": 2369 - }, - "A rest parameter must be of an array type.": { - "category": "Error", - "code": 2370 - }, - "A parameter initializer is only allowed in a function or constructor implementation.": { - "category": "Error", - "code": 2371 - }, - "Parameter '{0}' cannot be referenced in its initializer.": { - "category": "Error", - "code": 2372 - }, - "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.": { - "category": "Error", - "code": 2373 - }, - "Duplicate string index signature.": { - "category": "Error", - "code": 2374 - }, - "Duplicate number index signature.": { - "category": "Error", - "code": 2375 - }, - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": { - "category": "Error", - "code": 2376 - }, - "Constructors for derived classes must contain a 'super' call.": { - "category": "Error", - "code": 2377 - }, - "A 'get' accessor must return a value or consist of a single 'throw' statement.": { - "category": "Error", - "code": 2378 - }, - "Getter and setter accessors do not agree in visibility.": { - "category": "Error", - "code": 2379 - }, - "'get' and 'set' accessor must have the same type.": { - "category": "Error", - "code": 2380 - }, - "A signature with an implementation cannot use a string literal type.": { - "category": "Error", - "code": 2381 - }, - "Specialized overload signature is not assignable to any non-specialized signature.": { - "category": "Error", - "code": 2382 - }, - "Overload signatures must all be exported or not exported.": { - "category": "Error", - "code": 2383 - }, - "Overload signatures must all be ambient or non-ambient.": { - "category": "Error", - "code": 2384 - }, - "Overload signatures must all be public, private or protected.": { - "category": "Error", - "code": 2385 - }, - "Overload signatures must all be optional or required.": { - "category": "Error", - "code": 2386 - }, - "Function overload must be static.": { - "category": "Error", - "code": 2387 - }, - "Function overload must not be static.": { - "category": "Error", - "code": 2388 - }, - "Function implementation name must be '{0}'.": { - "category": "Error", - "code": 2389 - }, - "Constructor implementation is missing.": { - "category": "Error", - "code": 2390 - }, - "Function implementation is missing or not immediately following the declaration.": { - "category": "Error", - "code": 2391 - }, - "Multiple constructor implementations are not allowed.": { - "category": "Error", - "code": 2392 - }, - "Duplicate function implementation.": { - "category": "Error", - "code": 2393 - }, - "Overload signature is not compatible with function implementation.": { - "category": "Error", - "code": 2394 - }, - "Individual declarations in merged declaration {0} must be all exported or all local.": { - "category": "Error", - "code": 2395 - }, - "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.": { - "category": "Error", - "code": 2396 - }, - "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.": { - "category": "Error", - "code": 2399 - }, - "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.": { - "category": "Error", - "code": 2400 - }, - "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.": { - "category": "Error", - "code": 2401 - }, - "Expression resolves to '_super' that compiler uses to capture base class reference.": { - "category": "Error", - "code": 2402 - }, - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": { - "category": "Error", - "code": 2403 - }, - "The left-hand side of a 'for...in' statement cannot use a type annotation.": { - "category": "Error", - "code": 2404 - }, - "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.": { - "category": "Error", - "code": 2405 - }, - "Invalid left-hand side in 'for...in' statement.": { - "category": "Error", - "code": 2406 - }, - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": { - "category": "Error", - "code": 2407 - }, - "Setters cannot return a value.": { - "category": "Error", - "code": 2408 - }, - "Return type of constructor signature must be assignable to the instance type of the class": { - "category": "Error", - "code": 2409 - }, - "All symbols within a 'with' block will be resolved to 'any'.": { - "category": "Error", - "code": 2410 - }, - "Property '{0}' of type '{1}' is not assignable to string index type '{2}'.": { - "category": "Error", - "code": 2411 - }, - "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'.": { - "category": "Error", - "code": 2412 - }, - "Numeric index type '{0}' is not assignable to string index type '{1}'.": { - "category": "Error", - "code": 2413 - }, - "Class name cannot be '{0}'": { - "category": "Error", - "code": 2414 - }, - "Class '{0}' incorrectly extends base class '{1}'.": { - "category": "Error", - "code": 2415 - }, - "Class static side '{0}' incorrectly extends base class static side '{1}'.": { - "category": "Error", - "code": 2417 - }, - "Type name '{0}' in extends clause does not reference constructor function for '{0}'.": { - "category": "Error", - "code": 2419 - }, - "Class '{0}' incorrectly implements interface '{1}'.": { - "category": "Error", - "code": 2420 - }, - "A class may only implement another class or interface.": { - "category": "Error", - "code": 2422 - }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": { - "category": "Error", - "code": 2423 - }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": { - "category": "Error", - "code": 2424 - }, - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": { - "category": "Error", - "code": 2425 - }, - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": { - "category": "Error", - "code": 2426 - }, - "Interface name cannot be '{0}'": { - "category": "Error", - "code": 2427 - }, - "All declarations of an interface must have identical type parameters.": { - "category": "Error", - "code": 2428 - }, - "Interface '{0}' incorrectly extends interface '{1}'.": { - "category": "Error", - "code": 2430 - }, - "Enum name cannot be '{0}'": { - "category": "Error", - "code": 2431 - }, - "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.": { - "category": "Error", - "code": 2432 - }, - "A module declaration cannot be in a different file from a class or function with which it is merged": { - "category": "Error", - "code": 2433 - }, - "A module declaration cannot be located prior to a class or function with which it is merged": { - "category": "Error", - "code": 2434 - }, - "Ambient external modules cannot be nested in other modules.": { - "category": "Error", - "code": 2435 - }, - "Ambient external module declaration cannot specify relative module name.": { - "category": "Error", - "code": 2436 - }, - "Module '{0}' is hidden by a local declaration with the same name": { - "category": "Error", - "code": 2437 - }, - "Import name cannot be '{0}'": { - "category": "Error", - "code": 2438 - }, - "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.": { - "category": "Error", - "code": 2439 - }, - "Import declaration conflicts with local declaration of '{0}'": { - "category": "Error", - "code": 2440 - }, - "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module.": { - "category": "Error", - "code": 2441 - }, - "Types have separate declarations of a private property '{0}'.": { - "category": "Error", - "code": 2442 - }, - "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'.": { - "category": "Error", - "code": 2443 - }, - "Property '{0}' is protected in type '{1}' but public in type '{2}'.": { - "category": "Error", - "code": 2444 - }, - "Property '{0}' is protected and only accessible within class '{1}' and its subclasses.": { - "category": "Error", - "code": 2445 - }, - "Property '{0}' is protected and only accessible through an instance of class '{1}'.": { - "category": "Error", - "code": 2446 - }, - "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead.": { - "category": "Error", - "code": 2447 - }, - "Block-scoped variable '{0}' used before its declaration.": { - "category": "Error", - "code": 2448, - "isEarly": true - }, - "The operand of an increment or decrement operator cannot be a constant.": { - "category": "Error", - "code": 2449, - "isEarly": true - }, - "Left-hand side of assignment expression cannot be a constant.": { - "category": "Error", - "code": 2450, - "isEarly": true - }, - "Cannot redeclare block-scoped variable '{0}'.": { - "category": "Error", - "code": 2451, - "isEarly": true - }, - "An enum member cannot have a numeric name.": { - "category": "Error", - "code": 2452 - }, - "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly.": { - "category": "Error", - "code": 2453 - }, - "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'.": { - "category": "Error", - "code": 2455 - }, - "Type alias '{0}' circularly references itself.": { - "category": "Error", - "code": 2456 - }, - "Type alias name cannot be '{0}'": { - "category": "Error", - "code": 2457 - }, - "An AMD module cannot have multiple name assignments.": { - "category": "Error", - "code": 2458 - }, - "Type '{0}' has no property '{1}' and no string index signature.": { - "category": "Error", - "code": 2459 - }, - "Type '{0}' has no property '{1}'.": { - "category": "Error", - "code": 2460 - }, - "Type '{0}' is not an array type.": { - "category": "Error", - "code": 2461 - }, - "A rest element must be last in an array destructuring pattern": { - "category": "Error", - "code": 2462 - }, - "A binding pattern parameter cannot be optional in an implementation signature.": { - "category": "Error", - "code": 2463 - }, - "A computed property name must be of type 'string', 'number', or 'any'.": { - "category": "Error", - "code": 2464 - }, - "'this' cannot be referenced in a computed property name.": { - "category": "Error", - "code": 2465 - }, - "'super' cannot be referenced in a computed property name.": { - "category": "Error", - "code": 2466 - }, - "A computed property name cannot reference a type parameter from its containing type.": { - "category": "Error", - "code": 2466 - }, + "Duplicate identifier '{0}'.": { + "category": "Error", + "code": 2300 + }, + "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.": { + "category": "Error", + "code": 2301 + }, + "Static members cannot reference class type parameters.": { + "category": "Error", + "code": 2302 + }, + "Circular definition of import alias '{0}'.": { + "category": "Error", + "code": 2303 + }, + "Cannot find name '{0}'.": { + "category": "Error", + "code": 2304 + }, + "Module '{0}' has no exported member '{1}'.": { + "category": "Error", + "code": 2305 + }, + "File '{0}' is not an external module.": { + "category": "Error", + "code": 2306 + }, + "Cannot find external module '{0}'.": { + "category": "Error", + "code": 2307 + }, + "A module cannot have more than one export assignment.": { + "category": "Error", + "code": 2308 + }, + "An export assignment cannot be used in a module with other exported elements.": { + "category": "Error", + "code": 2309 + }, + "Type '{0}' recursively references itself as a base type.": { + "category": "Error", + "code": 2310 + }, + "A class may only extend another class.": { + "category": "Error", + "code": 2311 + }, + "An interface may only extend a class or another interface.": { + "category": "Error", + "code": 2312 + }, + "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.": { + "category": "Error", + "code": 2313 + }, + "Generic type '{0}' requires {1} type argument(s).": { + "category": "Error", + "code": 2314 + }, + "Type '{0}' is not generic.": { + "category": "Error", + "code": 2315 + }, + "Global type '{0}' must be a class or interface type.": { + "category": "Error", + "code": 2316 + }, + "Global type '{0}' must have {1} type parameter(s).": { + "category": "Error", + "code": 2317 + }, + "Cannot find global type '{0}'.": { + "category": "Error", + "code": 2318 + }, + "Named properties '{0}' of types '{1}' and '{2}' are not identical.": { + "category": "Error", + "code": 2319 + }, + "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'.": { + "category": "Error", + "code": 2320 + }, + "Excessive stack depth comparing types '{0}' and '{1}'.": { + "category": "Error", + "code": 2321 + }, + "Type '{0}' is not assignable to type '{1}'.": { + "category": "Error", + "code": 2322 + }, + "Property '{0}' is missing in type '{1}'.": { + "category": "Error", + "code": 2324 + }, + "Property '{0}' is private in type '{1}' but not in type '{2}'.": { + "category": "Error", + "code": 2325 + }, + "Types of property '{0}' are incompatible.": { + "category": "Error", + "code": 2326 + }, + "Property '{0}' is optional in type '{1}' but required in type '{2}'.": { + "category": "Error", + "code": 2327 + }, + "Types of parameters '{0}' and '{1}' are incompatible.": { + "category": "Error", + "code": 2328 + }, + "Index signature is missing in type '{0}'.": { + "category": "Error", + "code": 2329 + }, + "Index signatures are incompatible.": { + "category": "Error", + "code": 2330 + }, + "'this' cannot be referenced in a module body.": { + "category": "Error", + "code": 2331 + }, + "'this' cannot be referenced in current location.": { + "category": "Error", + "code": 2332 + }, + "'this' cannot be referenced in constructor arguments.": { + "category": "Error", + "code": 2333 + }, + "'this' cannot be referenced in a static property initializer.": { + "category": "Error", + "code": 2334 + }, + "'super' can only be referenced in a derived class.": { + "category": "Error", + "code": 2335 + }, + "'super' cannot be referenced in constructor arguments.": { + "category": "Error", + "code": 2336 + }, + "Super calls are not permitted outside constructors or in nested functions inside constructors": { + "category": "Error", + "code": 2337 + }, + "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class": { + "category": "Error", + "code": 2338 + }, + "Property '{0}' does not exist on type '{1}'.": { + "category": "Error", + "code": 2339 + }, + "Only public and protected methods of the base class are accessible via the 'super' keyword": { + "category": "Error", + "code": 2340 + }, + "Property '{0}' is private and only accessible within class '{1}'.": { + "category": "Error", + "code": 2341 + }, + "An index expression argument must be of type 'string', 'number', or 'any'.": { + "category": "Error", + "code": 2342 + }, + "Type '{0}' does not satisfy the constraint '{1}'.": { + "category": "Error", + "code": 2344 + }, + "Argument of type '{0}' is not assignable to parameter of type '{1}'.": { + "category": "Error", + "code": 2345 + }, + "Supplied parameters do not match any signature of call target.": { + "category": "Error", + "code": 2346 + }, + "Untyped function calls may not accept type arguments.": { + "category": "Error", + "code": 2347 + }, + "Value of type '{0}' is not callable. Did you mean to include 'new'?": { + "category": "Error", + "code": 2348 + }, + "Cannot invoke an expression whose type lacks a call signature.": { + "category": "Error", + "code": 2349 + }, + "Only a void function can be called with the 'new' keyword.": { + "category": "Error", + "code": 2350 + }, + "Cannot use 'new' with an expression whose type lacks a call or construct signature.": { + "category": "Error", + "code": 2351 + }, + "Neither type '{0}' nor type '{1}' is assignable to the other.": { + "category": "Error", + "code": 2352 + }, + "No best common type exists among return expressions.": { + "category": "Error", + "code": 2354 + }, + "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.": { + "category": "Error", + "code": 2355 + }, + "An arithmetic operand must be of type 'any', 'number' or an enum type.": { + "category": "Error", + "code": 2356 + }, + "The operand of an increment or decrement operator must be a variable, property or indexer.": { + "category": "Error", + "code": 2357 + }, + "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": { + "category": "Error", + "code": 2358 + }, + "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.": { + "category": "Error", + "code": 2359 + }, + "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.": { + "category": "Error", + "code": 2360 + }, + "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter": { + "category": "Error", + "code": 2361 + }, + "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { + "category": "Error", + "code": 2362 + }, + "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { + "category": "Error", + "code": 2363 + }, + "Invalid left-hand side of assignment expression.": { + "category": "Error", + "code": 2364 + }, + "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": { + "category": "Error", + "code": 2365 + }, + "Type parameter name cannot be '{0}'": { + "category": "Error", + "code": 2368 + }, + "A parameter property is only allowed in a constructor implementation.": { + "category": "Error", + "code": 2369 + }, + "A rest parameter must be of an array type.": { + "category": "Error", + "code": 2370 + }, + "A parameter initializer is only allowed in a function or constructor implementation.": { + "category": "Error", + "code": 2371 + }, + "Parameter '{0}' cannot be referenced in its initializer.": { + "category": "Error", + "code": 2372 + }, + "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.": { + "category": "Error", + "code": 2373 + }, + "Duplicate string index signature.": { + "category": "Error", + "code": 2374 + }, + "Duplicate number index signature.": { + "category": "Error", + "code": 2375 + }, + "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": { + "category": "Error", + "code": 2376 + }, + "Constructors for derived classes must contain a 'super' call.": { + "category": "Error", + "code": 2377 + }, + "A 'get' accessor must return a value or consist of a single 'throw' statement.": { + "category": "Error", + "code": 2378 + }, + "Getter and setter accessors do not agree in visibility.": { + "category": "Error", + "code": 2379 + }, + "'get' and 'set' accessor must have the same type.": { + "category": "Error", + "code": 2380 + }, + "A signature with an implementation cannot use a string literal type.": { + "category": "Error", + "code": 2381 + }, + "Specialized overload signature is not assignable to any non-specialized signature.": { + "category": "Error", + "code": 2382 + }, + "Overload signatures must all be exported or not exported.": { + "category": "Error", + "code": 2383 + }, + "Overload signatures must all be ambient or non-ambient.": { + "category": "Error", + "code": 2384 + }, + "Overload signatures must all be public, private or protected.": { + "category": "Error", + "code": 2385 + }, + "Overload signatures must all be optional or required.": { + "category": "Error", + "code": 2386 + }, + "Function overload must be static.": { + "category": "Error", + "code": 2387 + }, + "Function overload must not be static.": { + "category": "Error", + "code": 2388 + }, + "Function implementation name must be '{0}'.": { + "category": "Error", + "code": 2389 + }, + "Constructor implementation is missing.": { + "category": "Error", + "code": 2390 + }, + "Function implementation is missing or not immediately following the declaration.": { + "category": "Error", + "code": 2391 + }, + "Multiple constructor implementations are not allowed.": { + "category": "Error", + "code": 2392 + }, + "Duplicate function implementation.": { + "category": "Error", + "code": 2393 + }, + "Overload signature is not compatible with function implementation.": { + "category": "Error", + "code": 2394 + }, + "Individual declarations in merged declaration {0} must be all exported or all local.": { + "category": "Error", + "code": 2395 + }, + "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.": { + "category": "Error", + "code": 2396 + }, + "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.": { + "category": "Error", + "code": 2399 + }, + "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.": { + "category": "Error", + "code": 2400 + }, + "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.": { + "category": "Error", + "code": 2401 + }, + "Expression resolves to '_super' that compiler uses to capture base class reference.": { + "category": "Error", + "code": 2402 + }, + "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": { + "category": "Error", + "code": 2403 + }, + "The left-hand side of a 'for...in' statement cannot use a type annotation.": { + "category": "Error", + "code": 2404 + }, + "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.": { + "category": "Error", + "code": 2405 + }, + "Invalid left-hand side in 'for...in' statement.": { + "category": "Error", + "code": 2406 + }, + "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": { + "category": "Error", + "code": 2407 + }, + "Setters cannot return a value.": { + "category": "Error", + "code": 2408 + }, + "Return type of constructor signature must be assignable to the instance type of the class": { + "category": "Error", + "code": 2409 + }, + "All symbols within a 'with' block will be resolved to 'any'.": { + "category": "Error", + "code": 2410 + }, + "Property '{0}' of type '{1}' is not assignable to string index type '{2}'.": { + "category": "Error", + "code": 2411 + }, + "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'.": { + "category": "Error", + "code": 2412 + }, + "Numeric index type '{0}' is not assignable to string index type '{1}'.": { + "category": "Error", + "code": 2413 + }, + "Class name cannot be '{0}'": { + "category": "Error", + "code": 2414 + }, + "Class '{0}' incorrectly extends base class '{1}'.": { + "category": "Error", + "code": 2415 + }, + "Class static side '{0}' incorrectly extends base class static side '{1}'.": { + "category": "Error", + "code": 2417 + }, + "Type name '{0}' in extends clause does not reference constructor function for '{0}'.": { + "category": "Error", + "code": 2419 + }, + "Class '{0}' incorrectly implements interface '{1}'.": { + "category": "Error", + "code": 2420 + }, + "A class may only implement another class or interface.": { + "category": "Error", + "code": 2422 + }, + "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": { + "category": "Error", + "code": 2423 + }, + "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": { + "category": "Error", + "code": 2424 + }, + "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": { + "category": "Error", + "code": 2425 + }, + "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": { + "category": "Error", + "code": 2426 + }, + "Interface name cannot be '{0}'": { + "category": "Error", + "code": 2427 + }, + "All declarations of an interface must have identical type parameters.": { + "category": "Error", + "code": 2428 + }, + "Interface '{0}' incorrectly extends interface '{1}'.": { + "category": "Error", + "code": 2430 + }, + "Enum name cannot be '{0}'": { + "category": "Error", + "code": 2431 + }, + "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.": { + "category": "Error", + "code": 2432 + }, + "A module declaration cannot be in a different file from a class or function with which it is merged": { + "category": "Error", + "code": 2433 + }, + "A module declaration cannot be located prior to a class or function with which it is merged": { + "category": "Error", + "code": 2434 + }, + "Ambient external modules cannot be nested in other modules.": { + "category": "Error", + "code": 2435 + }, + "Ambient external module declaration cannot specify relative module name.": { + "category": "Error", + "code": 2436 + }, + "Module '{0}' is hidden by a local declaration with the same name": { + "category": "Error", + "code": 2437 + }, + "Import name cannot be '{0}'": { + "category": "Error", + "code": 2438 + }, + "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.": { + "category": "Error", + "code": 2439 + }, + "Import declaration conflicts with local declaration of '{0}'": { + "category": "Error", + "code": 2440 + }, + "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module.": { + "category": "Error", + "code": 2441 + }, + "Types have separate declarations of a private property '{0}'.": { + "category": "Error", + "code": 2442 + }, + "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'.": { + "category": "Error", + "code": 2443 + }, + "Property '{0}' is protected in type '{1}' but public in type '{2}'.": { + "category": "Error", + "code": 2444 + }, + "Property '{0}' is protected and only accessible within class '{1}' and its subclasses.": { + "category": "Error", + "code": 2445 + }, + "Property '{0}' is protected and only accessible through an instance of class '{1}'.": { + "category": "Error", + "code": 2446 + }, + "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead.": { + "category": "Error", + "code": 2447 + }, + "Block-scoped variable '{0}' used before its declaration.": { + "category": "Error", + "code": 2448, + "isEarly": true + }, + "The operand of an increment or decrement operator cannot be a constant.": { + "category": "Error", + "code": 2449, + "isEarly": true + }, + "Left-hand side of assignment expression cannot be a constant.": { + "category": "Error", + "code": 2450, + "isEarly": true + }, + "Cannot redeclare block-scoped variable '{0}'.": { + "category": "Error", + "code": 2451, + "isEarly": true + }, + "An enum member cannot have a numeric name.": { + "category": "Error", + "code": 2452 + }, + "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly.": { + "category": "Error", + "code": 2453 + }, + "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'.": { + "category": "Error", + "code": 2455 + }, + "Type alias '{0}' circularly references itself.": { + "category": "Error", + "code": 2456 + }, + "Type alias name cannot be '{0}'": { + "category": "Error", + "code": 2457 + }, + "An AMD module cannot have multiple name assignments.": { + "category": "Error", + "code": 2458 + }, + "Type '{0}' has no property '{1}' and no string index signature.": { + "category": "Error", + "code": 2459 + }, + "Type '{0}' has no property '{1}'.": { + "category": "Error", + "code": 2460 + }, + "Type '{0}' is not an array type.": { + "category": "Error", + "code": 2461 + }, + "A rest element must be last in an array destructuring pattern": { + "category": "Error", + "code": 2462 + }, + "A binding pattern parameter cannot be optional in an implementation signature.": { + "category": "Error", + "code": 2463 + }, + "A computed property name must be of type 'string', 'number', or 'any'.": { + "category": "Error", + "code": 2464 + }, + "'this' cannot be referenced in a computed property name.": { + "category": "Error", + "code": 2465 + }, + "'super' cannot be referenced in a computed property name.": { + "category": "Error", + "code": 2466 + }, + "A computed property name cannot reference a type parameter from its containing type.": { + "category": "Error", + "code": 2466 + }, - "Import declaration '{0}' is using private name '{1}'.": { - "category": "Error", - "code": 4000 - }, - "Type parameter '{0}' of exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4002 - }, - "Type parameter '{0}' of exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4004 - }, - "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4006 - }, - "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4008 - }, - "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4010 - }, - "Type parameter '{0}' of public method from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4012 - }, - "Type parameter '{0}' of method from exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4014 - }, - "Type parameter '{0}' of exported function has or is using private name '{1}'.": { - "category": "Error", - "code": 4016 - }, - "Implements clause of exported class '{0}' has or is using private name '{1}'.": { - "category": "Error", - "code": 4019 - }, - "Extends clause of exported class '{0}' has or is using private name '{1}'.": { - "category": "Error", - "code": 4020 - }, - "Extends clause of exported interface '{0}' has or is using private name '{1}'.": { - "category": "Error", - "code": 4022 - }, - "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4023 - }, - "Exported variable '{0}' has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4024 - }, - "Exported variable '{0}' has or is using private name '{1}'.": { - "category": "Error", - "code": 4025 - }, - "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4026 - }, - "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4027 - }, - "Public static property '{0}' of exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4028 - }, - "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4029 - }, - "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4030 - }, - "Public property '{0}' of exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4031 - }, - "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4032 - }, - "Property '{0}' of exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4033 - }, - "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4034 - }, - "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4035 - }, - "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4036 - }, - "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4037 - }, - "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named.": { - "category": "Error", - "code": 4038 - }, - "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4039 - }, - "Return type of public static property getter from exported class has or is using private name '{0}'.": { - "category": "Error", - "code": 4040 - }, - "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named.": { - "category": "Error", - "code": 4041 - }, - "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4042 - }, - "Return type of public property getter from exported class has or is using private name '{0}'.": { - "category": "Error", - "code": 4043 - }, - "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4044 - }, - "Return type of constructor signature from exported interface has or is using private name '{0}'.": { - "category": "Error", - "code": 4045 - }, - "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4046 - }, - "Return type of call signature from exported interface has or is using private name '{0}'.": { - "category": "Error", - "code": 4047 - }, - "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4048 - }, - "Return type of index signature from exported interface has or is using private name '{0}'.": { - "category": "Error", - "code": 4049 - }, - "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named.": { - "category": "Error", - "code": 4050 - }, - "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4051 - }, - "Return type of public static method from exported class has or is using private name '{0}'.": { - "category": "Error", - "code": 4052 - }, - "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named.": { - "category": "Error", - "code": 4053 - }, - "Return type of public method from exported class has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4054 - }, - "Return type of public method from exported class has or is using private name '{0}'.": { - "category": "Error", - "code": 4055 - }, - "Return type of method from exported interface has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4056 - }, - "Return type of method from exported interface has or is using private name '{0}'.": { - "category": "Error", - "code": 4057 - }, - "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named.": { - "category": "Error", - "code": 4058 - }, - "Return type of exported function has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4059 - }, - "Return type of exported function has or is using private name '{0}'.": { - "category": "Error", - "code": 4060 - }, - "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4061 - }, - "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4062 - }, - "Parameter '{0}' of constructor from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4063 - }, - "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4064 - }, - "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4065 - }, - "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4066 - }, - "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4067 - }, - "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4068 - }, - "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4069 - }, - "Parameter '{0}' of public static method from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4070 - }, - "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4071 - }, - "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4072 - }, - "Parameter '{0}' of public method from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4073 - }, - "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4074 - }, - "Parameter '{0}' of method from exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4075 - }, - "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4076 - }, - "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4077 - }, - "Parameter '{0}' of exported function has or is using private name '{1}'.": { - "category": "Error", - "code": 4078 - }, - "Exported type alias '{0}' has or is using private name '{1}'.": { - "category": "Error", - "code": 4081 - }, - "Enum declarations must all be const or non-const.": { - "category": "Error", - "code": 4082 - }, - "In 'const' enum declarations member initializer must be constant expression.": { - "category": "Error", - "code": 4083, - "isEarly": true - }, - "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.": { - "category": "Error", - "code": 4084 - }, - "A const enum member can only be accessed using a string literal.": { - "category": "Error", - "code": 4085, - "isEarly": true - }, - "'const' enum member initializer was evaluated to a non-finite value.": { - "category": "Error", - "code": 4086 - }, - "'const' enum member initializer was evaluated to disallowed value 'NaN'.": { - "category": "Error", - "code": 4087 - }, - "Property '{0}' does not exist on 'const' enum '{1}'.": { - "category": "Error", - "code": 4088, - "isEarly": true - }, - "The current host does not support the '{0}' option.": { - "category": "Error", - "code": 5001 - }, - "Cannot find the common subdirectory path for the input files.": { - "category": "Error", - "code": 5009 - }, - "Cannot read file '{0}': {1}": { - "category": "Error", - "code": 5012 - }, - "Unsupported file encoding.": { - "category": "Error", - "code": 5013 - }, - "Unknown compiler option '{0}'.": { - "category": "Error", - "code": 5023 - }, - "Compiler option '{0}' requires a value of type {1}.": { - "category": "Error", - "code": 5024 - }, - "Could not write file '{0}': {1}": { - "category": "Error", - "code": 5033 - }, - "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option.": { - "category": "Error", - "code": 5038 - }, - "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option.": { - "category": "Error", - "code": 5039 - }, - "Option 'noEmit' cannot be specified with option 'out' or 'outDir'.": { - "category": "Error", - "code": 5040 - }, - "Option 'noEmit' cannot be specified with option 'declaration'.": { - "category": "Error", - "code": 5041 - }, - "Option 'project' cannot be mixed with source files on a command line.": { - "category": "Error", - "code": 5042 - }, - "Concatenate and emit output to single file.": { - "category": "Message", - "code": 6001 - }, - "Generates corresponding '.d.ts' file.": { - "category": "Message", - "code": 6002 - }, - "Specifies the location where debugger should locate map files instead of generated locations.": { - "category": "Message", - "code": 6003 - }, - "Specifies the location where debugger should locate TypeScript files instead of source locations.": { - "category": "Message", - "code": 6004 - }, - "Watch input files.": { - "category": "Message", - "code": 6005 - }, - "Redirect output structure to the directory.": { - "category": "Message", - "code": 6006 - }, - "Do not erase const enum declarations in generated code.": { - "category": "Message", - "code": 6007 - }, - "Do not emit outputs if any type checking errors were reported.": { - "category": "Message", - "code": 6008 - }, - "Do not emit comments to output.": { - "category": "Message", - "code": 6009 - }, - "Do not emit outputs.": { - "category": "Message", - "code": 6010 - }, - "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)": { - "category": "Message", - "code": 6015 - }, - "Specify module code generation: 'commonjs' or 'amd'": { - "category": "Message", - "code": 6016 - }, - "Print this message.": { - "category": "Message", - "code": 6017 - }, - "Print the compiler's version.": { - "category": "Message", - "code": 6019 - }, - "Compile the project in the given directory.": { - "category": "Message", - "code": 6020 - }, - "Syntax: {0}": { - "category": "Message", - "code": 6023 - }, - "options": { - "category": "Message", - "code": 6024 - }, - "file": { - "category": "Message", - "code": 6025 - }, - "Examples: {0}": { - "category": "Message", - "code": 6026 - }, - "Options:": { - "category": "Message", - "code": 6027 - }, - "Version {0}": { - "category": "Message", - "code": 6029 - }, - "Insert command line options and files from a file.": { - "category": "Message", - "code": 6030 - }, - "File change detected. Starting incremental compilation...": { - "category": "Message", - "code": 6032 - }, - "KIND": { - "category": "Message", - "code": 6034 - }, - "FILE": { - "category": "Message", - "code": 6035 - }, - "VERSION": { - "category": "Message", - "code": 6036 - }, - "LOCATION": { - "category": "Message", - "code": 6037 - }, - "DIRECTORY": { - "category": "Message", - "code": 6038 - }, - "Compilation complete. Watching for file changes.": { - "category": "Message", - "code": 6042 - }, - "Generates corresponding '.map' file.": { - "category": "Message", - "code": 6043 - }, - "Compiler option '{0}' expects an argument.": { - "category": "Error", - "code": 6044 - }, - "Unterminated quoted string in response file '{0}'.": { - "category": "Error", - "code": 6045 - }, - "Argument for '--module' option must be 'commonjs' or 'amd'.": { - "category": "Error", - "code": 6046 - }, - "Argument for '--target' option must be 'es3', 'es5', or 'es6'.": { - "category": "Error", - "code": 6047 - }, - "Locale must be of the form or -. For example '{0}' or '{1}'.": { - "category": "Error", - "code": 6048 - }, - "Unsupported locale '{0}'.": { - "category": "Error", - "code": 6049 - }, - "Unable to open file '{0}'.": { - "category": "Error", - "code": 6050 - }, - "Corrupted locale file {0}.": { - "category": "Error", - "code": 6051 - }, - "Raise error on expressions and declarations with an implied 'any' type.": { - "category": "Message", - "code": 6052 - }, - "File '{0}' not found.": { - "category": "Error", - "code": 6053 - }, - "File '{0}' must have extension '.ts' or '.d.ts'.": { - "category": "Error", - "code": 6054 - }, - "Suppress noImplicitAny errors for indexing objects lacking index signatures.": { - "category": "Message", - "code": 6055 - }, + "Import declaration '{0}' is using private name '{1}'.": { + "category": "Error", + "code": 4000 + }, + "Type parameter '{0}' of exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4002 + }, + "Type parameter '{0}' of exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4004 + }, + "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4006 + }, + "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4008 + }, + "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4010 + }, + "Type parameter '{0}' of public method from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4012 + }, + "Type parameter '{0}' of method from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4014 + }, + "Type parameter '{0}' of exported function has or is using private name '{1}'.": { + "category": "Error", + "code": 4016 + }, + "Implements clause of exported class '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4019 + }, + "Extends clause of exported class '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4020 + }, + "Extends clause of exported interface '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4022 + }, + "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4023 + }, + "Exported variable '{0}' has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4024 + }, + "Exported variable '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4025 + }, + "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4026 + }, + "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4027 + }, + "Public static property '{0}' of exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4028 + }, + "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4029 + }, + "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4030 + }, + "Public property '{0}' of exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4031 + }, + "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4032 + }, + "Property '{0}' of exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4033 + }, + "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4034 + }, + "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4035 + }, + "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4036 + }, + "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4037 + }, + "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named.": { + "category": "Error", + "code": 4038 + }, + "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4039 + }, + "Return type of public static property getter from exported class has or is using private name '{0}'.": { + "category": "Error", + "code": 4040 + }, + "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named.": { + "category": "Error", + "code": 4041 + }, + "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4042 + }, + "Return type of public property getter from exported class has or is using private name '{0}'.": { + "category": "Error", + "code": 4043 + }, + "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4044 + }, + "Return type of constructor signature from exported interface has or is using private name '{0}'.": { + "category": "Error", + "code": 4045 + }, + "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4046 + }, + "Return type of call signature from exported interface has or is using private name '{0}'.": { + "category": "Error", + "code": 4047 + }, + "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4048 + }, + "Return type of index signature from exported interface has or is using private name '{0}'.": { + "category": "Error", + "code": 4049 + }, + "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named.": { + "category": "Error", + "code": 4050 + }, + "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4051 + }, + "Return type of public static method from exported class has or is using private name '{0}'.": { + "category": "Error", + "code": 4052 + }, + "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named.": { + "category": "Error", + "code": 4053 + }, + "Return type of public method from exported class has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4054 + }, + "Return type of public method from exported class has or is using private name '{0}'.": { + "category": "Error", + "code": 4055 + }, + "Return type of method from exported interface has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4056 + }, + "Return type of method from exported interface has or is using private name '{0}'.": { + "category": "Error", + "code": 4057 + }, + "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named.": { + "category": "Error", + "code": 4058 + }, + "Return type of exported function has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4059 + }, + "Return type of exported function has or is using private name '{0}'.": { + "category": "Error", + "code": 4060 + }, + "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4061 + }, + "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4062 + }, + "Parameter '{0}' of constructor from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4063 + }, + "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4064 + }, + "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4065 + }, + "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4066 + }, + "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4067 + }, + "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4068 + }, + "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4069 + }, + "Parameter '{0}' of public static method from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4070 + }, + "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4071 + }, + "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4072 + }, + "Parameter '{0}' of public method from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4073 + }, + "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4074 + }, + "Parameter '{0}' of method from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4075 + }, + "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4076 + }, + "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4077 + }, + "Parameter '{0}' of exported function has or is using private name '{1}'.": { + "category": "Error", + "code": 4078 + }, + "Exported type alias '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4081 + }, + "Enum declarations must all be const or non-const.": { + "category": "Error", + "code": 4082 + }, + "In 'const' enum declarations member initializer must be constant expression.": { + "category": "Error", + "code": 4083, + "isEarly": true + }, + "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.": { + "category": "Error", + "code": 4084 + }, + "A const enum member can only be accessed using a string literal.": { + "category": "Error", + "code": 4085, + "isEarly": true + }, + "'const' enum member initializer was evaluated to a non-finite value.": { + "category": "Error", + "code": 4086 + }, + "'const' enum member initializer was evaluated to disallowed value 'NaN'.": { + "category": "Error", + "code": 4087 + }, + "Property '{0}' does not exist on 'const' enum '{1}'.": { + "category": "Error", + "code": 4088, + "isEarly": true + }, + "The current host does not support the '{0}' option.": { + "category": "Error", + "code": 5001 + }, + "Cannot find the common subdirectory path for the input files.": { + "category": "Error", + "code": 5009 + }, + "Cannot read file '{0}': {1}": { + "category": "Error", + "code": 5012 + }, + "Unsupported file encoding.": { + "category": "Error", + "code": 5013 + }, + "Unknown compiler option '{0}'.": { + "category": "Error", + "code": 5023 + }, + "Compiler option '{0}' requires a value of type {1}.": { + "category": "Error", + "code": 5024 + }, + "Could not write file '{0}': {1}": { + "category": "Error", + "code": 5033 + }, + "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option.": { + "category": "Error", + "code": 5038 + }, + "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option.": { + "category": "Error", + "code": 5039 + }, + "Option 'noEmit' cannot be specified with option 'out' or 'outDir'.": { + "category": "Error", + "code": 5040 + }, + "Option 'noEmit' cannot be specified with option 'declaration'.": { + "category": "Error", + "code": 5041 + }, + "Option 'project' cannot be mixed with source files on a command line.": { + "category": "Error", + "code": 5042 + }, + "Concatenate and emit output to single file.": { + "category": "Message", + "code": 6001 + }, + "Generates corresponding '.d.ts' file.": { + "category": "Message", + "code": 6002 + }, + "Specifies the location where debugger should locate map files instead of generated locations.": { + "category": "Message", + "code": 6003 + }, + "Specifies the location where debugger should locate TypeScript files instead of source locations.": { + "category": "Message", + "code": 6004 + }, + "Watch input files.": { + "category": "Message", + "code": 6005 + }, + "Redirect output structure to the directory.": { + "category": "Message", + "code": 6006 + }, + "Do not erase const enum declarations in generated code.": { + "category": "Message", + "code": 6007 + }, + "Do not emit outputs if any type checking errors were reported.": { + "category": "Message", + "code": 6008 + }, + "Do not emit comments to output.": { + "category": "Message", + "code": 6009 + }, + "Do not emit outputs.": { + "category": "Message", + "code": 6010 + }, + "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)": { + "category": "Message", + "code": 6015 + }, + "Specify module code generation: 'commonjs' or 'amd'": { + "category": "Message", + "code": 6016 + }, + "Print this message.": { + "category": "Message", + "code": 6017 + }, + "Print the compiler's version.": { + "category": "Message", + "code": 6019 + }, + "Compile the project in the given directory.": { + "category": "Message", + "code": 6020 + }, + "Syntax: {0}": { + "category": "Message", + "code": 6023 + }, + "options": { + "category": "Message", + "code": 6024 + }, + "file": { + "category": "Message", + "code": 6025 + }, + "Examples: {0}": { + "category": "Message", + "code": 6026 + }, + "Options:": { + "category": "Message", + "code": 6027 + }, + "Version {0}": { + "category": "Message", + "code": 6029 + }, + "Insert command line options and files from a file.": { + "category": "Message", + "code": 6030 + }, + "File change detected. Starting incremental compilation...": { + "category": "Message", + "code": 6032 + }, + "KIND": { + "category": "Message", + "code": 6034 + }, + "FILE": { + "category": "Message", + "code": 6035 + }, + "VERSION": { + "category": "Message", + "code": 6036 + }, + "LOCATION": { + "category": "Message", + "code": 6037 + }, + "DIRECTORY": { + "category": "Message", + "code": 6038 + }, + "Compilation complete. Watching for file changes.": { + "category": "Message", + "code": 6042 + }, + "Generates corresponding '.map' file.": { + "category": "Message", + "code": 6043 + }, + "Compiler option '{0}' expects an argument.": { + "category": "Error", + "code": 6044 + }, + "Unterminated quoted string in response file '{0}'.": { + "category": "Error", + "code": 6045 + }, + "Argument for '--module' option must be 'commonjs' or 'amd'.": { + "category": "Error", + "code": 6046 + }, + "Argument for '--target' option must be 'es3', 'es5', or 'es6'.": { + "category": "Error", + "code": 6047 + }, + "Locale must be of the form or -. For example '{0}' or '{1}'.": { + "category": "Error", + "code": 6048 + }, + "Unsupported locale '{0}'.": { + "category": "Error", + "code": 6049 + }, + "Unable to open file '{0}'.": { + "category": "Error", + "code": 6050 + }, + "Corrupted locale file {0}.": { + "category": "Error", + "code": 6051 + }, + "Raise error on expressions and declarations with an implied 'any' type.": { + "category": "Message", + "code": 6052 + }, + "File '{0}' not found.": { + "category": "Error", + "code": 6053 + }, + "File '{0}' must have extension '.ts' or '.d.ts'.": { + "category": "Error", + "code": 6054 + }, + "Suppress noImplicitAny errors for indexing objects lacking index signatures.": { + "category": "Message", + "code": 6055 + }, - "Variable '{0}' implicitly has an '{1}' type.": { - "category": "Error", - "code": 7005 - }, - "Parameter '{0}' implicitly has an '{1}' type.": { - "category": "Error", - "code": 7006 - }, - "Member '{0}' implicitly has an '{1}' type.": { - "category": "Error", - "code": 7008 - }, - "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.": { - "category": "Error", - "code": 7009 - }, - "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type.": { - "category": "Error", - "code": 7010 - }, - "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type.": { - "category": "Error", - "code": 7011 - }, - "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type.": { - "category": "Error", - "code": 7013 - }, - "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation.": { - "category": "Error", - "code": 7016 - }, - "Index signature of object type implicitly has an 'any' type.": { - "category": "Error", - "code": 7017 - }, - "Object literal's property '{0}' implicitly has an '{1}' type.": { - "category": "Error", - "code": 7018 - }, - "Rest parameter '{0}' implicitly has an 'any[]' type.": { - "category": "Error", - "code": 7019 - }, - "Call signature, which lacks return-type annotation, implicitly has an 'any' return type.": { - "category": "Error", - "code": 7020 - }, - "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation.": { - "category": "Error", - "code": 7021 - }, - "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer.": { - "category": "Error", - "code": 7022 - }, - "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.": { - "category": "Error", - "code": 7023 - }, - "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.": { - "category": "Error", - "code": 7024 - }, - "You cannot rename this element.": { - "category": "Error", - "code": 8000 - }, - "'yield' expressions are not currently supported.": { - "category": "Error", - "code": 9000, - "isEarly": true - }, - "Generators are not currently supported.": { - "category": "Error", - "code": 9001, - "isEarly": true - } + "Variable '{0}' implicitly has an '{1}' type.": { + "category": "Error", + "code": 7005 + }, + "Parameter '{0}' implicitly has an '{1}' type.": { + "category": "Error", + "code": 7006 + }, + "Member '{0}' implicitly has an '{1}' type.": { + "category": "Error", + "code": 7008 + }, + "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.": { + "category": "Error", + "code": 7009 + }, + "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type.": { + "category": "Error", + "code": 7010 + }, + "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type.": { + "category": "Error", + "code": 7011 + }, + "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type.": { + "category": "Error", + "code": 7013 + }, + "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation.": { + "category": "Error", + "code": 7016 + }, + "Index signature of object type implicitly has an 'any' type.": { + "category": "Error", + "code": 7017 + }, + "Object literal's property '{0}' implicitly has an '{1}' type.": { + "category": "Error", + "code": 7018 + }, + "Rest parameter '{0}' implicitly has an 'any[]' type.": { + "category": "Error", + "code": 7019 + }, + "Call signature, which lacks return-type annotation, implicitly has an 'any' return type.": { + "category": "Error", + "code": 7020 + }, + "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation.": { + "category": "Error", + "code": 7021 + }, + "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer.": { + "category": "Error", + "code": 7022 + }, + "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.": { + "category": "Error", + "code": 7023 + }, + "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.": { + "category": "Error", + "code": 7024 + }, + "You cannot rename this element.": { + "category": "Error", + "code": 8000 + }, + "'yield' expressions are not currently supported.": { + "category": "Error", + "code": 9000, + "isEarly": true + }, + "Generators are not currently supported.": { + "category": "Error", + "code": 9001, + "isEarly": true + }, + "An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead": { + "category": "Error", + "code": 9002 + } } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index df73e52a605..166ae3c7d63 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -107,7 +107,7 @@ module Utils { export function memoize(f: T): T { var cache: { [idx: string]: any } = {}; - return (() => { + return (function () { var key = Array.prototype.join.call(arguments); var cachedResult = cache[key]; if (cachedResult) { diff --git a/src/harness/loggedIO.ts b/src/harness/loggedIO.ts index c6d15c34a84..57035262581 100644 --- a/src/harness/loggedIO.ts +++ b/src/harness/loggedIO.ts @@ -138,7 +138,7 @@ module Playback { function recordReplay(original: T, underlying: any) { function createWrapper(record: T, replay: T): T { - return (() => { + return (function () { if (replayLog !== undefined) { return replay.apply(undefined, arguments); } else if (recordLog !== undefined) { From d5b953d3f67eebd1fe0e75ab6126bf5450d02d9f Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 28 Jan 2015 16:17:13 -0800 Subject: [PATCH 12/23] Add testcases --- .../reference/emitArrowFunctionAsIs.js | 13 ++++ .../reference/emitArrowFunctionAsIs.types | 17 ++++++ .../reference/emitArrowFunctionAsIsES6.js | 13 ++++ .../reference/emitArrowFunctionAsIsES6.types | 17 ++++++ ...ArrowFunctionWhenUsingArguments.errors.txt | 46 ++++++++++++++ .../emitArrowFunctionWhenUsingArguments.js | 60 +++++++++++++++++++ ...owFunctionWhenUsingArgumentsES6.errors.txt | 46 ++++++++++++++ .../emitArrowFunctionWhenUsingArgumentsES6.js | 60 +++++++++++++++++++ .../arrowFunction/emitArrowFunctionAsIs.ts | 5 ++ .../arrowFunction/emitArrowFunctionAsIsES6.ts | 5 ++ .../emitArrowFunctionWhenUsingArguments.ts | 32 ++++++++++ .../emitArrowFunctionWhenUsingArgumentsES6.ts | 32 ++++++++++ 12 files changed, 346 insertions(+) create mode 100644 tests/baselines/reference/emitArrowFunctionAsIs.js create mode 100644 tests/baselines/reference/emitArrowFunctionAsIs.types create mode 100644 tests/baselines/reference/emitArrowFunctionAsIsES6.js create mode 100644 tests/baselines/reference/emitArrowFunctionAsIsES6.types create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionAsIs.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionAsIsES6.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts create mode 100644 tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts diff --git a/tests/baselines/reference/emitArrowFunctionAsIs.js b/tests/baselines/reference/emitArrowFunctionAsIs.js new file mode 100644 index 00000000000..11df7903ad8 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionAsIs.js @@ -0,0 +1,13 @@ +//// [emitArrowFunctionAsIs.ts] +var arrow1 = a => { }; +var arrow2 = (a) => { }; + +var arrow3 = (a, b) => { }; + +//// [emitArrowFunctionAsIs.js] +var arrow1 = function (a) { +}; +var arrow2 = function (a) { +}; +var arrow3 = function (a, b) { +}; diff --git a/tests/baselines/reference/emitArrowFunctionAsIs.types b/tests/baselines/reference/emitArrowFunctionAsIs.types new file mode 100644 index 00000000000..1ab5de9724a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionAsIs.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionAsIs.ts === +var arrow1 = a => { }; +>arrow1 : (a: any) => void +>a => { } : (a: any) => void +>a : any + +var arrow2 = (a) => { }; +>arrow2 : (a: any) => void +>(a) => { } : (a: any) => void +>a : any + +var arrow3 = (a, b) => { }; +>arrow3 : (a: any, b: any) => void +>(a, b) => { } : (a: any, b: any) => void +>a : any +>b : any + diff --git a/tests/baselines/reference/emitArrowFunctionAsIsES6.js b/tests/baselines/reference/emitArrowFunctionAsIsES6.js new file mode 100644 index 00000000000..9941434ae10 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionAsIsES6.js @@ -0,0 +1,13 @@ +//// [emitArrowFunctionAsIsES6.ts] +var arrow1 = a => { }; +var arrow2 = (a) => { }; + +var arrow3 = (a, b) => { }; + +//// [emitArrowFunctionAsIsES6.js] +var arrow1 = a => { +}; +var arrow2 = (a) => { +}; +var arrow3 = (a, b) => { +}; diff --git a/tests/baselines/reference/emitArrowFunctionAsIsES6.types b/tests/baselines/reference/emitArrowFunctionAsIsES6.types new file mode 100644 index 00000000000..6b8c9e54bbe --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionAsIsES6.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionAsIsES6.ts === +var arrow1 = a => { }; +>arrow1 : (a: any) => void +>a => { } : (a: any) => void +>a : any + +var arrow2 = (a) => { }; +>arrow2 : (a: any) => void +>(a) => { } : (a: any) => void +>a : any + +var arrow3 = (a, b) => { }; +>arrow3 : (a: any, b: any) => void +>(a, b) => { } : (a: any, b: any) => void +>a : any +>b : any + diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt new file mode 100644 index 00000000000..714d6a3e46f --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt @@ -0,0 +1,46 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(2,15): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(7,19): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(13,13): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(19,15): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts (4 errors) ==== + var a = () => { + var arg = arguments[0]; // error + ~~~~~~~~~ +!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead + } + + var b = function () { + var a = () => { + var arg = arguments[0]; // error + ~~~~~~~~~ +!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead + } + } + + function baz() { + () => { + var arg = arguments[0]; + ~~~~~~~~~ +!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead + } + } + + function foo(inputFunc: () => void) { } + foo(() => { + var arg = arguments[0]; // error + ~~~~~~~~~ +!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead + }); + + function bar() { + var arg = arguments[0]; // no error + } + + + () => { + function foo() { + var arg = arguments[0]; // no error + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js new file mode 100644 index 00000000000..00a4c7aa051 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js @@ -0,0 +1,60 @@ +//// [emitArrowFunctionWhenUsingArguments.ts] +var a = () => { + var arg = arguments[0]; // error +} + +var b = function () { + var a = () => { + var arg = arguments[0]; // error + } +} + +function baz() { + () => { + var arg = arguments[0]; + } +} + +function foo(inputFunc: () => void) { } +foo(() => { + var arg = arguments[0]; // error +}); + +function bar() { + var arg = arguments[0]; // no error +} + + +() => { + function foo() { + var arg = arguments[0]; // no error + } +} + +//// [emitArrowFunctionWhenUsingArguments.js] +var a = () => { + var arg = arguments[0]; // error +}; +var b = function () { + var a = () => { + var arg = arguments[0]; // error + }; +}; +function baz() { + (() => { + var arg = arguments[0]; + }); +} +function foo(inputFunc) { +} +foo(() => { + var arg = arguments[0]; // error +}); +function bar() { + var arg = arguments[0]; // no error +} +(() => { + function foo() { + var arg = arguments[0]; // no error + } +}); diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt new file mode 100644 index 00000000000..c134fb84958 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt @@ -0,0 +1,46 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(2,15): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(7,19): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(13,13): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(19,15): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts (4 errors) ==== + var a = () => { + var arg = arguments[0]; // error + ~~~~~~~~~ +!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead + } + + var b = function () { + var a = () => { + var arg = arguments[0]; // error + ~~~~~~~~~ +!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead + } + } + + function baz() { + () => { + var arg = arguments[0]; + ~~~~~~~~~ +!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead + } + } + + function foo(inputFunc: () => void) { } + foo(() => { + var arg = arguments[0]; // error + ~~~~~~~~~ +!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead + }); + + function bar() { + var arg = arguments[0]; // no error + } + + + () => { + function foo() { + var arg = arguments[0]; // no error + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js new file mode 100644 index 00000000000..0deacd409df --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js @@ -0,0 +1,60 @@ +//// [emitArrowFunctionWhenUsingArgumentsES6.ts] +var a = () => { + var arg = arguments[0]; // error +} + +var b = function () { + var a = () => { + var arg = arguments[0]; // error + } +} + +function baz() { + () => { + var arg = arguments[0]; + } +} + +function foo(inputFunc: () => void) { } +foo(() => { + var arg = arguments[0]; // error +}); + +function bar() { + var arg = arguments[0]; // no error +} + + +() => { + function foo() { + var arg = arguments[0]; // no error + } +} + +//// [emitArrowFunctionWhenUsingArgumentsES6.js] +var a = () => { + var arg = arguments[0]; // error +}; +var b = function () { + var a = () => { + var arg = arguments[0]; // error + }; +}; +function baz() { + (() => { + var arg = arguments[0]; + }); +} +function foo(inputFunc) { +} +foo(() => { + var arg = arguments[0]; // error +}); +function bar() { + var arg = arguments[0]; // no error +} +(() => { + function foo() { + var arg = arguments[0]; // no error + } +}); diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionAsIs.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionAsIs.ts new file mode 100644 index 00000000000..1366fff90a1 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionAsIs.ts @@ -0,0 +1,5 @@ +// @target:ES5 +var arrow1 = a => { }; +var arrow2 = (a) => { }; + +var arrow3 = (a, b) => { }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionAsIsES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionAsIsES6.ts new file mode 100644 index 00000000000..01331ededf9 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionAsIsES6.ts @@ -0,0 +1,5 @@ +// @target:ES6 +var arrow1 = a => { }; +var arrow2 = (a) => { }; + +var arrow3 = (a, b) => { }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts new file mode 100644 index 00000000000..fa92d48a4c0 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts @@ -0,0 +1,32 @@ +// @target: es6 +var a = () => { + var arg = arguments[0]; // error +} + +var b = function () { + var a = () => { + var arg = arguments[0]; // error + } +} + +function baz() { + () => { + var arg = arguments[0]; + } +} + +function foo(inputFunc: () => void) { } +foo(() => { + var arg = arguments[0]; // error +}); + +function bar() { + var arg = arguments[0]; // no error +} + + +() => { + function foo() { + var arg = arguments[0]; // no error + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts new file mode 100644 index 00000000000..fa92d48a4c0 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts @@ -0,0 +1,32 @@ +// @target: es6 +var a = () => { + var arg = arguments[0]; // error +} + +var b = function () { + var a = () => { + var arg = arguments[0]; // error + } +} + +function baz() { + () => { + var arg = arguments[0]; + } +} + +function foo(inputFunc: () => void) { } +foo(() => { + var arg = arguments[0]; // error +}); + +function bar() { + var arg = arguments[0]; // no error +} + + +() => { + function foo() { + var arg = arguments[0]; // no error + } +} \ No newline at end of file From 70140ef508cbfb6ab14910f5aa16b5d436808c1e Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 28 Jan 2015 16:43:25 -0800 Subject: [PATCH 13/23] Fix spacing due to tab --- src/compiler/checker.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index fdad2277f0a..ee9c827f612 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4836,15 +4836,15 @@ module ts { function checkIdentifier(node: Identifier): Type { var symbol = getResolvedSymbol(node); - // As noted in ECMAScript 6 language spec, arrow functions never have an arguments objects. - // Although in down-level emit of arrow function, we emit it using function expression which means that - // arguments objects will be inner bound while emitting arrow function natively in ES6, arguments objects - // will be bound to non-arrow function that contain this arrow function. This results in inconsistent bahaviour. - // To avoid that we will give an error to users if they use arguments objects in arrow function so that they - // can explicitly bound arguments objects - if (symbol === argumentsSymbol && getContainingFunction(node).kind === SyntaxKind.ArrowFunction) { - error(node, Diagnostics.An_argument_object_has_different_behaviour_across_Javascript_versions_Use_function_expression_or_rest_parameters_instead); - } + // As noted in ECMAScript 6 language spec, arrow functions never have an arguments objects. + // Although in down-level emit of arrow function, we emit it using function expression which means that + // arguments objects will be inner bound while emitting arrow function natively in ES6, arguments objects + // will be bound to non-arrow function that contain this arrow function. This results in inconsistent bahaviour. + // To avoid that we will give an error to users if they use arguments objects in arrow function so that they + // can explicitly bound arguments objects + if (symbol === argumentsSymbol && getContainingFunction(node).kind === SyntaxKind.ArrowFunction) { + error(node, Diagnostics.An_argument_object_has_different_behaviour_across_Javascript_versions_Use_function_expression_or_rest_parameters_instead); + } if (symbol.flags & SymbolFlags.Import) { var symbolLinks = getSymbolLinks(symbol); @@ -4905,9 +4905,9 @@ module ts { if (compilerOptions.target >= ScriptTarget.ES6) { needToCaptureLexicalThis = false; } - else { - needToCaptureLexicalThis = true; - } + else { + needToCaptureLexicalThis = true; + } } switch (container.kind) { From 8d731d400cec101dcc9a4c21de864a0150452c54 Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 28 Jan 2015 16:48:53 -0800 Subject: [PATCH 14/23] Address code review --- src/compiler/emitter.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 0d54920a617..6279f3a3ebb 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3313,20 +3313,20 @@ module ts { decreaseIndent(); } - function emitSignatureParametersES6(node: FunctionLikeDeclaration) { - // Check the node's parameters whether it contains flags indicating that it has no parenthesis around the parameters - // Preserver no-parenthesis - if (node && node.flags & NodeFlags.SimpleArrowFunction) { - increaseIndent(); + function emitSignatureParametersForArrow(node: FunctionLikeDeclaration) { + // Check the node's parameters whether it contains flags indicating that it has no parenthesis around the parameters + // Preserve no-parenthesis + if (node && node.flags & NodeFlags.SimpleArrowFunction) { + increaseIndent(); var parameters = node.parameters; - var omitCount = languageVersion < ScriptTarget.ES6 && hasRestParameters(node) ? 1 : 0; - emitList(parameters, 0, parameters.length - omitCount, /*multiLine*/ false, /*trailingComma*/ false); - decreaseIndent(); - } - else { - emitSignatureParameters(node); - } - } + var omitCount = hasRestParameters(node) ? 1 : 0; + emitList(parameters, 0, parameters.length - omitCount, /*multiLine*/ false, /*trailingComma*/ false); + decreaseIndent(); + } + else { + emitSignatureParameters(node); + } + } function emitSignatureAndBody(node: FunctionLikeDeclaration) { var saveTempCount = tempCount; @@ -3338,7 +3338,7 @@ module ts { // When targeting ES6, emit arrow function natively in ES6 if (isES6ArrowFunction(node)) { - emitSignatureParametersES6(node); + emitSignatureParametersForArrow(node); write(" =>"); } else { From 2b200d472706762a59521469b8e7e8f6cdacde0e Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 28 Jan 2015 17:34:38 -0800 Subject: [PATCH 15/23] Address code review --- src/compiler/checker.ts | 4 ++-- src/compiler/emitter.ts | 19 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ee9c827f612..697828c6891 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4838,8 +4838,8 @@ module ts { // As noted in ECMAScript 6 language spec, arrow functions never have an arguments objects. // Although in down-level emit of arrow function, we emit it using function expression which means that - // arguments objects will be inner bound while emitting arrow function natively in ES6, arguments objects - // will be bound to non-arrow function that contain this arrow function. This results in inconsistent bahaviour. + // arguments objects will be bound to the inner object; emitting arrow function natively in ES6, arguments objects + // will be bound to non-arrow function that contain this arrow function. This results in inconsistent behaviour. // To avoid that we will give an error to users if they use arguments objects in arrow function so that they // can explicitly bound arguments objects if (symbol === argumentsSymbol && getContainingFunction(node).kind === SyntaxKind.ArrowFunction) { diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 6279f3a3ebb..92051f4edb2 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3263,7 +3263,7 @@ module ts { emitTrailingComments(node); } - function isES6ArrowFunction(node: FunctionLikeDeclaration): boolean { + function shouldEmitAsArrowFunction(node: FunctionLikeDeclaration): boolean { return node.kind === SyntaxKind.ArrowFunction && compilerOptions.target >= ScriptTarget.ES6; } @@ -3279,7 +3279,7 @@ module ts { // For targeting below es6, emit functions-like declaration including arrow function using function keyword. // When targeting ES6, emit arrow function natively in ES6 by omitting function keyword and using fat arrow instead - if (!isES6ArrowFunction(node)) { + if (!shouldEmitAsArrowFunction(node)) { write("function "); } @@ -3314,9 +3314,8 @@ module ts { } function emitSignatureParametersForArrow(node: FunctionLikeDeclaration) { - // Check the node's parameters whether it contains flags indicating that it has no parenthesis around the parameters - // Preserve no-parenthesis - if (node && node.flags & NodeFlags.SimpleArrowFunction) { + // Check whether the parameter list needs parentheses and preserve no-parenthesis + if (node.flags & NodeFlags.SimpleArrowFunction) { increaseIndent(); var parameters = node.parameters; var omitCount = hasRestParameters(node) ? 1 : 0; @@ -3337,13 +3336,13 @@ module ts { tempParameters = undefined; // When targeting ES6, emit arrow function natively in ES6 - if (isES6ArrowFunction(node)) { + if (shouldEmitAsArrowFunction(node)) { emitSignatureParametersForArrow(node); - write(" =>"); + write(" =>"); + } + else { + emitSignatureParameters(node); } - else { - emitSignatureParameters(node); - } write(" {"); scopeEmitStart(node); From 9b04180475c8faebe6a44f759a70d30e62a61b84 Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 28 Jan 2015 17:56:48 -0800 Subject: [PATCH 16/23] Change tab to space --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 697828c6891..a4509599e35 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4905,7 +4905,7 @@ module ts { if (compilerOptions.target >= ScriptTarget.ES6) { needToCaptureLexicalThis = false; } - else { + else { needToCaptureLexicalThis = true; } } From fd2069595718770f01528e5d57716eaa4994a0b7 Mon Sep 17 00:00:00 2001 From: Yui T Date: Thu, 29 Jan 2015 16:07:55 -0800 Subject: [PATCH 17/23] Remove flag and compare position --- src/compiler/emitter.ts | 19 ++++++++++--------- src/compiler/parser.ts | 3 --- src/compiler/types.ts | 2 -- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index e57e367544f..8e0e95ce45b 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3292,16 +3292,17 @@ module ts { function emitSignatureParametersForArrow(node: FunctionLikeDeclaration) { // Check whether the parameter list needs parentheses and preserve no-parenthesis - if (node.flags & NodeFlags.SimpleArrowFunction) { - increaseIndent(); - var parameters = node.parameters; - var omitCount = hasRestParameters(node) ? 1 : 0; - emitList(parameters, 0, parameters.length - omitCount, /*multiLine*/ false, /*trailingComma*/ false); - decreaseIndent(); - } - else { - emitSignatureParameters(node); + if (node.parameters.length === 1){ + if (node.pos === node.parameters[0].pos) { + increaseIndent(); + var parameters = node.parameters; + var omitCount = hasRestParameters(node) ? 1 : 0; + emitList(parameters, 0, parameters.length - omitCount, /*multiLine*/ false, /*trailingComma*/ false); + decreaseIndent(); + return; + } } + emitSignatureParameters(node); } function emitSignatureAndBody(node: FunctionLikeDeclaration) { diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 82fa5f2c579..5ae44e5ff39 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2883,9 +2883,6 @@ module ts { node.parameters = >[parameter]; node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; - // Add node flags for simple arrow function(no parenthesis around parameters) - // so that in emit state we can check this flag and preserve users original text - node.flags |= NodeFlags.SimpleArrowFunction; parseExpected(SyntaxKind.EqualsGreaterThanToken); node.body = parseArrowFunctionExpressionBody(); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 2dd14d079a6..80bdc875177 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -293,8 +293,6 @@ module ts { Const = 0x00001000, // Variable declaration OctalLiteral = 0x00002000, - SimpleArrowFunction = 0x00004000, // Arrow function without parenthesized parameters - Modifier = Export | Ambient | Public | Private | Protected | Static, AccessibilityModifier = Public | Private | Protected, BlockScoped = Let | Const From fb2c5020a390d0c345267731354403ba5a8c56b9 Mon Sep 17 00:00:00 2001 From: Yui T Date: Thu, 29 Jan 2015 16:38:05 -0800 Subject: [PATCH 18/23] Clean up the checking of position --- src/compiler/emitter.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 8e0e95ce45b..a3bee98208d 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3292,15 +3292,13 @@ module ts { function emitSignatureParametersForArrow(node: FunctionLikeDeclaration) { // Check whether the parameter list needs parentheses and preserve no-parenthesis - if (node.parameters.length === 1){ - if (node.pos === node.parameters[0].pos) { - increaseIndent(); - var parameters = node.parameters; - var omitCount = hasRestParameters(node) ? 1 : 0; - emitList(parameters, 0, parameters.length - omitCount, /*multiLine*/ false, /*trailingComma*/ false); - decreaseIndent(); - return; - } + if ((node.parameters.length === 1) && (node.pos === node.parameters[0].pos)) { + increaseIndent(); + var parameters = node.parameters; + var omitCount = hasRestParameters(node) ? 1 : 0; + emitList(parameters, 0, parameters.length - omitCount, /*multiLine*/ false, /*trailingComma*/ false); + decreaseIndent(); + return; } emitSignatureParameters(node); } From cf5aadb28d22852963e9afc577020050aa276d82 Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 30 Jan 2015 12:20:21 -0800 Subject: [PATCH 19/23] Address code review --- src/compiler/checker.ts | 9 ++------- .../diagnosticInformationMap.generated.ts | 2 +- src/compiler/diagnosticMessages.json | 2 +- ...mitArrowFunctionWhenUsingArguments.errors.txt | 16 ++++++++-------- ...ArrowFunctionWhenUsingArgumentsES6.errors.txt | 16 ++++++++-------- 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b531090b160..ab5bc93512b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4856,7 +4856,7 @@ module ts { // To avoid that we will give an error to users if they use arguments objects in arrow function so that they // can explicitly bound arguments objects if (symbol === argumentsSymbol && getContainingFunction(node).kind === SyntaxKind.ArrowFunction) { - error(node, Diagnostics.An_argument_object_has_different_behaviour_across_Javascript_versions_Use_function_expression_or_rest_parameters_instead); + error(node, Diagnostics.The_argument_object_has_different_behaviour_across_Javascript_versions_Use_function_expression_or_rest_parameters_instead); } if (symbol.flags & SymbolFlags.Import) { @@ -4915,12 +4915,7 @@ module ts { container = getThisContainer(container, /* includeArrowFunctions */ false); // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code - if (compilerOptions.target >= ScriptTarget.ES6) { - needToCaptureLexicalThis = false; - } - else { - needToCaptureLexicalThis = true; - } + needToCaptureLexicalThis = !(compilerOptions.target >= ScriptTarget.ES6); } switch (container.kind) { diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 5f9c0a2d4fc..cb6b9098864 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -452,6 +452,6 @@ module ts { You_cannot_rename_this_element: { code: 8000, category: DiagnosticCategory.Error, key: "You cannot rename this element." }, yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported.", isEarly: true }, Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported.", isEarly: true }, - An_argument_object_has_different_behaviour_across_Javascript_versions_Use_function_expression_or_rest_parameters_instead: { code: 9002, category: DiagnosticCategory.Error, key: "An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead" }, + The_argument_object_has_different_behaviour_across_Javascript_versions_Use_function_expression_or_rest_parameters_instead: { code: 9002, category: DiagnosticCategory.Error, key: "The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead" }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index b5763adf47e..f3880aa545f 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1909,7 +1909,7 @@ "code": 9001, "isEarly": true }, - "An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead": { + "The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead": { "category": "Error", "code": 9002 } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt index 714d6a3e46f..ea5e4ca1df1 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt @@ -1,21 +1,21 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(2,15): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(7,19): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(13,13): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(19,15): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(2,15): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(7,19): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(13,13): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(19,15): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts (4 errors) ==== var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead } var b = function () { var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead } } @@ -23,7 +23,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts () => { var arg = arguments[0]; ~~~~~~~~~ -!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead } } @@ -31,7 +31,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts foo(() => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead }); function bar() { diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt index c134fb84958..060c1a6d3f4 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt @@ -1,21 +1,21 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(2,15): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(7,19): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(13,13): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(19,15): error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(2,15): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(7,19): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(13,13): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(19,15): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts (4 errors) ==== var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead } var b = function () { var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead } } @@ -23,7 +23,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6 () => { var arg = arguments[0]; ~~~~~~~~~ -!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead } } @@ -31,7 +31,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6 foo(() => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS9002: An argument object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead }); function bar() { From 5d0376fc783b5e023c30ba3b439ba27c24362c88 Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 30 Jan 2015 14:09:10 -0800 Subject: [PATCH 20/23] Address codereview --- src/compiler/emitter.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index a3bee98208d..e889ecc8868 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3292,12 +3292,8 @@ module ts { function emitSignatureParametersForArrow(node: FunctionLikeDeclaration) { // Check whether the parameter list needs parentheses and preserve no-parenthesis - if ((node.parameters.length === 1) && (node.pos === node.parameters[0].pos)) { - increaseIndent(); - var parameters = node.parameters; - var omitCount = hasRestParameters(node) ? 1 : 0; - emitList(parameters, 0, parameters.length - omitCount, /*multiLine*/ false, /*trailingComma*/ false); - decreaseIndent(); + if (node.parameters.length === 1 && node.pos === node.parameters[0].pos) { + emit(node.parameters[0]); return; } emitSignatureParameters(node); From 6a0eaf52bffe0f954549a9c3ead51e6bfba58534 Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 30 Jan 2015 16:51:12 -0800 Subject: [PATCH 21/23] Update an error --- src/compiler/checker.ts | 4 ++-- .../diagnosticInformationMap.generated.ts | 2 +- src/compiler/diagnosticMessages.json | 2 +- ...mitArrowFunctionWhenUsingArguments.errors.txt | 16 ++++++++-------- ...ArrowFunctionWhenUsingArgumentsES6.errors.txt | 16 ++++++++-------- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ab5bc93512b..29c22064787 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4852,11 +4852,11 @@ module ts { // As noted in ECMAScript 6 language spec, arrow functions never have an arguments objects. // Although in down-level emit of arrow function, we emit it using function expression which means that // arguments objects will be bound to the inner object; emitting arrow function natively in ES6, arguments objects - // will be bound to non-arrow function that contain this arrow function. This results in inconsistent behaviour. + // will be bound to non-arrow function that contain this arrow function. This results in inconsistent behavior. // To avoid that we will give an error to users if they use arguments objects in arrow function so that they // can explicitly bound arguments objects if (symbol === argumentsSymbol && getContainingFunction(node).kind === SyntaxKind.ArrowFunction) { - error(node, Diagnostics.The_argument_object_has_different_behaviour_across_Javascript_versions_Use_function_expression_or_rest_parameters_instead); + error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression); } if (symbol.flags & SymbolFlags.Import) { diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index cb6b9098864..94a026a1858 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -452,6 +452,6 @@ module ts { You_cannot_rename_this_element: { code: 8000, category: DiagnosticCategory.Error, key: "You cannot rename this element." }, yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported.", isEarly: true }, Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported.", isEarly: true }, - The_argument_object_has_different_behaviour_across_Javascript_versions_Use_function_expression_or_rest_parameters_instead: { code: 9002, category: DiagnosticCategory.Error, key: "The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead" }, + The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 9002, category: DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index f3880aa545f..0d13e2f761c 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1909,7 +1909,7 @@ "code": 9001, "isEarly": true }, - "The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead": { + "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.": { "category": "Error", "code": 9002 } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt index ea5e4ca1df1..3a0ab0e597c 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt @@ -1,21 +1,21 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(2,15): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(7,19): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(13,13): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(19,15): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(2,15): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(7,19): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(13,13): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(19,15): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts (4 errors) ==== var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. } var b = function () { var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. } } @@ -23,7 +23,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts () => { var arg = arguments[0]; ~~~~~~~~~ -!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. } } @@ -31,7 +31,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts foo(() => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. }); function bar() { diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt index 060c1a6d3f4..f879f11799b 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt @@ -1,21 +1,21 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(2,15): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(7,19): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(13,13): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(19,15): error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(2,15): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(7,19): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(13,13): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(19,15): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. ==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts (4 errors) ==== var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. } var b = function () { var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. } } @@ -23,7 +23,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6 () => { var arg = arguments[0]; ~~~~~~~~~ -!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. } } @@ -31,7 +31,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6 foo(() => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS9002: The 'argument' object has different behaviour across Javascript versions. Use function expression or rest parameters instead +!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. }); function bar() { From 416267172d832bd224a6b6d74842c60fbbddd89e Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 30 Jan 2015 17:48:07 -0800 Subject: [PATCH 22/23] Address code review --- src/compiler/checker.ts | 2 +- src/compiler/emitter.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 29c22064787..072c7cd9ebb 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4915,7 +4915,7 @@ module ts { container = getThisContainer(container, /* includeArrowFunctions */ false); // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code - needToCaptureLexicalThis = !(compilerOptions.target >= ScriptTarget.ES6); + needToCaptureLexicalThis = (languageVersion < ScriptTarget.ES6); } switch (container.kind) { diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index e889ecc8868..c33f7fd5234 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1487,7 +1487,6 @@ module ts { // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compilerOnSave feature export function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile?: SourceFile): EmitResult { - // var program = resolver.getProgram(); var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || ScriptTarget.ES3; var sourceMapDataList: SourceMapData[] = compilerOptions.sourceMap ? [] : undefined; @@ -3241,7 +3240,7 @@ module ts { } function shouldEmitAsArrowFunction(node: FunctionLikeDeclaration): boolean { - return node.kind === SyntaxKind.ArrowFunction && compilerOptions.target >= ScriptTarget.ES6; + return node.kind === SyntaxKind.ArrowFunction && languageVersion >= ScriptTarget.ES6; } function emitFunctionDeclaration(node: FunctionLikeDeclaration) { From a595a785c55ea416809c7523353db237ae469911 Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 30 Jan 2015 18:11:11 -0800 Subject: [PATCH 23/23] Remove tabs in json --- src/compiler/diagnosticMessages.json | 3822 +++++++++++++------------- 1 file changed, 1911 insertions(+), 1911 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 0d13e2f761c..a20f6adf649 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1,1916 +1,1916 @@ { - "Unterminated string literal.": { - "category": "Error", - "code": 1002 - }, - "Identifier expected.": { - "category": "Error", - "code": 1003 - }, - "'{0}' expected.": { - "category": "Error", - "code": 1005, - "isEarly": true - }, - "A file cannot have a reference to itself.": { - "category": "Error", - "code": 1006 - }, - "Trailing comma not allowed.": { - "category": "Error", - "code": 1009, - "isEarly": true - }, - "'*/' expected.": { - "category": "Error", - "code": 1010 - }, - "Unexpected token.": { - "category": "Error", - "code": 1012 - }, - "Catch clause parameter cannot have a type annotation.": { - "category": "Error", - "code": 1013, - "isEarly": true - }, - "A rest parameter must be last in a parameter list.": { - "category": "Error", - "code": 1014, - "isEarly": true - }, - "Parameter cannot have question mark and initializer.": { - "category": "Error", - "code": 1015, - "isEarly": true - }, - "A required parameter cannot follow an optional parameter.": { - "category": "Error", - "code": 1016, - "isEarly": true - }, - "An index signature cannot have a rest parameter.": { - "category": "Error", - "code": 1017, - "isEarly": true - }, - "An index signature parameter cannot have an accessibility modifier.": { - "category": "Error", - "code": 1018, - "isEarly": true - }, - "An index signature parameter cannot have a question mark.": { - "category": "Error", - "code": 1019, - "isEarly": true - }, - "An index signature parameter cannot have an initializer.": { - "category": "Error", - "code": 1020, - "isEarly": true - }, - "An index signature must have a type annotation.": { - "category": "Error", - "code": 1021, - "isEarly": true - }, - "An index signature parameter must have a type annotation.": { - "category": "Error", - "code": 1022, - "isEarly": true - }, - "An index signature parameter type must be 'string' or 'number'.": { - "category": "Error", - "code": 1023, - "isEarly": true - }, - "A class or interface declaration can only have one 'extends' clause.": { - "category": "Error", - "code": 1024 - }, - "An 'extends' clause must precede an 'implements' clause.": { - "category": "Error", - "code": 1025 - }, - "A class can only extend a single class.": { - "category": "Error", - "code": 1026 - }, - "A class declaration can only have one 'implements' clause.": { - "category": "Error", - "code": 1027 - }, - "Accessibility modifier already seen.": { - "category": "Error", - "code": 1028, - "isEarly": true - }, - "'{0}' modifier must precede '{1}' modifier.": { - "category": "Error", - "code": 1029, - "isEarly": true - }, - "'{0}' modifier already seen.": { - "category": "Error", - "code": 1030, - "isEarly": true - }, - "'{0}' modifier cannot appear on a class element.": { - "category": "Error", - "code": 1031, - "isEarly": true - }, - "An interface declaration cannot have an 'implements' clause.": { - "category": "Error", - "code": 1032 - }, - "'super' must be followed by an argument list or member access.": { - "category": "Error", - "code": 1034 - }, - "Only ambient modules can use quoted names.": { - "category": "Error", - "code": 1035, - "isEarly": true - }, - "Statements are not allowed in ambient contexts.": { - "category": "Error", - "code": 1036, - "isEarly": true - }, - "A 'declare' modifier cannot be used in an already ambient context.": { - "category": "Error", - "code": 1038, - "isEarly": true - }, - "Initializers are not allowed in ambient contexts.": { - "category": "Error", - "code": 1039, - "isEarly": true - }, - "'{0}' modifier cannot appear on a module element.": { - "category": "Error", - "code": 1044, - "isEarly": true - }, - "A 'declare' modifier cannot be used with an interface declaration.": { - "category": "Error", - "code": 1045, - "isEarly": true - }, - "A 'declare' modifier is required for a top level declaration in a .d.ts file.": { - "category": "Error", - "code": 1046 - }, - "A rest parameter cannot be optional.": { - "category": "Error", - "code": 1047, - "isEarly": true - }, - "A rest parameter cannot have an initializer.": { - "category": "Error", - "code": 1048, - "isEarly": true - }, - "A 'set' accessor must have exactly one parameter.": { - "category": "Error", - "code": 1049, - "isEarly": true - }, - "A 'set' accessor cannot have an optional parameter.": { - "category": "Error", - "code": 1051, - "isEarly": true - }, - "A 'set' accessor parameter cannot have an initializer.": { - "category": "Error", - "code": 1052, - "isEarly": true - }, - "A 'set' accessor cannot have rest parameter.": { - "category": "Error", - "code": 1053, - "isEarly": true - }, - "A 'get' accessor cannot have parameters.": { - "category": "Error", - "code": 1054, - "isEarly": true - }, - "Accessors are only available when targeting ECMAScript 5 and higher.": { - "category": "Error", - "code": 1056, - "isEarly": true - }, - "Enum member must have initializer.": { - "category": "Error", - "code": 1061, - "isEarly": true - }, - "An export assignment cannot be used in an internal module.": { - "category": "Error", - "code": 1063, - "isEarly": true - }, - "Ambient enum elements can only have integer literal initializers.": { - "category": "Error", - "code": 1066, - "isEarly": true - }, - "Unexpected token. A constructor, method, accessor, or property was expected.": { - "category": "Error", - "code": 1068 - }, - "A 'declare' modifier cannot be used with an import declaration.": { - "category": "Error", - "code": 1079, - "isEarly": true - }, - "Invalid 'reference' directive syntax.": { - "category": "Error", - "code": 1084 - }, - "Octal literals are not available when targeting ECMAScript 5 and higher.": { - "category": "Error", - "code": 1085, - "isEarly": true - }, - "An accessor cannot be declared in an ambient context.": { - "category": "Error", - "code": 1086, - "isEarly": true - }, - "'{0}' modifier cannot appear on a constructor declaration.": { - "category": "Error", - "code": 1089, - "isEarly": true - }, - "'{0}' modifier cannot appear on a parameter.": { - "category": "Error", - "code": 1090, - "isEarly": true - }, - "Only a single variable declaration is allowed in a 'for...in' statement.": { - "category": "Error", - "code": 1091, - "isEarly": true - }, - "Type parameters cannot appear on a constructor declaration.": { - "category": "Error", - "code": 1092, - "isEarly": true - }, - "Type annotation cannot appear on a constructor declaration.": { - "category": "Error", - "code": 1093, - "isEarly": true - }, - "An accessor cannot have type parameters.": { - "category": "Error", - "code": 1094, - "isEarly": true - }, - "A 'set' accessor cannot have a return type annotation.": { - "category": "Error", - "code": 1095, - "isEarly": true - }, - "An index signature must have exactly one parameter.": { - "category": "Error", - "code": 1096, - "isEarly": true - }, - "'{0}' list cannot be empty.": { - "category": "Error", - "code": 1097, - "isEarly": true - }, - "Type parameter list cannot be empty.": { - "category": "Error", - "code": 1098, - "isEarly": true - }, - "Type argument list cannot be empty.": { - "category": "Error", - "code": 1099, - "isEarly": true - }, - "Invalid use of '{0}' in strict mode.": { - "category": "Error", - "code": 1100, - "isEarly": true - }, - "'with' statements are not allowed in strict mode.": { - "category": "Error", - "code": 1101, - "isEarly": true - }, - "'delete' cannot be called on an identifier in strict mode.": { - "category": "Error", - "code": 1102, - "isEarly": true - }, - "A 'continue' statement can only be used within an enclosing iteration statement.": { - "category": "Error", - "code": 1104, - "isEarly": true - }, - "A 'break' statement can only be used within an enclosing iteration or switch statement.": { - "category": "Error", - "code": 1105, - "isEarly": true - }, - "Jump target cannot cross function boundary.": { - "category": "Error", - "code": 1107, - "isEarly": true - }, - "A 'return' statement can only be used within a function body.": { - "category": "Error", - "code": 1108, - "isEarly": true - }, - "Expression expected.": { - "category": "Error", - "code": 1109, - "isEarly": true - }, - "Type expected.": { - "category": "Error", - "code": 1110, - "isEarly": true - }, - "A class member cannot be declared optional.": { - "category": "Error", - "code": 1112, - "isEarly": true - }, - "A 'default' clause cannot appear more than once in a 'switch' statement.": { - "category": "Error", - "code": 1113, - "isEarly": true - }, - "Duplicate label '{0}'": { - "category": "Error", - "code": 1114, - "isEarly": true - }, - "A 'continue' statement can only jump to a label of an enclosing iteration statement.": { - "category": "Error", - "code": 1115, - "isEarly": true - }, - "A 'break' statement can only jump to a label of an enclosing statement.": { - "category": "Error", - "code": 1116, - "isEarly": true - }, - "An object literal cannot have multiple properties with the same name in strict mode.": { - "category": "Error", - "code": 1117, - "isEarly": true - }, - "An object literal cannot have multiple get/set accessors with the same name.": { - "category": "Error", - "code": 1118, - "isEarly": true - }, - "An object literal cannot have property and accessor with the same name.": { - "category": "Error", - "code": 1119, - "isEarly": true - }, - "An export assignment cannot have modifiers.": { - "category": "Error", - "code": 1120, - "isEarly": true - }, - "Octal literals are not allowed in strict mode.": { - "category": "Error", - "code": 1121, - "isEarly": true - }, - "A tuple type element list cannot be empty.": { - "category": "Error", - "code": 1122, - "isEarly": true - }, - "Variable declaration list cannot be empty.": { - "category": "Error", - "code": 1123, - "isEarly": true - }, - "Digit expected.": { - "category": "Error", - "code": 1124 - }, - "Hexadecimal digit expected.": { - "category": "Error", - "code": 1125 - }, - "Unexpected end of text.": { - "category": "Error", - "code": 1126 - }, - "Invalid character.": { - "category": "Error", - "code": 1127 - }, - "Declaration or statement expected.": { - "category": "Error", - "code": 1128 - }, - "Statement expected.": { - "category": "Error", - "code": 1129 - }, - "'case' or 'default' expected.": { - "category": "Error", - "code": 1130 - }, - "Property or signature expected.": { - "category": "Error", - "code": 1131 - }, - "Enum member expected.": { - "category": "Error", - "code": 1132 - }, - "Type reference expected.": { - "category": "Error", - "code": 1133 - }, - "Variable declaration expected.": { - "category": "Error", - "code": 1134 - }, - "Argument expression expected.": { - "category": "Error", - "code": 1135, - "isEarly": true - }, - "Property assignment expected.": { - "category": "Error", - "code": 1136 - }, - "Expression or comma expected.": { - "category": "Error", - "code": 1137 - }, - "Parameter declaration expected.": { - "category": "Error", - "code": 1138 - }, - "Type parameter declaration expected.": { - "category": "Error", - "code": 1139 - }, - "Type argument expected.": { - "category": "Error", - "code": 1140 - }, - "String literal expected.": { - "category": "Error", - "code": 1141, - "isEarly": true - }, - "Line break not permitted here.": { - "category": "Error", - "code": 1142, - "isEarly": true - }, - "'{' or ';' expected.": { - "category": "Error", - "code": 1144 - }, - "Modifiers not permitted on index signature members.": { - "category": "Error", - "code": 1145, - "isEarly": true - }, - "Declaration expected.": { - "category": "Error", - "code": 1146 - }, - "Import declarations in an internal module cannot reference an external module.": { - "category": "Error", - "code": 1147, - "isEarly": true - }, - "Cannot compile external modules unless the '--module' flag is provided.": { - "category": "Error", - "code": 1148 - }, - "Filename '{0}' differs from already included filename '{1}' only in casing": { - "category": "Error", - "code": 1149 - }, - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": { - "category": "Error", - "code": 1150, - "isEarly": true - }, - "'var', 'let' or 'const' expected.": { - "category": "Error", - "code": 1152 - }, - "'let' declarations are only available when targeting ECMAScript 6 and higher.": { - "category": "Error", - "code": 1153, - "isEarly": true - }, - "'const' declarations are only available when targeting ECMAScript 6 and higher.": { - "category": "Error", - "code": 1154, - "isEarly": true - }, - "'const' declarations must be initialized": { - "category": "Error", - "code": 1155, - "isEarly": true - }, - "'const' declarations can only be declared inside a block.": { - "category": "Error", - "code": 1156, - "isEarly": true - }, - "'let' declarations can only be declared inside a block.": { - "category": "Error", - "code": 1157, - "isEarly": true - }, - "Tagged templates are only available when targeting ECMAScript 6 and higher.": { - "category": "Error", - "code": 1159, - "isEarly": true - }, - "Unterminated template literal.": { - "category": "Error", - "code": 1160 - }, - "Unterminated regular expression literal.": { - "category": "Error", - "code": 1161 - }, - "An object member cannot be declared optional.": { - "category": "Error", - "code": 1162, - "isEarly": true - }, - "'yield' expression must be contained_within a generator declaration.": { - "category": "Error", - "code": 1163, - "isEarly": true - }, - "Computed property names are not allowed in enums.": { - "category": "Error", - "code": 1164, - "isEarly": true - }, - "Computed property names are not allowed in an ambient context.": { - "category": "Error", - "code": 1165, - "isEarly": true - }, - "Computed property names are not allowed in class property declarations.": { - "category": "Error", - "code": 1166, - "isEarly": true - }, - "Computed property names are only available when targeting ECMAScript 6 and higher.": { - "category": "Error", - "code": 1167, - "isEarly": true - }, - "Computed property names are not allowed in method overloads.": { - "category": "Error", - "code": 1168, - "isEarly": true - }, - "Computed property names are not allowed in interfaces.": { - "category": "Error", - "code": 1169, - "isEarly": true - }, - "Computed property names are not allowed in type literals.": { - "category": "Error", - "code": 1170, - "isEarly": true - }, - "A comma expression is not allowed in a computed property name.": { - "category": "Error", - "code": 1171 - }, - "'extends' clause already seen.": { - "category": "Error", - "code": 1172, - "isEarly": true - }, - "'extends' clause must precede 'implements' clause.": { - "category": "Error", - "code": 1173, - "isEarly": true - }, - "Classes can only extend a single class.": { - "category": "Error", - "code": 1174, - "isEarly": true - }, - "'implements' clause already seen.": { - "category": "Error", - "code": 1175, - "isEarly": true - }, - "Interface declaration cannot have 'implements' clause.": { - "category": "Error", - "code": 1176, - "isEarly": true - }, - "Binary digit expected.": { - "category": "Error", - "code": 1177 - }, - "Octal digit expected.": { - "category": "Error", - "code": 1178 - }, - "Unexpected token. '{' expected.": { - "category": "Error", - "code": 1179 - }, - "Property destructuring pattern expected.": { - "category": "Error", - "code": 1180 - }, - "Array element destructuring pattern expected.": { - "category": "Error", - "code": 1181 - }, - "A destructuring declaration must have an initializer.": { - "category": "Error", - "code": 1182, - "isEarly": true - }, - "Destructuring declarations are not allowed in ambient contexts.": { - "category": "Error", - "code": 1183, - "isEarly": true - }, - "An implementation cannot be declared in ambient contexts.": { - "category": "Error", - "code": 1184, - "isEarly": true - }, - "Modifiers cannot appear here.": { - "category": "Error", - "code": 1184 - }, - "Merge conflict marker encountered.": { - "category": "Error", - "code": 1185 - }, - "A rest element cannot have an initializer.": { - "category": "Error", - "code": 1186 - }, - "A parameter property may not be a binding pattern.": { - "category": "Error", - "code": 1187 - }, + "Unterminated string literal.": { + "category": "Error", + "code": 1002 + }, + "Identifier expected.": { + "category": "Error", + "code": 1003 + }, + "'{0}' expected.": { + "category": "Error", + "code": 1005, + "isEarly": true + }, + "A file cannot have a reference to itself.": { + "category": "Error", + "code": 1006 + }, + "Trailing comma not allowed.": { + "category": "Error", + "code": 1009, + "isEarly": true + }, + "'*/' expected.": { + "category": "Error", + "code": 1010 + }, + "Unexpected token.": { + "category": "Error", + "code": 1012 + }, + "Catch clause parameter cannot have a type annotation.": { + "category": "Error", + "code": 1013, + "isEarly": true + }, + "A rest parameter must be last in a parameter list.": { + "category": "Error", + "code": 1014, + "isEarly": true + }, + "Parameter cannot have question mark and initializer.": { + "category": "Error", + "code": 1015, + "isEarly": true + }, + "A required parameter cannot follow an optional parameter.": { + "category": "Error", + "code": 1016, + "isEarly": true + }, + "An index signature cannot have a rest parameter.": { + "category": "Error", + "code": 1017, + "isEarly": true + }, + "An index signature parameter cannot have an accessibility modifier.": { + "category": "Error", + "code": 1018, + "isEarly": true + }, + "An index signature parameter cannot have a question mark.": { + "category": "Error", + "code": 1019, + "isEarly": true + }, + "An index signature parameter cannot have an initializer.": { + "category": "Error", + "code": 1020, + "isEarly": true + }, + "An index signature must have a type annotation.": { + "category": "Error", + "code": 1021, + "isEarly": true + }, + "An index signature parameter must have a type annotation.": { + "category": "Error", + "code": 1022, + "isEarly": true + }, + "An index signature parameter type must be 'string' or 'number'.": { + "category": "Error", + "code": 1023, + "isEarly": true + }, + "A class or interface declaration can only have one 'extends' clause.": { + "category": "Error", + "code": 1024 + }, + "An 'extends' clause must precede an 'implements' clause.": { + "category": "Error", + "code": 1025 + }, + "A class can only extend a single class.": { + "category": "Error", + "code": 1026 + }, + "A class declaration can only have one 'implements' clause.": { + "category": "Error", + "code": 1027 + }, + "Accessibility modifier already seen.": { + "category": "Error", + "code": 1028, + "isEarly": true + }, + "'{0}' modifier must precede '{1}' modifier.": { + "category": "Error", + "code": 1029, + "isEarly": true + }, + "'{0}' modifier already seen.": { + "category": "Error", + "code": 1030, + "isEarly": true + }, + "'{0}' modifier cannot appear on a class element.": { + "category": "Error", + "code": 1031, + "isEarly": true + }, + "An interface declaration cannot have an 'implements' clause.": { + "category": "Error", + "code": 1032 + }, + "'super' must be followed by an argument list or member access.": { + "category": "Error", + "code": 1034 + }, + "Only ambient modules can use quoted names.": { + "category": "Error", + "code": 1035, + "isEarly": true + }, + "Statements are not allowed in ambient contexts.": { + "category": "Error", + "code": 1036, + "isEarly": true + }, + "A 'declare' modifier cannot be used in an already ambient context.": { + "category": "Error", + "code": 1038, + "isEarly": true + }, + "Initializers are not allowed in ambient contexts.": { + "category": "Error", + "code": 1039, + "isEarly": true + }, + "'{0}' modifier cannot appear on a module element.": { + "category": "Error", + "code": 1044, + "isEarly": true + }, + "A 'declare' modifier cannot be used with an interface declaration.": { + "category": "Error", + "code": 1045, + "isEarly": true + }, + "A 'declare' modifier is required for a top level declaration in a .d.ts file.": { + "category": "Error", + "code": 1046 + }, + "A rest parameter cannot be optional.": { + "category": "Error", + "code": 1047, + "isEarly": true + }, + "A rest parameter cannot have an initializer.": { + "category": "Error", + "code": 1048, + "isEarly": true + }, + "A 'set' accessor must have exactly one parameter.": { + "category": "Error", + "code": 1049, + "isEarly": true + }, + "A 'set' accessor cannot have an optional parameter.": { + "category": "Error", + "code": 1051, + "isEarly": true + }, + "A 'set' accessor parameter cannot have an initializer.": { + "category": "Error", + "code": 1052, + "isEarly": true + }, + "A 'set' accessor cannot have rest parameter.": { + "category": "Error", + "code": 1053, + "isEarly": true + }, + "A 'get' accessor cannot have parameters.": { + "category": "Error", + "code": 1054, + "isEarly": true + }, + "Accessors are only available when targeting ECMAScript 5 and higher.": { + "category": "Error", + "code": 1056, + "isEarly": true + }, + "Enum member must have initializer.": { + "category": "Error", + "code": 1061, + "isEarly": true + }, + "An export assignment cannot be used in an internal module.": { + "category": "Error", + "code": 1063, + "isEarly": true + }, + "Ambient enum elements can only have integer literal initializers.": { + "category": "Error", + "code": 1066, + "isEarly": true + }, + "Unexpected token. A constructor, method, accessor, or property was expected.": { + "category": "Error", + "code": 1068 + }, + "A 'declare' modifier cannot be used with an import declaration.": { + "category": "Error", + "code": 1079, + "isEarly": true + }, + "Invalid 'reference' directive syntax.": { + "category": "Error", + "code": 1084 + }, + "Octal literals are not available when targeting ECMAScript 5 and higher.": { + "category": "Error", + "code": 1085, + "isEarly": true + }, + "An accessor cannot be declared in an ambient context.": { + "category": "Error", + "code": 1086, + "isEarly": true + }, + "'{0}' modifier cannot appear on a constructor declaration.": { + "category": "Error", + "code": 1089, + "isEarly": true + }, + "'{0}' modifier cannot appear on a parameter.": { + "category": "Error", + "code": 1090, + "isEarly": true + }, + "Only a single variable declaration is allowed in a 'for...in' statement.": { + "category": "Error", + "code": 1091, + "isEarly": true + }, + "Type parameters cannot appear on a constructor declaration.": { + "category": "Error", + "code": 1092, + "isEarly": true + }, + "Type annotation cannot appear on a constructor declaration.": { + "category": "Error", + "code": 1093, + "isEarly": true + }, + "An accessor cannot have type parameters.": { + "category": "Error", + "code": 1094, + "isEarly": true + }, + "A 'set' accessor cannot have a return type annotation.": { + "category": "Error", + "code": 1095, + "isEarly": true + }, + "An index signature must have exactly one parameter.": { + "category": "Error", + "code": 1096, + "isEarly": true + }, + "'{0}' list cannot be empty.": { + "category": "Error", + "code": 1097, + "isEarly": true + }, + "Type parameter list cannot be empty.": { + "category": "Error", + "code": 1098, + "isEarly": true + }, + "Type argument list cannot be empty.": { + "category": "Error", + "code": 1099, + "isEarly": true + }, + "Invalid use of '{0}' in strict mode.": { + "category": "Error", + "code": 1100, + "isEarly": true + }, + "'with' statements are not allowed in strict mode.": { + "category": "Error", + "code": 1101, + "isEarly": true + }, + "'delete' cannot be called on an identifier in strict mode.": { + "category": "Error", + "code": 1102, + "isEarly": true + }, + "A 'continue' statement can only be used within an enclosing iteration statement.": { + "category": "Error", + "code": 1104, + "isEarly": true + }, + "A 'break' statement can only be used within an enclosing iteration or switch statement.": { + "category": "Error", + "code": 1105, + "isEarly": true + }, + "Jump target cannot cross function boundary.": { + "category": "Error", + "code": 1107, + "isEarly": true + }, + "A 'return' statement can only be used within a function body.": { + "category": "Error", + "code": 1108, + "isEarly": true + }, + "Expression expected.": { + "category": "Error", + "code": 1109, + "isEarly": true + }, + "Type expected.": { + "category": "Error", + "code": 1110, + "isEarly": true + }, + "A class member cannot be declared optional.": { + "category": "Error", + "code": 1112, + "isEarly": true + }, + "A 'default' clause cannot appear more than once in a 'switch' statement.": { + "category": "Error", + "code": 1113, + "isEarly": true + }, + "Duplicate label '{0}'": { + "category": "Error", + "code": 1114, + "isEarly": true + }, + "A 'continue' statement can only jump to a label of an enclosing iteration statement.": { + "category": "Error", + "code": 1115, + "isEarly": true + }, + "A 'break' statement can only jump to a label of an enclosing statement.": { + "category": "Error", + "code": 1116, + "isEarly": true + }, + "An object literal cannot have multiple properties with the same name in strict mode.": { + "category": "Error", + "code": 1117, + "isEarly": true + }, + "An object literal cannot have multiple get/set accessors with the same name.": { + "category": "Error", + "code": 1118, + "isEarly": true + }, + "An object literal cannot have property and accessor with the same name.": { + "category": "Error", + "code": 1119, + "isEarly": true + }, + "An export assignment cannot have modifiers.": { + "category": "Error", + "code": 1120, + "isEarly": true + }, + "Octal literals are not allowed in strict mode.": { + "category": "Error", + "code": 1121, + "isEarly": true + }, + "A tuple type element list cannot be empty.": { + "category": "Error", + "code": 1122, + "isEarly": true + }, + "Variable declaration list cannot be empty.": { + "category": "Error", + "code": 1123, + "isEarly": true + }, + "Digit expected.": { + "category": "Error", + "code": 1124 + }, + "Hexadecimal digit expected.": { + "category": "Error", + "code": 1125 + }, + "Unexpected end of text.": { + "category": "Error", + "code": 1126 + }, + "Invalid character.": { + "category": "Error", + "code": 1127 + }, + "Declaration or statement expected.": { + "category": "Error", + "code": 1128 + }, + "Statement expected.": { + "category": "Error", + "code": 1129 + }, + "'case' or 'default' expected.": { + "category": "Error", + "code": 1130 + }, + "Property or signature expected.": { + "category": "Error", + "code": 1131 + }, + "Enum member expected.": { + "category": "Error", + "code": 1132 + }, + "Type reference expected.": { + "category": "Error", + "code": 1133 + }, + "Variable declaration expected.": { + "category": "Error", + "code": 1134 + }, + "Argument expression expected.": { + "category": "Error", + "code": 1135, + "isEarly": true + }, + "Property assignment expected.": { + "category": "Error", + "code": 1136 + }, + "Expression or comma expected.": { + "category": "Error", + "code": 1137 + }, + "Parameter declaration expected.": { + "category": "Error", + "code": 1138 + }, + "Type parameter declaration expected.": { + "category": "Error", + "code": 1139 + }, + "Type argument expected.": { + "category": "Error", + "code": 1140 + }, + "String literal expected.": { + "category": "Error", + "code": 1141, + "isEarly": true + }, + "Line break not permitted here.": { + "category": "Error", + "code": 1142, + "isEarly": true + }, + "'{' or ';' expected.": { + "category": "Error", + "code": 1144 + }, + "Modifiers not permitted on index signature members.": { + "category": "Error", + "code": 1145, + "isEarly": true + }, + "Declaration expected.": { + "category": "Error", + "code": 1146 + }, + "Import declarations in an internal module cannot reference an external module.": { + "category": "Error", + "code": 1147, + "isEarly": true + }, + "Cannot compile external modules unless the '--module' flag is provided.": { + "category": "Error", + "code": 1148 + }, + "Filename '{0}' differs from already included filename '{1}' only in casing": { + "category": "Error", + "code": 1149 + }, + "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": { + "category": "Error", + "code": 1150, + "isEarly": true + }, + "'var', 'let' or 'const' expected.": { + "category": "Error", + "code": 1152 + }, + "'let' declarations are only available when targeting ECMAScript 6 and higher.": { + "category": "Error", + "code": 1153, + "isEarly": true + }, + "'const' declarations are only available when targeting ECMAScript 6 and higher.": { + "category": "Error", + "code": 1154, + "isEarly": true + }, + "'const' declarations must be initialized": { + "category": "Error", + "code": 1155, + "isEarly": true + }, + "'const' declarations can only be declared inside a block.": { + "category": "Error", + "code": 1156, + "isEarly": true + }, + "'let' declarations can only be declared inside a block.": { + "category": "Error", + "code": 1157, + "isEarly": true + }, + "Tagged templates are only available when targeting ECMAScript 6 and higher.": { + "category": "Error", + "code": 1159, + "isEarly": true + }, + "Unterminated template literal.": { + "category": "Error", + "code": 1160 + }, + "Unterminated regular expression literal.": { + "category": "Error", + "code": 1161 + }, + "An object member cannot be declared optional.": { + "category": "Error", + "code": 1162, + "isEarly": true + }, + "'yield' expression must be contained_within a generator declaration.": { + "category": "Error", + "code": 1163, + "isEarly": true + }, + "Computed property names are not allowed in enums.": { + "category": "Error", + "code": 1164, + "isEarly": true + }, + "Computed property names are not allowed in an ambient context.": { + "category": "Error", + "code": 1165, + "isEarly": true + }, + "Computed property names are not allowed in class property declarations.": { + "category": "Error", + "code": 1166, + "isEarly": true + }, + "Computed property names are only available when targeting ECMAScript 6 and higher.": { + "category": "Error", + "code": 1167, + "isEarly": true + }, + "Computed property names are not allowed in method overloads.": { + "category": "Error", + "code": 1168, + "isEarly": true + }, + "Computed property names are not allowed in interfaces.": { + "category": "Error", + "code": 1169, + "isEarly": true + }, + "Computed property names are not allowed in type literals.": { + "category": "Error", + "code": 1170, + "isEarly": true + }, + "A comma expression is not allowed in a computed property name.": { + "category": "Error", + "code": 1171 + }, + "'extends' clause already seen.": { + "category": "Error", + "code": 1172, + "isEarly": true + }, + "'extends' clause must precede 'implements' clause.": { + "category": "Error", + "code": 1173, + "isEarly": true + }, + "Classes can only extend a single class.": { + "category": "Error", + "code": 1174, + "isEarly": true + }, + "'implements' clause already seen.": { + "category": "Error", + "code": 1175, + "isEarly": true + }, + "Interface declaration cannot have 'implements' clause.": { + "category": "Error", + "code": 1176, + "isEarly": true + }, + "Binary digit expected.": { + "category": "Error", + "code": 1177 + }, + "Octal digit expected.": { + "category": "Error", + "code": 1178 + }, + "Unexpected token. '{' expected.": { + "category": "Error", + "code": 1179 + }, + "Property destructuring pattern expected.": { + "category": "Error", + "code": 1180 + }, + "Array element destructuring pattern expected.": { + "category": "Error", + "code": 1181 + }, + "A destructuring declaration must have an initializer.": { + "category": "Error", + "code": 1182, + "isEarly": true + }, + "Destructuring declarations are not allowed in ambient contexts.": { + "category": "Error", + "code": 1183, + "isEarly": true + }, + "An implementation cannot be declared in ambient contexts.": { + "category": "Error", + "code": 1184, + "isEarly": true + }, + "Modifiers cannot appear here.": { + "category": "Error", + "code": 1184 + }, + "Merge conflict marker encountered.": { + "category": "Error", + "code": 1185 + }, + "A rest element cannot have an initializer.": { + "category": "Error", + "code": 1186 + }, + "A parameter property may not be a binding pattern.": { + "category": "Error", + "code": 1187 + }, - "Duplicate identifier '{0}'.": { - "category": "Error", - "code": 2300 - }, - "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.": { - "category": "Error", - "code": 2301 - }, - "Static members cannot reference class type parameters.": { - "category": "Error", - "code": 2302 - }, - "Circular definition of import alias '{0}'.": { - "category": "Error", - "code": 2303 - }, - "Cannot find name '{0}'.": { - "category": "Error", - "code": 2304 - }, - "Module '{0}' has no exported member '{1}'.": { - "category": "Error", - "code": 2305 - }, - "File '{0}' is not an external module.": { - "category": "Error", - "code": 2306 - }, - "Cannot find external module '{0}'.": { - "category": "Error", - "code": 2307 - }, - "A module cannot have more than one export assignment.": { - "category": "Error", - "code": 2308 - }, - "An export assignment cannot be used in a module with other exported elements.": { - "category": "Error", - "code": 2309 - }, - "Type '{0}' recursively references itself as a base type.": { - "category": "Error", - "code": 2310 - }, - "A class may only extend another class.": { - "category": "Error", - "code": 2311 - }, - "An interface may only extend a class or another interface.": { - "category": "Error", - "code": 2312 - }, - "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.": { - "category": "Error", - "code": 2313 - }, - "Generic type '{0}' requires {1} type argument(s).": { - "category": "Error", - "code": 2314 - }, - "Type '{0}' is not generic.": { - "category": "Error", - "code": 2315 - }, - "Global type '{0}' must be a class or interface type.": { - "category": "Error", - "code": 2316 - }, - "Global type '{0}' must have {1} type parameter(s).": { - "category": "Error", - "code": 2317 - }, - "Cannot find global type '{0}'.": { - "category": "Error", - "code": 2318 - }, - "Named properties '{0}' of types '{1}' and '{2}' are not identical.": { - "category": "Error", - "code": 2319 - }, - "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'.": { - "category": "Error", - "code": 2320 - }, - "Excessive stack depth comparing types '{0}' and '{1}'.": { - "category": "Error", - "code": 2321 - }, - "Type '{0}' is not assignable to type '{1}'.": { - "category": "Error", - "code": 2322 - }, - "Property '{0}' is missing in type '{1}'.": { - "category": "Error", - "code": 2324 - }, - "Property '{0}' is private in type '{1}' but not in type '{2}'.": { - "category": "Error", - "code": 2325 - }, - "Types of property '{0}' are incompatible.": { - "category": "Error", - "code": 2326 - }, - "Property '{0}' is optional in type '{1}' but required in type '{2}'.": { - "category": "Error", - "code": 2327 - }, - "Types of parameters '{0}' and '{1}' are incompatible.": { - "category": "Error", - "code": 2328 - }, - "Index signature is missing in type '{0}'.": { - "category": "Error", - "code": 2329 - }, - "Index signatures are incompatible.": { - "category": "Error", - "code": 2330 - }, - "'this' cannot be referenced in a module body.": { - "category": "Error", - "code": 2331 - }, - "'this' cannot be referenced in current location.": { - "category": "Error", - "code": 2332 - }, - "'this' cannot be referenced in constructor arguments.": { - "category": "Error", - "code": 2333 - }, - "'this' cannot be referenced in a static property initializer.": { - "category": "Error", - "code": 2334 - }, - "'super' can only be referenced in a derived class.": { - "category": "Error", - "code": 2335 - }, - "'super' cannot be referenced in constructor arguments.": { - "category": "Error", - "code": 2336 - }, - "Super calls are not permitted outside constructors or in nested functions inside constructors": { - "category": "Error", - "code": 2337 - }, - "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class": { - "category": "Error", - "code": 2338 - }, - "Property '{0}' does not exist on type '{1}'.": { - "category": "Error", - "code": 2339 - }, - "Only public and protected methods of the base class are accessible via the 'super' keyword": { - "category": "Error", - "code": 2340 - }, - "Property '{0}' is private and only accessible within class '{1}'.": { - "category": "Error", - "code": 2341 - }, - "An index expression argument must be of type 'string', 'number', or 'any'.": { - "category": "Error", - "code": 2342 - }, - "Type '{0}' does not satisfy the constraint '{1}'.": { - "category": "Error", - "code": 2344 - }, - "Argument of type '{0}' is not assignable to parameter of type '{1}'.": { - "category": "Error", - "code": 2345 - }, - "Supplied parameters do not match any signature of call target.": { - "category": "Error", - "code": 2346 - }, - "Untyped function calls may not accept type arguments.": { - "category": "Error", - "code": 2347 - }, - "Value of type '{0}' is not callable. Did you mean to include 'new'?": { - "category": "Error", - "code": 2348 - }, - "Cannot invoke an expression whose type lacks a call signature.": { - "category": "Error", - "code": 2349 - }, - "Only a void function can be called with the 'new' keyword.": { - "category": "Error", - "code": 2350 - }, - "Cannot use 'new' with an expression whose type lacks a call or construct signature.": { - "category": "Error", - "code": 2351 - }, - "Neither type '{0}' nor type '{1}' is assignable to the other.": { - "category": "Error", - "code": 2352 - }, - "No best common type exists among return expressions.": { - "category": "Error", - "code": 2354 - }, - "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.": { - "category": "Error", - "code": 2355 - }, - "An arithmetic operand must be of type 'any', 'number' or an enum type.": { - "category": "Error", - "code": 2356 - }, - "The operand of an increment or decrement operator must be a variable, property or indexer.": { - "category": "Error", - "code": 2357 - }, - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": { - "category": "Error", - "code": 2358 - }, - "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.": { - "category": "Error", - "code": 2359 - }, - "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.": { - "category": "Error", - "code": 2360 - }, - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter": { - "category": "Error", - "code": 2361 - }, - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { - "category": "Error", - "code": 2362 - }, - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { - "category": "Error", - "code": 2363 - }, - "Invalid left-hand side of assignment expression.": { - "category": "Error", - "code": 2364 - }, - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": { - "category": "Error", - "code": 2365 - }, - "Type parameter name cannot be '{0}'": { - "category": "Error", - "code": 2368 - }, - "A parameter property is only allowed in a constructor implementation.": { - "category": "Error", - "code": 2369 - }, - "A rest parameter must be of an array type.": { - "category": "Error", - "code": 2370 - }, - "A parameter initializer is only allowed in a function or constructor implementation.": { - "category": "Error", - "code": 2371 - }, - "Parameter '{0}' cannot be referenced in its initializer.": { - "category": "Error", - "code": 2372 - }, - "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.": { - "category": "Error", - "code": 2373 - }, - "Duplicate string index signature.": { - "category": "Error", - "code": 2374 - }, - "Duplicate number index signature.": { - "category": "Error", - "code": 2375 - }, - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": { - "category": "Error", - "code": 2376 - }, - "Constructors for derived classes must contain a 'super' call.": { - "category": "Error", - "code": 2377 - }, - "A 'get' accessor must return a value or consist of a single 'throw' statement.": { - "category": "Error", - "code": 2378 - }, - "Getter and setter accessors do not agree in visibility.": { - "category": "Error", - "code": 2379 - }, - "'get' and 'set' accessor must have the same type.": { - "category": "Error", - "code": 2380 - }, - "A signature with an implementation cannot use a string literal type.": { - "category": "Error", - "code": 2381 - }, - "Specialized overload signature is not assignable to any non-specialized signature.": { - "category": "Error", - "code": 2382 - }, - "Overload signatures must all be exported or not exported.": { - "category": "Error", - "code": 2383 - }, - "Overload signatures must all be ambient or non-ambient.": { - "category": "Error", - "code": 2384 - }, - "Overload signatures must all be public, private or protected.": { - "category": "Error", - "code": 2385 - }, - "Overload signatures must all be optional or required.": { - "category": "Error", - "code": 2386 - }, - "Function overload must be static.": { - "category": "Error", - "code": 2387 - }, - "Function overload must not be static.": { - "category": "Error", - "code": 2388 - }, - "Function implementation name must be '{0}'.": { - "category": "Error", - "code": 2389 - }, - "Constructor implementation is missing.": { - "category": "Error", - "code": 2390 - }, - "Function implementation is missing or not immediately following the declaration.": { - "category": "Error", - "code": 2391 - }, - "Multiple constructor implementations are not allowed.": { - "category": "Error", - "code": 2392 - }, - "Duplicate function implementation.": { - "category": "Error", - "code": 2393 - }, - "Overload signature is not compatible with function implementation.": { - "category": "Error", - "code": 2394 - }, - "Individual declarations in merged declaration {0} must be all exported or all local.": { - "category": "Error", - "code": 2395 - }, - "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.": { - "category": "Error", - "code": 2396 - }, - "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.": { - "category": "Error", - "code": 2399 - }, - "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.": { - "category": "Error", - "code": 2400 - }, - "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.": { - "category": "Error", - "code": 2401 - }, - "Expression resolves to '_super' that compiler uses to capture base class reference.": { - "category": "Error", - "code": 2402 - }, - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": { - "category": "Error", - "code": 2403 - }, - "The left-hand side of a 'for...in' statement cannot use a type annotation.": { - "category": "Error", - "code": 2404 - }, - "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.": { - "category": "Error", - "code": 2405 - }, - "Invalid left-hand side in 'for...in' statement.": { - "category": "Error", - "code": 2406 - }, - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": { - "category": "Error", - "code": 2407 - }, - "Setters cannot return a value.": { - "category": "Error", - "code": 2408 - }, - "Return type of constructor signature must be assignable to the instance type of the class": { - "category": "Error", - "code": 2409 - }, - "All symbols within a 'with' block will be resolved to 'any'.": { - "category": "Error", - "code": 2410 - }, - "Property '{0}' of type '{1}' is not assignable to string index type '{2}'.": { - "category": "Error", - "code": 2411 - }, - "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'.": { - "category": "Error", - "code": 2412 - }, - "Numeric index type '{0}' is not assignable to string index type '{1}'.": { - "category": "Error", - "code": 2413 - }, - "Class name cannot be '{0}'": { - "category": "Error", - "code": 2414 - }, - "Class '{0}' incorrectly extends base class '{1}'.": { - "category": "Error", - "code": 2415 - }, - "Class static side '{0}' incorrectly extends base class static side '{1}'.": { - "category": "Error", - "code": 2417 - }, - "Type name '{0}' in extends clause does not reference constructor function for '{0}'.": { - "category": "Error", - "code": 2419 - }, - "Class '{0}' incorrectly implements interface '{1}'.": { - "category": "Error", - "code": 2420 - }, - "A class may only implement another class or interface.": { - "category": "Error", - "code": 2422 - }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": { - "category": "Error", - "code": 2423 - }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": { - "category": "Error", - "code": 2424 - }, - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": { - "category": "Error", - "code": 2425 - }, - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": { - "category": "Error", - "code": 2426 - }, - "Interface name cannot be '{0}'": { - "category": "Error", - "code": 2427 - }, - "All declarations of an interface must have identical type parameters.": { - "category": "Error", - "code": 2428 - }, - "Interface '{0}' incorrectly extends interface '{1}'.": { - "category": "Error", - "code": 2430 - }, - "Enum name cannot be '{0}'": { - "category": "Error", - "code": 2431 - }, - "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.": { - "category": "Error", - "code": 2432 - }, - "A module declaration cannot be in a different file from a class or function with which it is merged": { - "category": "Error", - "code": 2433 - }, - "A module declaration cannot be located prior to a class or function with which it is merged": { - "category": "Error", - "code": 2434 - }, - "Ambient external modules cannot be nested in other modules.": { - "category": "Error", - "code": 2435 - }, - "Ambient external module declaration cannot specify relative module name.": { - "category": "Error", - "code": 2436 - }, - "Module '{0}' is hidden by a local declaration with the same name": { - "category": "Error", - "code": 2437 - }, - "Import name cannot be '{0}'": { - "category": "Error", - "code": 2438 - }, - "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.": { - "category": "Error", - "code": 2439 - }, - "Import declaration conflicts with local declaration of '{0}'": { - "category": "Error", - "code": 2440 - }, - "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module.": { - "category": "Error", - "code": 2441 - }, - "Types have separate declarations of a private property '{0}'.": { - "category": "Error", - "code": 2442 - }, - "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'.": { - "category": "Error", - "code": 2443 - }, - "Property '{0}' is protected in type '{1}' but public in type '{2}'.": { - "category": "Error", - "code": 2444 - }, - "Property '{0}' is protected and only accessible within class '{1}' and its subclasses.": { - "category": "Error", - "code": 2445 - }, - "Property '{0}' is protected and only accessible through an instance of class '{1}'.": { - "category": "Error", - "code": 2446 - }, - "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead.": { - "category": "Error", - "code": 2447 - }, - "Block-scoped variable '{0}' used before its declaration.": { - "category": "Error", - "code": 2448, - "isEarly": true - }, - "The operand of an increment or decrement operator cannot be a constant.": { - "category": "Error", - "code": 2449, - "isEarly": true - }, - "Left-hand side of assignment expression cannot be a constant.": { - "category": "Error", - "code": 2450, - "isEarly": true - }, - "Cannot redeclare block-scoped variable '{0}'.": { - "category": "Error", - "code": 2451, - "isEarly": true - }, - "An enum member cannot have a numeric name.": { - "category": "Error", - "code": 2452 - }, - "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly.": { - "category": "Error", - "code": 2453 - }, - "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'.": { - "category": "Error", - "code": 2455 - }, - "Type alias '{0}' circularly references itself.": { - "category": "Error", - "code": 2456 - }, - "Type alias name cannot be '{0}'": { - "category": "Error", - "code": 2457 - }, - "An AMD module cannot have multiple name assignments.": { - "category": "Error", - "code": 2458 - }, - "Type '{0}' has no property '{1}' and no string index signature.": { - "category": "Error", - "code": 2459 - }, - "Type '{0}' has no property '{1}'.": { - "category": "Error", - "code": 2460 - }, - "Type '{0}' is not an array type.": { - "category": "Error", - "code": 2461 - }, - "A rest element must be last in an array destructuring pattern": { - "category": "Error", - "code": 2462 - }, - "A binding pattern parameter cannot be optional in an implementation signature.": { - "category": "Error", - "code": 2463 - }, - "A computed property name must be of type 'string', 'number', or 'any'.": { - "category": "Error", - "code": 2464 - }, - "'this' cannot be referenced in a computed property name.": { - "category": "Error", - "code": 2465 - }, - "'super' cannot be referenced in a computed property name.": { - "category": "Error", - "code": 2466 - }, - "A computed property name cannot reference a type parameter from its containing type.": { - "category": "Error", - "code": 2466 - }, + "Duplicate identifier '{0}'.": { + "category": "Error", + "code": 2300 + }, + "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.": { + "category": "Error", + "code": 2301 + }, + "Static members cannot reference class type parameters.": { + "category": "Error", + "code": 2302 + }, + "Circular definition of import alias '{0}'.": { + "category": "Error", + "code": 2303 + }, + "Cannot find name '{0}'.": { + "category": "Error", + "code": 2304 + }, + "Module '{0}' has no exported member '{1}'.": { + "category": "Error", + "code": 2305 + }, + "File '{0}' is not an external module.": { + "category": "Error", + "code": 2306 + }, + "Cannot find external module '{0}'.": { + "category": "Error", + "code": 2307 + }, + "A module cannot have more than one export assignment.": { + "category": "Error", + "code": 2308 + }, + "An export assignment cannot be used in a module with other exported elements.": { + "category": "Error", + "code": 2309 + }, + "Type '{0}' recursively references itself as a base type.": { + "category": "Error", + "code": 2310 + }, + "A class may only extend another class.": { + "category": "Error", + "code": 2311 + }, + "An interface may only extend a class or another interface.": { + "category": "Error", + "code": 2312 + }, + "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.": { + "category": "Error", + "code": 2313 + }, + "Generic type '{0}' requires {1} type argument(s).": { + "category": "Error", + "code": 2314 + }, + "Type '{0}' is not generic.": { + "category": "Error", + "code": 2315 + }, + "Global type '{0}' must be a class or interface type.": { + "category": "Error", + "code": 2316 + }, + "Global type '{0}' must have {1} type parameter(s).": { + "category": "Error", + "code": 2317 + }, + "Cannot find global type '{0}'.": { + "category": "Error", + "code": 2318 + }, + "Named properties '{0}' of types '{1}' and '{2}' are not identical.": { + "category": "Error", + "code": 2319 + }, + "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'.": { + "category": "Error", + "code": 2320 + }, + "Excessive stack depth comparing types '{0}' and '{1}'.": { + "category": "Error", + "code": 2321 + }, + "Type '{0}' is not assignable to type '{1}'.": { + "category": "Error", + "code": 2322 + }, + "Property '{0}' is missing in type '{1}'.": { + "category": "Error", + "code": 2324 + }, + "Property '{0}' is private in type '{1}' but not in type '{2}'.": { + "category": "Error", + "code": 2325 + }, + "Types of property '{0}' are incompatible.": { + "category": "Error", + "code": 2326 + }, + "Property '{0}' is optional in type '{1}' but required in type '{2}'.": { + "category": "Error", + "code": 2327 + }, + "Types of parameters '{0}' and '{1}' are incompatible.": { + "category": "Error", + "code": 2328 + }, + "Index signature is missing in type '{0}'.": { + "category": "Error", + "code": 2329 + }, + "Index signatures are incompatible.": { + "category": "Error", + "code": 2330 + }, + "'this' cannot be referenced in a module body.": { + "category": "Error", + "code": 2331 + }, + "'this' cannot be referenced in current location.": { + "category": "Error", + "code": 2332 + }, + "'this' cannot be referenced in constructor arguments.": { + "category": "Error", + "code": 2333 + }, + "'this' cannot be referenced in a static property initializer.": { + "category": "Error", + "code": 2334 + }, + "'super' can only be referenced in a derived class.": { + "category": "Error", + "code": 2335 + }, + "'super' cannot be referenced in constructor arguments.": { + "category": "Error", + "code": 2336 + }, + "Super calls are not permitted outside constructors or in nested functions inside constructors": { + "category": "Error", + "code": 2337 + }, + "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class": { + "category": "Error", + "code": 2338 + }, + "Property '{0}' does not exist on type '{1}'.": { + "category": "Error", + "code": 2339 + }, + "Only public and protected methods of the base class are accessible via the 'super' keyword": { + "category": "Error", + "code": 2340 + }, + "Property '{0}' is private and only accessible within class '{1}'.": { + "category": "Error", + "code": 2341 + }, + "An index expression argument must be of type 'string', 'number', or 'any'.": { + "category": "Error", + "code": 2342 + }, + "Type '{0}' does not satisfy the constraint '{1}'.": { + "category": "Error", + "code": 2344 + }, + "Argument of type '{0}' is not assignable to parameter of type '{1}'.": { + "category": "Error", + "code": 2345 + }, + "Supplied parameters do not match any signature of call target.": { + "category": "Error", + "code": 2346 + }, + "Untyped function calls may not accept type arguments.": { + "category": "Error", + "code": 2347 + }, + "Value of type '{0}' is not callable. Did you mean to include 'new'?": { + "category": "Error", + "code": 2348 + }, + "Cannot invoke an expression whose type lacks a call signature.": { + "category": "Error", + "code": 2349 + }, + "Only a void function can be called with the 'new' keyword.": { + "category": "Error", + "code": 2350 + }, + "Cannot use 'new' with an expression whose type lacks a call or construct signature.": { + "category": "Error", + "code": 2351 + }, + "Neither type '{0}' nor type '{1}' is assignable to the other.": { + "category": "Error", + "code": 2352 + }, + "No best common type exists among return expressions.": { + "category": "Error", + "code": 2354 + }, + "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.": { + "category": "Error", + "code": 2355 + }, + "An arithmetic operand must be of type 'any', 'number' or an enum type.": { + "category": "Error", + "code": 2356 + }, + "The operand of an increment or decrement operator must be a variable, property or indexer.": { + "category": "Error", + "code": 2357 + }, + "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": { + "category": "Error", + "code": 2358 + }, + "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.": { + "category": "Error", + "code": 2359 + }, + "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.": { + "category": "Error", + "code": 2360 + }, + "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter": { + "category": "Error", + "code": 2361 + }, + "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { + "category": "Error", + "code": 2362 + }, + "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { + "category": "Error", + "code": 2363 + }, + "Invalid left-hand side of assignment expression.": { + "category": "Error", + "code": 2364 + }, + "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": { + "category": "Error", + "code": 2365 + }, + "Type parameter name cannot be '{0}'": { + "category": "Error", + "code": 2368 + }, + "A parameter property is only allowed in a constructor implementation.": { + "category": "Error", + "code": 2369 + }, + "A rest parameter must be of an array type.": { + "category": "Error", + "code": 2370 + }, + "A parameter initializer is only allowed in a function or constructor implementation.": { + "category": "Error", + "code": 2371 + }, + "Parameter '{0}' cannot be referenced in its initializer.": { + "category": "Error", + "code": 2372 + }, + "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.": { + "category": "Error", + "code": 2373 + }, + "Duplicate string index signature.": { + "category": "Error", + "code": 2374 + }, + "Duplicate number index signature.": { + "category": "Error", + "code": 2375 + }, + "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": { + "category": "Error", + "code": 2376 + }, + "Constructors for derived classes must contain a 'super' call.": { + "category": "Error", + "code": 2377 + }, + "A 'get' accessor must return a value or consist of a single 'throw' statement.": { + "category": "Error", + "code": 2378 + }, + "Getter and setter accessors do not agree in visibility.": { + "category": "Error", + "code": 2379 + }, + "'get' and 'set' accessor must have the same type.": { + "category": "Error", + "code": 2380 + }, + "A signature with an implementation cannot use a string literal type.": { + "category": "Error", + "code": 2381 + }, + "Specialized overload signature is not assignable to any non-specialized signature.": { + "category": "Error", + "code": 2382 + }, + "Overload signatures must all be exported or not exported.": { + "category": "Error", + "code": 2383 + }, + "Overload signatures must all be ambient or non-ambient.": { + "category": "Error", + "code": 2384 + }, + "Overload signatures must all be public, private or protected.": { + "category": "Error", + "code": 2385 + }, + "Overload signatures must all be optional or required.": { + "category": "Error", + "code": 2386 + }, + "Function overload must be static.": { + "category": "Error", + "code": 2387 + }, + "Function overload must not be static.": { + "category": "Error", + "code": 2388 + }, + "Function implementation name must be '{0}'.": { + "category": "Error", + "code": 2389 + }, + "Constructor implementation is missing.": { + "category": "Error", + "code": 2390 + }, + "Function implementation is missing or not immediately following the declaration.": { + "category": "Error", + "code": 2391 + }, + "Multiple constructor implementations are not allowed.": { + "category": "Error", + "code": 2392 + }, + "Duplicate function implementation.": { + "category": "Error", + "code": 2393 + }, + "Overload signature is not compatible with function implementation.": { + "category": "Error", + "code": 2394 + }, + "Individual declarations in merged declaration {0} must be all exported or all local.": { + "category": "Error", + "code": 2395 + }, + "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.": { + "category": "Error", + "code": 2396 + }, + "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.": { + "category": "Error", + "code": 2399 + }, + "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.": { + "category": "Error", + "code": 2400 + }, + "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.": { + "category": "Error", + "code": 2401 + }, + "Expression resolves to '_super' that compiler uses to capture base class reference.": { + "category": "Error", + "code": 2402 + }, + "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": { + "category": "Error", + "code": 2403 + }, + "The left-hand side of a 'for...in' statement cannot use a type annotation.": { + "category": "Error", + "code": 2404 + }, + "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.": { + "category": "Error", + "code": 2405 + }, + "Invalid left-hand side in 'for...in' statement.": { + "category": "Error", + "code": 2406 + }, + "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": { + "category": "Error", + "code": 2407 + }, + "Setters cannot return a value.": { + "category": "Error", + "code": 2408 + }, + "Return type of constructor signature must be assignable to the instance type of the class": { + "category": "Error", + "code": 2409 + }, + "All symbols within a 'with' block will be resolved to 'any'.": { + "category": "Error", + "code": 2410 + }, + "Property '{0}' of type '{1}' is not assignable to string index type '{2}'.": { + "category": "Error", + "code": 2411 + }, + "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'.": { + "category": "Error", + "code": 2412 + }, + "Numeric index type '{0}' is not assignable to string index type '{1}'.": { + "category": "Error", + "code": 2413 + }, + "Class name cannot be '{0}'": { + "category": "Error", + "code": 2414 + }, + "Class '{0}' incorrectly extends base class '{1}'.": { + "category": "Error", + "code": 2415 + }, + "Class static side '{0}' incorrectly extends base class static side '{1}'.": { + "category": "Error", + "code": 2417 + }, + "Type name '{0}' in extends clause does not reference constructor function for '{0}'.": { + "category": "Error", + "code": 2419 + }, + "Class '{0}' incorrectly implements interface '{1}'.": { + "category": "Error", + "code": 2420 + }, + "A class may only implement another class or interface.": { + "category": "Error", + "code": 2422 + }, + "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": { + "category": "Error", + "code": 2423 + }, + "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": { + "category": "Error", + "code": 2424 + }, + "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": { + "category": "Error", + "code": 2425 + }, + "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": { + "category": "Error", + "code": 2426 + }, + "Interface name cannot be '{0}'": { + "category": "Error", + "code": 2427 + }, + "All declarations of an interface must have identical type parameters.": { + "category": "Error", + "code": 2428 + }, + "Interface '{0}' incorrectly extends interface '{1}'.": { + "category": "Error", + "code": 2430 + }, + "Enum name cannot be '{0}'": { + "category": "Error", + "code": 2431 + }, + "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.": { + "category": "Error", + "code": 2432 + }, + "A module declaration cannot be in a different file from a class or function with which it is merged": { + "category": "Error", + "code": 2433 + }, + "A module declaration cannot be located prior to a class or function with which it is merged": { + "category": "Error", + "code": 2434 + }, + "Ambient external modules cannot be nested in other modules.": { + "category": "Error", + "code": 2435 + }, + "Ambient external module declaration cannot specify relative module name.": { + "category": "Error", + "code": 2436 + }, + "Module '{0}' is hidden by a local declaration with the same name": { + "category": "Error", + "code": 2437 + }, + "Import name cannot be '{0}'": { + "category": "Error", + "code": 2438 + }, + "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.": { + "category": "Error", + "code": 2439 + }, + "Import declaration conflicts with local declaration of '{0}'": { + "category": "Error", + "code": 2440 + }, + "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module.": { + "category": "Error", + "code": 2441 + }, + "Types have separate declarations of a private property '{0}'.": { + "category": "Error", + "code": 2442 + }, + "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'.": { + "category": "Error", + "code": 2443 + }, + "Property '{0}' is protected in type '{1}' but public in type '{2}'.": { + "category": "Error", + "code": 2444 + }, + "Property '{0}' is protected and only accessible within class '{1}' and its subclasses.": { + "category": "Error", + "code": 2445 + }, + "Property '{0}' is protected and only accessible through an instance of class '{1}'.": { + "category": "Error", + "code": 2446 + }, + "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead.": { + "category": "Error", + "code": 2447 + }, + "Block-scoped variable '{0}' used before its declaration.": { + "category": "Error", + "code": 2448, + "isEarly": true + }, + "The operand of an increment or decrement operator cannot be a constant.": { + "category": "Error", + "code": 2449, + "isEarly": true + }, + "Left-hand side of assignment expression cannot be a constant.": { + "category": "Error", + "code": 2450, + "isEarly": true + }, + "Cannot redeclare block-scoped variable '{0}'.": { + "category": "Error", + "code": 2451, + "isEarly": true + }, + "An enum member cannot have a numeric name.": { + "category": "Error", + "code": 2452 + }, + "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly.": { + "category": "Error", + "code": 2453 + }, + "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'.": { + "category": "Error", + "code": 2455 + }, + "Type alias '{0}' circularly references itself.": { + "category": "Error", + "code": 2456 + }, + "Type alias name cannot be '{0}'": { + "category": "Error", + "code": 2457 + }, + "An AMD module cannot have multiple name assignments.": { + "category": "Error", + "code": 2458 + }, + "Type '{0}' has no property '{1}' and no string index signature.": { + "category": "Error", + "code": 2459 + }, + "Type '{0}' has no property '{1}'.": { + "category": "Error", + "code": 2460 + }, + "Type '{0}' is not an array type.": { + "category": "Error", + "code": 2461 + }, + "A rest element must be last in an array destructuring pattern": { + "category": "Error", + "code": 2462 + }, + "A binding pattern parameter cannot be optional in an implementation signature.": { + "category": "Error", + "code": 2463 + }, + "A computed property name must be of type 'string', 'number', or 'any'.": { + "category": "Error", + "code": 2464 + }, + "'this' cannot be referenced in a computed property name.": { + "category": "Error", + "code": 2465 + }, + "'super' cannot be referenced in a computed property name.": { + "category": "Error", + "code": 2466 + }, + "A computed property name cannot reference a type parameter from its containing type.": { + "category": "Error", + "code": 2466 + }, - "Import declaration '{0}' is using private name '{1}'.": { - "category": "Error", - "code": 4000 - }, - "Type parameter '{0}' of exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4002 - }, - "Type parameter '{0}' of exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4004 - }, - "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4006 - }, - "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4008 - }, - "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4010 - }, - "Type parameter '{0}' of public method from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4012 - }, - "Type parameter '{0}' of method from exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4014 - }, - "Type parameter '{0}' of exported function has or is using private name '{1}'.": { - "category": "Error", - "code": 4016 - }, - "Implements clause of exported class '{0}' has or is using private name '{1}'.": { - "category": "Error", - "code": 4019 - }, - "Extends clause of exported class '{0}' has or is using private name '{1}'.": { - "category": "Error", - "code": 4020 - }, - "Extends clause of exported interface '{0}' has or is using private name '{1}'.": { - "category": "Error", - "code": 4022 - }, - "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4023 - }, - "Exported variable '{0}' has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4024 - }, - "Exported variable '{0}' has or is using private name '{1}'.": { - "category": "Error", - "code": 4025 - }, - "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4026 - }, - "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4027 - }, - "Public static property '{0}' of exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4028 - }, - "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4029 - }, - "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4030 - }, - "Public property '{0}' of exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4031 - }, - "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4032 - }, - "Property '{0}' of exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4033 - }, - "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4034 - }, - "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4035 - }, - "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4036 - }, - "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4037 - }, - "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named.": { - "category": "Error", - "code": 4038 - }, - "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4039 - }, - "Return type of public static property getter from exported class has or is using private name '{0}'.": { - "category": "Error", - "code": 4040 - }, - "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named.": { - "category": "Error", - "code": 4041 - }, - "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4042 - }, - "Return type of public property getter from exported class has or is using private name '{0}'.": { - "category": "Error", - "code": 4043 - }, - "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4044 - }, - "Return type of constructor signature from exported interface has or is using private name '{0}'.": { - "category": "Error", - "code": 4045 - }, - "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4046 - }, - "Return type of call signature from exported interface has or is using private name '{0}'.": { - "category": "Error", - "code": 4047 - }, - "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4048 - }, - "Return type of index signature from exported interface has or is using private name '{0}'.": { - "category": "Error", - "code": 4049 - }, - "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named.": { - "category": "Error", - "code": 4050 - }, - "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4051 - }, - "Return type of public static method from exported class has or is using private name '{0}'.": { - "category": "Error", - "code": 4052 - }, - "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named.": { - "category": "Error", - "code": 4053 - }, - "Return type of public method from exported class has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4054 - }, - "Return type of public method from exported class has or is using private name '{0}'.": { - "category": "Error", - "code": 4055 - }, - "Return type of method from exported interface has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4056 - }, - "Return type of method from exported interface has or is using private name '{0}'.": { - "category": "Error", - "code": 4057 - }, - "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named.": { - "category": "Error", - "code": 4058 - }, - "Return type of exported function has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 4059 - }, - "Return type of exported function has or is using private name '{0}'.": { - "category": "Error", - "code": 4060 - }, - "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4061 - }, - "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4062 - }, - "Parameter '{0}' of constructor from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4063 - }, - "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4064 - }, - "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4065 - }, - "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4066 - }, - "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4067 - }, - "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4068 - }, - "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4069 - }, - "Parameter '{0}' of public static method from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4070 - }, - "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4071 - }, - "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4072 - }, - "Parameter '{0}' of public method from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 4073 - }, - "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4074 - }, - "Parameter '{0}' of method from exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 4075 - }, - "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4076 - }, - "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4077 - }, - "Parameter '{0}' of exported function has or is using private name '{1}'.": { - "category": "Error", - "code": 4078 - }, - "Exported type alias '{0}' has or is using private name '{1}'.": { - "category": "Error", - "code": 4081 - }, - "Enum declarations must all be const or non-const.": { - "category": "Error", - "code": 4082 - }, - "In 'const' enum declarations member initializer must be constant expression.": { - "category": "Error", - "code": 4083, - "isEarly": true - }, - "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.": { - "category": "Error", - "code": 4084 - }, - "A const enum member can only be accessed using a string literal.": { - "category": "Error", - "code": 4085, - "isEarly": true - }, - "'const' enum member initializer was evaluated to a non-finite value.": { - "category": "Error", - "code": 4086 - }, - "'const' enum member initializer was evaluated to disallowed value 'NaN'.": { - "category": "Error", - "code": 4087 - }, - "Property '{0}' does not exist on 'const' enum '{1}'.": { - "category": "Error", - "code": 4088, - "isEarly": true - }, - "The current host does not support the '{0}' option.": { - "category": "Error", - "code": 5001 - }, - "Cannot find the common subdirectory path for the input files.": { - "category": "Error", - "code": 5009 - }, - "Cannot read file '{0}': {1}": { - "category": "Error", - "code": 5012 - }, - "Unsupported file encoding.": { - "category": "Error", - "code": 5013 - }, - "Unknown compiler option '{0}'.": { - "category": "Error", - "code": 5023 - }, - "Compiler option '{0}' requires a value of type {1}.": { - "category": "Error", - "code": 5024 - }, - "Could not write file '{0}': {1}": { - "category": "Error", - "code": 5033 - }, - "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option.": { - "category": "Error", - "code": 5038 - }, - "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option.": { - "category": "Error", - "code": 5039 - }, - "Option 'noEmit' cannot be specified with option 'out' or 'outDir'.": { - "category": "Error", - "code": 5040 - }, - "Option 'noEmit' cannot be specified with option 'declaration'.": { - "category": "Error", - "code": 5041 - }, - "Option 'project' cannot be mixed with source files on a command line.": { - "category": "Error", - "code": 5042 - }, - "Concatenate and emit output to single file.": { - "category": "Message", - "code": 6001 - }, - "Generates corresponding '.d.ts' file.": { - "category": "Message", - "code": 6002 - }, - "Specifies the location where debugger should locate map files instead of generated locations.": { - "category": "Message", - "code": 6003 - }, - "Specifies the location where debugger should locate TypeScript files instead of source locations.": { - "category": "Message", - "code": 6004 - }, - "Watch input files.": { - "category": "Message", - "code": 6005 - }, - "Redirect output structure to the directory.": { - "category": "Message", - "code": 6006 - }, - "Do not erase const enum declarations in generated code.": { - "category": "Message", - "code": 6007 - }, - "Do not emit outputs if any type checking errors were reported.": { - "category": "Message", - "code": 6008 - }, - "Do not emit comments to output.": { - "category": "Message", - "code": 6009 - }, - "Do not emit outputs.": { - "category": "Message", - "code": 6010 - }, - "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)": { - "category": "Message", - "code": 6015 - }, - "Specify module code generation: 'commonjs' or 'amd'": { - "category": "Message", - "code": 6016 - }, - "Print this message.": { - "category": "Message", - "code": 6017 - }, - "Print the compiler's version.": { - "category": "Message", - "code": 6019 - }, - "Compile the project in the given directory.": { - "category": "Message", - "code": 6020 - }, - "Syntax: {0}": { - "category": "Message", - "code": 6023 - }, - "options": { - "category": "Message", - "code": 6024 - }, - "file": { - "category": "Message", - "code": 6025 - }, - "Examples: {0}": { - "category": "Message", - "code": 6026 - }, - "Options:": { - "category": "Message", - "code": 6027 - }, - "Version {0}": { - "category": "Message", - "code": 6029 - }, - "Insert command line options and files from a file.": { - "category": "Message", - "code": 6030 - }, - "File change detected. Starting incremental compilation...": { - "category": "Message", - "code": 6032 - }, - "KIND": { - "category": "Message", - "code": 6034 - }, - "FILE": { - "category": "Message", - "code": 6035 - }, - "VERSION": { - "category": "Message", - "code": 6036 - }, - "LOCATION": { - "category": "Message", - "code": 6037 - }, - "DIRECTORY": { - "category": "Message", - "code": 6038 - }, - "Compilation complete. Watching for file changes.": { - "category": "Message", - "code": 6042 - }, - "Generates corresponding '.map' file.": { - "category": "Message", - "code": 6043 - }, - "Compiler option '{0}' expects an argument.": { - "category": "Error", - "code": 6044 - }, - "Unterminated quoted string in response file '{0}'.": { - "category": "Error", - "code": 6045 - }, - "Argument for '--module' option must be 'commonjs' or 'amd'.": { - "category": "Error", - "code": 6046 - }, - "Argument for '--target' option must be 'es3', 'es5', or 'es6'.": { - "category": "Error", - "code": 6047 - }, - "Locale must be of the form or -. For example '{0}' or '{1}'.": { - "category": "Error", - "code": 6048 - }, - "Unsupported locale '{0}'.": { - "category": "Error", - "code": 6049 - }, - "Unable to open file '{0}'.": { - "category": "Error", - "code": 6050 - }, - "Corrupted locale file {0}.": { - "category": "Error", - "code": 6051 - }, - "Raise error on expressions and declarations with an implied 'any' type.": { - "category": "Message", - "code": 6052 - }, - "File '{0}' not found.": { - "category": "Error", - "code": 6053 - }, - "File '{0}' must have extension '.ts' or '.d.ts'.": { - "category": "Error", - "code": 6054 - }, - "Suppress noImplicitAny errors for indexing objects lacking index signatures.": { - "category": "Message", - "code": 6055 - }, + "Import declaration '{0}' is using private name '{1}'.": { + "category": "Error", + "code": 4000 + }, + "Type parameter '{0}' of exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4002 + }, + "Type parameter '{0}' of exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4004 + }, + "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4006 + }, + "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4008 + }, + "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4010 + }, + "Type parameter '{0}' of public method from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4012 + }, + "Type parameter '{0}' of method from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4014 + }, + "Type parameter '{0}' of exported function has or is using private name '{1}'.": { + "category": "Error", + "code": 4016 + }, + "Implements clause of exported class '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4019 + }, + "Extends clause of exported class '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4020 + }, + "Extends clause of exported interface '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4022 + }, + "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4023 + }, + "Exported variable '{0}' has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4024 + }, + "Exported variable '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4025 + }, + "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4026 + }, + "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4027 + }, + "Public static property '{0}' of exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4028 + }, + "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4029 + }, + "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4030 + }, + "Public property '{0}' of exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4031 + }, + "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4032 + }, + "Property '{0}' of exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4033 + }, + "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4034 + }, + "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4035 + }, + "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4036 + }, + "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4037 + }, + "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named.": { + "category": "Error", + "code": 4038 + }, + "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4039 + }, + "Return type of public static property getter from exported class has or is using private name '{0}'.": { + "category": "Error", + "code": 4040 + }, + "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named.": { + "category": "Error", + "code": 4041 + }, + "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4042 + }, + "Return type of public property getter from exported class has or is using private name '{0}'.": { + "category": "Error", + "code": 4043 + }, + "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4044 + }, + "Return type of constructor signature from exported interface has or is using private name '{0}'.": { + "category": "Error", + "code": 4045 + }, + "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4046 + }, + "Return type of call signature from exported interface has or is using private name '{0}'.": { + "category": "Error", + "code": 4047 + }, + "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4048 + }, + "Return type of index signature from exported interface has or is using private name '{0}'.": { + "category": "Error", + "code": 4049 + }, + "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named.": { + "category": "Error", + "code": 4050 + }, + "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4051 + }, + "Return type of public static method from exported class has or is using private name '{0}'.": { + "category": "Error", + "code": 4052 + }, + "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named.": { + "category": "Error", + "code": 4053 + }, + "Return type of public method from exported class has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4054 + }, + "Return type of public method from exported class has or is using private name '{0}'.": { + "category": "Error", + "code": 4055 + }, + "Return type of method from exported interface has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4056 + }, + "Return type of method from exported interface has or is using private name '{0}'.": { + "category": "Error", + "code": 4057 + }, + "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named.": { + "category": "Error", + "code": 4058 + }, + "Return type of exported function has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4059 + }, + "Return type of exported function has or is using private name '{0}'.": { + "category": "Error", + "code": 4060 + }, + "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4061 + }, + "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4062 + }, + "Parameter '{0}' of constructor from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4063 + }, + "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4064 + }, + "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4065 + }, + "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4066 + }, + "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4067 + }, + "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4068 + }, + "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4069 + }, + "Parameter '{0}' of public static method from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4070 + }, + "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4071 + }, + "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4072 + }, + "Parameter '{0}' of public method from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4073 + }, + "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4074 + }, + "Parameter '{0}' of method from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4075 + }, + "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4076 + }, + "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4077 + }, + "Parameter '{0}' of exported function has or is using private name '{1}'.": { + "category": "Error", + "code": 4078 + }, + "Exported type alias '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4081 + }, + "Enum declarations must all be const or non-const.": { + "category": "Error", + "code": 4082 + }, + "In 'const' enum declarations member initializer must be constant expression.": { + "category": "Error", + "code": 4083, + "isEarly": true + }, + "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.": { + "category": "Error", + "code": 4084 + }, + "A const enum member can only be accessed using a string literal.": { + "category": "Error", + "code": 4085, + "isEarly": true + }, + "'const' enum member initializer was evaluated to a non-finite value.": { + "category": "Error", + "code": 4086 + }, + "'const' enum member initializer was evaluated to disallowed value 'NaN'.": { + "category": "Error", + "code": 4087 + }, + "Property '{0}' does not exist on 'const' enum '{1}'.": { + "category": "Error", + "code": 4088, + "isEarly": true + }, + "The current host does not support the '{0}' option.": { + "category": "Error", + "code": 5001 + }, + "Cannot find the common subdirectory path for the input files.": { + "category": "Error", + "code": 5009 + }, + "Cannot read file '{0}': {1}": { + "category": "Error", + "code": 5012 + }, + "Unsupported file encoding.": { + "category": "Error", + "code": 5013 + }, + "Unknown compiler option '{0}'.": { + "category": "Error", + "code": 5023 + }, + "Compiler option '{0}' requires a value of type {1}.": { + "category": "Error", + "code": 5024 + }, + "Could not write file '{0}': {1}": { + "category": "Error", + "code": 5033 + }, + "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option.": { + "category": "Error", + "code": 5038 + }, + "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option.": { + "category": "Error", + "code": 5039 + }, + "Option 'noEmit' cannot be specified with option 'out' or 'outDir'.": { + "category": "Error", + "code": 5040 + }, + "Option 'noEmit' cannot be specified with option 'declaration'.": { + "category": "Error", + "code": 5041 + }, + "Option 'project' cannot be mixed with source files on a command line.": { + "category": "Error", + "code": 5042 + }, + "Concatenate and emit output to single file.": { + "category": "Message", + "code": 6001 + }, + "Generates corresponding '.d.ts' file.": { + "category": "Message", + "code": 6002 + }, + "Specifies the location where debugger should locate map files instead of generated locations.": { + "category": "Message", + "code": 6003 + }, + "Specifies the location where debugger should locate TypeScript files instead of source locations.": { + "category": "Message", + "code": 6004 + }, + "Watch input files.": { + "category": "Message", + "code": 6005 + }, + "Redirect output structure to the directory.": { + "category": "Message", + "code": 6006 + }, + "Do not erase const enum declarations in generated code.": { + "category": "Message", + "code": 6007 + }, + "Do not emit outputs if any type checking errors were reported.": { + "category": "Message", + "code": 6008 + }, + "Do not emit comments to output.": { + "category": "Message", + "code": 6009 + }, + "Do not emit outputs.": { + "category": "Message", + "code": 6010 + }, + "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)": { + "category": "Message", + "code": 6015 + }, + "Specify module code generation: 'commonjs' or 'amd'": { + "category": "Message", + "code": 6016 + }, + "Print this message.": { + "category": "Message", + "code": 6017 + }, + "Print the compiler's version.": { + "category": "Message", + "code": 6019 + }, + "Compile the project in the given directory.": { + "category": "Message", + "code": 6020 + }, + "Syntax: {0}": { + "category": "Message", + "code": 6023 + }, + "options": { + "category": "Message", + "code": 6024 + }, + "file": { + "category": "Message", + "code": 6025 + }, + "Examples: {0}": { + "category": "Message", + "code": 6026 + }, + "Options:": { + "category": "Message", + "code": 6027 + }, + "Version {0}": { + "category": "Message", + "code": 6029 + }, + "Insert command line options and files from a file.": { + "category": "Message", + "code": 6030 + }, + "File change detected. Starting incremental compilation...": { + "category": "Message", + "code": 6032 + }, + "KIND": { + "category": "Message", + "code": 6034 + }, + "FILE": { + "category": "Message", + "code": 6035 + }, + "VERSION": { + "category": "Message", + "code": 6036 + }, + "LOCATION": { + "category": "Message", + "code": 6037 + }, + "DIRECTORY": { + "category": "Message", + "code": 6038 + }, + "Compilation complete. Watching for file changes.": { + "category": "Message", + "code": 6042 + }, + "Generates corresponding '.map' file.": { + "category": "Message", + "code": 6043 + }, + "Compiler option '{0}' expects an argument.": { + "category": "Error", + "code": 6044 + }, + "Unterminated quoted string in response file '{0}'.": { + "category": "Error", + "code": 6045 + }, + "Argument for '--module' option must be 'commonjs' or 'amd'.": { + "category": "Error", + "code": 6046 + }, + "Argument for '--target' option must be 'es3', 'es5', or 'es6'.": { + "category": "Error", + "code": 6047 + }, + "Locale must be of the form or -. For example '{0}' or '{1}'.": { + "category": "Error", + "code": 6048 + }, + "Unsupported locale '{0}'.": { + "category": "Error", + "code": 6049 + }, + "Unable to open file '{0}'.": { + "category": "Error", + "code": 6050 + }, + "Corrupted locale file {0}.": { + "category": "Error", + "code": 6051 + }, + "Raise error on expressions and declarations with an implied 'any' type.": { + "category": "Message", + "code": 6052 + }, + "File '{0}' not found.": { + "category": "Error", + "code": 6053 + }, + "File '{0}' must have extension '.ts' or '.d.ts'.": { + "category": "Error", + "code": 6054 + }, + "Suppress noImplicitAny errors for indexing objects lacking index signatures.": { + "category": "Message", + "code": 6055 + }, - "Variable '{0}' implicitly has an '{1}' type.": { - "category": "Error", - "code": 7005 - }, - "Parameter '{0}' implicitly has an '{1}' type.": { - "category": "Error", - "code": 7006 - }, - "Member '{0}' implicitly has an '{1}' type.": { - "category": "Error", - "code": 7008 - }, - "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.": { - "category": "Error", - "code": 7009 - }, - "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type.": { - "category": "Error", - "code": 7010 - }, - "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type.": { - "category": "Error", - "code": 7011 - }, - "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type.": { - "category": "Error", - "code": 7013 - }, - "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation.": { - "category": "Error", - "code": 7016 - }, - "Index signature of object type implicitly has an 'any' type.": { - "category": "Error", - "code": 7017 - }, - "Object literal's property '{0}' implicitly has an '{1}' type.": { - "category": "Error", - "code": 7018 - }, - "Rest parameter '{0}' implicitly has an 'any[]' type.": { - "category": "Error", - "code": 7019 - }, - "Call signature, which lacks return-type annotation, implicitly has an 'any' return type.": { - "category": "Error", - "code": 7020 - }, - "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation.": { - "category": "Error", - "code": 7021 - }, - "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer.": { - "category": "Error", - "code": 7022 - }, - "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.": { - "category": "Error", - "code": 7023 - }, - "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.": { - "category": "Error", - "code": 7024 - }, - "You cannot rename this element.": { - "category": "Error", - "code": 8000 - }, - "'yield' expressions are not currently supported.": { - "category": "Error", - "code": 9000, - "isEarly": true - }, - "Generators are not currently supported.": { - "category": "Error", - "code": 9001, - "isEarly": true - }, - "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.": { - "category": "Error", - "code": 9002 - } + "Variable '{0}' implicitly has an '{1}' type.": { + "category": "Error", + "code": 7005 + }, + "Parameter '{0}' implicitly has an '{1}' type.": { + "category": "Error", + "code": 7006 + }, + "Member '{0}' implicitly has an '{1}' type.": { + "category": "Error", + "code": 7008 + }, + "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.": { + "category": "Error", + "code": 7009 + }, + "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type.": { + "category": "Error", + "code": 7010 + }, + "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type.": { + "category": "Error", + "code": 7011 + }, + "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type.": { + "category": "Error", + "code": 7013 + }, + "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation.": { + "category": "Error", + "code": 7016 + }, + "Index signature of object type implicitly has an 'any' type.": { + "category": "Error", + "code": 7017 + }, + "Object literal's property '{0}' implicitly has an '{1}' type.": { + "category": "Error", + "code": 7018 + }, + "Rest parameter '{0}' implicitly has an 'any[]' type.": { + "category": "Error", + "code": 7019 + }, + "Call signature, which lacks return-type annotation, implicitly has an 'any' return type.": { + "category": "Error", + "code": 7020 + }, + "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation.": { + "category": "Error", + "code": 7021 + }, + "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer.": { + "category": "Error", + "code": 7022 + }, + "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.": { + "category": "Error", + "code": 7023 + }, + "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.": { + "category": "Error", + "code": 7024 + }, + "You cannot rename this element.": { + "category": "Error", + "code": 8000 + }, + "'yield' expressions are not currently supported.": { + "category": "Error", + "code": 9000, + "isEarly": true + }, + "Generators are not currently supported.": { + "category": "Error", + "code": 9001, + "isEarly": true + }, + "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.": { + "category": "Error", + "code": 9002 + } }