diff --git a/.travis.yml b/.travis.yml
index c16ae086448..2751337c708 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,7 +15,7 @@ matrix:
branches:
only:
- master
- - release-2.0
+ - release-2.1
install:
- npm uninstall typescript
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 1c242022979..6dbb7e514a0 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -183,5 +183,3 @@ jake baseline-accept
```
to establish the new baselines as the desired behavior. This will change the files in `tests\baselines\reference`, which should be included as part of your commit. It's important to carefully validate changes in the baselines.
-
-**Note** that `baseline-accept` should only be run after a full test run! Accepting baselines after running a subset of tests will delete baseline files for the tests that didn't run.
diff --git a/Jakefile.js b/Jakefile.js
index 76ac1b19b2c..8ce70eb353f 100644
--- a/Jakefile.js
+++ b/Jakefile.js
@@ -70,14 +70,15 @@ var compilerSources = [
"visitor.ts",
"transformers/destructuring.ts",
"transformers/ts.ts",
- "transformers/module/es2015.ts",
- "transformers/module/system.ts",
- "transformers/module/module.ts",
"transformers/jsx.ts",
"transformers/es2017.ts",
"transformers/es2016.ts",
"transformers/es2015.ts",
"transformers/generators.ts",
+ "transformers/es5.ts",
+ "transformers/module/es2015.ts",
+ "transformers/module/system.ts",
+ "transformers/module/module.ts",
"transformer.ts",
"sourcemap.ts",
"comments.ts",
@@ -105,14 +106,15 @@ var servicesSources = [
"visitor.ts",
"transformers/destructuring.ts",
"transformers/ts.ts",
- "transformers/module/es2015.ts",
- "transformers/module/system.ts",
- "transformers/module/module.ts",
"transformers/jsx.ts",
"transformers/es2017.ts",
"transformers/es2016.ts",
"transformers/es2015.ts",
"transformers/generators.ts",
+ "transformers/es5.ts",
+ "transformers/module/es2015.ts",
+ "transformers/module/system.ts",
+ "transformers/module/module.ts",
"transformer.ts",
"sourcemap.ts",
"comments.ts",
@@ -355,6 +357,7 @@ function concatenateFiles(destinationFile, sourceFiles) {
if (!fs.existsSync(sourceFiles[i])) {
fail(sourceFiles[i] + " does not exist!");
}
+ fs.appendFileSync(temp, "\n\n");
fs.appendFileSync(temp, fs.readFileSync(sourceFiles[i]));
}
// Move the file to the final destination
@@ -445,6 +448,8 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts
options += " --stripInternal";
}
+ options += " --target es5 --noUnusedLocals --noUnusedParameters";
+
var cmd = host + " " + compilerPath + " " + options + " ";
cmd = cmd + sources.join(" ");
console.log(cmd + "\n");
diff --git a/jenkins.sh b/jenkins.sh
new file mode 100755
index 00000000000..377a44b7bf7
--- /dev/null
+++ b/jenkins.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+# Set up NVM
+export NVM_DIR="/home/dotnet-bot/.nvm"
+[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
+
+nvm install $1
+
+npm uninstall typescript
+npm uninstall tslint
+npm install
+npm update
+npm test
diff --git a/lib/cancellationToken.js b/lib/cancellationToken.js
index 8af21172df4..f5a28f8d52d 100644
--- a/lib/cancellationToken.js
+++ b/lib/cancellationToken.js
@@ -39,3 +39,5 @@ function createCancellationToken(args) {
};
}
module.exports = createCancellationToken;
+
+//# sourceMappingURL=cancellationToken.js.map
diff --git a/lib/lib.d.ts b/lib/lib.d.ts
index 922820b5d90..969bf70448c 100644
--- a/lib/lib.d.ts
+++ b/lib/lib.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
/////////////////////////////
/// ECMAScript APIs
/////////////////////////////
@@ -4149,6 +4153,8 @@ interface Date {
*/
toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
}
+
+
/////////////////////////////
/// IE DOM APIs
@@ -18774,12 +18780,16 @@ type ScrollLogicalPosition = "start" | "center" | "end" | "nearest";
type IDBValidKey = number | string | Date | IDBArrayKey;
type BufferSource = ArrayBuffer | ArrayBufferView;
type MouseWheelEvent = WheelEvent;
-type ScrollRestoration = "auto" | "manual";
+type ScrollRestoration = "auto" | "manual";
+
+
/////////////////////////////
/// WorkerGlobalScope APIs
/////////////////////////////
// These are only available in a Web Worker
declare function importScripts(...urls: string[]): void;
+
+
/////////////////////////////
diff --git a/lib/lib.dom.d.ts b/lib/lib.dom.d.ts
index 4c19c878064..b80f167b7a8 100644
--- a/lib/lib.dom.d.ts
+++ b/lib/lib.dom.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
/////////////////////////////
/// IE DOM APIs
diff --git a/lib/lib.dom.iterable.d.ts b/lib/lib.dom.iterable.d.ts
index 397e0ab111e..2b62054765b 100644
--- a/lib/lib.dom.iterable.d.ts
+++ b/lib/lib.dom.iterable.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
///
interface DOMTokenList {
diff --git a/lib/lib.es2015.collection.d.ts b/lib/lib.es2015.collection.d.ts
index 24c737df74b..eabd6319de6 100644
--- a/lib/lib.es2015.collection.d.ts
+++ b/lib/lib.es2015.collection.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
interface Map {
clear(): void;
delete(key: K): boolean;
diff --git a/lib/lib.es2015.core.d.ts b/lib/lib.es2015.core.d.ts
index 669c80944ec..499d0de52db 100644
--- a/lib/lib.es2015.core.d.ts
+++ b/lib/lib.es2015.core.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
declare type PropertyKey = string | number | symbol;
interface Array {
diff --git a/lib/lib.es2015.d.ts b/lib/lib.es2015.d.ts
index 973d5180989..ff5c555bfee 100644
--- a/lib/lib.es2015.d.ts
+++ b/lib/lib.es2015.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
///
///
///
diff --git a/lib/lib.es2015.generator.d.ts b/lib/lib.es2015.generator.d.ts
index 003f325e4e0..20d6725f66b 100644
--- a/lib/lib.es2015.generator.d.ts
+++ b/lib/lib.es2015.generator.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
interface GeneratorFunction extends Function { }
interface GeneratorFunctionConstructor {
diff --git a/lib/lib.es2015.iterable.d.ts b/lib/lib.es2015.iterable.d.ts
index 1c27525d432..cb92cb4b8aa 100644
--- a/lib/lib.es2015.iterable.d.ts
+++ b/lib/lib.es2015.iterable.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
///
interface SymbolConstructor {
diff --git a/lib/lib.es2015.promise.d.ts b/lib/lib.es2015.promise.d.ts
index 36fe9e7777f..02352da4061 100644
--- a/lib/lib.es2015.promise.d.ts
+++ b/lib/lib.es2015.promise.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
/**
* Represents the completion of an asynchronous operation
*/
diff --git a/lib/lib.es2015.proxy.d.ts b/lib/lib.es2015.proxy.d.ts
index 3908e97c17c..03996c6ad9f 100644
--- a/lib/lib.es2015.proxy.d.ts
+++ b/lib/lib.es2015.proxy.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
interface ProxyHandler {
getPrototypeOf? (target: T): any;
setPrototypeOf? (target: T, v: any): boolean;
diff --git a/lib/lib.es2015.reflect.d.ts b/lib/lib.es2015.reflect.d.ts
index 0f1a491ebcf..b6a6853457a 100644
--- a/lib/lib.es2015.reflect.d.ts
+++ b/lib/lib.es2015.reflect.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
declare namespace Reflect {
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any;
function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any;
diff --git a/lib/lib.es2015.symbol.d.ts b/lib/lib.es2015.symbol.d.ts
index 4ab7b4374f1..c0474aec011 100644
--- a/lib/lib.es2015.symbol.d.ts
+++ b/lib/lib.es2015.symbol.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
interface Symbol {
/** Returns a string representation of an object. */
toString(): string;
diff --git a/lib/lib.es2015.symbol.wellknown.d.ts b/lib/lib.es2015.symbol.wellknown.d.ts
index 2d122d1284e..42299fe7d09 100644
--- a/lib/lib.es2015.symbol.wellknown.d.ts
+++ b/lib/lib.es2015.symbol.wellknown.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
///
interface SymbolConstructor {
diff --git a/lib/lib.es2016.array.include.d.ts b/lib/lib.es2016.array.include.d.ts
index a4677e7cf1e..42b95c478d0 100644
--- a/lib/lib.es2016.array.include.d.ts
+++ b/lib/lib.es2016.array.include.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
interface Array {
/**
* Determines whether an array includes a certain element, returning true or false as appropriate.
diff --git a/lib/lib.es2016.d.ts b/lib/lib.es2016.d.ts
index 04a23379676..5921e060d0f 100644
--- a/lib/lib.es2016.d.ts
+++ b/lib/lib.es2016.d.ts
@@ -13,6 +13,10 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
///
///
\ No newline at end of file
diff --git a/lib/lib.es2017.d.ts b/lib/lib.es2017.d.ts
index 24d23994d96..8354de37f7f 100644
--- a/lib/lib.es2017.d.ts
+++ b/lib/lib.es2017.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
///
///
///
\ No newline at end of file
diff --git a/lib/lib.es2017.object.d.ts b/lib/lib.es2017.object.d.ts
index ac3a16ab370..996147a9746 100644
--- a/lib/lib.es2017.object.d.ts
+++ b/lib/lib.es2017.object.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
interface ObjectConstructor {
/**
* Returns an array of values of the enumerable properties of an object
diff --git a/lib/lib.es2017.sharedmemory.d.ts b/lib/lib.es2017.sharedmemory.d.ts
index 639ca7530e4..c59e1255519 100644
--- a/lib/lib.es2017.sharedmemory.d.ts
+++ b/lib/lib.es2017.sharedmemory.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
///
///
diff --git a/lib/lib.es5.d.ts b/lib/lib.es5.d.ts
index a13ffc92d04..2cf3f742522 100644
--- a/lib/lib.es5.d.ts
+++ b/lib/lib.es5.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
/////////////////////////////
/// ECMAScript APIs
/////////////////////////////
diff --git a/lib/lib.es6.d.ts b/lib/lib.es6.d.ts
index 4c8806dd7dd..1ace5f499b1 100644
--- a/lib/lib.es6.d.ts
+++ b/lib/lib.es6.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
/////////////////////////////
/// ECMAScript APIs
/////////////////////////////
@@ -4149,6 +4153,8 @@ interface Date {
*/
toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
}
+
+
declare type PropertyKey = string | number | symbol;
interface Array {
@@ -4673,6 +4679,8 @@ interface StringConstructor {
*/
raw(template: TemplateStringsArray, ...substitutions: any[]): string;
}
+
+
interface Map {
clear(): void;
delete(key: K): boolean;
@@ -4745,6 +4753,8 @@ interface WeakSetConstructor {
readonly prototype: WeakSet;
}
declare var WeakSet: WeakSetConstructor;
+
+
interface GeneratorFunction extends Function { }
interface GeneratorFunctionConstructor {
@@ -4757,6 +4767,8 @@ interface GeneratorFunctionConstructor {
readonly prototype: GeneratorFunction;
}
declare var GeneratorFunction: GeneratorFunctionConstructor;
+
+
///
interface SymbolConstructor {
@@ -5201,7 +5213,9 @@ interface Float64ArrayConstructor {
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;
-}/**
+}
+
+/**
* Represents the completion of an asynchronous operation
*/
interface Promise {
@@ -5454,7 +5468,9 @@ interface PromiseConstructor {
resolve(): Promise;
}
-declare var Promise: PromiseConstructor;interface ProxyHandler {
+declare var Promise: PromiseConstructor;
+
+interface ProxyHandler {
getPrototypeOf? (target: T): any;
setPrototypeOf? (target: T, v: any): boolean;
isExtensible? (target: T): boolean;
@@ -5475,7 +5491,9 @@ interface ProxyConstructor {
revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; };
new (target: T, handler: ProxyHandler): T
}
-declare var Proxy: ProxyConstructor;declare namespace Reflect {
+declare var Proxy: ProxyConstructor;
+
+declare namespace Reflect {
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any;
function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any;
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
@@ -5489,7 +5507,9 @@ declare var Proxy: ProxyConstructor;declare namespace Reflect {
function preventExtensions(target: any): boolean;
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
function setPrototypeOf(target: any, proto: any): boolean;
-}interface Symbol {
+}
+
+interface Symbol {
/** Returns a string representation of an object. */
toString(): string;
@@ -5524,7 +5544,9 @@ interface SymbolConstructor {
keyFor(sym: symbol): string | undefined;
}
-declare var Symbol: SymbolConstructor;///
+declare var Symbol: SymbolConstructor;
+
+///
interface SymbolConstructor {
/**
@@ -5850,7 +5872,9 @@ interface Float32Array {
*/
interface Float64Array {
readonly [Symbol.toStringTag]: "Float64Array";
-}
+}
+
+
/////////////////////////////
/// IE DOM APIs
/////////////////////////////
@@ -20475,12 +20499,16 @@ type ScrollLogicalPosition = "start" | "center" | "end" | "nearest";
type IDBValidKey = number | string | Date | IDBArrayKey;
type BufferSource = ArrayBuffer | ArrayBufferView;
type MouseWheelEvent = WheelEvent;
-type ScrollRestoration = "auto" | "manual";
+type ScrollRestoration = "auto" | "manual";
+
+
/////////////////////////////
/// WorkerGlobalScope APIs
/////////////////////////////
// These are only available in a Web Worker
declare function importScripts(...urls: string[]): void;
+
+
/////////////////////////////
@@ -20772,6 +20800,8 @@ interface DateConstructor {
interface Date {
getVarDate: () => VarDate;
}
+
+
///
interface DOMTokenList {
diff --git a/lib/lib.scripthost.d.ts b/lib/lib.scripthost.d.ts
index b4e52a342f1..2d2f4df3b70 100644
--- a/lib/lib.scripthost.d.ts
+++ b/lib/lib.scripthost.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
/////////////////////////////
diff --git a/lib/lib.webworker.d.ts b/lib/lib.webworker.d.ts
index 6cb14c5b184..53129567256 100644
--- a/lib/lib.webworker.d.ts
+++ b/lib/lib.webworker.d.ts
@@ -13,7 +13,11 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
///
+
+
/////////////////////////////
/// IE Worker APIs
diff --git a/lib/tsc.js b/lib/tsc.js
index b1fac7955d0..fbfe07a4588 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -15,6 +15,418 @@ and limitations under the License.
var ts;
(function (ts) {
+ (function (SyntaxKind) {
+ SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown";
+ SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken";
+ SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia";
+ SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia";
+ SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia";
+ SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia";
+ SyntaxKind[SyntaxKind["ShebangTrivia"] = 6] = "ShebangTrivia";
+ SyntaxKind[SyntaxKind["ConflictMarkerTrivia"] = 7] = "ConflictMarkerTrivia";
+ SyntaxKind[SyntaxKind["NumericLiteral"] = 8] = "NumericLiteral";
+ SyntaxKind[SyntaxKind["StringLiteral"] = 9] = "StringLiteral";
+ SyntaxKind[SyntaxKind["JsxText"] = 10] = "JsxText";
+ SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 11] = "RegularExpressionLiteral";
+ SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 12] = "NoSubstitutionTemplateLiteral";
+ SyntaxKind[SyntaxKind["TemplateHead"] = 13] = "TemplateHead";
+ SyntaxKind[SyntaxKind["TemplateMiddle"] = 14] = "TemplateMiddle";
+ SyntaxKind[SyntaxKind["TemplateTail"] = 15] = "TemplateTail";
+ SyntaxKind[SyntaxKind["OpenBraceToken"] = 16] = "OpenBraceToken";
+ SyntaxKind[SyntaxKind["CloseBraceToken"] = 17] = "CloseBraceToken";
+ SyntaxKind[SyntaxKind["OpenParenToken"] = 18] = "OpenParenToken";
+ SyntaxKind[SyntaxKind["CloseParenToken"] = 19] = "CloseParenToken";
+ SyntaxKind[SyntaxKind["OpenBracketToken"] = 20] = "OpenBracketToken";
+ SyntaxKind[SyntaxKind["CloseBracketToken"] = 21] = "CloseBracketToken";
+ SyntaxKind[SyntaxKind["DotToken"] = 22] = "DotToken";
+ SyntaxKind[SyntaxKind["DotDotDotToken"] = 23] = "DotDotDotToken";
+ SyntaxKind[SyntaxKind["SemicolonToken"] = 24] = "SemicolonToken";
+ SyntaxKind[SyntaxKind["CommaToken"] = 25] = "CommaToken";
+ SyntaxKind[SyntaxKind["LessThanToken"] = 26] = "LessThanToken";
+ SyntaxKind[SyntaxKind["LessThanSlashToken"] = 27] = "LessThanSlashToken";
+ SyntaxKind[SyntaxKind["GreaterThanToken"] = 28] = "GreaterThanToken";
+ SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 29] = "LessThanEqualsToken";
+ SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 30] = "GreaterThanEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 31] = "EqualsEqualsToken";
+ SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 32] = "ExclamationEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 33] = "EqualsEqualsEqualsToken";
+ SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 34] = "ExclamationEqualsEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 35] = "EqualsGreaterThanToken";
+ SyntaxKind[SyntaxKind["PlusToken"] = 36] = "PlusToken";
+ SyntaxKind[SyntaxKind["MinusToken"] = 37] = "MinusToken";
+ SyntaxKind[SyntaxKind["AsteriskToken"] = 38] = "AsteriskToken";
+ SyntaxKind[SyntaxKind["AsteriskAsteriskToken"] = 39] = "AsteriskAsteriskToken";
+ SyntaxKind[SyntaxKind["SlashToken"] = 40] = "SlashToken";
+ SyntaxKind[SyntaxKind["PercentToken"] = 41] = "PercentToken";
+ SyntaxKind[SyntaxKind["PlusPlusToken"] = 42] = "PlusPlusToken";
+ SyntaxKind[SyntaxKind["MinusMinusToken"] = 43] = "MinusMinusToken";
+ SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 44] = "LessThanLessThanToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 45] = "GreaterThanGreaterThanToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 46] = "GreaterThanGreaterThanGreaterThanToken";
+ SyntaxKind[SyntaxKind["AmpersandToken"] = 47] = "AmpersandToken";
+ SyntaxKind[SyntaxKind["BarToken"] = 48] = "BarToken";
+ SyntaxKind[SyntaxKind["CaretToken"] = 49] = "CaretToken";
+ SyntaxKind[SyntaxKind["ExclamationToken"] = 50] = "ExclamationToken";
+ SyntaxKind[SyntaxKind["TildeToken"] = 51] = "TildeToken";
+ SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 52] = "AmpersandAmpersandToken";
+ SyntaxKind[SyntaxKind["BarBarToken"] = 53] = "BarBarToken";
+ SyntaxKind[SyntaxKind["QuestionToken"] = 54] = "QuestionToken";
+ SyntaxKind[SyntaxKind["ColonToken"] = 55] = "ColonToken";
+ SyntaxKind[SyntaxKind["AtToken"] = 56] = "AtToken";
+ SyntaxKind[SyntaxKind["EqualsToken"] = 57] = "EqualsToken";
+ SyntaxKind[SyntaxKind["PlusEqualsToken"] = 58] = "PlusEqualsToken";
+ SyntaxKind[SyntaxKind["MinusEqualsToken"] = 59] = "MinusEqualsToken";
+ SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 60] = "AsteriskEqualsToken";
+ SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 61] = "AsteriskAsteriskEqualsToken";
+ SyntaxKind[SyntaxKind["SlashEqualsToken"] = 62] = "SlashEqualsToken";
+ SyntaxKind[SyntaxKind["PercentEqualsToken"] = 63] = "PercentEqualsToken";
+ SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 64] = "LessThanLessThanEqualsToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 65] = "GreaterThanGreaterThanEqualsToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 66] = "GreaterThanGreaterThanGreaterThanEqualsToken";
+ SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 67] = "AmpersandEqualsToken";
+ SyntaxKind[SyntaxKind["BarEqualsToken"] = 68] = "BarEqualsToken";
+ SyntaxKind[SyntaxKind["CaretEqualsToken"] = 69] = "CaretEqualsToken";
+ SyntaxKind[SyntaxKind["Identifier"] = 70] = "Identifier";
+ SyntaxKind[SyntaxKind["BreakKeyword"] = 71] = "BreakKeyword";
+ SyntaxKind[SyntaxKind["CaseKeyword"] = 72] = "CaseKeyword";
+ SyntaxKind[SyntaxKind["CatchKeyword"] = 73] = "CatchKeyword";
+ SyntaxKind[SyntaxKind["ClassKeyword"] = 74] = "ClassKeyword";
+ SyntaxKind[SyntaxKind["ConstKeyword"] = 75] = "ConstKeyword";
+ SyntaxKind[SyntaxKind["ContinueKeyword"] = 76] = "ContinueKeyword";
+ SyntaxKind[SyntaxKind["DebuggerKeyword"] = 77] = "DebuggerKeyword";
+ SyntaxKind[SyntaxKind["DefaultKeyword"] = 78] = "DefaultKeyword";
+ SyntaxKind[SyntaxKind["DeleteKeyword"] = 79] = "DeleteKeyword";
+ SyntaxKind[SyntaxKind["DoKeyword"] = 80] = "DoKeyword";
+ SyntaxKind[SyntaxKind["ElseKeyword"] = 81] = "ElseKeyword";
+ SyntaxKind[SyntaxKind["EnumKeyword"] = 82] = "EnumKeyword";
+ SyntaxKind[SyntaxKind["ExportKeyword"] = 83] = "ExportKeyword";
+ SyntaxKind[SyntaxKind["ExtendsKeyword"] = 84] = "ExtendsKeyword";
+ SyntaxKind[SyntaxKind["FalseKeyword"] = 85] = "FalseKeyword";
+ SyntaxKind[SyntaxKind["FinallyKeyword"] = 86] = "FinallyKeyword";
+ SyntaxKind[SyntaxKind["ForKeyword"] = 87] = "ForKeyword";
+ SyntaxKind[SyntaxKind["FunctionKeyword"] = 88] = "FunctionKeyword";
+ SyntaxKind[SyntaxKind["IfKeyword"] = 89] = "IfKeyword";
+ SyntaxKind[SyntaxKind["ImportKeyword"] = 90] = "ImportKeyword";
+ SyntaxKind[SyntaxKind["InKeyword"] = 91] = "InKeyword";
+ SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 92] = "InstanceOfKeyword";
+ SyntaxKind[SyntaxKind["NewKeyword"] = 93] = "NewKeyword";
+ SyntaxKind[SyntaxKind["NullKeyword"] = 94] = "NullKeyword";
+ SyntaxKind[SyntaxKind["ReturnKeyword"] = 95] = "ReturnKeyword";
+ SyntaxKind[SyntaxKind["SuperKeyword"] = 96] = "SuperKeyword";
+ SyntaxKind[SyntaxKind["SwitchKeyword"] = 97] = "SwitchKeyword";
+ SyntaxKind[SyntaxKind["ThisKeyword"] = 98] = "ThisKeyword";
+ SyntaxKind[SyntaxKind["ThrowKeyword"] = 99] = "ThrowKeyword";
+ SyntaxKind[SyntaxKind["TrueKeyword"] = 100] = "TrueKeyword";
+ SyntaxKind[SyntaxKind["TryKeyword"] = 101] = "TryKeyword";
+ SyntaxKind[SyntaxKind["TypeOfKeyword"] = 102] = "TypeOfKeyword";
+ SyntaxKind[SyntaxKind["VarKeyword"] = 103] = "VarKeyword";
+ SyntaxKind[SyntaxKind["VoidKeyword"] = 104] = "VoidKeyword";
+ SyntaxKind[SyntaxKind["WhileKeyword"] = 105] = "WhileKeyword";
+ SyntaxKind[SyntaxKind["WithKeyword"] = 106] = "WithKeyword";
+ SyntaxKind[SyntaxKind["ImplementsKeyword"] = 107] = "ImplementsKeyword";
+ SyntaxKind[SyntaxKind["InterfaceKeyword"] = 108] = "InterfaceKeyword";
+ SyntaxKind[SyntaxKind["LetKeyword"] = 109] = "LetKeyword";
+ SyntaxKind[SyntaxKind["PackageKeyword"] = 110] = "PackageKeyword";
+ SyntaxKind[SyntaxKind["PrivateKeyword"] = 111] = "PrivateKeyword";
+ SyntaxKind[SyntaxKind["ProtectedKeyword"] = 112] = "ProtectedKeyword";
+ SyntaxKind[SyntaxKind["PublicKeyword"] = 113] = "PublicKeyword";
+ SyntaxKind[SyntaxKind["StaticKeyword"] = 114] = "StaticKeyword";
+ SyntaxKind[SyntaxKind["YieldKeyword"] = 115] = "YieldKeyword";
+ SyntaxKind[SyntaxKind["AbstractKeyword"] = 116] = "AbstractKeyword";
+ SyntaxKind[SyntaxKind["AsKeyword"] = 117] = "AsKeyword";
+ SyntaxKind[SyntaxKind["AnyKeyword"] = 118] = "AnyKeyword";
+ SyntaxKind[SyntaxKind["AsyncKeyword"] = 119] = "AsyncKeyword";
+ SyntaxKind[SyntaxKind["AwaitKeyword"] = 120] = "AwaitKeyword";
+ SyntaxKind[SyntaxKind["BooleanKeyword"] = 121] = "BooleanKeyword";
+ SyntaxKind[SyntaxKind["ConstructorKeyword"] = 122] = "ConstructorKeyword";
+ SyntaxKind[SyntaxKind["DeclareKeyword"] = 123] = "DeclareKeyword";
+ SyntaxKind[SyntaxKind["GetKeyword"] = 124] = "GetKeyword";
+ SyntaxKind[SyntaxKind["IsKeyword"] = 125] = "IsKeyword";
+ SyntaxKind[SyntaxKind["ModuleKeyword"] = 126] = "ModuleKeyword";
+ SyntaxKind[SyntaxKind["NamespaceKeyword"] = 127] = "NamespaceKeyword";
+ SyntaxKind[SyntaxKind["NeverKeyword"] = 128] = "NeverKeyword";
+ SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 129] = "ReadonlyKeyword";
+ SyntaxKind[SyntaxKind["RequireKeyword"] = 130] = "RequireKeyword";
+ SyntaxKind[SyntaxKind["NumberKeyword"] = 131] = "NumberKeyword";
+ SyntaxKind[SyntaxKind["SetKeyword"] = 132] = "SetKeyword";
+ SyntaxKind[SyntaxKind["StringKeyword"] = 133] = "StringKeyword";
+ SyntaxKind[SyntaxKind["SymbolKeyword"] = 134] = "SymbolKeyword";
+ SyntaxKind[SyntaxKind["TypeKeyword"] = 135] = "TypeKeyword";
+ SyntaxKind[SyntaxKind["UndefinedKeyword"] = 136] = "UndefinedKeyword";
+ SyntaxKind[SyntaxKind["FromKeyword"] = 137] = "FromKeyword";
+ SyntaxKind[SyntaxKind["GlobalKeyword"] = 138] = "GlobalKeyword";
+ SyntaxKind[SyntaxKind["OfKeyword"] = 139] = "OfKeyword";
+ SyntaxKind[SyntaxKind["QualifiedName"] = 140] = "QualifiedName";
+ SyntaxKind[SyntaxKind["ComputedPropertyName"] = 141] = "ComputedPropertyName";
+ SyntaxKind[SyntaxKind["TypeParameter"] = 142] = "TypeParameter";
+ SyntaxKind[SyntaxKind["Parameter"] = 143] = "Parameter";
+ SyntaxKind[SyntaxKind["Decorator"] = 144] = "Decorator";
+ SyntaxKind[SyntaxKind["PropertySignature"] = 145] = "PropertySignature";
+ SyntaxKind[SyntaxKind["PropertyDeclaration"] = 146] = "PropertyDeclaration";
+ SyntaxKind[SyntaxKind["MethodSignature"] = 147] = "MethodSignature";
+ SyntaxKind[SyntaxKind["MethodDeclaration"] = 148] = "MethodDeclaration";
+ SyntaxKind[SyntaxKind["Constructor"] = 149] = "Constructor";
+ SyntaxKind[SyntaxKind["GetAccessor"] = 150] = "GetAccessor";
+ SyntaxKind[SyntaxKind["SetAccessor"] = 151] = "SetAccessor";
+ SyntaxKind[SyntaxKind["CallSignature"] = 152] = "CallSignature";
+ SyntaxKind[SyntaxKind["ConstructSignature"] = 153] = "ConstructSignature";
+ SyntaxKind[SyntaxKind["IndexSignature"] = 154] = "IndexSignature";
+ SyntaxKind[SyntaxKind["TypePredicate"] = 155] = "TypePredicate";
+ SyntaxKind[SyntaxKind["TypeReference"] = 156] = "TypeReference";
+ SyntaxKind[SyntaxKind["FunctionType"] = 157] = "FunctionType";
+ SyntaxKind[SyntaxKind["ConstructorType"] = 158] = "ConstructorType";
+ SyntaxKind[SyntaxKind["TypeQuery"] = 159] = "TypeQuery";
+ SyntaxKind[SyntaxKind["TypeLiteral"] = 160] = "TypeLiteral";
+ SyntaxKind[SyntaxKind["ArrayType"] = 161] = "ArrayType";
+ SyntaxKind[SyntaxKind["TupleType"] = 162] = "TupleType";
+ SyntaxKind[SyntaxKind["UnionType"] = 163] = "UnionType";
+ SyntaxKind[SyntaxKind["IntersectionType"] = 164] = "IntersectionType";
+ SyntaxKind[SyntaxKind["ParenthesizedType"] = 165] = "ParenthesizedType";
+ SyntaxKind[SyntaxKind["ThisType"] = 166] = "ThisType";
+ SyntaxKind[SyntaxKind["LiteralType"] = 167] = "LiteralType";
+ SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 168] = "ObjectBindingPattern";
+ SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 169] = "ArrayBindingPattern";
+ SyntaxKind[SyntaxKind["BindingElement"] = 170] = "BindingElement";
+ SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 171] = "ArrayLiteralExpression";
+ SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 172] = "ObjectLiteralExpression";
+ SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 173] = "PropertyAccessExpression";
+ SyntaxKind[SyntaxKind["ElementAccessExpression"] = 174] = "ElementAccessExpression";
+ SyntaxKind[SyntaxKind["CallExpression"] = 175] = "CallExpression";
+ SyntaxKind[SyntaxKind["NewExpression"] = 176] = "NewExpression";
+ SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 177] = "TaggedTemplateExpression";
+ SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 178] = "TypeAssertionExpression";
+ SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 179] = "ParenthesizedExpression";
+ SyntaxKind[SyntaxKind["FunctionExpression"] = 180] = "FunctionExpression";
+ SyntaxKind[SyntaxKind["ArrowFunction"] = 181] = "ArrowFunction";
+ SyntaxKind[SyntaxKind["DeleteExpression"] = 182] = "DeleteExpression";
+ SyntaxKind[SyntaxKind["TypeOfExpression"] = 183] = "TypeOfExpression";
+ SyntaxKind[SyntaxKind["VoidExpression"] = 184] = "VoidExpression";
+ SyntaxKind[SyntaxKind["AwaitExpression"] = 185] = "AwaitExpression";
+ SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 186] = "PrefixUnaryExpression";
+ SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 187] = "PostfixUnaryExpression";
+ SyntaxKind[SyntaxKind["BinaryExpression"] = 188] = "BinaryExpression";
+ SyntaxKind[SyntaxKind["ConditionalExpression"] = 189] = "ConditionalExpression";
+ SyntaxKind[SyntaxKind["TemplateExpression"] = 190] = "TemplateExpression";
+ SyntaxKind[SyntaxKind["YieldExpression"] = 191] = "YieldExpression";
+ SyntaxKind[SyntaxKind["SpreadElementExpression"] = 192] = "SpreadElementExpression";
+ SyntaxKind[SyntaxKind["ClassExpression"] = 193] = "ClassExpression";
+ SyntaxKind[SyntaxKind["OmittedExpression"] = 194] = "OmittedExpression";
+ SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 195] = "ExpressionWithTypeArguments";
+ SyntaxKind[SyntaxKind["AsExpression"] = 196] = "AsExpression";
+ SyntaxKind[SyntaxKind["NonNullExpression"] = 197] = "NonNullExpression";
+ SyntaxKind[SyntaxKind["TemplateSpan"] = 198] = "TemplateSpan";
+ SyntaxKind[SyntaxKind["SemicolonClassElement"] = 199] = "SemicolonClassElement";
+ SyntaxKind[SyntaxKind["Block"] = 200] = "Block";
+ SyntaxKind[SyntaxKind["VariableStatement"] = 201] = "VariableStatement";
+ SyntaxKind[SyntaxKind["EmptyStatement"] = 202] = "EmptyStatement";
+ SyntaxKind[SyntaxKind["ExpressionStatement"] = 203] = "ExpressionStatement";
+ SyntaxKind[SyntaxKind["IfStatement"] = 204] = "IfStatement";
+ SyntaxKind[SyntaxKind["DoStatement"] = 205] = "DoStatement";
+ SyntaxKind[SyntaxKind["WhileStatement"] = 206] = "WhileStatement";
+ SyntaxKind[SyntaxKind["ForStatement"] = 207] = "ForStatement";
+ SyntaxKind[SyntaxKind["ForInStatement"] = 208] = "ForInStatement";
+ SyntaxKind[SyntaxKind["ForOfStatement"] = 209] = "ForOfStatement";
+ SyntaxKind[SyntaxKind["ContinueStatement"] = 210] = "ContinueStatement";
+ SyntaxKind[SyntaxKind["BreakStatement"] = 211] = "BreakStatement";
+ SyntaxKind[SyntaxKind["ReturnStatement"] = 212] = "ReturnStatement";
+ SyntaxKind[SyntaxKind["WithStatement"] = 213] = "WithStatement";
+ SyntaxKind[SyntaxKind["SwitchStatement"] = 214] = "SwitchStatement";
+ SyntaxKind[SyntaxKind["LabeledStatement"] = 215] = "LabeledStatement";
+ SyntaxKind[SyntaxKind["ThrowStatement"] = 216] = "ThrowStatement";
+ SyntaxKind[SyntaxKind["TryStatement"] = 217] = "TryStatement";
+ SyntaxKind[SyntaxKind["DebuggerStatement"] = 218] = "DebuggerStatement";
+ SyntaxKind[SyntaxKind["VariableDeclaration"] = 219] = "VariableDeclaration";
+ SyntaxKind[SyntaxKind["VariableDeclarationList"] = 220] = "VariableDeclarationList";
+ SyntaxKind[SyntaxKind["FunctionDeclaration"] = 221] = "FunctionDeclaration";
+ SyntaxKind[SyntaxKind["ClassDeclaration"] = 222] = "ClassDeclaration";
+ SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 223] = "InterfaceDeclaration";
+ SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 224] = "TypeAliasDeclaration";
+ SyntaxKind[SyntaxKind["EnumDeclaration"] = 225] = "EnumDeclaration";
+ SyntaxKind[SyntaxKind["ModuleDeclaration"] = 226] = "ModuleDeclaration";
+ SyntaxKind[SyntaxKind["ModuleBlock"] = 227] = "ModuleBlock";
+ SyntaxKind[SyntaxKind["CaseBlock"] = 228] = "CaseBlock";
+ SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 229] = "NamespaceExportDeclaration";
+ SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 230] = "ImportEqualsDeclaration";
+ SyntaxKind[SyntaxKind["ImportDeclaration"] = 231] = "ImportDeclaration";
+ SyntaxKind[SyntaxKind["ImportClause"] = 232] = "ImportClause";
+ SyntaxKind[SyntaxKind["NamespaceImport"] = 233] = "NamespaceImport";
+ SyntaxKind[SyntaxKind["NamedImports"] = 234] = "NamedImports";
+ SyntaxKind[SyntaxKind["ImportSpecifier"] = 235] = "ImportSpecifier";
+ SyntaxKind[SyntaxKind["ExportAssignment"] = 236] = "ExportAssignment";
+ SyntaxKind[SyntaxKind["ExportDeclaration"] = 237] = "ExportDeclaration";
+ SyntaxKind[SyntaxKind["NamedExports"] = 238] = "NamedExports";
+ SyntaxKind[SyntaxKind["ExportSpecifier"] = 239] = "ExportSpecifier";
+ SyntaxKind[SyntaxKind["MissingDeclaration"] = 240] = "MissingDeclaration";
+ SyntaxKind[SyntaxKind["ExternalModuleReference"] = 241] = "ExternalModuleReference";
+ SyntaxKind[SyntaxKind["JsxElement"] = 242] = "JsxElement";
+ SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 243] = "JsxSelfClosingElement";
+ SyntaxKind[SyntaxKind["JsxOpeningElement"] = 244] = "JsxOpeningElement";
+ SyntaxKind[SyntaxKind["JsxClosingElement"] = 245] = "JsxClosingElement";
+ SyntaxKind[SyntaxKind["JsxAttribute"] = 246] = "JsxAttribute";
+ SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 247] = "JsxSpreadAttribute";
+ SyntaxKind[SyntaxKind["JsxExpression"] = 248] = "JsxExpression";
+ SyntaxKind[SyntaxKind["CaseClause"] = 249] = "CaseClause";
+ SyntaxKind[SyntaxKind["DefaultClause"] = 250] = "DefaultClause";
+ SyntaxKind[SyntaxKind["HeritageClause"] = 251] = "HeritageClause";
+ SyntaxKind[SyntaxKind["CatchClause"] = 252] = "CatchClause";
+ SyntaxKind[SyntaxKind["PropertyAssignment"] = 253] = "PropertyAssignment";
+ SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 254] = "ShorthandPropertyAssignment";
+ SyntaxKind[SyntaxKind["EnumMember"] = 255] = "EnumMember";
+ SyntaxKind[SyntaxKind["SourceFile"] = 256] = "SourceFile";
+ SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 257] = "JSDocTypeExpression";
+ SyntaxKind[SyntaxKind["JSDocAllType"] = 258] = "JSDocAllType";
+ SyntaxKind[SyntaxKind["JSDocUnknownType"] = 259] = "JSDocUnknownType";
+ SyntaxKind[SyntaxKind["JSDocArrayType"] = 260] = "JSDocArrayType";
+ SyntaxKind[SyntaxKind["JSDocUnionType"] = 261] = "JSDocUnionType";
+ SyntaxKind[SyntaxKind["JSDocTupleType"] = 262] = "JSDocTupleType";
+ SyntaxKind[SyntaxKind["JSDocNullableType"] = 263] = "JSDocNullableType";
+ SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 264] = "JSDocNonNullableType";
+ SyntaxKind[SyntaxKind["JSDocRecordType"] = 265] = "JSDocRecordType";
+ SyntaxKind[SyntaxKind["JSDocRecordMember"] = 266] = "JSDocRecordMember";
+ SyntaxKind[SyntaxKind["JSDocTypeReference"] = 267] = "JSDocTypeReference";
+ SyntaxKind[SyntaxKind["JSDocOptionalType"] = 268] = "JSDocOptionalType";
+ SyntaxKind[SyntaxKind["JSDocFunctionType"] = 269] = "JSDocFunctionType";
+ SyntaxKind[SyntaxKind["JSDocVariadicType"] = 270] = "JSDocVariadicType";
+ SyntaxKind[SyntaxKind["JSDocConstructorType"] = 271] = "JSDocConstructorType";
+ SyntaxKind[SyntaxKind["JSDocThisType"] = 272] = "JSDocThisType";
+ SyntaxKind[SyntaxKind["JSDocComment"] = 273] = "JSDocComment";
+ SyntaxKind[SyntaxKind["JSDocTag"] = 274] = "JSDocTag";
+ SyntaxKind[SyntaxKind["JSDocParameterTag"] = 275] = "JSDocParameterTag";
+ SyntaxKind[SyntaxKind["JSDocReturnTag"] = 276] = "JSDocReturnTag";
+ SyntaxKind[SyntaxKind["JSDocTypeTag"] = 277] = "JSDocTypeTag";
+ SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 278] = "JSDocTemplateTag";
+ SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 279] = "JSDocTypedefTag";
+ SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 280] = "JSDocPropertyTag";
+ SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 281] = "JSDocTypeLiteral";
+ SyntaxKind[SyntaxKind["JSDocLiteralType"] = 282] = "JSDocLiteralType";
+ SyntaxKind[SyntaxKind["JSDocNullKeyword"] = 283] = "JSDocNullKeyword";
+ SyntaxKind[SyntaxKind["JSDocUndefinedKeyword"] = 284] = "JSDocUndefinedKeyword";
+ SyntaxKind[SyntaxKind["JSDocNeverKeyword"] = 285] = "JSDocNeverKeyword";
+ SyntaxKind[SyntaxKind["SyntaxList"] = 286] = "SyntaxList";
+ SyntaxKind[SyntaxKind["NotEmittedStatement"] = 287] = "NotEmittedStatement";
+ SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 288] = "PartiallyEmittedExpression";
+ SyntaxKind[SyntaxKind["Count"] = 289] = "Count";
+ SyntaxKind[SyntaxKind["FirstAssignment"] = 57] = "FirstAssignment";
+ SyntaxKind[SyntaxKind["LastAssignment"] = 69] = "LastAssignment";
+ SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 58] = "FirstCompoundAssignment";
+ SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 69] = "LastCompoundAssignment";
+ SyntaxKind[SyntaxKind["FirstReservedWord"] = 71] = "FirstReservedWord";
+ SyntaxKind[SyntaxKind["LastReservedWord"] = 106] = "LastReservedWord";
+ SyntaxKind[SyntaxKind["FirstKeyword"] = 71] = "FirstKeyword";
+ SyntaxKind[SyntaxKind["LastKeyword"] = 139] = "LastKeyword";
+ SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 107] = "FirstFutureReservedWord";
+ SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 115] = "LastFutureReservedWord";
+ SyntaxKind[SyntaxKind["FirstTypeNode"] = 155] = "FirstTypeNode";
+ SyntaxKind[SyntaxKind["LastTypeNode"] = 167] = "LastTypeNode";
+ SyntaxKind[SyntaxKind["FirstPunctuation"] = 16] = "FirstPunctuation";
+ SyntaxKind[SyntaxKind["LastPunctuation"] = 69] = "LastPunctuation";
+ SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken";
+ SyntaxKind[SyntaxKind["LastToken"] = 139] = "LastToken";
+ SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken";
+ SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken";
+ SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken";
+ SyntaxKind[SyntaxKind["LastLiteralToken"] = 12] = "LastLiteralToken";
+ SyntaxKind[SyntaxKind["FirstTemplateToken"] = 12] = "FirstTemplateToken";
+ SyntaxKind[SyntaxKind["LastTemplateToken"] = 15] = "LastTemplateToken";
+ SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 26] = "FirstBinaryOperator";
+ SyntaxKind[SyntaxKind["LastBinaryOperator"] = 69] = "LastBinaryOperator";
+ SyntaxKind[SyntaxKind["FirstNode"] = 140] = "FirstNode";
+ SyntaxKind[SyntaxKind["FirstJSDocNode"] = 257] = "FirstJSDocNode";
+ SyntaxKind[SyntaxKind["LastJSDocNode"] = 282] = "LastJSDocNode";
+ SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 273] = "FirstJSDocTagNode";
+ SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 285] = "LastJSDocTagNode";
+ })(ts.SyntaxKind || (ts.SyntaxKind = {}));
+ var SyntaxKind = ts.SyntaxKind;
+ (function (NodeFlags) {
+ NodeFlags[NodeFlags["None"] = 0] = "None";
+ NodeFlags[NodeFlags["Let"] = 1] = "Let";
+ NodeFlags[NodeFlags["Const"] = 2] = "Const";
+ NodeFlags[NodeFlags["NestedNamespace"] = 4] = "NestedNamespace";
+ NodeFlags[NodeFlags["Synthesized"] = 8] = "Synthesized";
+ NodeFlags[NodeFlags["Namespace"] = 16] = "Namespace";
+ NodeFlags[NodeFlags["ExportContext"] = 32] = "ExportContext";
+ NodeFlags[NodeFlags["ContainsThis"] = 64] = "ContainsThis";
+ NodeFlags[NodeFlags["HasImplicitReturn"] = 128] = "HasImplicitReturn";
+ NodeFlags[NodeFlags["HasExplicitReturn"] = 256] = "HasExplicitReturn";
+ NodeFlags[NodeFlags["GlobalAugmentation"] = 512] = "GlobalAugmentation";
+ NodeFlags[NodeFlags["HasClassExtends"] = 1024] = "HasClassExtends";
+ NodeFlags[NodeFlags["HasDecorators"] = 2048] = "HasDecorators";
+ NodeFlags[NodeFlags["HasParamDecorators"] = 4096] = "HasParamDecorators";
+ NodeFlags[NodeFlags["HasAsyncFunctions"] = 8192] = "HasAsyncFunctions";
+ NodeFlags[NodeFlags["HasJsxSpreadAttributes"] = 16384] = "HasJsxSpreadAttributes";
+ NodeFlags[NodeFlags["DisallowInContext"] = 32768] = "DisallowInContext";
+ NodeFlags[NodeFlags["YieldContext"] = 65536] = "YieldContext";
+ NodeFlags[NodeFlags["DecoratorContext"] = 131072] = "DecoratorContext";
+ NodeFlags[NodeFlags["AwaitContext"] = 262144] = "AwaitContext";
+ NodeFlags[NodeFlags["ThisNodeHasError"] = 524288] = "ThisNodeHasError";
+ NodeFlags[NodeFlags["JavaScriptFile"] = 1048576] = "JavaScriptFile";
+ NodeFlags[NodeFlags["ThisNodeOrAnySubNodesHasError"] = 2097152] = "ThisNodeOrAnySubNodesHasError";
+ NodeFlags[NodeFlags["HasAggregatedChildData"] = 4194304] = "HasAggregatedChildData";
+ NodeFlags[NodeFlags["BlockScoped"] = 3] = "BlockScoped";
+ NodeFlags[NodeFlags["ReachabilityCheckFlags"] = 384] = "ReachabilityCheckFlags";
+ NodeFlags[NodeFlags["EmitHelperFlags"] = 31744] = "EmitHelperFlags";
+ NodeFlags[NodeFlags["ReachabilityAndEmitFlags"] = 32128] = "ReachabilityAndEmitFlags";
+ NodeFlags[NodeFlags["ContextFlags"] = 1540096] = "ContextFlags";
+ NodeFlags[NodeFlags["TypeExcludesFlags"] = 327680] = "TypeExcludesFlags";
+ })(ts.NodeFlags || (ts.NodeFlags = {}));
+ var NodeFlags = ts.NodeFlags;
+ (function (ModifierFlags) {
+ ModifierFlags[ModifierFlags["None"] = 0] = "None";
+ ModifierFlags[ModifierFlags["Export"] = 1] = "Export";
+ ModifierFlags[ModifierFlags["Ambient"] = 2] = "Ambient";
+ ModifierFlags[ModifierFlags["Public"] = 4] = "Public";
+ ModifierFlags[ModifierFlags["Private"] = 8] = "Private";
+ ModifierFlags[ModifierFlags["Protected"] = 16] = "Protected";
+ ModifierFlags[ModifierFlags["Static"] = 32] = "Static";
+ ModifierFlags[ModifierFlags["Readonly"] = 64] = "Readonly";
+ ModifierFlags[ModifierFlags["Abstract"] = 128] = "Abstract";
+ ModifierFlags[ModifierFlags["Async"] = 256] = "Async";
+ ModifierFlags[ModifierFlags["Default"] = 512] = "Default";
+ ModifierFlags[ModifierFlags["Const"] = 2048] = "Const";
+ ModifierFlags[ModifierFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags";
+ ModifierFlags[ModifierFlags["AccessibilityModifier"] = 28] = "AccessibilityModifier";
+ ModifierFlags[ModifierFlags["ParameterPropertyModifier"] = 92] = "ParameterPropertyModifier";
+ ModifierFlags[ModifierFlags["NonPublicAccessibilityModifier"] = 24] = "NonPublicAccessibilityModifier";
+ ModifierFlags[ModifierFlags["TypeScriptModifier"] = 2270] = "TypeScriptModifier";
+ })(ts.ModifierFlags || (ts.ModifierFlags = {}));
+ var ModifierFlags = ts.ModifierFlags;
+ (function (JsxFlags) {
+ JsxFlags[JsxFlags["None"] = 0] = "None";
+ JsxFlags[JsxFlags["IntrinsicNamedElement"] = 1] = "IntrinsicNamedElement";
+ JsxFlags[JsxFlags["IntrinsicIndexedElement"] = 2] = "IntrinsicIndexedElement";
+ JsxFlags[JsxFlags["IntrinsicElement"] = 3] = "IntrinsicElement";
+ })(ts.JsxFlags || (ts.JsxFlags = {}));
+ var JsxFlags = ts.JsxFlags;
+ (function (RelationComparisonResult) {
+ RelationComparisonResult[RelationComparisonResult["Succeeded"] = 1] = "Succeeded";
+ RelationComparisonResult[RelationComparisonResult["Failed"] = 2] = "Failed";
+ RelationComparisonResult[RelationComparisonResult["FailedAndReported"] = 3] = "FailedAndReported";
+ })(ts.RelationComparisonResult || (ts.RelationComparisonResult = {}));
+ var RelationComparisonResult = ts.RelationComparisonResult;
+ (function (GeneratedIdentifierKind) {
+ GeneratedIdentifierKind[GeneratedIdentifierKind["None"] = 0] = "None";
+ GeneratedIdentifierKind[GeneratedIdentifierKind["Auto"] = 1] = "Auto";
+ GeneratedIdentifierKind[GeneratedIdentifierKind["Loop"] = 2] = "Loop";
+ GeneratedIdentifierKind[GeneratedIdentifierKind["Unique"] = 3] = "Unique";
+ GeneratedIdentifierKind[GeneratedIdentifierKind["Node"] = 4] = "Node";
+ })(ts.GeneratedIdentifierKind || (ts.GeneratedIdentifierKind = {}));
+ var GeneratedIdentifierKind = ts.GeneratedIdentifierKind;
+ (function (FlowFlags) {
+ FlowFlags[FlowFlags["Unreachable"] = 1] = "Unreachable";
+ FlowFlags[FlowFlags["Start"] = 2] = "Start";
+ FlowFlags[FlowFlags["BranchLabel"] = 4] = "BranchLabel";
+ FlowFlags[FlowFlags["LoopLabel"] = 8] = "LoopLabel";
+ FlowFlags[FlowFlags["Assignment"] = 16] = "Assignment";
+ FlowFlags[FlowFlags["TrueCondition"] = 32] = "TrueCondition";
+ FlowFlags[FlowFlags["FalseCondition"] = 64] = "FalseCondition";
+ FlowFlags[FlowFlags["SwitchClause"] = 128] = "SwitchClause";
+ FlowFlags[FlowFlags["ArrayMutation"] = 256] = "ArrayMutation";
+ FlowFlags[FlowFlags["Referenced"] = 512] = "Referenced";
+ FlowFlags[FlowFlags["Shared"] = 1024] = "Shared";
+ FlowFlags[FlowFlags["Label"] = 12] = "Label";
+ FlowFlags[FlowFlags["Condition"] = 96] = "Condition";
+ })(ts.FlowFlags || (ts.FlowFlags = {}));
+ var FlowFlags = ts.FlowFlags;
var OperationCanceledException = (function () {
function OperationCanceledException() {
}
@@ -27,6 +439,38 @@ var ts;
ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated";
})(ts.ExitStatus || (ts.ExitStatus = {}));
var ExitStatus = ts.ExitStatus;
+ (function (TypeFormatFlags) {
+ TypeFormatFlags[TypeFormatFlags["None"] = 0] = "None";
+ TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 1] = "WriteArrayAsGenericType";
+ TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 2] = "UseTypeOfFunction";
+ TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 4] = "NoTruncation";
+ TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 8] = "WriteArrowStyleSignature";
+ TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 16] = "WriteOwnNameForAnyLike";
+ TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature";
+ TypeFormatFlags[TypeFormatFlags["InElementType"] = 64] = "InElementType";
+ TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 128] = "UseFullyQualifiedType";
+ TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 256] = "InFirstTypeArgument";
+ TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 512] = "InTypeAlias";
+ TypeFormatFlags[TypeFormatFlags["UseTypeAliasValue"] = 1024] = "UseTypeAliasValue";
+ })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {}));
+ var TypeFormatFlags = ts.TypeFormatFlags;
+ (function (SymbolFormatFlags) {
+ SymbolFormatFlags[SymbolFormatFlags["None"] = 0] = "None";
+ SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments";
+ SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing";
+ })(ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {}));
+ var SymbolFormatFlags = ts.SymbolFormatFlags;
+ (function (SymbolAccessibility) {
+ SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible";
+ SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible";
+ SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed";
+ })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {}));
+ var SymbolAccessibility = ts.SymbolAccessibility;
+ (function (TypePredicateKind) {
+ TypePredicateKind[TypePredicateKind["This"] = 0] = "This";
+ TypePredicateKind[TypePredicateKind["Identifier"] = 1] = "Identifier";
+ })(ts.TypePredicateKind || (ts.TypePredicateKind = {}));
+ var TypePredicateKind = ts.TypePredicateKind;
(function (TypeReferenceSerializationKind) {
TypeReferenceSerializationKind[TypeReferenceSerializationKind["Unknown"] = 0] = "Unknown";
TypeReferenceSerializationKind[TypeReferenceSerializationKind["TypeWithConstructSignatureAndValue"] = 1] = "TypeWithConstructSignatureAndValue";
@@ -41,6 +485,166 @@ var ts;
TypeReferenceSerializationKind[TypeReferenceSerializationKind["ObjectType"] = 10] = "ObjectType";
})(ts.TypeReferenceSerializationKind || (ts.TypeReferenceSerializationKind = {}));
var TypeReferenceSerializationKind = ts.TypeReferenceSerializationKind;
+ (function (SymbolFlags) {
+ SymbolFlags[SymbolFlags["None"] = 0] = "None";
+ SymbolFlags[SymbolFlags["FunctionScopedVariable"] = 1] = "FunctionScopedVariable";
+ SymbolFlags[SymbolFlags["BlockScopedVariable"] = 2] = "BlockScopedVariable";
+ SymbolFlags[SymbolFlags["Property"] = 4] = "Property";
+ SymbolFlags[SymbolFlags["EnumMember"] = 8] = "EnumMember";
+ SymbolFlags[SymbolFlags["Function"] = 16] = "Function";
+ SymbolFlags[SymbolFlags["Class"] = 32] = "Class";
+ SymbolFlags[SymbolFlags["Interface"] = 64] = "Interface";
+ SymbolFlags[SymbolFlags["ConstEnum"] = 128] = "ConstEnum";
+ SymbolFlags[SymbolFlags["RegularEnum"] = 256] = "RegularEnum";
+ SymbolFlags[SymbolFlags["ValueModule"] = 512] = "ValueModule";
+ SymbolFlags[SymbolFlags["NamespaceModule"] = 1024] = "NamespaceModule";
+ SymbolFlags[SymbolFlags["TypeLiteral"] = 2048] = "TypeLiteral";
+ SymbolFlags[SymbolFlags["ObjectLiteral"] = 4096] = "ObjectLiteral";
+ SymbolFlags[SymbolFlags["Method"] = 8192] = "Method";
+ SymbolFlags[SymbolFlags["Constructor"] = 16384] = "Constructor";
+ SymbolFlags[SymbolFlags["GetAccessor"] = 32768] = "GetAccessor";
+ SymbolFlags[SymbolFlags["SetAccessor"] = 65536] = "SetAccessor";
+ SymbolFlags[SymbolFlags["Signature"] = 131072] = "Signature";
+ SymbolFlags[SymbolFlags["TypeParameter"] = 262144] = "TypeParameter";
+ SymbolFlags[SymbolFlags["TypeAlias"] = 524288] = "TypeAlias";
+ SymbolFlags[SymbolFlags["ExportValue"] = 1048576] = "ExportValue";
+ SymbolFlags[SymbolFlags["ExportType"] = 2097152] = "ExportType";
+ SymbolFlags[SymbolFlags["ExportNamespace"] = 4194304] = "ExportNamespace";
+ SymbolFlags[SymbolFlags["Alias"] = 8388608] = "Alias";
+ SymbolFlags[SymbolFlags["Instantiated"] = 16777216] = "Instantiated";
+ SymbolFlags[SymbolFlags["Merged"] = 33554432] = "Merged";
+ SymbolFlags[SymbolFlags["Transient"] = 67108864] = "Transient";
+ SymbolFlags[SymbolFlags["Prototype"] = 134217728] = "Prototype";
+ SymbolFlags[SymbolFlags["SyntheticProperty"] = 268435456] = "SyntheticProperty";
+ SymbolFlags[SymbolFlags["Optional"] = 536870912] = "Optional";
+ SymbolFlags[SymbolFlags["ExportStar"] = 1073741824] = "ExportStar";
+ SymbolFlags[SymbolFlags["Enum"] = 384] = "Enum";
+ SymbolFlags[SymbolFlags["Variable"] = 3] = "Variable";
+ SymbolFlags[SymbolFlags["Value"] = 107455] = "Value";
+ SymbolFlags[SymbolFlags["Type"] = 793064] = "Type";
+ SymbolFlags[SymbolFlags["Namespace"] = 1920] = "Namespace";
+ SymbolFlags[SymbolFlags["Module"] = 1536] = "Module";
+ SymbolFlags[SymbolFlags["Accessor"] = 98304] = "Accessor";
+ SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = 107454] = "FunctionScopedVariableExcludes";
+ SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = 107455] = "BlockScopedVariableExcludes";
+ SymbolFlags[SymbolFlags["ParameterExcludes"] = 107455] = "ParameterExcludes";
+ SymbolFlags[SymbolFlags["PropertyExcludes"] = 0] = "PropertyExcludes";
+ SymbolFlags[SymbolFlags["EnumMemberExcludes"] = 900095] = "EnumMemberExcludes";
+ SymbolFlags[SymbolFlags["FunctionExcludes"] = 106927] = "FunctionExcludes";
+ SymbolFlags[SymbolFlags["ClassExcludes"] = 899519] = "ClassExcludes";
+ SymbolFlags[SymbolFlags["InterfaceExcludes"] = 792968] = "InterfaceExcludes";
+ SymbolFlags[SymbolFlags["RegularEnumExcludes"] = 899327] = "RegularEnumExcludes";
+ SymbolFlags[SymbolFlags["ConstEnumExcludes"] = 899967] = "ConstEnumExcludes";
+ SymbolFlags[SymbolFlags["ValueModuleExcludes"] = 106639] = "ValueModuleExcludes";
+ SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes";
+ SymbolFlags[SymbolFlags["MethodExcludes"] = 99263] = "MethodExcludes";
+ SymbolFlags[SymbolFlags["GetAccessorExcludes"] = 41919] = "GetAccessorExcludes";
+ SymbolFlags[SymbolFlags["SetAccessorExcludes"] = 74687] = "SetAccessorExcludes";
+ SymbolFlags[SymbolFlags["TypeParameterExcludes"] = 530920] = "TypeParameterExcludes";
+ SymbolFlags[SymbolFlags["TypeAliasExcludes"] = 793064] = "TypeAliasExcludes";
+ SymbolFlags[SymbolFlags["AliasExcludes"] = 8388608] = "AliasExcludes";
+ SymbolFlags[SymbolFlags["ModuleMember"] = 8914931] = "ModuleMember";
+ SymbolFlags[SymbolFlags["ExportHasLocal"] = 944] = "ExportHasLocal";
+ SymbolFlags[SymbolFlags["HasExports"] = 1952] = "HasExports";
+ SymbolFlags[SymbolFlags["HasMembers"] = 6240] = "HasMembers";
+ SymbolFlags[SymbolFlags["BlockScoped"] = 418] = "BlockScoped";
+ SymbolFlags[SymbolFlags["PropertyOrAccessor"] = 98308] = "PropertyOrAccessor";
+ SymbolFlags[SymbolFlags["Export"] = 7340032] = "Export";
+ SymbolFlags[SymbolFlags["ClassMember"] = 106500] = "ClassMember";
+ SymbolFlags[SymbolFlags["Classifiable"] = 788448] = "Classifiable";
+ })(ts.SymbolFlags || (ts.SymbolFlags = {}));
+ var SymbolFlags = ts.SymbolFlags;
+ (function (NodeCheckFlags) {
+ NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 1] = "TypeChecked";
+ NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 2] = "LexicalThis";
+ NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 4] = "CaptureThis";
+ NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 256] = "SuperInstance";
+ NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 512] = "SuperStatic";
+ NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 1024] = "ContextChecked";
+ NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuper"] = 2048] = "AsyncMethodWithSuper";
+ NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuperBinding"] = 4096] = "AsyncMethodWithSuperBinding";
+ NodeCheckFlags[NodeCheckFlags["CaptureArguments"] = 8192] = "CaptureArguments";
+ NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 16384] = "EnumValuesComputed";
+ NodeCheckFlags[NodeCheckFlags["LexicalModuleMergesWithClass"] = 32768] = "LexicalModuleMergesWithClass";
+ NodeCheckFlags[NodeCheckFlags["LoopWithCapturedBlockScopedBinding"] = 65536] = "LoopWithCapturedBlockScopedBinding";
+ NodeCheckFlags[NodeCheckFlags["CapturedBlockScopedBinding"] = 131072] = "CapturedBlockScopedBinding";
+ NodeCheckFlags[NodeCheckFlags["BlockScopedBindingInLoop"] = 262144] = "BlockScopedBindingInLoop";
+ NodeCheckFlags[NodeCheckFlags["ClassWithBodyScopedClassBinding"] = 524288] = "ClassWithBodyScopedClassBinding";
+ NodeCheckFlags[NodeCheckFlags["BodyScopedClassBinding"] = 1048576] = "BodyScopedClassBinding";
+ NodeCheckFlags[NodeCheckFlags["NeedsLoopOutParameter"] = 2097152] = "NeedsLoopOutParameter";
+ NodeCheckFlags[NodeCheckFlags["AssignmentsMarked"] = 4194304] = "AssignmentsMarked";
+ NodeCheckFlags[NodeCheckFlags["ClassWithConstructorReference"] = 8388608] = "ClassWithConstructorReference";
+ NodeCheckFlags[NodeCheckFlags["ConstructorReferenceInClass"] = 16777216] = "ConstructorReferenceInClass";
+ })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {}));
+ var NodeCheckFlags = ts.NodeCheckFlags;
+ (function (TypeFlags) {
+ TypeFlags[TypeFlags["Any"] = 1] = "Any";
+ TypeFlags[TypeFlags["String"] = 2] = "String";
+ TypeFlags[TypeFlags["Number"] = 4] = "Number";
+ TypeFlags[TypeFlags["Boolean"] = 8] = "Boolean";
+ TypeFlags[TypeFlags["Enum"] = 16] = "Enum";
+ TypeFlags[TypeFlags["StringLiteral"] = 32] = "StringLiteral";
+ TypeFlags[TypeFlags["NumberLiteral"] = 64] = "NumberLiteral";
+ TypeFlags[TypeFlags["BooleanLiteral"] = 128] = "BooleanLiteral";
+ TypeFlags[TypeFlags["EnumLiteral"] = 256] = "EnumLiteral";
+ TypeFlags[TypeFlags["ESSymbol"] = 512] = "ESSymbol";
+ TypeFlags[TypeFlags["Void"] = 1024] = "Void";
+ TypeFlags[TypeFlags["Undefined"] = 2048] = "Undefined";
+ TypeFlags[TypeFlags["Null"] = 4096] = "Null";
+ TypeFlags[TypeFlags["Never"] = 8192] = "Never";
+ TypeFlags[TypeFlags["TypeParameter"] = 16384] = "TypeParameter";
+ TypeFlags[TypeFlags["Class"] = 32768] = "Class";
+ TypeFlags[TypeFlags["Interface"] = 65536] = "Interface";
+ TypeFlags[TypeFlags["Reference"] = 131072] = "Reference";
+ TypeFlags[TypeFlags["Tuple"] = 262144] = "Tuple";
+ TypeFlags[TypeFlags["Union"] = 524288] = "Union";
+ TypeFlags[TypeFlags["Intersection"] = 1048576] = "Intersection";
+ TypeFlags[TypeFlags["Anonymous"] = 2097152] = "Anonymous";
+ TypeFlags[TypeFlags["Instantiated"] = 4194304] = "Instantiated";
+ TypeFlags[TypeFlags["ObjectLiteral"] = 8388608] = "ObjectLiteral";
+ TypeFlags[TypeFlags["FreshLiteral"] = 16777216] = "FreshLiteral";
+ TypeFlags[TypeFlags["ContainsWideningType"] = 33554432] = "ContainsWideningType";
+ TypeFlags[TypeFlags["ContainsObjectLiteral"] = 67108864] = "ContainsObjectLiteral";
+ TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 134217728] = "ContainsAnyFunctionType";
+ TypeFlags[TypeFlags["Nullable"] = 6144] = "Nullable";
+ TypeFlags[TypeFlags["Literal"] = 480] = "Literal";
+ TypeFlags[TypeFlags["StringOrNumberLiteral"] = 96] = "StringOrNumberLiteral";
+ TypeFlags[TypeFlags["DefinitelyFalsy"] = 7392] = "DefinitelyFalsy";
+ TypeFlags[TypeFlags["PossiblyFalsy"] = 7406] = "PossiblyFalsy";
+ TypeFlags[TypeFlags["Intrinsic"] = 16015] = "Intrinsic";
+ TypeFlags[TypeFlags["Primitive"] = 8190] = "Primitive";
+ TypeFlags[TypeFlags["StringLike"] = 34] = "StringLike";
+ TypeFlags[TypeFlags["NumberLike"] = 340] = "NumberLike";
+ TypeFlags[TypeFlags["BooleanLike"] = 136] = "BooleanLike";
+ TypeFlags[TypeFlags["EnumLike"] = 272] = "EnumLike";
+ TypeFlags[TypeFlags["ObjectType"] = 2588672] = "ObjectType";
+ TypeFlags[TypeFlags["UnionOrIntersection"] = 1572864] = "UnionOrIntersection";
+ TypeFlags[TypeFlags["StructuredType"] = 4161536] = "StructuredType";
+ TypeFlags[TypeFlags["StructuredOrTypeParameter"] = 4177920] = "StructuredOrTypeParameter";
+ TypeFlags[TypeFlags["Narrowable"] = 4178943] = "Narrowable";
+ TypeFlags[TypeFlags["NotUnionOrUnit"] = 2589185] = "NotUnionOrUnit";
+ TypeFlags[TypeFlags["RequiresWidening"] = 100663296] = "RequiresWidening";
+ TypeFlags[TypeFlags["PropagatingFlags"] = 234881024] = "PropagatingFlags";
+ })(ts.TypeFlags || (ts.TypeFlags = {}));
+ var TypeFlags = ts.TypeFlags;
+ (function (SignatureKind) {
+ SignatureKind[SignatureKind["Call"] = 0] = "Call";
+ SignatureKind[SignatureKind["Construct"] = 1] = "Construct";
+ })(ts.SignatureKind || (ts.SignatureKind = {}));
+ var SignatureKind = ts.SignatureKind;
+ (function (IndexKind) {
+ IndexKind[IndexKind["String"] = 0] = "String";
+ IndexKind[IndexKind["Number"] = 1] = "Number";
+ })(ts.IndexKind || (ts.IndexKind = {}));
+ var IndexKind = ts.IndexKind;
+ (function (SpecialPropertyAssignmentKind) {
+ SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["None"] = 0] = "None";
+ SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ExportsProperty"] = 1] = "ExportsProperty";
+ SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ModuleExports"] = 2] = "ModuleExports";
+ SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["PrototypeProperty"] = 3] = "PrototypeProperty";
+ SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ThisProperty"] = 4] = "ThisProperty";
+ })(ts.SpecialPropertyAssignmentKind || (ts.SpecialPropertyAssignmentKind = {}));
+ var SpecialPropertyAssignmentKind = ts.SpecialPropertyAssignmentKind;
(function (DiagnosticCategory) {
DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning";
DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error";
@@ -58,10 +662,267 @@ var ts;
ModuleKind[ModuleKind["AMD"] = 2] = "AMD";
ModuleKind[ModuleKind["UMD"] = 3] = "UMD";
ModuleKind[ModuleKind["System"] = 4] = "System";
- ModuleKind[ModuleKind["ES6"] = 5] = "ES6";
ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015";
})(ts.ModuleKind || (ts.ModuleKind = {}));
var ModuleKind = ts.ModuleKind;
+ (function (JsxEmit) {
+ JsxEmit[JsxEmit["None"] = 0] = "None";
+ JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve";
+ JsxEmit[JsxEmit["React"] = 2] = "React";
+ })(ts.JsxEmit || (ts.JsxEmit = {}));
+ var JsxEmit = ts.JsxEmit;
+ (function (NewLineKind) {
+ NewLineKind[NewLineKind["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed";
+ NewLineKind[NewLineKind["LineFeed"] = 1] = "LineFeed";
+ })(ts.NewLineKind || (ts.NewLineKind = {}));
+ var NewLineKind = ts.NewLineKind;
+ (function (ScriptKind) {
+ ScriptKind[ScriptKind["Unknown"] = 0] = "Unknown";
+ ScriptKind[ScriptKind["JS"] = 1] = "JS";
+ ScriptKind[ScriptKind["JSX"] = 2] = "JSX";
+ ScriptKind[ScriptKind["TS"] = 3] = "TS";
+ ScriptKind[ScriptKind["TSX"] = 4] = "TSX";
+ })(ts.ScriptKind || (ts.ScriptKind = {}));
+ var ScriptKind = ts.ScriptKind;
+ (function (ScriptTarget) {
+ ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3";
+ ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5";
+ ScriptTarget[ScriptTarget["ES2015"] = 2] = "ES2015";
+ ScriptTarget[ScriptTarget["ES2016"] = 3] = "ES2016";
+ ScriptTarget[ScriptTarget["ES2017"] = 4] = "ES2017";
+ ScriptTarget[ScriptTarget["Latest"] = 4] = "Latest";
+ })(ts.ScriptTarget || (ts.ScriptTarget = {}));
+ var ScriptTarget = ts.ScriptTarget;
+ (function (LanguageVariant) {
+ LanguageVariant[LanguageVariant["Standard"] = 0] = "Standard";
+ LanguageVariant[LanguageVariant["JSX"] = 1] = "JSX";
+ })(ts.LanguageVariant || (ts.LanguageVariant = {}));
+ var LanguageVariant = ts.LanguageVariant;
+ (function (DiagnosticStyle) {
+ DiagnosticStyle[DiagnosticStyle["Simple"] = 0] = "Simple";
+ DiagnosticStyle[DiagnosticStyle["Pretty"] = 1] = "Pretty";
+ })(ts.DiagnosticStyle || (ts.DiagnosticStyle = {}));
+ var DiagnosticStyle = ts.DiagnosticStyle;
+ (function (WatchDirectoryFlags) {
+ WatchDirectoryFlags[WatchDirectoryFlags["None"] = 0] = "None";
+ WatchDirectoryFlags[WatchDirectoryFlags["Recursive"] = 1] = "Recursive";
+ })(ts.WatchDirectoryFlags || (ts.WatchDirectoryFlags = {}));
+ var WatchDirectoryFlags = ts.WatchDirectoryFlags;
+ (function (CharacterCodes) {
+ CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter";
+ CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter";
+ CharacterCodes[CharacterCodes["lineFeed"] = 10] = "lineFeed";
+ CharacterCodes[CharacterCodes["carriageReturn"] = 13] = "carriageReturn";
+ CharacterCodes[CharacterCodes["lineSeparator"] = 8232] = "lineSeparator";
+ CharacterCodes[CharacterCodes["paragraphSeparator"] = 8233] = "paragraphSeparator";
+ CharacterCodes[CharacterCodes["nextLine"] = 133] = "nextLine";
+ CharacterCodes[CharacterCodes["space"] = 32] = "space";
+ CharacterCodes[CharacterCodes["nonBreakingSpace"] = 160] = "nonBreakingSpace";
+ CharacterCodes[CharacterCodes["enQuad"] = 8192] = "enQuad";
+ CharacterCodes[CharacterCodes["emQuad"] = 8193] = "emQuad";
+ CharacterCodes[CharacterCodes["enSpace"] = 8194] = "enSpace";
+ CharacterCodes[CharacterCodes["emSpace"] = 8195] = "emSpace";
+ CharacterCodes[CharacterCodes["threePerEmSpace"] = 8196] = "threePerEmSpace";
+ CharacterCodes[CharacterCodes["fourPerEmSpace"] = 8197] = "fourPerEmSpace";
+ CharacterCodes[CharacterCodes["sixPerEmSpace"] = 8198] = "sixPerEmSpace";
+ CharacterCodes[CharacterCodes["figureSpace"] = 8199] = "figureSpace";
+ CharacterCodes[CharacterCodes["punctuationSpace"] = 8200] = "punctuationSpace";
+ CharacterCodes[CharacterCodes["thinSpace"] = 8201] = "thinSpace";
+ CharacterCodes[CharacterCodes["hairSpace"] = 8202] = "hairSpace";
+ CharacterCodes[CharacterCodes["zeroWidthSpace"] = 8203] = "zeroWidthSpace";
+ CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 8239] = "narrowNoBreakSpace";
+ CharacterCodes[CharacterCodes["ideographicSpace"] = 12288] = "ideographicSpace";
+ CharacterCodes[CharacterCodes["mathematicalSpace"] = 8287] = "mathematicalSpace";
+ CharacterCodes[CharacterCodes["ogham"] = 5760] = "ogham";
+ CharacterCodes[CharacterCodes["_"] = 95] = "_";
+ CharacterCodes[CharacterCodes["$"] = 36] = "$";
+ CharacterCodes[CharacterCodes["_0"] = 48] = "_0";
+ CharacterCodes[CharacterCodes["_1"] = 49] = "_1";
+ CharacterCodes[CharacterCodes["_2"] = 50] = "_2";
+ CharacterCodes[CharacterCodes["_3"] = 51] = "_3";
+ CharacterCodes[CharacterCodes["_4"] = 52] = "_4";
+ CharacterCodes[CharacterCodes["_5"] = 53] = "_5";
+ CharacterCodes[CharacterCodes["_6"] = 54] = "_6";
+ CharacterCodes[CharacterCodes["_7"] = 55] = "_7";
+ CharacterCodes[CharacterCodes["_8"] = 56] = "_8";
+ CharacterCodes[CharacterCodes["_9"] = 57] = "_9";
+ CharacterCodes[CharacterCodes["a"] = 97] = "a";
+ CharacterCodes[CharacterCodes["b"] = 98] = "b";
+ CharacterCodes[CharacterCodes["c"] = 99] = "c";
+ CharacterCodes[CharacterCodes["d"] = 100] = "d";
+ CharacterCodes[CharacterCodes["e"] = 101] = "e";
+ CharacterCodes[CharacterCodes["f"] = 102] = "f";
+ CharacterCodes[CharacterCodes["g"] = 103] = "g";
+ CharacterCodes[CharacterCodes["h"] = 104] = "h";
+ CharacterCodes[CharacterCodes["i"] = 105] = "i";
+ CharacterCodes[CharacterCodes["j"] = 106] = "j";
+ CharacterCodes[CharacterCodes["k"] = 107] = "k";
+ CharacterCodes[CharacterCodes["l"] = 108] = "l";
+ CharacterCodes[CharacterCodes["m"] = 109] = "m";
+ CharacterCodes[CharacterCodes["n"] = 110] = "n";
+ CharacterCodes[CharacterCodes["o"] = 111] = "o";
+ CharacterCodes[CharacterCodes["p"] = 112] = "p";
+ CharacterCodes[CharacterCodes["q"] = 113] = "q";
+ CharacterCodes[CharacterCodes["r"] = 114] = "r";
+ CharacterCodes[CharacterCodes["s"] = 115] = "s";
+ CharacterCodes[CharacterCodes["t"] = 116] = "t";
+ CharacterCodes[CharacterCodes["u"] = 117] = "u";
+ CharacterCodes[CharacterCodes["v"] = 118] = "v";
+ CharacterCodes[CharacterCodes["w"] = 119] = "w";
+ CharacterCodes[CharacterCodes["x"] = 120] = "x";
+ CharacterCodes[CharacterCodes["y"] = 121] = "y";
+ CharacterCodes[CharacterCodes["z"] = 122] = "z";
+ CharacterCodes[CharacterCodes["A"] = 65] = "A";
+ CharacterCodes[CharacterCodes["B"] = 66] = "B";
+ CharacterCodes[CharacterCodes["C"] = 67] = "C";
+ CharacterCodes[CharacterCodes["D"] = 68] = "D";
+ CharacterCodes[CharacterCodes["E"] = 69] = "E";
+ CharacterCodes[CharacterCodes["F"] = 70] = "F";
+ CharacterCodes[CharacterCodes["G"] = 71] = "G";
+ CharacterCodes[CharacterCodes["H"] = 72] = "H";
+ CharacterCodes[CharacterCodes["I"] = 73] = "I";
+ CharacterCodes[CharacterCodes["J"] = 74] = "J";
+ CharacterCodes[CharacterCodes["K"] = 75] = "K";
+ CharacterCodes[CharacterCodes["L"] = 76] = "L";
+ CharacterCodes[CharacterCodes["M"] = 77] = "M";
+ CharacterCodes[CharacterCodes["N"] = 78] = "N";
+ CharacterCodes[CharacterCodes["O"] = 79] = "O";
+ CharacterCodes[CharacterCodes["P"] = 80] = "P";
+ CharacterCodes[CharacterCodes["Q"] = 81] = "Q";
+ CharacterCodes[CharacterCodes["R"] = 82] = "R";
+ CharacterCodes[CharacterCodes["S"] = 83] = "S";
+ CharacterCodes[CharacterCodes["T"] = 84] = "T";
+ CharacterCodes[CharacterCodes["U"] = 85] = "U";
+ CharacterCodes[CharacterCodes["V"] = 86] = "V";
+ CharacterCodes[CharacterCodes["W"] = 87] = "W";
+ CharacterCodes[CharacterCodes["X"] = 88] = "X";
+ CharacterCodes[CharacterCodes["Y"] = 89] = "Y";
+ CharacterCodes[CharacterCodes["Z"] = 90] = "Z";
+ CharacterCodes[CharacterCodes["ampersand"] = 38] = "ampersand";
+ CharacterCodes[CharacterCodes["asterisk"] = 42] = "asterisk";
+ CharacterCodes[CharacterCodes["at"] = 64] = "at";
+ CharacterCodes[CharacterCodes["backslash"] = 92] = "backslash";
+ CharacterCodes[CharacterCodes["backtick"] = 96] = "backtick";
+ CharacterCodes[CharacterCodes["bar"] = 124] = "bar";
+ CharacterCodes[CharacterCodes["caret"] = 94] = "caret";
+ CharacterCodes[CharacterCodes["closeBrace"] = 125] = "closeBrace";
+ CharacterCodes[CharacterCodes["closeBracket"] = 93] = "closeBracket";
+ CharacterCodes[CharacterCodes["closeParen"] = 41] = "closeParen";
+ CharacterCodes[CharacterCodes["colon"] = 58] = "colon";
+ CharacterCodes[CharacterCodes["comma"] = 44] = "comma";
+ CharacterCodes[CharacterCodes["dot"] = 46] = "dot";
+ CharacterCodes[CharacterCodes["doubleQuote"] = 34] = "doubleQuote";
+ CharacterCodes[CharacterCodes["equals"] = 61] = "equals";
+ CharacterCodes[CharacterCodes["exclamation"] = 33] = "exclamation";
+ CharacterCodes[CharacterCodes["greaterThan"] = 62] = "greaterThan";
+ CharacterCodes[CharacterCodes["hash"] = 35] = "hash";
+ CharacterCodes[CharacterCodes["lessThan"] = 60] = "lessThan";
+ CharacterCodes[CharacterCodes["minus"] = 45] = "minus";
+ CharacterCodes[CharacterCodes["openBrace"] = 123] = "openBrace";
+ CharacterCodes[CharacterCodes["openBracket"] = 91] = "openBracket";
+ CharacterCodes[CharacterCodes["openParen"] = 40] = "openParen";
+ CharacterCodes[CharacterCodes["percent"] = 37] = "percent";
+ CharacterCodes[CharacterCodes["plus"] = 43] = "plus";
+ CharacterCodes[CharacterCodes["question"] = 63] = "question";
+ CharacterCodes[CharacterCodes["semicolon"] = 59] = "semicolon";
+ CharacterCodes[CharacterCodes["singleQuote"] = 39] = "singleQuote";
+ CharacterCodes[CharacterCodes["slash"] = 47] = "slash";
+ CharacterCodes[CharacterCodes["tilde"] = 126] = "tilde";
+ CharacterCodes[CharacterCodes["backspace"] = 8] = "backspace";
+ CharacterCodes[CharacterCodes["formFeed"] = 12] = "formFeed";
+ CharacterCodes[CharacterCodes["byteOrderMark"] = 65279] = "byteOrderMark";
+ CharacterCodes[CharacterCodes["tab"] = 9] = "tab";
+ CharacterCodes[CharacterCodes["verticalTab"] = 11] = "verticalTab";
+ })(ts.CharacterCodes || (ts.CharacterCodes = {}));
+ var CharacterCodes = ts.CharacterCodes;
+ (function (TransformFlags) {
+ TransformFlags[TransformFlags["None"] = 0] = "None";
+ TransformFlags[TransformFlags["TypeScript"] = 1] = "TypeScript";
+ TransformFlags[TransformFlags["ContainsTypeScript"] = 2] = "ContainsTypeScript";
+ TransformFlags[TransformFlags["Jsx"] = 4] = "Jsx";
+ TransformFlags[TransformFlags["ContainsJsx"] = 8] = "ContainsJsx";
+ TransformFlags[TransformFlags["ES2017"] = 16] = "ES2017";
+ TransformFlags[TransformFlags["ContainsES2017"] = 32] = "ContainsES2017";
+ TransformFlags[TransformFlags["ES2016"] = 64] = "ES2016";
+ TransformFlags[TransformFlags["ContainsES2016"] = 128] = "ContainsES2016";
+ TransformFlags[TransformFlags["ES2015"] = 256] = "ES2015";
+ TransformFlags[TransformFlags["ContainsES2015"] = 512] = "ContainsES2015";
+ TransformFlags[TransformFlags["DestructuringAssignment"] = 1024] = "DestructuringAssignment";
+ TransformFlags[TransformFlags["Generator"] = 2048] = "Generator";
+ TransformFlags[TransformFlags["ContainsGenerator"] = 4096] = "ContainsGenerator";
+ TransformFlags[TransformFlags["ContainsDecorators"] = 8192] = "ContainsDecorators";
+ TransformFlags[TransformFlags["ContainsPropertyInitializer"] = 16384] = "ContainsPropertyInitializer";
+ TransformFlags[TransformFlags["ContainsLexicalThis"] = 32768] = "ContainsLexicalThis";
+ TransformFlags[TransformFlags["ContainsCapturedLexicalThis"] = 65536] = "ContainsCapturedLexicalThis";
+ TransformFlags[TransformFlags["ContainsLexicalThisInComputedPropertyName"] = 131072] = "ContainsLexicalThisInComputedPropertyName";
+ TransformFlags[TransformFlags["ContainsDefaultValueAssignments"] = 262144] = "ContainsDefaultValueAssignments";
+ TransformFlags[TransformFlags["ContainsParameterPropertyAssignments"] = 524288] = "ContainsParameterPropertyAssignments";
+ TransformFlags[TransformFlags["ContainsSpreadElementExpression"] = 1048576] = "ContainsSpreadElementExpression";
+ TransformFlags[TransformFlags["ContainsComputedPropertyName"] = 2097152] = "ContainsComputedPropertyName";
+ TransformFlags[TransformFlags["ContainsBlockScopedBinding"] = 4194304] = "ContainsBlockScopedBinding";
+ TransformFlags[TransformFlags["ContainsBindingPattern"] = 8388608] = "ContainsBindingPattern";
+ TransformFlags[TransformFlags["ContainsYield"] = 16777216] = "ContainsYield";
+ TransformFlags[TransformFlags["ContainsHoistedDeclarationOrCompletion"] = 33554432] = "ContainsHoistedDeclarationOrCompletion";
+ TransformFlags[TransformFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags";
+ TransformFlags[TransformFlags["AssertTypeScript"] = 3] = "AssertTypeScript";
+ TransformFlags[TransformFlags["AssertJsx"] = 12] = "AssertJsx";
+ TransformFlags[TransformFlags["AssertES2017"] = 48] = "AssertES2017";
+ TransformFlags[TransformFlags["AssertES2016"] = 192] = "AssertES2016";
+ TransformFlags[TransformFlags["AssertES2015"] = 768] = "AssertES2015";
+ TransformFlags[TransformFlags["AssertGenerator"] = 6144] = "AssertGenerator";
+ TransformFlags[TransformFlags["NodeExcludes"] = 536874325] = "NodeExcludes";
+ TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 592227669] = "ArrowFunctionExcludes";
+ TransformFlags[TransformFlags["FunctionExcludes"] = 592293205] = "FunctionExcludes";
+ TransformFlags[TransformFlags["ConstructorExcludes"] = 591760725] = "ConstructorExcludes";
+ TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 591760725] = "MethodOrAccessorExcludes";
+ TransformFlags[TransformFlags["ClassExcludes"] = 539749717] = "ClassExcludes";
+ TransformFlags[TransformFlags["ModuleExcludes"] = 574729557] = "ModuleExcludes";
+ TransformFlags[TransformFlags["TypeExcludes"] = -3] = "TypeExcludes";
+ TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 539110741] = "ObjectLiteralExcludes";
+ TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 537922901] = "ArrayLiteralOrCallOrNewExcludes";
+ TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 545262933] = "VariableDeclarationListExcludes";
+ TransformFlags[TransformFlags["ParameterExcludes"] = 545262933] = "ParameterExcludes";
+ TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 548864] = "TypeScriptClassSyntaxMask";
+ TransformFlags[TransformFlags["ES2015FunctionSyntaxMask"] = 327680] = "ES2015FunctionSyntaxMask";
+ })(ts.TransformFlags || (ts.TransformFlags = {}));
+ var TransformFlags = ts.TransformFlags;
+ (function (EmitFlags) {
+ EmitFlags[EmitFlags["EmitEmitHelpers"] = 1] = "EmitEmitHelpers";
+ EmitFlags[EmitFlags["EmitExportStar"] = 2] = "EmitExportStar";
+ EmitFlags[EmitFlags["EmitSuperHelper"] = 4] = "EmitSuperHelper";
+ EmitFlags[EmitFlags["EmitAdvancedSuperHelper"] = 8] = "EmitAdvancedSuperHelper";
+ EmitFlags[EmitFlags["UMDDefine"] = 16] = "UMDDefine";
+ EmitFlags[EmitFlags["SingleLine"] = 32] = "SingleLine";
+ EmitFlags[EmitFlags["AdviseOnEmitNode"] = 64] = "AdviseOnEmitNode";
+ EmitFlags[EmitFlags["NoSubstitution"] = 128] = "NoSubstitution";
+ EmitFlags[EmitFlags["CapturesThis"] = 256] = "CapturesThis";
+ EmitFlags[EmitFlags["NoLeadingSourceMap"] = 512] = "NoLeadingSourceMap";
+ EmitFlags[EmitFlags["NoTrailingSourceMap"] = 1024] = "NoTrailingSourceMap";
+ EmitFlags[EmitFlags["NoSourceMap"] = 1536] = "NoSourceMap";
+ EmitFlags[EmitFlags["NoNestedSourceMaps"] = 2048] = "NoNestedSourceMaps";
+ EmitFlags[EmitFlags["NoTokenLeadingSourceMaps"] = 4096] = "NoTokenLeadingSourceMaps";
+ EmitFlags[EmitFlags["NoTokenTrailingSourceMaps"] = 8192] = "NoTokenTrailingSourceMaps";
+ EmitFlags[EmitFlags["NoTokenSourceMaps"] = 12288] = "NoTokenSourceMaps";
+ EmitFlags[EmitFlags["NoLeadingComments"] = 16384] = "NoLeadingComments";
+ EmitFlags[EmitFlags["NoTrailingComments"] = 32768] = "NoTrailingComments";
+ EmitFlags[EmitFlags["NoComments"] = 49152] = "NoComments";
+ EmitFlags[EmitFlags["NoNestedComments"] = 65536] = "NoNestedComments";
+ EmitFlags[EmitFlags["ExportName"] = 131072] = "ExportName";
+ EmitFlags[EmitFlags["LocalName"] = 262144] = "LocalName";
+ EmitFlags[EmitFlags["Indented"] = 524288] = "Indented";
+ EmitFlags[EmitFlags["NoIndentation"] = 1048576] = "NoIndentation";
+ EmitFlags[EmitFlags["AsyncFunctionBody"] = 2097152] = "AsyncFunctionBody";
+ EmitFlags[EmitFlags["ReuseTempVariableScope"] = 4194304] = "ReuseTempVariableScope";
+ EmitFlags[EmitFlags["CustomPrologue"] = 8388608] = "CustomPrologue";
+ })(ts.EmitFlags || (ts.EmitFlags = {}));
+ var EmitFlags = ts.EmitFlags;
+ (function (EmitContext) {
+ EmitContext[EmitContext["SourceFile"] = 0] = "SourceFile";
+ EmitContext[EmitContext["Expression"] = 1] = "Expression";
+ EmitContext[EmitContext["IdentifierName"] = 2] = "IdentifierName";
+ EmitContext[EmitContext["Unspecified"] = 3] = "Unspecified";
+ })(ts.EmitContext || (ts.EmitContext = {}));
+ var EmitContext = ts.EmitContext;
})(ts || (ts = {}));
var ts;
(function (ts) {
@@ -72,7 +933,7 @@ var ts;
(function (performance) {
var profilerEvent = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true
? onProfilerEvent
- : function (markName) { };
+ : function (_markName) { };
var enabled = false;
var profilerStart = 0;
var counts;
@@ -124,7 +985,14 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
+ (function (Ternary) {
+ Ternary[Ternary["False"] = 0] = "False";
+ Ternary[Ternary["Maybe"] = 1] = "Maybe";
+ Ternary[Ternary["True"] = -1] = "True";
+ })(ts.Ternary || (ts.Ternary = {}));
+ var Ternary = ts.Ternary;
var createObject = Object.create;
+ ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined;
function createMap(template) {
var map = createObject(null);
map["__"] = undefined;
@@ -145,7 +1013,7 @@ var ts;
remove: remove,
forEachValue: forEachValueInMap,
getKeys: getKeys,
- clear: clear
+ clear: clear,
};
function forEachValueInMap(f) {
for (var key in files) {
@@ -187,6 +1055,12 @@ var ts;
return getCanonicalFileName(nonCanonicalizedPath);
}
ts.toPath = toPath;
+ (function (Comparison) {
+ Comparison[Comparison["LessThan"] = -1] = "LessThan";
+ Comparison[Comparison["EqualTo"] = 0] = "EqualTo";
+ Comparison[Comparison["GreaterThan"] = 1] = "GreaterThan";
+ })(ts.Comparison || (ts.Comparison = {}));
+ var Comparison = ts.Comparison;
function forEach(array, callback) {
if (array) {
for (var i = 0, len = array.length; i < len; i++) {
@@ -330,13 +1204,32 @@ var ts;
if (array) {
result = [];
for (var i = 0; i < array.length; i++) {
- var v = array[i];
- result.push(f(v, i));
+ result.push(f(array[i], i));
}
}
return result;
}
ts.map = map;
+ function sameMap(array, f) {
+ var result;
+ if (array) {
+ for (var i = 0; i < array.length; i++) {
+ if (result) {
+ result.push(f(array[i], i));
+ }
+ else {
+ var item = array[i];
+ var mapped = f(item, i);
+ if (item !== mapped) {
+ result = array.slice(0, i);
+ result.push(mapped);
+ }
+ }
+ }
+ }
+ return result || array;
+ }
+ ts.sameMap = sameMap;
function flatten(array) {
var result;
if (array) {
@@ -437,6 +1330,18 @@ var ts;
return result;
}
ts.mapObject = mapObject;
+ function some(array, predicate) {
+ if (array) {
+ for (var _i = 0, array_5 = array; _i < array_5.length; _i++) {
+ var v = array_5[_i];
+ if (!predicate || predicate(v)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ ts.some = some;
function concatenate(array1, array2) {
if (!array2 || !array2.length)
return array1;
@@ -449,8 +1354,8 @@ var ts;
var result;
if (array) {
result = [];
- loop: for (var _i = 0, array_5 = array; _i < array_5.length; _i++) {
- var item = array_5[_i];
+ loop: for (var _i = 0, array_6 = array; _i < array_6.length; _i++) {
+ var item = array_6[_i];
for (var _a = 0, result_1 = result; _a < result_1.length; _a++) {
var res = result_1[_a];
if (areEqual ? areEqual(res, item) : res === item) {
@@ -483,8 +1388,8 @@ var ts;
ts.compact = compact;
function sum(array, prop) {
var result = 0;
- for (var _i = 0, array_6 = array; _i < array_6.length; _i++) {
- var v = array_6[_i];
+ for (var _i = 0, array_7 = array; _i < array_7.length; _i++) {
+ var v = array_7[_i];
result += v[prop];
}
return result;
@@ -703,8 +1608,8 @@ var ts;
ts.equalOwnProperties = equalOwnProperties;
function arrayToMap(array, makeKey, makeValue) {
var result = createMap();
- for (var _i = 0, array_7 = array; _i < array_7.length; _i++) {
- var value = array_7[_i];
+ for (var _i = 0, array_8 = array; _i < array_8.length; _i++) {
+ var value = array_8[_i];
result[makeKey(value)] = makeValue ? makeValue(value) : value;
}
return result;
@@ -805,7 +1710,7 @@ var ts;
return function (t) { return compose(a(t)); };
}
else {
- return function (t) { return function (u) { return u; }; };
+ return function (_) { return function (u) { return u; }; };
}
}
ts.chain = chain;
@@ -836,7 +1741,7 @@ var ts;
ts.compose = compose;
function formatStringFromArgs(text, args, baseIndex) {
baseIndex = baseIndex || 0;
- return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; });
+ return text.replace(/{(\d+)}/g, function (_match, index) { return args[+index + baseIndex]; });
}
ts.localizedDiagnosticMessages = undefined;
function getLocaleSpecificMessage(message) {
@@ -861,11 +1766,11 @@ var ts;
length: length,
messageText: text,
category: message.category,
- code: message.code
+ code: message.code,
};
}
ts.createFileDiagnostic = createFileDiagnostic;
- function formatMessage(dummy, message) {
+ function formatMessage(_dummy, message) {
var text = getLocaleSpecificMessage(message);
if (arguments.length > 2) {
text = formatStringFromArgs(text, arguments, 2);
@@ -928,7 +1833,7 @@ var ts;
if (b === undefined)
return 1;
if (ignoreCase) {
- if (String.prototype.localeCompare) {
+ if (ts.collator && String.prototype.localeCompare) {
var result = a.localeCompare(b, undefined, { usage: "sort", sensitivity: "accent" });
return result < 0 ? -1 : result > 0 ? 1 : 0;
}
@@ -1081,7 +1986,7 @@ var ts;
function getEmitModuleKind(compilerOptions) {
return typeof compilerOptions.module === "number" ?
compilerOptions.module :
- getEmitScriptTarget(compilerOptions) === 2 ? ts.ModuleKind.ES6 : ts.ModuleKind.CommonJS;
+ getEmitScriptTarget(compilerOptions) >= 2 ? ts.ModuleKind.ES2015 : ts.ModuleKind.CommonJS;
}
ts.getEmitModuleKind = getEmitModuleKind;
function hasZeroOrOneAsteriskCharacter(str) {
@@ -1378,7 +2283,7 @@ var ts;
function replaceWildcardCharacter(match, singleAsteriskRegexFragment) {
return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match;
}
- function getFileMatcherPatterns(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {
+ function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {
path = normalizePath(path);
currentDirectory = normalizePath(currentDirectory);
var absolutePath = combinePaths(currentDirectory, path);
@@ -1393,7 +2298,7 @@ var ts;
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, getFileSystemEntries) {
path = normalizePath(path);
currentDirectory = normalizePath(currentDirectory);
- var patterns = getFileMatcherPatterns(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
+ var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
var regexFlag = useCaseSensitiveFileNames ? "" : "i";
var includeFileRegex = patterns.includeFilePattern && new RegExp(patterns.includeFilePattern, regexFlag);
var includeDirectoryRegex = patterns.includeDirectoryPattern && new RegExp(patterns.includeDirectoryPattern, regexFlag);
@@ -1503,6 +2408,14 @@ var ts;
return false;
}
ts.isSupportedSourceFileName = isSupportedSourceFileName;
+ (function (ExtensionPriority) {
+ ExtensionPriority[ExtensionPriority["TypeScriptFiles"] = 0] = "TypeScriptFiles";
+ ExtensionPriority[ExtensionPriority["DeclarationAndJavaScriptFiles"] = 2] = "DeclarationAndJavaScriptFiles";
+ ExtensionPriority[ExtensionPriority["Limit"] = 5] = "Limit";
+ ExtensionPriority[ExtensionPriority["Highest"] = 0] = "Highest";
+ ExtensionPriority[ExtensionPriority["Lowest"] = 2] = "Lowest";
+ })(ts.ExtensionPriority || (ts.ExtensionPriority = {}));
+ var ExtensionPriority = ts.ExtensionPriority;
function getExtensionPriority(path, supportedExtensions) {
for (var i = supportedExtensions.length - 1; i >= 0; i--) {
if (fileExtensionIs(path, supportedExtensions[i])) {
@@ -1566,10 +2479,10 @@ var ts;
this.name = name;
this.declarations = undefined;
}
- function Type(checker, flags) {
+ function Type(_checker, flags) {
this.flags = flags;
}
- function Signature(checker) {
+ function Signature() {
}
function Node(kind, pos, end) {
this.id = 0;
@@ -1591,6 +2504,13 @@ var ts;
getTypeConstructor: function () { return Type; },
getSignatureConstructor: function () { return Signature; }
};
+ (function (AssertionLevel) {
+ AssertionLevel[AssertionLevel["None"] = 0] = "None";
+ AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal";
+ AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive";
+ AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive";
+ })(ts.AssertionLevel || (ts.AssertionLevel = {}));
+ var AssertionLevel = ts.AssertionLevel;
var Debug;
(function (Debug) {
Debug.currentAssertionLevel = 0;
@@ -1903,7 +2823,7 @@ var ts;
}
var platform = _os.platform();
var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
- function readFile(fileName, encoding) {
+ function readFile(fileName, _encoding) {
if (!fileExists(fileName)) {
return undefined;
}
@@ -1975,6 +2895,11 @@ var ts;
function readDirectory(path, extensions, excludes, includes) {
return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), getAccessibleFileSystemEntries);
}
+ var FileSystemEntryKind;
+ (function (FileSystemEntryKind) {
+ FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File";
+ FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory";
+ })(FileSystemEntryKind || (FileSystemEntryKind = {}));
function fileSystemEntryExists(path, entryKind) {
try {
var stat = _fs.statSync(path);
@@ -2116,7 +3041,7 @@ var ts;
args: ChakraHost.args,
useCaseSensitiveFileNames: !!ChakraHost.useCaseSensitiveFileNames,
write: ChakraHost.echo,
- readFile: function (path, encoding) {
+ readFile: function (path, _encoding) {
return ChakraHost.readFile(path);
},
writeFile: function (path, data, writeByteOrderMark) {
@@ -2132,9 +3057,9 @@ var ts;
getExecutingFilePath: function () { return ChakraHost.executingFile; },
getCurrentDirectory: function () { return ChakraHost.currentDirectory; },
getDirectories: ChakraHost.getDirectories,
- getEnvironmentVariable: ChakraHost.getEnvironmentVariable || (function (name) { return ""; }),
+ getEnvironmentVariable: ChakraHost.getEnvironmentVariable || (function () { return ""; }),
readDirectory: function (path, extensions, excludes, includes) {
- var pattern = ts.getFileMatcherPatterns(path, extensions, excludes, includes, !!ChakraHost.useCaseSensitiveFileNames, ChakraHost.currentDirectory);
+ var pattern = ts.getFileMatcherPatterns(path, excludes, includes, !!ChakraHost.useCaseSensitiveFileNames, ChakraHost.currentDirectory);
return ChakraHost.readDirectory(path, extensions, pattern.basePaths, pattern.excludePattern, pattern.includeFilePattern, pattern.includeDirectoryPattern);
},
exit: ChakraHost.quit,
@@ -2922,7 +3847,7 @@ var ts;
Binding_element_0_implicitly_has_an_1_type: { code: 7031, category: ts.DiagnosticCategory.Error, key: "Binding_element_0_implicitly_has_an_1_type_7031", message: "Binding element '{0}' implicitly has an '{1}' type." },
Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: { code: 7032, category: ts.DiagnosticCategory.Error, key: "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032", message: "Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation." },
Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: { code: 7033, category: ts.DiagnosticCategory.Error, key: "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033", message: "Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation." },
- Variable_0_implicitly_has_type_any_in_some_locations_where_its_type_cannot_be_determined: { code: 7034, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_type_any_in_some_locations_where_its_type_cannot_be_determined_7034", message: "Variable '{0}' implicitly has type 'any' in some locations where its type cannot be determined." },
+ Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: { code: 7034, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", message: "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined." },
You_cannot_rename_this_element: { code: 8000, category: ts.DiagnosticCategory.Error, key: "You_cannot_rename_this_element_8000", message: "You cannot rename this element." },
You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: ts.DiagnosticCategory.Error, key: "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", message: "You cannot rename elements that are defined in the standard TypeScript library." },
import_can_only_be_used_in_a_ts_file: { code: 8002, category: ts.DiagnosticCategory.Error, key: "import_can_only_be_used_in_a_ts_file_8002", message: "'import ... =' can only be used in a .ts file." },
@@ -2959,139 +3884,139 @@ var ts;
Remove_unused_identifiers: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_unused_identifiers_90004", message: "Remove unused identifiers" },
Implement_interface_on_reference: { code: 90005, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_reference_90005", message: "Implement interface on reference" },
Implement_interface_on_class: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_class_90006", message: "Implement interface on class" },
- Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" }
+ Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" },
};
})(ts || (ts = {}));
var ts;
(function (ts) {
function tokenIsIdentifierOrKeyword(token) {
- return token >= 69;
+ return token >= 70;
}
ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword;
var textToToken = ts.createMap({
- "abstract": 115,
- "any": 117,
- "as": 116,
- "boolean": 120,
- "break": 70,
- "case": 71,
- "catch": 72,
- "class": 73,
- "continue": 75,
- "const": 74,
- "constructor": 121,
- "debugger": 76,
- "declare": 122,
- "default": 77,
- "delete": 78,
- "do": 79,
- "else": 80,
- "enum": 81,
- "export": 82,
- "extends": 83,
- "false": 84,
- "finally": 85,
- "for": 86,
- "from": 136,
- "function": 87,
- "get": 123,
- "if": 88,
- "implements": 106,
- "import": 89,
- "in": 90,
- "instanceof": 91,
- "interface": 107,
- "is": 124,
- "let": 108,
- "module": 125,
- "namespace": 126,
- "never": 127,
- "new": 92,
- "null": 93,
- "number": 130,
- "package": 109,
- "private": 110,
- "protected": 111,
- "public": 112,
- "readonly": 128,
- "require": 129,
- "global": 137,
- "return": 94,
- "set": 131,
- "static": 113,
- "string": 132,
- "super": 95,
- "switch": 96,
- "symbol": 133,
- "this": 97,
- "throw": 98,
- "true": 99,
- "try": 100,
- "type": 134,
- "typeof": 101,
- "undefined": 135,
- "var": 102,
- "void": 103,
- "while": 104,
- "with": 105,
- "yield": 114,
- "async": 118,
- "await": 119,
- "of": 138,
- "{": 15,
- "}": 16,
- "(": 17,
- ")": 18,
- "[": 19,
- "]": 20,
- ".": 21,
- "...": 22,
- ";": 23,
- ",": 24,
- "<": 25,
- ">": 27,
- "<=": 28,
- ">=": 29,
- "==": 30,
- "!=": 31,
- "===": 32,
- "!==": 33,
- "=>": 34,
- "+": 35,
- "-": 36,
- "**": 38,
- "*": 37,
- "/": 39,
- "%": 40,
- "++": 41,
- "--": 42,
- "<<": 43,
- "": 26,
- ">>": 44,
- ">>>": 45,
- "&": 46,
- "|": 47,
- "^": 48,
- "!": 49,
- "~": 50,
- "&&": 51,
- "||": 52,
- "?": 53,
- ":": 54,
- "=": 56,
- "+=": 57,
- "-=": 58,
- "*=": 59,
- "**=": 60,
- "/=": 61,
- "%=": 62,
- "<<=": 63,
- ">>=": 64,
- ">>>=": 65,
- "&=": 66,
- "|=": 67,
- "^=": 68,
- "@": 55
+ "abstract": 116,
+ "any": 118,
+ "as": 117,
+ "boolean": 121,
+ "break": 71,
+ "case": 72,
+ "catch": 73,
+ "class": 74,
+ "continue": 76,
+ "const": 75,
+ "constructor": 122,
+ "debugger": 77,
+ "declare": 123,
+ "default": 78,
+ "delete": 79,
+ "do": 80,
+ "else": 81,
+ "enum": 82,
+ "export": 83,
+ "extends": 84,
+ "false": 85,
+ "finally": 86,
+ "for": 87,
+ "from": 137,
+ "function": 88,
+ "get": 124,
+ "if": 89,
+ "implements": 107,
+ "import": 90,
+ "in": 91,
+ "instanceof": 92,
+ "interface": 108,
+ "is": 125,
+ "let": 109,
+ "module": 126,
+ "namespace": 127,
+ "never": 128,
+ "new": 93,
+ "null": 94,
+ "number": 131,
+ "package": 110,
+ "private": 111,
+ "protected": 112,
+ "public": 113,
+ "readonly": 129,
+ "require": 130,
+ "global": 138,
+ "return": 95,
+ "set": 132,
+ "static": 114,
+ "string": 133,
+ "super": 96,
+ "switch": 97,
+ "symbol": 134,
+ "this": 98,
+ "throw": 99,
+ "true": 100,
+ "try": 101,
+ "type": 135,
+ "typeof": 102,
+ "undefined": 136,
+ "var": 103,
+ "void": 104,
+ "while": 105,
+ "with": 106,
+ "yield": 115,
+ "async": 119,
+ "await": 120,
+ "of": 139,
+ "{": 16,
+ "}": 17,
+ "(": 18,
+ ")": 19,
+ "[": 20,
+ "]": 21,
+ ".": 22,
+ "...": 23,
+ ";": 24,
+ ",": 25,
+ "<": 26,
+ ">": 28,
+ "<=": 29,
+ ">=": 30,
+ "==": 31,
+ "!=": 32,
+ "===": 33,
+ "!==": 34,
+ "=>": 35,
+ "+": 36,
+ "-": 37,
+ "**": 39,
+ "*": 38,
+ "/": 40,
+ "%": 41,
+ "++": 42,
+ "--": 43,
+ "<<": 44,
+ "": 27,
+ ">>": 45,
+ ">>>": 46,
+ "&": 47,
+ "|": 48,
+ "^": 49,
+ "!": 50,
+ "~": 51,
+ "&&": 52,
+ "||": 53,
+ "?": 54,
+ ":": 55,
+ "=": 57,
+ "+=": 58,
+ "-=": 59,
+ "*=": 60,
+ "**=": 61,
+ "/=": 62,
+ "%=": 63,
+ "<<=": 64,
+ ">>=": 65,
+ ">>>=": 66,
+ "&=": 67,
+ "|=": 68,
+ "^=": 69,
+ "@": 56,
});
var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
@@ -3488,7 +4413,7 @@ var ts;
return iterateCommentRanges(true, text, pos, true, cb, state, initial);
}
ts.reduceEachTrailingCommentRange = reduceEachTrailingCommentRange;
- function appendCommentRange(pos, end, kind, hasTrailingNewLine, state, comments) {
+ function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments) {
if (!comments) {
comments = [];
}
@@ -3554,8 +4479,8 @@ var ts;
getTokenValue: function () { return tokenValue; },
hasExtendedUnicodeEscape: function () { return hasExtendedUnicodeEscape; },
hasPrecedingLineBreak: function () { return precedingLineBreak; },
- isIdentifier: function () { return token === 69 || token > 105; },
- isReservedWord: function () { return token >= 70 && token <= 105; },
+ isIdentifier: function () { return token === 70 || token > 106; },
+ isReservedWord: function () { return token >= 71 && token <= 106; },
isUnterminated: function () { return tokenIsUnterminated; },
reScanGreaterToken: reScanGreaterToken,
reScanSlashToken: reScanSlashToken,
@@ -3574,7 +4499,7 @@ var ts;
setTextPos: setTextPos,
tryScan: tryScan,
lookAhead: lookAhead,
- scanRange: scanRange
+ scanRange: scanRange,
};
function error(message, length) {
if (onError) {
@@ -3691,20 +4616,20 @@ var ts;
contents += text.substring(start, pos);
tokenIsUnterminated = true;
error(ts.Diagnostics.Unterminated_template_literal);
- resultingToken = startedWithBacktick ? 11 : 14;
+ resultingToken = startedWithBacktick ? 12 : 15;
break;
}
var currChar = text.charCodeAt(pos);
if (currChar === 96) {
contents += text.substring(start, pos);
pos++;
- resultingToken = startedWithBacktick ? 11 : 14;
+ resultingToken = startedWithBacktick ? 12 : 15;
break;
}
if (currChar === 36 && pos + 1 < end && text.charCodeAt(pos + 1) === 123) {
contents += text.substring(start, pos);
pos += 2;
- resultingToken = startedWithBacktick ? 12 : 13;
+ resultingToken = startedWithBacktick ? 13 : 14;
break;
}
if (currChar === 92) {
@@ -3866,7 +4791,7 @@ var ts;
return token = textToToken[tokenValue];
}
}
- return token = 69;
+ return token = 70;
}
function scanBinaryOrOctalDigits(base) {
ts.Debug.assert(base === 2 || base === 8, "Expected either base 2 or base 8");
@@ -3941,12 +4866,12 @@ var ts;
case 33:
if (text.charCodeAt(pos + 1) === 61) {
if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 33;
+ return pos += 3, token = 34;
}
- return pos += 2, token = 31;
+ return pos += 2, token = 32;
}
pos++;
- return token = 49;
+ return token = 50;
case 34:
case 39:
tokenValue = scanString();
@@ -3955,51 +4880,39 @@ var ts;
return token = scanTemplateAndSetTokenValue();
case 37:
if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 62;
+ return pos += 2, token = 63;
}
pos++;
- return token = 40;
+ return token = 41;
case 38:
if (text.charCodeAt(pos + 1) === 38) {
- return pos += 2, token = 51;
+ return pos += 2, token = 52;
}
if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 66;
+ return pos += 2, token = 67;
}
pos++;
- return token = 46;
+ return token = 47;
case 40:
pos++;
- return token = 17;
+ return token = 18;
case 41:
pos++;
- return token = 18;
+ return token = 19;
case 42:
if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 59;
+ return pos += 2, token = 60;
}
if (text.charCodeAt(pos + 1) === 42) {
if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 60;
+ return pos += 3, token = 61;
}
- return pos += 2, token = 38;
+ return pos += 2, token = 39;
}
pos++;
- return token = 37;
+ return token = 38;
case 43:
if (text.charCodeAt(pos + 1) === 43) {
- return pos += 2, token = 41;
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 57;
- }
- pos++;
- return token = 35;
- case 44:
- pos++;
- return token = 24;
- case 45:
- if (text.charCodeAt(pos + 1) === 45) {
return pos += 2, token = 42;
}
if (text.charCodeAt(pos + 1) === 61) {
@@ -4007,16 +4920,28 @@ var ts;
}
pos++;
return token = 36;
+ case 44:
+ pos++;
+ return token = 25;
+ case 45:
+ if (text.charCodeAt(pos + 1) === 45) {
+ return pos += 2, token = 43;
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 59;
+ }
+ pos++;
+ return token = 37;
case 46:
if (isDigit(text.charCodeAt(pos + 1))) {
tokenValue = scanNumber();
return token = 8;
}
if (text.charCodeAt(pos + 1) === 46 && text.charCodeAt(pos + 2) === 46) {
- return pos += 3, token = 22;
+ return pos += 3, token = 23;
}
pos++;
- return token = 21;
+ return token = 22;
case 47:
if (text.charCodeAt(pos + 1) === 47) {
pos += 2;
@@ -4060,10 +4985,10 @@ var ts;
}
}
if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 61;
+ return pos += 2, token = 62;
}
pos++;
- return token = 39;
+ return token = 40;
case 48:
if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) {
pos += 2;
@@ -4112,10 +5037,10 @@ var ts;
return token = 8;
case 58:
pos++;
- return token = 54;
+ return token = 55;
case 59:
pos++;
- return token = 23;
+ return token = 24;
case 60:
if (isConflictMarkerTrivia(text, pos)) {
pos = scanConflictMarkerTrivia(text, pos, error);
@@ -4128,20 +5053,20 @@ var ts;
}
if (text.charCodeAt(pos + 1) === 60) {
if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 63;
+ return pos += 3, token = 64;
}
- return pos += 2, token = 43;
+ return pos += 2, token = 44;
}
if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 28;
+ return pos += 2, token = 29;
}
if (languageVariant === 1 &&
text.charCodeAt(pos + 1) === 47 &&
text.charCodeAt(pos + 2) !== 42) {
- return pos += 2, token = 26;
+ return pos += 2, token = 27;
}
pos++;
- return token = 25;
+ return token = 26;
case 61:
if (isConflictMarkerTrivia(text, pos)) {
pos = scanConflictMarkerTrivia(text, pos, error);
@@ -4154,15 +5079,15 @@ var ts;
}
if (text.charCodeAt(pos + 1) === 61) {
if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 32;
+ return pos += 3, token = 33;
}
- return pos += 2, token = 30;
+ return pos += 2, token = 31;
}
if (text.charCodeAt(pos + 1) === 62) {
- return pos += 2, token = 34;
+ return pos += 2, token = 35;
}
pos++;
- return token = 56;
+ return token = 57;
case 62:
if (isConflictMarkerTrivia(text, pos)) {
pos = scanConflictMarkerTrivia(text, pos, error);
@@ -4174,43 +5099,43 @@ var ts;
}
}
pos++;
- return token = 27;
+ return token = 28;
case 63:
pos++;
- return token = 53;
+ return token = 54;
case 91:
pos++;
- return token = 19;
+ return token = 20;
case 93:
pos++;
- return token = 20;
+ return token = 21;
case 94:
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 69;
+ }
+ pos++;
+ return token = 49;
+ case 123:
+ pos++;
+ return token = 16;
+ case 124:
+ if (text.charCodeAt(pos + 1) === 124) {
+ return pos += 2, token = 53;
+ }
if (text.charCodeAt(pos + 1) === 61) {
return pos += 2, token = 68;
}
pos++;
return token = 48;
- case 123:
- pos++;
- return token = 15;
- case 124:
- if (text.charCodeAt(pos + 1) === 124) {
- return pos += 2, token = 52;
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 67;
- }
- pos++;
- return token = 47;
case 125:
pos++;
- return token = 16;
+ return token = 17;
case 126:
pos++;
- return token = 50;
+ return token = 51;
case 64:
pos++;
- return token = 55;
+ return token = 56;
case 92:
var cookedChar = peekUnicodeEscape();
if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) {
@@ -4248,29 +5173,29 @@ var ts;
}
}
function reScanGreaterToken() {
- if (token === 27) {
+ if (token === 28) {
if (text.charCodeAt(pos) === 62) {
if (text.charCodeAt(pos + 1) === 62) {
if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 65;
+ return pos += 3, token = 66;
}
- return pos += 2, token = 45;
+ return pos += 2, token = 46;
}
if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 64;
+ return pos += 2, token = 65;
}
pos++;
- return token = 44;
+ return token = 45;
}
if (text.charCodeAt(pos) === 61) {
pos++;
- return token = 29;
+ return token = 30;
}
}
return token;
}
function reScanSlashToken() {
- if (token === 39 || token === 61) {
+ if (token === 40 || token === 62) {
var p = tokenPos + 1;
var inEscape = false;
var inCharacterClass = false;
@@ -4309,12 +5234,12 @@ var ts;
}
pos = p;
tokenValue = text.substring(tokenPos, pos);
- token = 10;
+ token = 11;
}
return token;
}
function reScanTemplateToken() {
- ts.Debug.assert(token === 16, "'reScanTemplateToken' should only be called on a '}'");
+ ts.Debug.assert(token === 17, "'reScanTemplateToken' should only be called on a '}'");
pos = tokenPos;
return token = scanTemplateAndSetTokenValue();
}
@@ -4331,14 +5256,14 @@ var ts;
if (char === 60) {
if (text.charCodeAt(pos + 1) === 47) {
pos += 2;
- return token = 26;
+ return token = 27;
}
pos++;
- return token = 25;
+ return token = 26;
}
if (char === 123) {
pos++;
- return token = 15;
+ return token = 16;
}
while (pos < end) {
pos++;
@@ -4347,7 +5272,7 @@ var ts;
break;
}
}
- return token = 244;
+ return token = 10;
}
function scanJsxIdentifier() {
if (tokenIsIdentifierOrKeyword(token)) {
@@ -4394,39 +5319,39 @@ var ts;
return token = 5;
case 64:
pos++;
- return token = 55;
+ return token = 56;
case 10:
case 13:
pos++;
return token = 4;
case 42:
pos++;
- return token = 37;
+ return token = 38;
case 123:
pos++;
- return token = 15;
+ return token = 16;
case 125:
pos++;
- return token = 16;
+ return token = 17;
case 91:
pos++;
- return token = 19;
+ return token = 20;
case 93:
pos++;
- return token = 20;
+ return token = 21;
case 61:
pos++;
- return token = 56;
+ return token = 57;
case 44:
pos++;
- return token = 24;
+ return token = 25;
}
- if (isIdentifierStart(ch, 2)) {
+ if (isIdentifierStart(ch, 4)) {
pos++;
- while (isIdentifierPart(text.charCodeAt(pos), 2) && pos < end) {
+ while (isIdentifierPart(text.charCodeAt(pos), 4) && pos < end) {
pos++;
}
- return token = 69;
+ return token = 70;
}
else {
return pos += 1, token = 0;
@@ -4647,11 +5572,11 @@ var ts;
ts.getSourceFileOfNode = getSourceFileOfNode;
function isStatementWithLocals(node) {
switch (node.kind) {
- case 199:
- case 227:
- case 206:
+ case 200:
+ case 228:
case 207:
case 208:
+ case 209:
return true;
}
return false;
@@ -4772,13 +5697,13 @@ var ts;
switch (node.kind) {
case 9:
return getQuotedEscapedLiteralText('"', node.text, '"');
- case 11:
- return getQuotedEscapedLiteralText("`", node.text, "`");
case 12:
- return getQuotedEscapedLiteralText("`", node.text, "${");
+ return getQuotedEscapedLiteralText("`", node.text, "`");
case 13:
- return getQuotedEscapedLiteralText("}", node.text, "${");
+ return getQuotedEscapedLiteralText("`", node.text, "${");
case 14:
+ return getQuotedEscapedLiteralText("}", node.text, "${");
+ case 15:
return getQuotedEscapedLiteralText("}", node.text, "`");
case 8:
return node.text;
@@ -4820,7 +5745,7 @@ var ts;
}
ts.isBlockOrCatchScoped = isBlockOrCatchScoped;
function isAmbientModule(node) {
- return node && node.kind === 225 &&
+ return node && node.kind === 226 &&
(node.name.kind === 9 || isGlobalScopeAugmentation(node));
}
ts.isAmbientModule = isAmbientModule;
@@ -4829,11 +5754,11 @@ var ts;
}
ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;
function isShorthandAmbientModule(node) {
- return node.kind === 225 && (!node.body);
+ return node.kind === 226 && (!node.body);
}
function isBlockScopedContainerTopLevel(node) {
return node.kind === 256 ||
- node.kind === 225 ||
+ node.kind === 226 ||
isFunctionLike(node);
}
ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel;
@@ -4848,7 +5773,7 @@ var ts;
switch (node.parent.kind) {
case 256:
return ts.isExternalModule(node.parent);
- case 226:
+ case 227:
return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent);
}
return false;
@@ -4857,21 +5782,21 @@ var ts;
function isBlockScope(node, parentNode) {
switch (node.kind) {
case 256:
- case 227:
+ case 228:
case 252:
- case 225:
- case 206:
+ case 226:
case 207:
case 208:
- case 148:
- case 147:
+ case 209:
case 149:
+ case 148:
case 150:
- case 220:
- case 179:
+ case 151:
+ case 221:
case 180:
+ case 181:
return true;
- case 199:
+ case 200:
return parentNode && !isFunctionLike(parentNode);
}
return false;
@@ -4889,7 +5814,7 @@ var ts;
ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer;
function isCatchClauseVariableDeclaration(declaration) {
return declaration &&
- declaration.kind === 218 &&
+ declaration.kind === 219 &&
declaration.parent &&
declaration.parent.kind === 252;
}
@@ -4926,7 +5851,7 @@ var ts;
ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition;
function getErrorSpanForArrowFunction(sourceFile, node) {
var pos = ts.skipTrivia(sourceFile.text, node.pos);
- if (node.body && node.body.kind === 199) {
+ if (node.body && node.body.kind === 200) {
var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line;
var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line;
if (startLine < endLine) {
@@ -4944,23 +5869,23 @@ var ts;
return ts.createTextSpan(0, 0);
}
return getSpanOfTokenAtPosition(sourceFile, pos_1);
- case 218:
- case 169:
- case 221:
- case 192:
+ case 219:
+ case 170:
case 222:
- case 225:
- case 224:
- case 255:
- case 220:
- case 179:
- case 147:
- case 149:
- case 150:
+ case 193:
case 223:
+ case 226:
+ case 225:
+ case 255:
+ case 221:
+ case 180:
+ case 148:
+ case 150:
+ case 151:
+ case 224:
errorNode = node.name;
break;
- case 180:
+ case 181:
return getErrorSpanForArrowFunction(sourceFile, node);
}
if (errorNode === undefined) {
@@ -4981,7 +5906,7 @@ var ts;
}
ts.isDeclarationFile = isDeclarationFile;
function isConstEnumDeclaration(node) {
- return node.kind === 224 && isConst(node);
+ return node.kind === 225 && isConst(node);
}
ts.isConstEnumDeclaration = isConstEnumDeclaration;
function isConst(node) {
@@ -4994,11 +5919,11 @@ var ts;
}
ts.isLet = isLet;
function isSuperCall(n) {
- return n.kind === 174 && n.expression.kind === 95;
+ return n.kind === 175 && n.expression.kind === 96;
}
ts.isSuperCall = isSuperCall;
function isPrologueDirective(node) {
- return node.kind === 202 && node.expression.kind === 9;
+ return node.kind === 203 && node.expression.kind === 9;
}
ts.isPrologueDirective = isPrologueDirective;
function getLeadingCommentRangesOfNode(node, sourceFileOfNode) {
@@ -5014,10 +5939,10 @@ var ts;
}
ts.getJsDocComments = getJsDocComments;
function getJsDocCommentsFromText(node, text) {
- var commentRanges = (node.kind === 142 ||
- node.kind === 141 ||
- node.kind === 179 ||
- node.kind === 180) ?
+ var commentRanges = (node.kind === 143 ||
+ node.kind === 142 ||
+ node.kind === 180 ||
+ node.kind === 181) ?
ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
getLeadingCommentRangesOfNodeFromText(node, text);
return ts.filter(commentRanges, isJsDocComment);
@@ -5032,69 +5957,69 @@ var ts;
ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/;
ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/;
function isPartOfTypeNode(node) {
- if (154 <= node.kind && node.kind <= 166) {
+ if (155 <= node.kind && node.kind <= 167) {
return true;
}
switch (node.kind) {
- case 117:
- case 130:
- case 132:
- case 120:
+ case 118:
+ case 131:
case 133:
- case 135:
- case 127:
+ case 121:
+ case 134:
+ case 136:
+ case 128:
return true;
- case 103:
- return node.parent.kind !== 183;
- case 194:
+ case 104:
+ return node.parent.kind !== 184;
+ case 195:
return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
- case 69:
- if (node.parent.kind === 139 && node.parent.right === node) {
+ case 70:
+ if (node.parent.kind === 140 && node.parent.right === node) {
node = node.parent;
}
- else if (node.parent.kind === 172 && node.parent.name === node) {
+ else if (node.parent.kind === 173 && node.parent.name === node) {
node = node.parent;
}
- ts.Debug.assert(node.kind === 69 || node.kind === 139 || node.kind === 172, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
- case 139:
- case 172:
- case 97:
+ ts.Debug.assert(node.kind === 70 || node.kind === 140 || node.kind === 173, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
+ case 140:
+ case 173:
+ case 98:
var parent_1 = node.parent;
- if (parent_1.kind === 158) {
+ if (parent_1.kind === 159) {
return false;
}
- if (154 <= parent_1.kind && parent_1.kind <= 166) {
+ if (155 <= parent_1.kind && parent_1.kind <= 167) {
return true;
}
switch (parent_1.kind) {
- case 194:
+ case 195:
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1);
- case 141:
- return node === parent_1.constraint;
- case 145:
- case 144:
case 142:
- case 218:
+ return node === parent_1.constraint;
+ case 146:
+ case 145:
+ case 143:
+ case 219:
return node === parent_1.type;
- case 220:
- case 179:
+ case 221:
case 180:
+ case 181:
+ case 149:
case 148:
case 147:
- case 146:
- case 149:
case 150:
- return node === parent_1.type;
case 151:
+ return node === parent_1.type;
case 152:
case 153:
+ case 154:
return node === parent_1.type;
- case 177:
+ case 178:
return node === parent_1.type;
- case 174:
case 175:
- return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0;
case 176:
+ return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0;
+ case 177:
return false;
}
}
@@ -5105,22 +6030,22 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 211:
+ case 212:
return visitor(node);
- case 227:
- case 199:
- case 203:
+ case 228:
+ case 200:
case 204:
case 205:
case 206:
case 207:
case 208:
- case 212:
+ case 209:
case 213:
+ case 214:
case 249:
case 250:
- case 214:
- case 216:
+ case 215:
+ case 217:
case 252:
return ts.forEachChild(node, traverse);
}
@@ -5131,23 +6056,23 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 190:
+ case 191:
visitor(node);
var operand = node.expression;
if (operand) {
traverse(operand);
}
- case 224:
- case 222:
case 225:
case 223:
- case 221:
- case 192:
+ case 226:
+ case 224:
+ case 222:
+ case 193:
return;
default:
if (isFunctionLike(node)) {
var name_5 = node.name;
- if (name_5 && name_5.kind === 140) {
+ if (name_5 && name_5.kind === 141) {
traverse(name_5.expression);
return;
}
@@ -5162,14 +6087,14 @@ var ts;
function isVariableLike(node) {
if (node) {
switch (node.kind) {
- case 169:
+ case 170:
case 255:
- case 142:
+ case 143:
case 253:
+ case 146:
case 145:
- case 144:
case 254:
- case 218:
+ case 219:
return true;
}
}
@@ -5177,11 +6102,11 @@ var ts;
}
ts.isVariableLike = isVariableLike;
function isAccessor(node) {
- return node && (node.kind === 149 || node.kind === 150);
+ return node && (node.kind === 150 || node.kind === 151);
}
ts.isAccessor = isAccessor;
function isClassLike(node) {
- return node && (node.kind === 221 || node.kind === 192);
+ return node && (node.kind === 222 || node.kind === 193);
}
ts.isClassLike = isClassLike;
function isFunctionLike(node) {
@@ -5190,19 +6115,19 @@ var ts;
ts.isFunctionLike = isFunctionLike;
function isFunctionLikeKind(kind) {
switch (kind) {
- case 148:
- case 179:
- case 220:
- case 180:
- case 147:
- case 146:
case 149:
+ case 180:
+ case 221:
+ case 181:
+ case 148:
+ case 147:
case 150:
case 151:
case 152:
case 153:
- case 156:
+ case 154:
case 157:
+ case 158:
return true;
}
return false;
@@ -5210,13 +6135,13 @@ var ts;
ts.isFunctionLikeKind = isFunctionLikeKind;
function introducesArgumentsExoticObject(node) {
switch (node.kind) {
- case 147:
- case 146:
case 148:
+ case 147:
case 149:
case 150:
- case 220:
- case 179:
+ case 151:
+ case 221:
+ case 180:
return true;
}
return false;
@@ -5224,30 +6149,30 @@ var ts;
ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject;
function isIterationStatement(node, lookInLabeledStatements) {
switch (node.kind) {
- case 206:
case 207:
case 208:
- case 204:
+ case 209:
case 205:
+ case 206:
return true;
- case 214:
+ case 215:
return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements);
}
return false;
}
ts.isIterationStatement = isIterationStatement;
function isFunctionBlock(node) {
- return node && node.kind === 199 && isFunctionLike(node.parent);
+ return node && node.kind === 200 && isFunctionLike(node.parent);
}
ts.isFunctionBlock = isFunctionBlock;
function isObjectLiteralMethod(node) {
- return node && node.kind === 147 && node.parent.kind === 171;
+ return node && node.kind === 148 && node.parent.kind === 172;
}
ts.isObjectLiteralMethod = isObjectLiteralMethod;
function isObjectLiteralOrClassExpressionMethod(node) {
- return node.kind === 147 &&
- (node.parent.kind === 171 ||
- node.parent.kind === 192);
+ return node.kind === 148 &&
+ (node.parent.kind === 172 ||
+ node.parent.kind === 193);
}
ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod;
function isIdentifierTypePredicate(predicate) {
@@ -5283,38 +6208,38 @@ var ts;
return undefined;
}
switch (node.kind) {
- case 140:
+ case 141:
if (isClassLike(node.parent.parent)) {
return node;
}
node = node.parent;
break;
- case 143:
- if (node.parent.kind === 142 && isClassElement(node.parent.parent)) {
+ case 144:
+ if (node.parent.kind === 143 && isClassElement(node.parent.parent)) {
node = node.parent.parent;
}
else if (isClassElement(node.parent)) {
node = node.parent;
}
break;
- case 180:
+ case 181:
if (!includeArrowFunctions) {
continue;
}
- case 220:
- case 179:
- case 225:
- case 145:
- case 144:
- case 147:
+ case 221:
+ case 180:
+ case 226:
case 146:
+ case 145:
case 148:
+ case 147:
case 149:
case 150:
case 151:
case 152:
case 153:
- case 224:
+ case 154:
+ case 225:
case 256:
return node;
}
@@ -5328,25 +6253,25 @@ var ts;
return node;
}
switch (node.kind) {
- case 140:
+ case 141:
node = node.parent;
break;
- case 220:
- case 179:
+ case 221:
case 180:
+ case 181:
if (!stopOnFunctions) {
continue;
}
- case 145:
- case 144:
- case 147:
case 146:
+ case 145:
case 148:
+ case 147:
case 149:
case 150:
+ case 151:
return node;
- case 143:
- if (node.parent.kind === 142 && isClassElement(node.parent.parent)) {
+ case 144:
+ if (node.parent.kind === 143 && isClassElement(node.parent.parent)) {
node = node.parent.parent;
}
else if (isClassElement(node.parent)) {
@@ -5358,14 +6283,14 @@ var ts;
}
ts.getSuperContainer = getSuperContainer;
function getImmediatelyInvokedFunctionExpression(func) {
- if (func.kind === 179 || func.kind === 180) {
+ if (func.kind === 180 || func.kind === 181) {
var prev = func;
var parent_2 = func.parent;
- while (parent_2.kind === 178) {
+ while (parent_2.kind === 179) {
prev = parent_2;
parent_2 = parent_2.parent;
}
- if (parent_2.kind === 174 && parent_2.expression === prev) {
+ if (parent_2.kind === 175 && parent_2.expression === prev) {
return parent_2;
}
}
@@ -5373,20 +6298,20 @@ var ts;
ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression;
function isSuperProperty(node) {
var kind = node.kind;
- return (kind === 172 || kind === 173)
- && node.expression.kind === 95;
+ return (kind === 173 || kind === 174)
+ && node.expression.kind === 96;
}
ts.isSuperProperty = isSuperProperty;
function getEntityNameFromTypeNode(node) {
if (node) {
switch (node.kind) {
- case 155:
+ case 156:
return node.typeName;
- case 194:
+ case 195:
ts.Debug.assert(isEntityNameExpression(node.expression));
return node.expression;
- case 69:
- case 139:
+ case 70:
+ case 140:
return node;
}
}
@@ -5395,10 +6320,10 @@ var ts;
ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode;
function isCallLikeExpression(node) {
switch (node.kind) {
- case 174:
case 175:
case 176:
- case 143:
+ case 177:
+ case 144:
return true;
default:
return false;
@@ -5406,7 +6331,7 @@ var ts;
}
ts.isCallLikeExpression = isCallLikeExpression;
function getInvokedExpression(node) {
- if (node.kind === 176) {
+ if (node.kind === 177) {
return node.tag;
}
return node.expression;
@@ -5414,21 +6339,21 @@ var ts;
ts.getInvokedExpression = getInvokedExpression;
function nodeCanBeDecorated(node) {
switch (node.kind) {
- case 221:
+ case 222:
return true;
- case 145:
- return node.parent.kind === 221;
- case 149:
+ case 146:
+ return node.parent.kind === 222;
case 150:
- case 147:
+ case 151:
+ case 148:
return node.body !== undefined
- && node.parent.kind === 221;
- case 142:
+ && node.parent.kind === 222;
+ case 143:
return node.parent.body !== undefined
- && (node.parent.kind === 148
- || node.parent.kind === 147
- || node.parent.kind === 150)
- && node.parent.parent.kind === 221;
+ && (node.parent.kind === 149
+ || node.parent.kind === 148
+ || node.parent.kind === 151)
+ && node.parent.parent.kind === 222;
}
return false;
}
@@ -5444,18 +6369,18 @@ var ts;
ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated;
function childIsDecorated(node) {
switch (node.kind) {
- case 221:
+ case 222:
return ts.forEach(node.members, nodeOrChildIsDecorated);
- case 147:
- case 150:
+ case 148:
+ case 151:
return ts.forEach(node.parameters, nodeIsDecorated);
}
}
ts.childIsDecorated = childIsDecorated;
function isJSXTagName(node) {
var parent = node.parent;
- if (parent.kind === 243 ||
- parent.kind === 242 ||
+ if (parent.kind === 244 ||
+ parent.kind === 243 ||
parent.kind === 245) {
return parent.tagName === node;
}
@@ -5464,97 +6389,97 @@ var ts;
ts.isJSXTagName = isJSXTagName;
function isPartOfExpression(node) {
switch (node.kind) {
- case 97:
- case 95:
- case 93:
- case 99:
- case 84:
- case 10:
- case 170:
+ case 98:
+ case 96:
+ case 94:
+ case 100:
+ case 85:
+ case 11:
case 171:
case 172:
case 173:
case 174:
case 175:
case 176:
- case 195:
case 177:
case 196:
case 178:
+ case 197:
case 179:
- case 192:
case 180:
- case 183:
+ case 193:
case 181:
+ case 184:
case 182:
- case 185:
+ case 183:
case 186:
case 187:
case 188:
- case 191:
case 189:
- case 11:
- case 193:
- case 241:
- case 242:
+ case 192:
case 190:
- case 184:
+ case 12:
+ case 194:
+ case 242:
+ case 243:
+ case 191:
+ case 185:
return true;
- case 139:
- while (node.parent.kind === 139) {
+ case 140:
+ while (node.parent.kind === 140) {
node = node.parent;
}
- return node.parent.kind === 158 || isJSXTagName(node);
- case 69:
- if (node.parent.kind === 158 || isJSXTagName(node)) {
+ return node.parent.kind === 159 || isJSXTagName(node);
+ case 70:
+ if (node.parent.kind === 159 || isJSXTagName(node)) {
return true;
}
case 8:
case 9:
- case 97:
+ case 98:
var parent_3 = node.parent;
switch (parent_3.kind) {
- case 218:
- case 142:
+ case 219:
+ case 143:
+ case 146:
case 145:
- case 144:
case 255:
case 253:
- case 169:
+ case 170:
return parent_3.initializer === node;
- case 202:
case 203:
case 204:
case 205:
- case 211:
+ case 206:
case 212:
case 213:
+ case 214:
case 249:
- case 215:
- case 213:
+ case 216:
+ case 214:
return parent_3.expression === node;
- case 206:
+ case 207:
var forStatement = parent_3;
- return (forStatement.initializer === node && forStatement.initializer.kind !== 219) ||
+ return (forStatement.initializer === node && forStatement.initializer.kind !== 220) ||
forStatement.condition === node ||
forStatement.incrementor === node;
- case 207:
case 208:
+ case 209:
var forInStatement = parent_3;
- return (forInStatement.initializer === node && forInStatement.initializer.kind !== 219) ||
+ return (forInStatement.initializer === node && forInStatement.initializer.kind !== 220) ||
forInStatement.expression === node;
- case 177:
- case 195:
+ case 178:
+ case 196:
return node === parent_3.expression;
- case 197:
+ case 198:
return node === parent_3.expression;
- case 140:
+ case 141:
return node === parent_3.expression;
- case 143:
+ case 144:
case 248:
case 247:
return true;
- case 194:
+ case 195:
return parent_3.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_3);
default:
if (isPartOfExpression(parent_3)) {
@@ -5572,7 +6497,7 @@ var ts;
}
ts.isInstantiatedModule = isInstantiatedModule;
function isExternalModuleImportEqualsDeclaration(node) {
- return node.kind === 229 && node.moduleReference.kind === 240;
+ return node.kind === 230 && node.moduleReference.kind === 241;
}
ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration;
function getExternalModuleImportEqualsDeclarationExpression(node) {
@@ -5581,7 +6506,7 @@ var ts;
}
ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
function isInternalModuleImportEqualsDeclaration(node) {
- return node.kind === 229 && node.moduleReference.kind !== 240;
+ return node.kind === 230 && node.moduleReference.kind !== 241;
}
ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration;
function isSourceFileJavaScript(file) {
@@ -5593,8 +6518,8 @@ var ts;
}
ts.isInJavaScriptFile = isInJavaScriptFile;
function isRequireCall(expression, checkArgumentIsStringLiteral) {
- var isRequire = expression.kind === 174 &&
- expression.expression.kind === 69 &&
+ var isRequire = expression.kind === 175 &&
+ expression.expression.kind === 70 &&
expression.expression.text === "require" &&
expression.arguments.length === 1;
return isRequire && (!checkArgumentIsStringLiteral || expression.arguments[0].kind === 9);
@@ -5605,9 +6530,9 @@ var ts;
}
ts.isSingleOrDoubleQuote = isSingleOrDoubleQuote;
function isDeclarationOfFunctionExpression(s) {
- if (s.valueDeclaration && s.valueDeclaration.kind === 218) {
+ if (s.valueDeclaration && s.valueDeclaration.kind === 219) {
var declaration = s.valueDeclaration;
- return declaration.initializer && declaration.initializer.kind === 179;
+ return declaration.initializer && declaration.initializer.kind === 180;
}
return false;
}
@@ -5616,15 +6541,15 @@ var ts;
if (!isInJavaScriptFile(expression)) {
return 0;
}
- if (expression.kind !== 187) {
+ if (expression.kind !== 188) {
return 0;
}
var expr = expression;
- if (expr.operatorToken.kind !== 56 || expr.left.kind !== 172) {
+ if (expr.operatorToken.kind !== 57 || expr.left.kind !== 173) {
return 0;
}
var lhs = expr.left;
- if (lhs.expression.kind === 69) {
+ if (lhs.expression.kind === 70) {
var lhsId = lhs.expression;
if (lhsId.text === "exports") {
return 1;
@@ -5633,12 +6558,12 @@ var ts;
return 2;
}
}
- else if (lhs.expression.kind === 97) {
+ else if (lhs.expression.kind === 98) {
return 4;
}
- else if (lhs.expression.kind === 172) {
+ else if (lhs.expression.kind === 173) {
var innerPropertyAccess = lhs.expression;
- if (innerPropertyAccess.expression.kind === 69) {
+ if (innerPropertyAccess.expression.kind === 70) {
var innerPropertyAccessIdentifier = innerPropertyAccess.expression;
if (innerPropertyAccessIdentifier.text === "module" && innerPropertyAccess.name.text === "exports") {
return 1;
@@ -5652,35 +6577,35 @@ var ts;
}
ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind;
function getExternalModuleName(node) {
- if (node.kind === 230) {
+ if (node.kind === 231) {
return node.moduleSpecifier;
}
- if (node.kind === 229) {
+ if (node.kind === 230) {
var reference = node.moduleReference;
- if (reference.kind === 240) {
+ if (reference.kind === 241) {
return reference.expression;
}
}
- if (node.kind === 236) {
+ if (node.kind === 237) {
return node.moduleSpecifier;
}
- if (node.kind === 225 && node.name.kind === 9) {
+ if (node.kind === 226 && node.name.kind === 9) {
return node.name;
}
}
ts.getExternalModuleName = getExternalModuleName;
function getNamespaceDeclarationNode(node) {
- if (node.kind === 229) {
+ if (node.kind === 230) {
return node;
}
var importClause = node.importClause;
- if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 232) {
+ if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 233) {
return importClause.namedBindings;
}
}
ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode;
function isDefaultImport(node) {
- return node.kind === 230
+ return node.kind === 231
&& node.importClause
&& !!node.importClause.name;
}
@@ -5688,13 +6613,13 @@ var ts;
function hasQuestionToken(node) {
if (node) {
switch (node.kind) {
- case 142:
+ case 143:
+ case 148:
case 147:
- case 146:
case 254:
case 253:
+ case 146:
case 145:
- case 144:
return node.questionToken !== undefined;
}
}
@@ -5755,24 +6680,24 @@ var ts;
if (checkParentVariableStatement) {
var isInitializerOfVariableDeclarationInStatement = isVariableLike(node.parent) &&
(node.parent).initializer === node &&
- node.parent.parent.parent.kind === 200;
+ node.parent.parent.parent.kind === 201;
var isVariableOfVariableDeclarationStatement = isVariableLike(node) &&
- node.parent.parent.kind === 200;
+ node.parent.parent.kind === 201;
var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? node.parent.parent.parent :
isVariableOfVariableDeclarationStatement ? node.parent.parent :
undefined;
if (variableStatementNode) {
result = append(result, getJSDocs(variableStatementNode, checkParentVariableStatement, getDocs, getTags));
}
- if (node.kind === 225 &&
- node.parent && node.parent.kind === 225) {
+ if (node.kind === 226 &&
+ node.parent && node.parent.kind === 226) {
result = append(result, getJSDocs(node.parent, checkParentVariableStatement, getDocs, getTags));
}
var parent_4 = node.parent;
var isSourceOfAssignmentExpressionStatement = parent_4 && parent_4.parent &&
- parent_4.kind === 187 &&
- parent_4.operatorToken.kind === 56 &&
- parent_4.parent.kind === 202;
+ parent_4.kind === 188 &&
+ parent_4.operatorToken.kind === 57 &&
+ parent_4.parent.kind === 203;
if (isSourceOfAssignmentExpressionStatement) {
result = append(result, getJSDocs(parent_4.parent, checkParentVariableStatement, getDocs, getTags));
}
@@ -5780,7 +6705,7 @@ var ts;
if (isPropertyAssignmentExpression) {
result = append(result, getJSDocs(parent_4, checkParentVariableStatement, getDocs, getTags));
}
- if (node.kind === 142) {
+ if (node.kind === 143) {
var paramTags = getJSDocParameterTag(node, checkParentVariableStatement);
if (paramTags) {
result = append(result, getTags(paramTags));
@@ -5810,7 +6735,7 @@ var ts;
return [paramTags[i]];
}
}
- else if (param.name.kind === 69) {
+ else if (param.name.kind === 70) {
var name_6 = param.name.text;
var paramTags = ts.filter(tags, function (tag) { return tag.kind === 275 && tag.parameterName.text === name_6; });
if (paramTags) {
@@ -5834,7 +6759,7 @@ var ts;
}
ts.getJSDocTemplateTag = getJSDocTemplateTag;
function getCorrespondingJSDocParameterTag(parameter) {
- if (parameter.name && parameter.name.kind === 69) {
+ if (parameter.name && parameter.name.kind === 70) {
var parameterName = parameter.name.text;
var jsDocTags = getJSDocTags(parameter.parent, true);
if (!jsDocTags) {
@@ -5879,12 +6804,12 @@ var ts;
}
ts.isDeclaredRestParam = isDeclaredRestParam;
function isAssignmentTarget(node) {
- while (node.parent.kind === 178) {
+ while (node.parent.kind === 179) {
node = node.parent;
}
while (true) {
var parent_5 = node.parent;
- if (parent_5.kind === 170 || parent_5.kind === 191) {
+ if (parent_5.kind === 171 || parent_5.kind === 192) {
node = parent_5;
continue;
}
@@ -5892,10 +6817,10 @@ var ts;
node = parent_5.parent;
continue;
}
- return parent_5.kind === 187 &&
+ return parent_5.kind === 188 &&
isAssignmentOperator(parent_5.operatorToken.kind) &&
parent_5.left === node ||
- (parent_5.kind === 207 || parent_5.kind === 208) &&
+ (parent_5.kind === 208 || parent_5.kind === 209) &&
parent_5.initializer === node;
}
}
@@ -5920,11 +6845,11 @@ var ts;
}
ts.isInAmbientContext = isInAmbientContext;
function isDeclarationName(name) {
- if (name.kind !== 69 && name.kind !== 9 && name.kind !== 8) {
+ if (name.kind !== 70 && name.kind !== 9 && name.kind !== 8) {
return false;
}
var parent = name.parent;
- if (parent.kind === 234 || parent.kind === 238) {
+ if (parent.kind === 235 || parent.kind === 239) {
if (parent.propertyName) {
return true;
}
@@ -5937,48 +6862,48 @@ var ts;
ts.isDeclarationName = isDeclarationName;
function isLiteralComputedPropertyDeclarationName(node) {
return (node.kind === 9 || node.kind === 8) &&
- node.parent.kind === 140 &&
+ node.parent.kind === 141 &&
isDeclaration(node.parent.parent);
}
ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName;
function isIdentifierName(node) {
var parent = node.parent;
switch (parent.kind) {
- case 145:
- case 144:
- case 147:
case 146:
- case 149:
+ case 145:
+ case 148:
+ case 147:
case 150:
+ case 151:
case 255:
case 253:
- case 172:
+ case 173:
return parent.name === node;
- case 139:
+ case 140:
if (parent.right === node) {
- while (parent.kind === 139) {
+ while (parent.kind === 140) {
parent = parent.parent;
}
- return parent.kind === 158;
+ return parent.kind === 159;
}
return false;
- case 169:
- case 234:
+ case 170:
+ case 235:
return parent.propertyName === node;
- case 238:
+ case 239:
return true;
}
return false;
}
ts.isIdentifierName = isIdentifierName;
function isAliasSymbolDeclaration(node) {
- return node.kind === 229 ||
- node.kind === 228 ||
- node.kind === 231 && !!node.name ||
- node.kind === 232 ||
- node.kind === 234 ||
- node.kind === 238 ||
- node.kind === 235 && exportAssignmentIsAlias(node);
+ return node.kind === 230 ||
+ node.kind === 229 ||
+ node.kind === 232 && !!node.name ||
+ node.kind === 233 ||
+ node.kind === 235 ||
+ node.kind === 239 ||
+ node.kind === 236 && exportAssignmentIsAlias(node);
}
ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration;
function exportAssignmentIsAlias(node) {
@@ -5986,17 +6911,17 @@ var ts;
}
ts.exportAssignmentIsAlias = exportAssignmentIsAlias;
function getClassExtendsHeritageClauseElement(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 83);
+ var heritageClause = getHeritageClause(node.heritageClauses, 84);
return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined;
}
ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement;
function getClassImplementsHeritageClauseElements(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 106);
+ var heritageClause = getHeritageClause(node.heritageClauses, 107);
return heritageClause ? heritageClause.types : undefined;
}
ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements;
function getInterfaceBaseTypeNodes(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 83);
+ var heritageClause = getHeritageClause(node.heritageClauses, 84);
return heritageClause ? heritageClause.types : undefined;
}
ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes;
@@ -6064,7 +6989,7 @@ var ts;
}
ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath;
function isKeyword(token) {
- return 70 <= token && token <= 138;
+ return 71 <= token && token <= 139;
}
ts.isKeyword = isKeyword;
function isTrivia(token) {
@@ -6084,7 +7009,7 @@ var ts;
}
ts.hasDynamicName = hasDynamicName;
function isDynamicName(name) {
- return name.kind === 140 &&
+ return name.kind === 141 &&
!isStringOrNumericLiteral(name.expression.kind) &&
!isWellKnownSymbolSyntactically(name.expression);
}
@@ -6094,10 +7019,10 @@ var ts;
}
ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically;
function getPropertyNameForPropertyNameNode(name) {
- if (name.kind === 69 || name.kind === 9 || name.kind === 8 || name.kind === 142) {
+ if (name.kind === 70 || name.kind === 9 || name.kind === 8 || name.kind === 143) {
return name.text;
}
- if (name.kind === 140) {
+ if (name.kind === 141) {
var nameExpression = name.expression;
if (isWellKnownSymbolSyntactically(nameExpression)) {
var rightHandSideName = nameExpression.name.text;
@@ -6115,22 +7040,26 @@ var ts;
}
ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName;
function isESSymbolIdentifier(node) {
- return node.kind === 69 && node.text === "Symbol";
+ return node.kind === 70 && node.text === "Symbol";
}
ts.isESSymbolIdentifier = isESSymbolIdentifier;
+ function isPushOrUnshiftIdentifier(node) {
+ return node.text === "push" || node.text === "unshift";
+ }
+ ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier;
function isModifierKind(token) {
switch (token) {
- case 115:
- case 118:
- case 74:
- case 122:
- case 77:
- case 82:
- case 112:
- case 110:
- case 111:
- case 128:
+ case 116:
+ case 119:
+ case 75:
+ case 123:
+ case 78:
+ case 83:
case 113:
+ case 111:
+ case 112:
+ case 129:
+ case 114:
return true;
}
return false;
@@ -6138,11 +7067,11 @@ var ts;
ts.isModifierKind = isModifierKind;
function isParameterDeclaration(node) {
var root = getRootDeclaration(node);
- return root.kind === 142;
+ return root.kind === 143;
}
ts.isParameterDeclaration = isParameterDeclaration;
function getRootDeclaration(node) {
- while (node.kind === 169) {
+ while (node.kind === 170) {
node = node.parent.parent;
}
return node;
@@ -6150,14 +7079,14 @@ var ts;
ts.getRootDeclaration = getRootDeclaration;
function nodeStartsNewLexicalEnvironment(node) {
var kind = node.kind;
- return kind === 148
- || kind === 179
- || kind === 220
+ return kind === 149
|| kind === 180
- || kind === 147
- || kind === 149
+ || kind === 221
+ || kind === 181
+ || kind === 148
|| kind === 150
- || kind === 225
+ || kind === 151
+ || kind === 226
|| kind === 256;
}
ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment;
@@ -6207,40 +7136,45 @@ var ts;
return node ? ts.getNodeId(node) : 0;
}
ts.getOriginalNodeId = getOriginalNodeId;
+ (function (Associativity) {
+ Associativity[Associativity["Left"] = 0] = "Left";
+ Associativity[Associativity["Right"] = 1] = "Right";
+ })(ts.Associativity || (ts.Associativity = {}));
+ var Associativity = ts.Associativity;
function getExpressionAssociativity(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 175 && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 176 && expression.arguments !== undefined;
return getOperatorAssociativity(expression.kind, operator, hasArguments);
}
ts.getExpressionAssociativity = getExpressionAssociativity;
function getOperatorAssociativity(kind, operator, hasArguments) {
switch (kind) {
- case 175:
+ case 176:
return hasArguments ? 0 : 1;
- case 185:
- case 182:
+ case 186:
case 183:
- case 181:
case 184:
- case 188:
- case 190:
+ case 182:
+ case 185:
+ case 189:
+ case 191:
return 1;
- case 187:
+ case 188:
switch (operator) {
- case 38:
- case 56:
+ case 39:
case 57:
case 58:
- case 60:
case 59:
case 61:
+ case 60:
case 62:
case 63:
case 64:
case 65:
case 66:
- case 68:
case 67:
+ case 69:
+ case 68:
return 1;
}
}
@@ -6249,15 +7183,15 @@ var ts;
ts.getOperatorAssociativity = getOperatorAssociativity;
function getExpressionPrecedence(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 175 && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 176 && expression.arguments !== undefined;
return getOperatorPrecedence(expression.kind, operator, hasArguments);
}
ts.getExpressionPrecedence = getExpressionPrecedence;
function getOperator(expression) {
- if (expression.kind === 187) {
+ if (expression.kind === 188) {
return expression.operatorToken.kind;
}
- else if (expression.kind === 185 || expression.kind === 186) {
+ else if (expression.kind === 186 || expression.kind === 187) {
return expression.operator;
}
else {
@@ -6267,106 +7201,106 @@ var ts;
ts.getOperator = getOperator;
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
switch (nodeKind) {
- case 97:
- case 95:
- case 69:
- case 93:
- case 99:
- case 84:
+ case 98:
+ case 96:
+ case 70:
+ case 94:
+ case 100:
+ case 85:
case 8:
case 9:
- case 170:
case 171:
- case 179:
- case 180:
- case 192:
- case 241:
- case 242:
- case 10:
- case 11:
- case 189:
- case 178:
- case 193:
- return 19;
- case 176:
case 172:
- case 173:
- return 18;
- case 175:
- return hasArguments ? 18 : 17;
- case 174:
- return 17;
- case 186:
- return 16;
- case 185:
- case 182:
- case 183:
+ case 180:
case 181:
- case 184:
- return 15;
+ case 193:
+ case 242:
+ case 243:
+ case 11:
+ case 12:
+ case 190:
+ case 179:
+ case 194:
+ return 19;
+ case 177:
+ case 173:
+ case 174:
+ return 18;
+ case 176:
+ return hasArguments ? 18 : 17;
+ case 175:
+ return 17;
case 187:
+ return 16;
+ case 186:
+ case 183:
+ case 184:
+ case 182:
+ case 185:
+ return 15;
+ case 188:
switch (operatorKind) {
- case 49:
case 50:
+ case 51:
return 15;
- case 38:
- case 37:
case 39:
+ case 38:
case 40:
+ case 41:
return 14;
- case 35:
case 36:
+ case 37:
return 13;
- case 43:
case 44:
case 45:
+ case 46:
return 12;
- case 25:
- case 28:
- case 27:
+ case 26:
case 29:
- case 90:
- case 91:
- return 11;
+ case 28:
case 30:
- case 32:
+ case 91:
+ case 92:
+ return 11;
case 31:
case 33:
+ case 32:
+ case 34:
return 10;
- case 46:
- return 9;
- case 48:
- return 8;
case 47:
+ return 9;
+ case 49:
+ return 8;
+ case 48:
return 7;
- case 51:
- return 6;
case 52:
+ return 6;
+ case 53:
return 5;
- case 56:
case 57:
case 58:
- case 60:
case 59:
case 61:
+ case 60:
case 62:
case 63:
case 64:
case 65:
case 66:
- case 68:
case 67:
+ case 69:
+ case 68:
return 3;
- case 24:
+ case 25:
return 0;
default:
return -1;
}
- case 188:
+ case 189:
return 4;
- case 190:
- return 2;
case 191:
+ return 2;
+ case 192:
return 1;
default:
return -1;
@@ -6630,7 +7564,7 @@ var ts;
function forEachTransformedEmitFile(host, sourceFiles, action, emitOnlyDtsFiles) {
var options = host.getCompilerOptions();
if (options.outFile || options.out) {
- onBundledEmit(host, sourceFiles);
+ onBundledEmit(sourceFiles);
}
else {
for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) {
@@ -6657,7 +7591,7 @@ var ts;
var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (options.declaration || emitOnlyDtsFiles) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined;
action(jsFilePath, sourceMapFilePath, declarationFilePath, [sourceFile], false);
}
- function onBundledEmit(host, sourceFiles) {
+ function onBundledEmit(sourceFiles) {
if (sourceFiles.length) {
var jsFilePath = options.outFile || options.out;
var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options);
@@ -6746,7 +7680,7 @@ var ts;
ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap;
function getFirstConstructorWithBody(node) {
return ts.forEach(node.members, function (member) {
- if (member.kind === 148 && nodeIsPresent(member.body)) {
+ if (member.kind === 149 && nodeIsPresent(member.body)) {
return member;
}
});
@@ -6773,11 +7707,11 @@ var ts;
}
ts.parameterIsThisKeyword = parameterIsThisKeyword;
function isThisIdentifier(node) {
- return node && node.kind === 69 && identifierIsThisKeyword(node);
+ return node && node.kind === 70 && identifierIsThisKeyword(node);
}
ts.isThisIdentifier = isThisIdentifier;
function identifierIsThisKeyword(id) {
- return id.originalKeywordKind === 97;
+ return id.originalKeywordKind === 98;
}
ts.identifierIsThisKeyword = identifierIsThisKeyword;
function getAllAccessorDeclarations(declarations, accessor) {
@@ -6787,10 +7721,10 @@ var ts;
var setAccessor;
if (hasDynamicName(accessor)) {
firstAccessor = accessor;
- if (accessor.kind === 149) {
+ if (accessor.kind === 150) {
getAccessor = accessor;
}
- else if (accessor.kind === 150) {
+ else if (accessor.kind === 151) {
setAccessor = accessor;
}
else {
@@ -6799,7 +7733,7 @@ var ts;
}
else {
ts.forEach(declarations, function (member) {
- if ((member.kind === 149 || member.kind === 150)
+ if ((member.kind === 150 || member.kind === 151)
&& hasModifier(member, 32) === hasModifier(accessor, 32)) {
var memberName = getPropertyNameForPropertyNameNode(member.name);
var accessorName = getPropertyNameForPropertyNameNode(accessor.name);
@@ -6810,10 +7744,10 @@ var ts;
else if (!secondAccessor) {
secondAccessor = member;
}
- if (member.kind === 149 && !getAccessor) {
+ if (member.kind === 150 && !getAccessor) {
getAccessor = member;
}
- if (member.kind === 150 && !setAccessor) {
+ if (member.kind === 151 && !setAccessor) {
setAccessor = member;
}
}
@@ -7005,34 +7939,34 @@ var ts;
ts.getModifierFlags = getModifierFlags;
function modifierToFlag(token) {
switch (token) {
- case 113: return 32;
- case 112: return 4;
- case 111: return 16;
- case 110: return 8;
- case 115: return 128;
- case 82: return 1;
- case 122: return 2;
- case 74: return 2048;
- case 77: return 512;
- case 118: return 256;
- case 128: return 64;
+ case 114: return 32;
+ case 113: return 4;
+ case 112: return 16;
+ case 111: return 8;
+ case 116: return 128;
+ case 83: return 1;
+ case 123: return 2;
+ case 75: return 2048;
+ case 78: return 512;
+ case 119: return 256;
+ case 129: return 64;
}
return 0;
}
ts.modifierToFlag = modifierToFlag;
function isLogicalOperator(token) {
- return token === 52
- || token === 51
- || token === 49;
+ return token === 53
+ || token === 52
+ || token === 50;
}
ts.isLogicalOperator = isLogicalOperator;
function isAssignmentOperator(token) {
- return token >= 56 && token <= 68;
+ return token >= 57 && token <= 69;
}
ts.isAssignmentOperator = isAssignmentOperator;
function tryGetClassExtendingExpressionWithTypeArguments(node) {
- if (node.kind === 194 &&
- node.parent.token === 83 &&
+ if (node.kind === 195 &&
+ node.parent.token === 84 &&
isClassLike(node.parent.parent)) {
return node.parent.parent;
}
@@ -7040,10 +7974,10 @@ var ts;
ts.tryGetClassExtendingExpressionWithTypeArguments = tryGetClassExtendingExpressionWithTypeArguments;
function isDestructuringAssignment(node) {
if (isBinaryExpression(node)) {
- if (node.operatorToken.kind === 56) {
+ if (node.operatorToken.kind === 57) {
var kind = node.left.kind;
- return kind === 171
- || kind === 170;
+ return kind === 172
+ || kind === 171;
}
}
return false;
@@ -7054,7 +7988,7 @@ var ts;
}
ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments;
function isSupportedExpressionWithTypeArgumentsRest(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
return true;
}
else if (isPropertyAccessExpression(node)) {
@@ -7069,21 +8003,21 @@ var ts;
}
ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause;
function isEntityNameExpression(node) {
- return node.kind === 69 ||
- node.kind === 172 && isEntityNameExpression(node.expression);
+ return node.kind === 70 ||
+ node.kind === 173 && isEntityNameExpression(node.expression);
}
ts.isEntityNameExpression = isEntityNameExpression;
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
- return (node.parent.kind === 139 && node.parent.right === node) ||
- (node.parent.kind === 172 && node.parent.name === node);
+ return (node.parent.kind === 140 && node.parent.right === node) ||
+ (node.parent.kind === 173 && node.parent.name === node);
}
ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess;
function isEmptyObjectLiteralOrArrayLiteral(expression) {
var kind = expression.kind;
- if (kind === 171) {
+ if (kind === 172) {
return expression.properties.length === 0;
}
- if (kind === 170) {
+ if (kind === 171) {
return expression.elements.length === 0;
}
return false;
@@ -7207,49 +8141,49 @@ var ts;
var kind = node.kind;
if (kind === 9
|| kind === 8
- || kind === 10
|| kind === 11
- || kind === 69
- || kind === 97
- || kind === 95
- || kind === 99
- || kind === 84
- || kind === 93) {
+ || kind === 12
+ || kind === 70
+ || kind === 98
+ || kind === 96
+ || kind === 100
+ || kind === 85
+ || kind === 94) {
return true;
}
- else if (kind === 172) {
+ else if (kind === 173) {
return isSimpleExpressionWorker(node.expression, depth + 1);
}
- else if (kind === 173) {
+ else if (kind === 174) {
return isSimpleExpressionWorker(node.expression, depth + 1)
&& isSimpleExpressionWorker(node.argumentExpression, depth + 1);
}
- else if (kind === 185
- || kind === 186) {
+ else if (kind === 186
+ || kind === 187) {
return isSimpleExpressionWorker(node.operand, depth + 1);
}
- else if (kind === 187) {
- return node.operatorToken.kind !== 38
+ else if (kind === 188) {
+ return node.operatorToken.kind !== 39
&& isSimpleExpressionWorker(node.left, depth + 1)
&& isSimpleExpressionWorker(node.right, depth + 1);
}
- else if (kind === 188) {
+ else if (kind === 189) {
return isSimpleExpressionWorker(node.condition, depth + 1)
&& isSimpleExpressionWorker(node.whenTrue, depth + 1)
&& isSimpleExpressionWorker(node.whenFalse, depth + 1);
}
- else if (kind === 183
- || kind === 182
- || kind === 181) {
+ else if (kind === 184
+ || kind === 183
+ || kind === 182) {
return isSimpleExpressionWorker(node.expression, depth + 1);
}
- else if (kind === 170) {
+ else if (kind === 171) {
return node.elements.length === 0;
}
- else if (kind === 171) {
+ else if (kind === 172) {
return node.properties.length === 0;
}
- else if (kind === 174) {
+ else if (kind === 175) {
if (!isSimpleExpressionWorker(node.expression, depth + 1)) {
return false;
}
@@ -7355,7 +8289,7 @@ var ts;
return ts.positionIsSynthesized(range.pos) ? -1 : ts.skipTrivia(sourceFile.text, range.pos);
}
ts.getStartPositionOfRange = getStartPositionOfRange;
- function collectExternalModuleInfo(sourceFile, resolver) {
+ function collectExternalModuleInfo(sourceFile) {
var externalImports = [];
var exportSpecifiers = ts.createMap();
var exportEquals = undefined;
@@ -7363,26 +8297,21 @@ var ts;
for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
var node = _a[_i];
switch (node.kind) {
+ case 231:
+ externalImports.push(node);
+ break;
case 230:
- if (!node.importClause ||
- resolver.isReferencedAliasDeclaration(node.importClause, true)) {
+ if (node.moduleReference.kind === 241) {
externalImports.push(node);
}
break;
- case 229:
- if (node.moduleReference.kind === 240 && resolver.isReferencedAliasDeclaration(node)) {
- externalImports.push(node);
- }
- break;
- case 236:
+ case 237:
if (node.moduleSpecifier) {
if (!node.exportClause) {
- if (resolver.moduleExportsSomeValue(node.moduleSpecifier)) {
- externalImports.push(node);
- hasExportStarsToExportValues = true;
- }
+ externalImports.push(node);
+ hasExportStarsToExportValues = true;
}
- else if (resolver.isValueAliasDeclaration(node)) {
+ else {
externalImports.push(node);
}
}
@@ -7394,7 +8323,7 @@ var ts;
}
}
break;
- case 235:
+ case 236:
if (node.isExportEquals && !exportEquals) {
exportEquals = node;
}
@@ -7415,7 +8344,7 @@ var ts;
if (node.symbol) {
for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 221 && declaration !== node) {
+ if (declaration.kind === 222 && declaration !== node) {
return true;
}
}
@@ -7433,15 +8362,15 @@ var ts;
}
ts.isNodeArray = isNodeArray;
function isNoSubstitutionTemplateLiteral(node) {
- return node.kind === 11;
+ return node.kind === 12;
}
ts.isNoSubstitutionTemplateLiteral = isNoSubstitutionTemplateLiteral;
function isLiteralKind(kind) {
- return 8 <= kind && kind <= 11;
+ return 8 <= kind && kind <= 12;
}
ts.isLiteralKind = isLiteralKind;
function isTextualLiteralKind(kind) {
- return kind === 9 || kind === 11;
+ return kind === 9 || kind === 12;
}
ts.isTextualLiteralKind = isTextualLiteralKind;
function isLiteralExpression(node) {
@@ -7449,21 +8378,21 @@ var ts;
}
ts.isLiteralExpression = isLiteralExpression;
function isTemplateLiteralKind(kind) {
- return 11 <= kind && kind <= 14;
+ return 12 <= kind && kind <= 15;
}
ts.isTemplateLiteralKind = isTemplateLiteralKind;
function isTemplateHead(node) {
- return node.kind === 12;
+ return node.kind === 13;
}
ts.isTemplateHead = isTemplateHead;
function isTemplateMiddleOrTemplateTail(node) {
var kind = node.kind;
- return kind === 13
- || kind === 14;
+ return kind === 14
+ || kind === 15;
}
ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail;
function isIdentifier(node) {
- return node.kind === 69;
+ return node.kind === 70;
}
ts.isIdentifier = isIdentifier;
function isGeneratedIdentifier(node) {
@@ -7475,87 +8404,87 @@ var ts;
}
ts.isModifier = isModifier;
function isQualifiedName(node) {
- return node.kind === 139;
+ return node.kind === 140;
}
ts.isQualifiedName = isQualifiedName;
function isComputedPropertyName(node) {
- return node.kind === 140;
+ return node.kind === 141;
}
ts.isComputedPropertyName = isComputedPropertyName;
function isEntityName(node) {
var kind = node.kind;
- return kind === 139
- || kind === 69;
+ return kind === 140
+ || kind === 70;
}
ts.isEntityName = isEntityName;
function isPropertyName(node) {
var kind = node.kind;
- return kind === 69
+ return kind === 70
|| kind === 9
|| kind === 8
- || kind === 140;
+ || kind === 141;
}
ts.isPropertyName = isPropertyName;
function isModuleName(node) {
var kind = node.kind;
- return kind === 69
+ return kind === 70
|| kind === 9;
}
ts.isModuleName = isModuleName;
function isBindingName(node) {
var kind = node.kind;
- return kind === 69
- || kind === 167
- || kind === 168;
+ return kind === 70
+ || kind === 168
+ || kind === 169;
}
ts.isBindingName = isBindingName;
function isTypeParameter(node) {
- return node.kind === 141;
+ return node.kind === 142;
}
ts.isTypeParameter = isTypeParameter;
function isParameter(node) {
- return node.kind === 142;
+ return node.kind === 143;
}
ts.isParameter = isParameter;
function isDecorator(node) {
- return node.kind === 143;
+ return node.kind === 144;
}
ts.isDecorator = isDecorator;
function isMethodDeclaration(node) {
- return node.kind === 147;
+ return node.kind === 148;
}
ts.isMethodDeclaration = isMethodDeclaration;
function isClassElement(node) {
var kind = node.kind;
- return kind === 148
- || kind === 145
- || kind === 147
- || kind === 149
+ return kind === 149
+ || kind === 146
+ || kind === 148
|| kind === 150
- || kind === 153
- || kind === 198;
+ || kind === 151
+ || kind === 154
+ || kind === 199;
}
ts.isClassElement = isClassElement;
function isObjectLiteralElementLike(node) {
var kind = node.kind;
return kind === 253
|| kind === 254
- || kind === 147
- || kind === 149
+ || kind === 148
|| kind === 150
- || kind === 239;
+ || kind === 151
+ || kind === 240;
}
ts.isObjectLiteralElementLike = isObjectLiteralElementLike;
function isTypeNodeKind(kind) {
- return (kind >= 154 && kind <= 166)
- || kind === 117
- || kind === 130
- || kind === 120
- || kind === 132
+ return (kind >= 155 && kind <= 167)
+ || kind === 118
+ || kind === 131
+ || kind === 121
|| kind === 133
- || kind === 103
- || kind === 127
- || kind === 194;
+ || kind === 134
+ || kind === 104
+ || kind === 128
+ || kind === 195;
}
function isTypeNode(node) {
return isTypeNodeKind(node.kind);
@@ -7564,94 +8493,94 @@ var ts;
function isBindingPattern(node) {
if (node) {
var kind = node.kind;
- return kind === 168
- || kind === 167;
+ return kind === 169
+ || kind === 168;
}
return false;
}
ts.isBindingPattern = isBindingPattern;
function isBindingElement(node) {
- return node.kind === 169;
+ return node.kind === 170;
}
ts.isBindingElement = isBindingElement;
function isArrayBindingElement(node) {
var kind = node.kind;
- return kind === 169
- || kind === 193;
+ return kind === 170
+ || kind === 194;
}
ts.isArrayBindingElement = isArrayBindingElement;
function isPropertyAccessExpression(node) {
- return node.kind === 172;
+ return node.kind === 173;
}
ts.isPropertyAccessExpression = isPropertyAccessExpression;
function isElementAccessExpression(node) {
- return node.kind === 173;
+ return node.kind === 174;
}
ts.isElementAccessExpression = isElementAccessExpression;
function isBinaryExpression(node) {
- return node.kind === 187;
+ return node.kind === 188;
}
ts.isBinaryExpression = isBinaryExpression;
function isConditionalExpression(node) {
- return node.kind === 188;
+ return node.kind === 189;
}
ts.isConditionalExpression = isConditionalExpression;
function isCallExpression(node) {
- return node.kind === 174;
+ return node.kind === 175;
}
ts.isCallExpression = isCallExpression;
function isTemplateLiteral(node) {
var kind = node.kind;
- return kind === 189
- || kind === 11;
+ return kind === 190
+ || kind === 12;
}
ts.isTemplateLiteral = isTemplateLiteral;
function isSpreadElementExpression(node) {
- return node.kind === 191;
+ return node.kind === 192;
}
ts.isSpreadElementExpression = isSpreadElementExpression;
function isExpressionWithTypeArguments(node) {
- return node.kind === 194;
+ return node.kind === 195;
}
ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments;
function isLeftHandSideExpressionKind(kind) {
- return kind === 172
- || kind === 173
- || kind === 175
+ return kind === 173
|| kind === 174
- || kind === 241
- || kind === 242
|| kind === 176
- || kind === 170
- || kind === 178
+ || kind === 175
+ || kind === 242
+ || kind === 243
+ || kind === 177
|| kind === 171
- || kind === 192
|| kind === 179
- || kind === 69
- || kind === 10
+ || kind === 172
+ || kind === 193
+ || kind === 180
+ || kind === 70
+ || kind === 11
|| kind === 8
|| kind === 9
- || kind === 11
- || kind === 189
- || kind === 84
- || kind === 93
- || kind === 97
- || kind === 99
- || kind === 95
- || kind === 196;
+ || kind === 12
+ || kind === 190
+ || kind === 85
+ || kind === 94
+ || kind === 98
+ || kind === 100
+ || kind === 96
+ || kind === 197;
}
function isLeftHandSideExpression(node) {
return isLeftHandSideExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind);
}
ts.isLeftHandSideExpression = isLeftHandSideExpression;
function isUnaryExpressionKind(kind) {
- return kind === 185
- || kind === 186
- || kind === 181
+ return kind === 186
+ || kind === 187
|| kind === 182
|| kind === 183
|| kind === 184
- || kind === 177
+ || kind === 185
+ || kind === 178
|| isLeftHandSideExpressionKind(kind);
}
function isUnaryExpression(node) {
@@ -7659,13 +8588,13 @@ var ts;
}
ts.isUnaryExpression = isUnaryExpression;
function isExpressionKind(kind) {
- return kind === 188
- || kind === 190
- || kind === 180
- || kind === 187
+ return kind === 189
|| kind === 191
- || kind === 195
- || kind === 193
+ || kind === 181
+ || kind === 188
+ || kind === 192
+ || kind === 196
+ || kind === 194
|| isUnaryExpressionKind(kind);
}
function isExpression(node) {
@@ -7674,8 +8603,8 @@ var ts;
ts.isExpression = isExpression;
function isAssertionExpression(node) {
var kind = node.kind;
- return kind === 177
- || kind === 195;
+ return kind === 178
+ || kind === 196;
}
ts.isAssertionExpression = isAssertionExpression;
function isPartiallyEmittedExpression(node) {
@@ -7692,15 +8621,15 @@ var ts;
}
ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode;
function isOmittedExpression(node) {
- return node.kind === 193;
+ return node.kind === 194;
}
ts.isOmittedExpression = isOmittedExpression;
function isTemplateSpan(node) {
- return node.kind === 197;
+ return node.kind === 198;
}
ts.isTemplateSpan = isTemplateSpan;
function isBlock(node) {
- return node.kind === 199;
+ return node.kind === 200;
}
ts.isBlock = isBlock;
function isConciseBody(node) {
@@ -7718,118 +8647,118 @@ var ts;
}
ts.isForInitializer = isForInitializer;
function isVariableDeclaration(node) {
- return node.kind === 218;
+ return node.kind === 219;
}
ts.isVariableDeclaration = isVariableDeclaration;
function isVariableDeclarationList(node) {
- return node.kind === 219;
+ return node.kind === 220;
}
ts.isVariableDeclarationList = isVariableDeclarationList;
function isCaseBlock(node) {
- return node.kind === 227;
+ return node.kind === 228;
}
ts.isCaseBlock = isCaseBlock;
function isModuleBody(node) {
var kind = node.kind;
- return kind === 226
- || kind === 225;
+ return kind === 227
+ || kind === 226;
}
ts.isModuleBody = isModuleBody;
function isImportEqualsDeclaration(node) {
- return node.kind === 229;
+ return node.kind === 230;
}
ts.isImportEqualsDeclaration = isImportEqualsDeclaration;
function isImportClause(node) {
- return node.kind === 231;
+ return node.kind === 232;
}
ts.isImportClause = isImportClause;
function isNamedImportBindings(node) {
var kind = node.kind;
- return kind === 233
- || kind === 232;
+ return kind === 234
+ || kind === 233;
}
ts.isNamedImportBindings = isNamedImportBindings;
function isImportSpecifier(node) {
- return node.kind === 234;
+ return node.kind === 235;
}
ts.isImportSpecifier = isImportSpecifier;
function isNamedExports(node) {
- return node.kind === 237;
+ return node.kind === 238;
}
ts.isNamedExports = isNamedExports;
function isExportSpecifier(node) {
- return node.kind === 238;
+ return node.kind === 239;
}
ts.isExportSpecifier = isExportSpecifier;
function isModuleOrEnumDeclaration(node) {
- return node.kind === 225 || node.kind === 224;
+ return node.kind === 226 || node.kind === 225;
}
ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration;
function isDeclarationKind(kind) {
- return kind === 180
- || kind === 169
- || kind === 221
- || kind === 192
- || kind === 148
- || kind === 224
- || kind === 255
- || kind === 238
- || kind === 220
- || kind === 179
- || kind === 149
- || kind === 231
- || kind === 229
- || kind === 234
+ return kind === 181
+ || kind === 170
|| kind === 222
- || kind === 147
- || kind === 146
+ || kind === 193
+ || kind === 149
|| kind === 225
- || kind === 228
- || kind === 232
- || kind === 142
- || kind === 253
- || kind === 145
- || kind === 144
+ || kind === 255
+ || kind === 239
+ || kind === 221
+ || kind === 180
|| kind === 150
- || kind === 254
+ || kind === 232
+ || kind === 230
+ || kind === 235
|| kind === 223
- || kind === 141
- || kind === 218
+ || kind === 148
+ || kind === 147
+ || kind === 226
+ || kind === 229
+ || kind === 233
+ || kind === 143
+ || kind === 253
+ || kind === 146
+ || kind === 145
+ || kind === 151
+ || kind === 254
+ || kind === 224
+ || kind === 142
+ || kind === 219
|| kind === 279;
}
function isDeclarationStatementKind(kind) {
- return kind === 220
- || kind === 239
- || kind === 221
+ return kind === 221
+ || kind === 240
|| kind === 222
|| kind === 223
|| kind === 224
|| kind === 225
+ || kind === 226
+ || kind === 231
|| kind === 230
- || kind === 229
+ || kind === 237
|| kind === 236
- || kind === 235
- || kind === 228;
+ || kind === 229;
}
function isStatementKindButNotDeclarationKind(kind) {
- return kind === 210
- || kind === 209
- || kind === 217
- || kind === 204
- || kind === 202
- || kind === 201
- || kind === 207
- || kind === 208
- || kind === 206
- || kind === 203
- || kind === 214
- || kind === 211
- || kind === 213
- || kind === 215
- || kind === 216
- || kind === 200
+ return kind === 211
+ || kind === 210
+ || kind === 218
|| kind === 205
+ || kind === 203
+ || kind === 202
+ || kind === 208
+ || kind === 209
+ || kind === 207
+ || kind === 204
+ || kind === 215
|| kind === 212
+ || kind === 214
+ || kind === 216
+ || kind === 217
+ || kind === 201
+ || kind === 206
+ || kind === 213
|| kind === 287;
}
function isDeclaration(node) {
@@ -7848,18 +8777,18 @@ var ts;
var kind = node.kind;
return isStatementKindButNotDeclarationKind(kind)
|| isDeclarationStatementKind(kind)
- || kind === 199;
+ || kind === 200;
}
ts.isStatement = isStatement;
function isModuleReference(node) {
var kind = node.kind;
- return kind === 240
- || kind === 139
- || kind === 69;
+ return kind === 241
+ || kind === 140
+ || kind === 70;
}
ts.isModuleReference = isModuleReference;
function isJsxOpeningElement(node) {
- return node.kind === 243;
+ return node.kind === 244;
}
ts.isJsxOpeningElement = isJsxOpeningElement;
function isJsxClosingElement(node) {
@@ -7868,17 +8797,17 @@ var ts;
ts.isJsxClosingElement = isJsxClosingElement;
function isJsxTagNameExpression(node) {
var kind = node.kind;
- return kind === 97
- || kind === 69
- || kind === 172;
+ return kind === 98
+ || kind === 70
+ || kind === 173;
}
ts.isJsxTagNameExpression = isJsxTagNameExpression;
function isJsxChild(node) {
var kind = node.kind;
- return kind === 241
+ return kind === 242
|| kind === 248
- || kind === 242
- || kind === 244;
+ || kind === 243
+ || kind === 10;
}
ts.isJsxChild = isJsxChild;
function isJsxAttributeLike(node) {
@@ -7938,7 +8867,16 @@ var ts;
})(ts || (ts = {}));
(function (ts) {
function getDefaultLibFileName(options) {
- return options.target === 2 ? "lib.es6.d.ts" : "lib.d.ts";
+ switch (options.target) {
+ case 4:
+ return "lib.es2017.d.ts";
+ case 3:
+ return "lib.es2016.d.ts";
+ case 2:
+ return "lib.es6.d.ts";
+ default:
+ return "lib.d.ts";
+ }
}
ts.getDefaultLibFileName = getDefaultLibFileName;
function textSpanEnd(span) {
@@ -8057,9 +8995,9 @@ var ts;
}
ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
function getTypeParameterOwner(d) {
- if (d && d.kind === 141) {
+ if (d && d.kind === 142) {
for (var current = d; current; current = current.parent) {
- if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 222) {
+ if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 223) {
return current;
}
}
@@ -8067,11 +9005,11 @@ var ts;
}
ts.getTypeParameterOwner = getTypeParameterOwner;
function isParameterPropertyDeclaration(node) {
- return ts.hasModifier(node, 92) && node.parent.kind === 148 && ts.isClassLike(node.parent.parent);
+ return ts.hasModifier(node, 92) && node.parent.kind === 149 && ts.isClassLike(node.parent.parent);
}
ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration;
function walkUpBindingElementsAndPatterns(node) {
- while (node && (node.kind === 169 || ts.isBindingPattern(node))) {
+ while (node && (node.kind === 170 || ts.isBindingPattern(node))) {
node = node.parent;
}
return node;
@@ -8079,14 +9017,14 @@ var ts;
function getCombinedModifierFlags(node) {
node = walkUpBindingElementsAndPatterns(node);
var flags = ts.getModifierFlags(node);
- if (node.kind === 218) {
+ if (node.kind === 219) {
node = node.parent;
}
- if (node && node.kind === 219) {
+ if (node && node.kind === 220) {
flags |= ts.getModifierFlags(node);
node = node.parent;
}
- if (node && node.kind === 200) {
+ if (node && node.kind === 201) {
flags |= ts.getModifierFlags(node);
}
return flags;
@@ -8095,14 +9033,14 @@ var ts;
function getCombinedNodeFlags(node) {
node = walkUpBindingElementsAndPatterns(node);
var flags = node.flags;
- if (node.kind === 218) {
+ if (node.kind === 219) {
node = node.parent;
}
- if (node && node.kind === 219) {
+ if (node && node.kind === 220) {
flags |= node.flags;
node = node.parent;
}
- if (node && node.kind === 200) {
+ if (node && node.kind === 201) {
flags |= node.flags;
}
return flags;
@@ -8195,7 +9133,7 @@ var ts;
return node;
}
else if (typeof value === "boolean") {
- return createNode(value ? 99 : 84, location, undefined);
+ return createNode(value ? 100 : 85, location, undefined);
}
else if (typeof value === "string") {
var node = createNode(9, location, undefined);
@@ -8212,7 +9150,7 @@ var ts;
ts.createLiteral = createLiteral;
var nextAutoGenerateId = 0;
function createIdentifier(text, location) {
- var node = createNode(69, location);
+ var node = createNode(70, location);
node.text = ts.escapeIdentifier(text);
node.originalKeywordKind = ts.stringToToken(text);
node.autoGenerateKind = 0;
@@ -8221,7 +9159,7 @@ var ts;
}
ts.createIdentifier = createIdentifier;
function createTempVariable(recordTempVariable, location) {
- var name = createNode(69, location);
+ var name = createNode(70, location);
name.text = "";
name.originalKeywordKind = 0;
name.autoGenerateKind = 1;
@@ -8234,7 +9172,7 @@ var ts;
}
ts.createTempVariable = createTempVariable;
function createLoopVariable(location) {
- var name = createNode(69, location);
+ var name = createNode(70, location);
name.text = "";
name.originalKeywordKind = 0;
name.autoGenerateKind = 2;
@@ -8244,7 +9182,7 @@ var ts;
}
ts.createLoopVariable = createLoopVariable;
function createUniqueName(text, location) {
- var name = createNode(69, location);
+ var name = createNode(70, location);
name.text = text;
name.originalKeywordKind = 0;
name.autoGenerateKind = 3;
@@ -8254,7 +9192,7 @@ var ts;
}
ts.createUniqueName = createUniqueName;
function getGeneratedNameForNode(node, location) {
- var name = createNode(69, location);
+ var name = createNode(70, location);
name.original = node;
name.text = "";
name.originalKeywordKind = 0;
@@ -8269,22 +9207,22 @@ var ts;
}
ts.createToken = createToken;
function createSuper() {
- var node = createNode(95);
+ var node = createNode(96);
return node;
}
ts.createSuper = createSuper;
function createThis(location) {
- var node = createNode(97, location);
+ var node = createNode(98, location);
return node;
}
ts.createThis = createThis;
function createNull() {
- var node = createNode(93);
+ var node = createNode(94);
return node;
}
ts.createNull = createNull;
function createComputedPropertyName(expression, location) {
- var node = createNode(140, location);
+ var node = createNode(141, location);
node.expression = expression;
return node;
}
@@ -8301,7 +9239,7 @@ var ts;
}
ts.createParameter = createParameter;
function createParameterDeclaration(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer, location, flags) {
- var node = createNode(142, location, flags);
+ var node = createNode(143, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.dotDotDotToken = dotDotDotToken;
@@ -8320,7 +9258,7 @@ var ts;
}
ts.updateParameterDeclaration = updateParameterDeclaration;
function createProperty(decorators, modifiers, name, questionToken, type, initializer, location) {
- var node = createNode(145, location);
+ var node = createNode(146, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -8338,7 +9276,7 @@ var ts;
}
ts.updateProperty = updateProperty;
function createMethod(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
- var node = createNode(147, location, flags);
+ var node = createNode(148, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.asteriskToken = asteriskToken;
@@ -8358,7 +9296,7 @@ var ts;
}
ts.updateMethod = updateMethod;
function createConstructor(decorators, modifiers, parameters, body, location, flags) {
- var node = createNode(148, location, flags);
+ var node = createNode(149, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.typeParameters = undefined;
@@ -8376,7 +9314,7 @@ var ts;
}
ts.updateConstructor = updateConstructor;
function createGetAccessor(decorators, modifiers, name, parameters, type, body, location, flags) {
- var node = createNode(149, location, flags);
+ var node = createNode(150, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -8395,7 +9333,7 @@ var ts;
}
ts.updateGetAccessor = updateGetAccessor;
function createSetAccessor(decorators, modifiers, name, parameters, body, location, flags) {
- var node = createNode(150, location, flags);
+ var node = createNode(151, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -8413,7 +9351,7 @@ var ts;
}
ts.updateSetAccessor = updateSetAccessor;
function createObjectBindingPattern(elements, location) {
- var node = createNode(167, location);
+ var node = createNode(168, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -8426,7 +9364,7 @@ var ts;
}
ts.updateObjectBindingPattern = updateObjectBindingPattern;
function createArrayBindingPattern(elements, location) {
- var node = createNode(168, location);
+ var node = createNode(169, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -8439,7 +9377,7 @@ var ts;
}
ts.updateArrayBindingPattern = updateArrayBindingPattern;
function createBindingElement(propertyName, dotDotDotToken, name, initializer, location) {
- var node = createNode(169, location);
+ var node = createNode(170, location);
node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName;
node.dotDotDotToken = dotDotDotToken;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -8455,7 +9393,7 @@ var ts;
}
ts.updateBindingElement = updateBindingElement;
function createArrayLiteral(elements, location, multiLine) {
- var node = createNode(170, location);
+ var node = createNode(171, location);
node.elements = parenthesizeListElements(createNodeArray(elements));
if (multiLine) {
node.multiLine = true;
@@ -8471,7 +9409,7 @@ var ts;
}
ts.updateArrayLiteral = updateArrayLiteral;
function createObjectLiteral(properties, location, multiLine) {
- var node = createNode(171, location);
+ var node = createNode(172, location);
node.properties = createNodeArray(properties);
if (multiLine) {
node.multiLine = true;
@@ -8487,7 +9425,7 @@ var ts;
}
ts.updateObjectLiteral = updateObjectLiteral;
function createPropertyAccess(expression, name, location, flags) {
- var node = createNode(172, location, flags);
+ var node = createNode(173, location, flags);
node.expression = parenthesizeForAccess(expression);
(node.emitNode || (node.emitNode = {})).flags |= 1048576;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -8504,7 +9442,7 @@ var ts;
}
ts.updatePropertyAccess = updatePropertyAccess;
function createElementAccess(expression, index, location) {
- var node = createNode(173, location);
+ var node = createNode(174, location);
node.expression = parenthesizeForAccess(expression);
node.argumentExpression = typeof index === "number" ? createLiteral(index) : index;
return node;
@@ -8518,7 +9456,7 @@ var ts;
}
ts.updateElementAccess = updateElementAccess;
function createCall(expression, typeArguments, argumentsArray, location, flags) {
- var node = createNode(174, location, flags);
+ var node = createNode(175, location, flags);
node.expression = parenthesizeForAccess(expression);
if (typeArguments) {
node.typeArguments = createNodeArray(typeArguments);
@@ -8535,7 +9473,7 @@ var ts;
}
ts.updateCall = updateCall;
function createNew(expression, typeArguments, argumentsArray, location, flags) {
- var node = createNode(175, location, flags);
+ var node = createNode(176, location, flags);
node.expression = parenthesizeForNew(expression);
node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined;
node.arguments = argumentsArray ? parenthesizeListElements(createNodeArray(argumentsArray)) : undefined;
@@ -8550,7 +9488,7 @@ var ts;
}
ts.updateNew = updateNew;
function createTaggedTemplate(tag, template, location) {
- var node = createNode(176, location);
+ var node = createNode(177, location);
node.tag = parenthesizeForAccess(tag);
node.template = template;
return node;
@@ -8564,7 +9502,7 @@ var ts;
}
ts.updateTaggedTemplate = updateTaggedTemplate;
function createParen(expression, location) {
- var node = createNode(178, location);
+ var node = createNode(179, location);
node.expression = expression;
return node;
}
@@ -8576,9 +9514,9 @@ var ts;
return node;
}
ts.updateParen = updateParen;
- function createFunctionExpression(asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
- var node = createNode(179, location, flags);
- node.modifiers = undefined;
+ function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
+ var node = createNode(180, location, flags);
+ node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.asteriskToken = asteriskToken;
node.name = typeof name === "string" ? createIdentifier(name) : name;
node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined;
@@ -8588,20 +9526,20 @@ var ts;
return node;
}
ts.createFunctionExpression = createFunctionExpression;
- function updateFunctionExpression(node, name, typeParameters, parameters, type, body) {
- if (node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) {
- return updateNode(createFunctionExpression(node.asteriskToken, name, typeParameters, parameters, type, body, node, node.flags), node);
+ function updateFunctionExpression(node, modifiers, name, typeParameters, parameters, type, body) {
+ if (node.name !== name || node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) {
+ return updateNode(createFunctionExpression(modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, node, node.flags), node);
}
return node;
}
ts.updateFunctionExpression = updateFunctionExpression;
function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body, location, flags) {
- var node = createNode(180, location, flags);
+ var node = createNode(181, location, flags);
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined;
node.parameters = createNodeArray(parameters);
node.type = type;
- node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(34);
+ node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(35);
node.body = parenthesizeConciseBody(body);
return node;
}
@@ -8614,7 +9552,7 @@ var ts;
}
ts.updateArrowFunction = updateArrowFunction;
function createDelete(expression, location) {
- var node = createNode(181, location);
+ var node = createNode(182, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -8627,7 +9565,7 @@ var ts;
}
ts.updateDelete = updateDelete;
function createTypeOf(expression, location) {
- var node = createNode(182, location);
+ var node = createNode(183, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -8640,7 +9578,7 @@ var ts;
}
ts.updateTypeOf = updateTypeOf;
function createVoid(expression, location) {
- var node = createNode(183, location);
+ var node = createNode(184, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -8653,7 +9591,7 @@ var ts;
}
ts.updateVoid = updateVoid;
function createAwait(expression, location) {
- var node = createNode(184, location);
+ var node = createNode(185, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -8666,7 +9604,7 @@ var ts;
}
ts.updateAwait = updateAwait;
function createPrefix(operator, operand, location) {
- var node = createNode(185, location);
+ var node = createNode(186, location);
node.operator = operator;
node.operand = parenthesizePrefixOperand(operand);
return node;
@@ -8680,7 +9618,7 @@ var ts;
}
ts.updatePrefix = updatePrefix;
function createPostfix(operand, operator, location) {
- var node = createNode(186, location);
+ var node = createNode(187, location);
node.operand = parenthesizePostfixOperand(operand);
node.operator = operator;
return node;
@@ -8696,7 +9634,7 @@ var ts;
function createBinary(left, operator, right, location) {
var operatorToken = typeof operator === "number" ? createToken(operator) : operator;
var operatorKind = operatorToken.kind;
- var node = createNode(187, location);
+ var node = createNode(188, location);
node.left = parenthesizeBinaryOperand(operatorKind, left, true, undefined);
node.operatorToken = operatorToken;
node.right = parenthesizeBinaryOperand(operatorKind, right, false, node.left);
@@ -8711,7 +9649,7 @@ var ts;
}
ts.updateBinary = updateBinary;
function createConditional(condition, questionToken, whenTrue, colonToken, whenFalse, location) {
- var node = createNode(188, location);
+ var node = createNode(189, location);
node.condition = condition;
node.questionToken = questionToken;
node.whenTrue = whenTrue;
@@ -8728,7 +9666,7 @@ var ts;
}
ts.updateConditional = updateConditional;
function createTemplateExpression(head, templateSpans, location) {
- var node = createNode(189, location);
+ var node = createNode(190, location);
node.head = head;
node.templateSpans = createNodeArray(templateSpans);
return node;
@@ -8742,7 +9680,7 @@ var ts;
}
ts.updateTemplateExpression = updateTemplateExpression;
function createYield(asteriskToken, expression, location) {
- var node = createNode(190, location);
+ var node = createNode(191, location);
node.asteriskToken = asteriskToken;
node.expression = expression;
return node;
@@ -8756,7 +9694,7 @@ var ts;
}
ts.updateYield = updateYield;
function createSpread(expression, location) {
- var node = createNode(191, location);
+ var node = createNode(192, location);
node.expression = parenthesizeExpressionForList(expression);
return node;
}
@@ -8769,7 +9707,7 @@ var ts;
}
ts.updateSpread = updateSpread;
function createClassExpression(modifiers, name, typeParameters, heritageClauses, members, location) {
- var node = createNode(192, location);
+ var node = createNode(193, location);
node.decorators = undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = name;
@@ -8787,12 +9725,12 @@ var ts;
}
ts.updateClassExpression = updateClassExpression;
function createOmittedExpression(location) {
- var node = createNode(193, location);
+ var node = createNode(194, location);
return node;
}
ts.createOmittedExpression = createOmittedExpression;
function createExpressionWithTypeArguments(typeArguments, expression, location) {
- var node = createNode(194, location);
+ var node = createNode(195, location);
node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined;
node.expression = parenthesizeForAccess(expression);
return node;
@@ -8806,7 +9744,7 @@ var ts;
}
ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments;
function createTemplateSpan(expression, literal, location) {
- var node = createNode(197, location);
+ var node = createNode(198, location);
node.expression = expression;
node.literal = literal;
return node;
@@ -8820,7 +9758,7 @@ var ts;
}
ts.updateTemplateSpan = updateTemplateSpan;
function createBlock(statements, location, multiLine, flags) {
- var block = createNode(199, location, flags);
+ var block = createNode(200, location, flags);
block.statements = createNodeArray(statements);
if (multiLine) {
block.multiLine = true;
@@ -8836,7 +9774,7 @@ var ts;
}
ts.updateBlock = updateBlock;
function createVariableStatement(modifiers, declarationList, location, flags) {
- var node = createNode(200, location, flags);
+ var node = createNode(201, location, flags);
node.decorators = undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
@@ -8851,7 +9789,7 @@ var ts;
}
ts.updateVariableStatement = updateVariableStatement;
function createVariableDeclarationList(declarations, location, flags) {
- var node = createNode(219, location, flags);
+ var node = createNode(220, location, flags);
node.declarations = createNodeArray(declarations);
return node;
}
@@ -8864,7 +9802,7 @@ var ts;
}
ts.updateVariableDeclarationList = updateVariableDeclarationList;
function createVariableDeclaration(name, type, initializer, location, flags) {
- var node = createNode(218, location, flags);
+ var node = createNode(219, location, flags);
node.name = typeof name === "string" ? createIdentifier(name) : name;
node.type = type;
node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined;
@@ -8879,11 +9817,11 @@ var ts;
}
ts.updateVariableDeclaration = updateVariableDeclaration;
function createEmptyStatement(location) {
- return createNode(201, location);
+ return createNode(202, location);
}
ts.createEmptyStatement = createEmptyStatement;
function createStatement(expression, location, flags) {
- var node = createNode(202, location, flags);
+ var node = createNode(203, location, flags);
node.expression = parenthesizeExpressionForExpressionStatement(expression);
return node;
}
@@ -8896,7 +9834,7 @@ var ts;
}
ts.updateStatement = updateStatement;
function createIf(expression, thenStatement, elseStatement, location) {
- var node = createNode(203, location);
+ var node = createNode(204, location);
node.expression = expression;
node.thenStatement = thenStatement;
node.elseStatement = elseStatement;
@@ -8911,7 +9849,7 @@ var ts;
}
ts.updateIf = updateIf;
function createDo(statement, expression, location) {
- var node = createNode(204, location);
+ var node = createNode(205, location);
node.statement = statement;
node.expression = expression;
return node;
@@ -8925,7 +9863,7 @@ var ts;
}
ts.updateDo = updateDo;
function createWhile(expression, statement, location) {
- var node = createNode(205, location);
+ var node = createNode(206, location);
node.expression = expression;
node.statement = statement;
return node;
@@ -8939,7 +9877,7 @@ var ts;
}
ts.updateWhile = updateWhile;
function createFor(initializer, condition, incrementor, statement, location) {
- var node = createNode(206, location, undefined);
+ var node = createNode(207, location, undefined);
node.initializer = initializer;
node.condition = condition;
node.incrementor = incrementor;
@@ -8955,7 +9893,7 @@ var ts;
}
ts.updateFor = updateFor;
function createForIn(initializer, expression, statement, location) {
- var node = createNode(207, location);
+ var node = createNode(208, location);
node.initializer = initializer;
node.expression = expression;
node.statement = statement;
@@ -8970,7 +9908,7 @@ var ts;
}
ts.updateForIn = updateForIn;
function createForOf(initializer, expression, statement, location) {
- var node = createNode(208, location);
+ var node = createNode(209, location);
node.initializer = initializer;
node.expression = expression;
node.statement = statement;
@@ -8985,7 +9923,7 @@ var ts;
}
ts.updateForOf = updateForOf;
function createContinue(label, location) {
- var node = createNode(209, location);
+ var node = createNode(210, location);
if (label) {
node.label = label;
}
@@ -9000,7 +9938,7 @@ var ts;
}
ts.updateContinue = updateContinue;
function createBreak(label, location) {
- var node = createNode(210, location);
+ var node = createNode(211, location);
if (label) {
node.label = label;
}
@@ -9015,7 +9953,7 @@ var ts;
}
ts.updateBreak = updateBreak;
function createReturn(expression, location) {
- var node = createNode(211, location);
+ var node = createNode(212, location);
node.expression = expression;
return node;
}
@@ -9028,7 +9966,7 @@ var ts;
}
ts.updateReturn = updateReturn;
function createWith(expression, statement, location) {
- var node = createNode(212, location);
+ var node = createNode(213, location);
node.expression = expression;
node.statement = statement;
return node;
@@ -9042,7 +9980,7 @@ var ts;
}
ts.updateWith = updateWith;
function createSwitch(expression, caseBlock, location) {
- var node = createNode(213, location);
+ var node = createNode(214, location);
node.expression = parenthesizeExpressionForList(expression);
node.caseBlock = caseBlock;
return node;
@@ -9056,7 +9994,7 @@ var ts;
}
ts.updateSwitch = updateSwitch;
function createLabel(label, statement, location) {
- var node = createNode(214, location);
+ var node = createNode(215, location);
node.label = typeof label === "string" ? createIdentifier(label) : label;
node.statement = statement;
return node;
@@ -9070,7 +10008,7 @@ var ts;
}
ts.updateLabel = updateLabel;
function createThrow(expression, location) {
- var node = createNode(215, location);
+ var node = createNode(216, location);
node.expression = expression;
return node;
}
@@ -9083,7 +10021,7 @@ var ts;
}
ts.updateThrow = updateThrow;
function createTry(tryBlock, catchClause, finallyBlock, location) {
- var node = createNode(216, location);
+ var node = createNode(217, location);
node.tryBlock = tryBlock;
node.catchClause = catchClause;
node.finallyBlock = finallyBlock;
@@ -9098,7 +10036,7 @@ var ts;
}
ts.updateTry = updateTry;
function createCaseBlock(clauses, location) {
- var node = createNode(227, location);
+ var node = createNode(228, location);
node.clauses = createNodeArray(clauses);
return node;
}
@@ -9111,7 +10049,7 @@ var ts;
}
ts.updateCaseBlock = updateCaseBlock;
function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
- var node = createNode(220, location, flags);
+ var node = createNode(221, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.asteriskToken = asteriskToken;
@@ -9131,7 +10069,7 @@ var ts;
}
ts.updateFunctionDeclaration = updateFunctionDeclaration;
function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, location) {
- var node = createNode(221, location);
+ var node = createNode(222, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = name;
@@ -9149,7 +10087,7 @@ var ts;
}
ts.updateClassDeclaration = updateClassDeclaration;
function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, location) {
- var node = createNode(230, location);
+ var node = createNode(231, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.importClause = importClause;
@@ -9165,7 +10103,7 @@ var ts;
}
ts.updateImportDeclaration = updateImportDeclaration;
function createImportClause(name, namedBindings, location) {
- var node = createNode(231, location);
+ var node = createNode(232, location);
node.name = name;
node.namedBindings = namedBindings;
return node;
@@ -9179,7 +10117,7 @@ var ts;
}
ts.updateImportClause = updateImportClause;
function createNamespaceImport(name, location) {
- var node = createNode(232, location);
+ var node = createNode(233, location);
node.name = name;
return node;
}
@@ -9192,7 +10130,7 @@ var ts;
}
ts.updateNamespaceImport = updateNamespaceImport;
function createNamedImports(elements, location) {
- var node = createNode(233, location);
+ var node = createNode(234, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -9205,7 +10143,7 @@ var ts;
}
ts.updateNamedImports = updateNamedImports;
function createImportSpecifier(propertyName, name, location) {
- var node = createNode(234, location);
+ var node = createNode(235, location);
node.propertyName = propertyName;
node.name = name;
return node;
@@ -9219,7 +10157,7 @@ var ts;
}
ts.updateImportSpecifier = updateImportSpecifier;
function createExportAssignment(decorators, modifiers, isExportEquals, expression, location) {
- var node = createNode(235, location);
+ var node = createNode(236, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.isExportEquals = isExportEquals;
@@ -9235,7 +10173,7 @@ var ts;
}
ts.updateExportAssignment = updateExportAssignment;
function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, location) {
- var node = createNode(236, location);
+ var node = createNode(237, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.exportClause = exportClause;
@@ -9251,7 +10189,7 @@ var ts;
}
ts.updateExportDeclaration = updateExportDeclaration;
function createNamedExports(elements, location) {
- var node = createNode(237, location);
+ var node = createNode(238, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -9264,7 +10202,7 @@ var ts;
}
ts.updateNamedExports = updateNamedExports;
function createExportSpecifier(name, propertyName, location) {
- var node = createNode(238, location);
+ var node = createNode(239, location);
node.name = typeof name === "string" ? createIdentifier(name) : name;
node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName;
return node;
@@ -9278,7 +10216,7 @@ var ts;
}
ts.updateExportSpecifier = updateExportSpecifier;
function createJsxElement(openingElement, children, closingElement, location) {
- var node = createNode(241, location);
+ var node = createNode(242, location);
node.openingElement = openingElement;
node.children = createNodeArray(children);
node.closingElement = closingElement;
@@ -9293,7 +10231,7 @@ var ts;
}
ts.updateJsxElement = updateJsxElement;
function createJsxSelfClosingElement(tagName, attributes, location) {
- var node = createNode(242, location);
+ var node = createNode(243, location);
node.tagName = tagName;
node.attributes = createNodeArray(attributes);
return node;
@@ -9307,7 +10245,7 @@ var ts;
}
ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement;
function createJsxOpeningElement(tagName, attributes, location) {
- var node = createNode(243, location);
+ var node = createNode(244, location);
node.tagName = tagName;
node.attributes = createNodeArray(attributes);
return node;
@@ -9541,47 +10479,47 @@ var ts;
}
ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression;
function createComma(left, right) {
- return createBinary(left, 24, right);
+ return createBinary(left, 25, right);
}
ts.createComma = createComma;
function createLessThan(left, right, location) {
- return createBinary(left, 25, right, location);
+ return createBinary(left, 26, right, location);
}
ts.createLessThan = createLessThan;
function createAssignment(left, right, location) {
- return createBinary(left, 56, right, location);
+ return createBinary(left, 57, right, location);
}
ts.createAssignment = createAssignment;
function createStrictEquality(left, right) {
- return createBinary(left, 32, right);
+ return createBinary(left, 33, right);
}
ts.createStrictEquality = createStrictEquality;
function createStrictInequality(left, right) {
- return createBinary(left, 33, right);
+ return createBinary(left, 34, right);
}
ts.createStrictInequality = createStrictInequality;
function createAdd(left, right) {
- return createBinary(left, 35, right);
+ return createBinary(left, 36, right);
}
ts.createAdd = createAdd;
function createSubtract(left, right) {
- return createBinary(left, 36, right);
+ return createBinary(left, 37, right);
}
ts.createSubtract = createSubtract;
function createPostfixIncrement(operand, location) {
- return createPostfix(operand, 41, location);
+ return createPostfix(operand, 42, location);
}
ts.createPostfixIncrement = createPostfixIncrement;
function createLogicalAnd(left, right) {
- return createBinary(left, 51, right);
+ return createBinary(left, 52, right);
}
ts.createLogicalAnd = createLogicalAnd;
function createLogicalOr(left, right) {
- return createBinary(left, 52, right);
+ return createBinary(left, 53, right);
}
ts.createLogicalOr = createLogicalOr;
function createLogicalNot(operand) {
- return createPrefix(49, operand);
+ return createPrefix(50, operand);
}
ts.createLogicalNot = createLogicalNot;
function createVoidZero() {
@@ -9600,7 +10538,7 @@ var ts;
}
ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName;
function createRestParameter(name) {
- return createParameterDeclaration(undefined, undefined, createToken(22), name, undefined, undefined, undefined);
+ return createParameterDeclaration(undefined, undefined, createToken(23), name, undefined, undefined, undefined);
}
ts.createRestParameter = createRestParameter;
function createFunctionCall(func, thisArg, argumentsList, location) {
@@ -9714,7 +10652,7 @@ var ts;
}
ts.createDecorateHelper = createDecorateHelper;
function createAwaiterHelper(externalHelpersModuleName, hasLexicalArguments, promiseConstructor, body) {
- var generatorFunc = createFunctionExpression(createToken(37), undefined, undefined, [], undefined, body);
+ var generatorFunc = createFunctionExpression(undefined, createToken(38), undefined, undefined, [], undefined, body);
(generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 2097152;
return createCall(createHelperName(externalHelpersModuleName, "__awaiter"), undefined, [
createThis(),
@@ -9758,7 +10696,7 @@ var ts;
setter
]))))));
return createVariableStatement(undefined, createConstDeclarationList([
- createVariableDeclaration("_super", undefined, createCall(createParen(createFunctionExpression(undefined, undefined, undefined, [
+ createVariableDeclaration("_super", undefined, createCall(createParen(createFunctionExpression(undefined, undefined, undefined, undefined, [
createParameter("geti"),
createParameter("seti")
], undefined, createBlock([
@@ -9780,19 +10718,19 @@ var ts;
function shouldBeCapturedInTempVariable(node, cacheIdentifiers) {
var target = skipParentheses(node);
switch (target.kind) {
- case 69:
+ case 70:
return cacheIdentifiers;
- case 97:
+ case 98:
case 8:
case 9:
return false;
- case 170:
+ case 171:
var elements = target.elements;
if (elements.length === 0) {
return false;
}
return true;
- case 171:
+ case 172:
return target.properties.length > 0;
default:
return true;
@@ -9806,13 +10744,13 @@ var ts;
thisArg = createThis();
target = callee;
}
- else if (callee.kind === 95) {
+ else if (callee.kind === 96) {
thisArg = createThis();
target = languageVersion < 2 ? createIdentifier("_super", callee) : callee;
}
else {
switch (callee.kind) {
- case 172: {
+ case 173: {
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
thisArg = createTempVariable(recordTempVariable);
target = createPropertyAccess(createAssignment(thisArg, callee.expression, callee.expression), callee.name, callee);
@@ -9823,7 +10761,7 @@ var ts;
}
break;
}
- case 173: {
+ case 174: {
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
thisArg = createTempVariable(recordTempVariable);
target = createElementAccess(createAssignment(thisArg, callee.expression, callee.expression), callee.argumentExpression, callee);
@@ -9873,14 +10811,14 @@ var ts;
ts.createExpressionForPropertyName = createExpressionForPropertyName;
function createExpressionForObjectLiteralElementLike(node, property, receiver) {
switch (property.kind) {
- case 149:
case 150:
+ case 151:
return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine);
case 253:
return createExpressionForPropertyAssignment(property, receiver);
case 254:
return createExpressionForShorthandPropertyAssignment(property, receiver);
- case 147:
+ case 148:
return createExpressionForMethodDeclaration(property, receiver);
}
}
@@ -9890,13 +10828,13 @@ var ts;
if (property === firstAccessor) {
var properties_1 = [];
if (getAccessor) {
- var getterFunction = createFunctionExpression(undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body, getAccessor);
+ var getterFunction = createFunctionExpression(getAccessor.modifiers, undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body, getAccessor);
setOriginalNode(getterFunction, getAccessor);
var getter = createPropertyAssignment("get", getterFunction);
properties_1.push(getter);
}
if (setAccessor) {
- var setterFunction = createFunctionExpression(undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body, setAccessor);
+ var setterFunction = createFunctionExpression(setAccessor.modifiers, undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body, setAccessor);
setOriginalNode(setterFunction, setAccessor);
var setter = createPropertyAssignment("set", setterFunction);
properties_1.push(setter);
@@ -9919,13 +10857,13 @@ var ts;
return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, property.name, property.name), getSynthesizedClone(property.name), property), property));
}
function createExpressionForMethodDeclaration(method, receiver) {
- return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, method.name, method.name), setOriginalNode(createFunctionExpression(method.asteriskToken, undefined, undefined, method.parameters, undefined, method.body, method), method), method), method));
+ return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, method.name, method.name), setOriginalNode(createFunctionExpression(method.modifiers, method.asteriskToken, undefined, undefined, method.parameters, undefined, method.body, method), method), method), method));
}
function isUseStrictPrologue(node) {
return node.expression.text === "use strict";
}
function addPrologueDirectives(target, source, ensureUseStrict, visitor) {
- ts.Debug.assert(target.length === 0, "PrologueDirectives should be at the first statement in the target statements array");
+ ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array");
var foundUseStrict = false;
var statementOffset = 0;
var numStatements = source.length;
@@ -9938,16 +10876,20 @@ var ts;
target.push(statement);
}
else {
- if (ensureUseStrict && !foundUseStrict) {
- target.push(startOnNewLine(createStatement(createLiteral("use strict"))));
- foundUseStrict = true;
- }
- if (getEmitFlags(statement) & 8388608) {
- target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement);
- }
- else {
- break;
- }
+ break;
+ }
+ statementOffset++;
+ }
+ if (ensureUseStrict && !foundUseStrict) {
+ target.push(startOnNewLine(createStatement(createLiteral("use strict"))));
+ }
+ while (statementOffset < numStatements) {
+ var statement = source[statementOffset];
+ if (getEmitFlags(statement) & 8388608) {
+ target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement);
+ }
+ else {
+ break;
}
statementOffset++;
}
@@ -9978,7 +10920,7 @@ var ts;
ts.ensureUseStrict = ensureUseStrict;
function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
var skipped = skipPartiallyEmittedExpressions(operand);
- if (skipped.kind === 178) {
+ if (skipped.kind === 179) {
return operand;
}
return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand)
@@ -9987,15 +10929,15 @@ var ts;
}
ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand;
function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
- var binaryOperatorPrecedence = ts.getOperatorPrecedence(187, binaryOperator);
- var binaryOperatorAssociativity = ts.getOperatorAssociativity(187, binaryOperator);
+ var binaryOperatorPrecedence = ts.getOperatorPrecedence(188, binaryOperator);
+ var binaryOperatorAssociativity = ts.getOperatorAssociativity(188, binaryOperator);
var emittedOperand = skipPartiallyEmittedExpressions(operand);
var operandPrecedence = ts.getExpressionPrecedence(emittedOperand);
switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) {
case -1:
if (!isLeftSideOfBinary
&& binaryOperatorAssociativity === 1
- && operand.kind === 190) {
+ && operand.kind === 191) {
return false;
}
return true;
@@ -10011,7 +10953,7 @@ var ts;
if (operatorHasAssociativeProperty(binaryOperator)) {
return false;
}
- if (binaryOperator === 35) {
+ if (binaryOperator === 36) {
var leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0;
if (ts.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) {
return false;
@@ -10024,17 +10966,17 @@ var ts;
}
}
function operatorHasAssociativeProperty(binaryOperator) {
- return binaryOperator === 37
+ return binaryOperator === 38
+ || binaryOperator === 48
|| binaryOperator === 47
- || binaryOperator === 46
- || binaryOperator === 48;
+ || binaryOperator === 49;
}
function getLiteralKindOfBinaryPlusOperand(node) {
node = skipPartiallyEmittedExpressions(node);
if (ts.isLiteralKind(node.kind)) {
return node.kind;
}
- if (node.kind === 187 && node.operatorToken.kind === 35) {
+ if (node.kind === 188 && node.operatorToken.kind === 36) {
if (node.cachedLiteralKind !== undefined) {
return node.cachedLiteralKind;
}
@@ -10051,9 +10993,9 @@ var ts;
function parenthesizeForNew(expression) {
var emittedExpression = skipPartiallyEmittedExpressions(expression);
switch (emittedExpression.kind) {
- case 174:
- return createParen(expression);
case 175:
+ return createParen(expression);
+ case 176:
return emittedExpression.arguments
? expression
: createParen(expression);
@@ -10064,7 +11006,7 @@ var ts;
function parenthesizeForAccess(expression) {
var emittedExpression = skipPartiallyEmittedExpressions(expression);
if (ts.isLeftHandSideExpression(emittedExpression)
- && (emittedExpression.kind !== 175 || emittedExpression.arguments)
+ && (emittedExpression.kind !== 176 || emittedExpression.arguments)
&& emittedExpression.kind !== 8) {
return expression;
}
@@ -10102,7 +11044,7 @@ var ts;
function parenthesizeExpressionForList(expression) {
var emittedExpression = skipPartiallyEmittedExpressions(expression);
var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression);
- var commaPrecedence = ts.getOperatorPrecedence(187, 24);
+ var commaPrecedence = ts.getOperatorPrecedence(188, 25);
return expressionPrecedence > commaPrecedence
? expression
: createParen(expression, expression);
@@ -10113,7 +11055,7 @@ var ts;
if (ts.isCallExpression(emittedExpression)) {
var callee = emittedExpression.expression;
var kind = skipPartiallyEmittedExpressions(callee).kind;
- if (kind === 179 || kind === 180) {
+ if (kind === 180 || kind === 181) {
var mutableCall = getMutableClone(emittedExpression);
mutableCall.expression = createParen(callee, callee);
return recreatePartiallyEmittedExpressions(expression, mutableCall);
@@ -10121,7 +11063,7 @@ var ts;
}
else {
var leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind;
- if (leftmostExpressionKind === 171 || leftmostExpressionKind === 179) {
+ if (leftmostExpressionKind === 172 || leftmostExpressionKind === 180) {
return createParen(expression, expression);
}
}
@@ -10139,18 +11081,18 @@ var ts;
function getLeftmostExpression(node) {
while (true) {
switch (node.kind) {
- case 186:
+ case 187:
node = node.operand;
continue;
- case 187:
+ case 188:
node = node.left;
continue;
- case 188:
+ case 189:
node = node.condition;
continue;
+ case 175:
case 174:
case 173:
- case 172:
node = node.expression;
continue;
case 288:
@@ -10162,12 +11104,19 @@ var ts;
}
function parenthesizeConciseBody(body) {
var emittedBody = skipPartiallyEmittedExpressions(body);
- if (emittedBody.kind === 171) {
+ if (emittedBody.kind === 172) {
return createParen(body, body);
}
return body;
}
ts.parenthesizeConciseBody = parenthesizeConciseBody;
+ (function (OuterExpressionKinds) {
+ OuterExpressionKinds[OuterExpressionKinds["Parentheses"] = 1] = "Parentheses";
+ OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 2] = "Assertions";
+ OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 4] = "PartiallyEmittedExpressions";
+ OuterExpressionKinds[OuterExpressionKinds["All"] = 7] = "All";
+ })(ts.OuterExpressionKinds || (ts.OuterExpressionKinds = {}));
+ var OuterExpressionKinds = ts.OuterExpressionKinds;
function skipOuterExpressions(node, kinds) {
if (kinds === void 0) { kinds = 7; }
var previousNode;
@@ -10187,7 +11136,7 @@ var ts;
}
ts.skipOuterExpressions = skipOuterExpressions;
function skipParentheses(node) {
- while (node.kind === 178) {
+ while (node.kind === 179) {
node = node.expression;
}
return node;
@@ -10350,10 +11299,10 @@ var ts;
var name_9 = namespaceDeclaration.name;
return ts.isGeneratedIdentifier(name_9) ? name_9 : createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name));
}
- if (node.kind === 230 && node.importClause) {
+ if (node.kind === 231 && node.importClause) {
return getGeneratedNameForNode(node);
}
- if (node.kind === 236 && node.moduleSpecifier) {
+ if (node.kind === 237 && node.moduleSpecifier) {
return getGeneratedNameForNode(node);
}
return undefined;
@@ -10402,10 +11351,10 @@ var ts;
if (kind === 256) {
return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end);
}
- else if (kind === 69) {
+ else if (kind === 70) {
return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, pos, end);
}
- else if (kind < 139) {
+ else if (kind < 140) {
return new (TokenConstructor || (TokenConstructor = ts.objectAllocator.getTokenConstructor()))(kind, pos, end);
}
else {
@@ -10441,10 +11390,10 @@ var ts;
var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode;
var cbNodes = cbNodeArray || cbNode;
switch (node.kind) {
- case 139:
+ case 140:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.right);
- case 141:
+ case 142:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.constraint) ||
visitNode(cbNode, node.expression);
@@ -10455,12 +11404,12 @@ var ts;
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.equalsToken) ||
visitNode(cbNode, node.objectAssignmentInitializer);
- case 142:
+ case 143:
+ case 146:
case 145:
- case 144:
case 253:
- case 218:
- case 169:
+ case 219:
+ case 170:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.propertyName) ||
@@ -10469,24 +11418,24 @@ var ts;
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
- case 156:
case 157:
- case 151:
+ case 158:
case 152:
case 153:
+ case 154:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNodes(cbNodes, node.typeParameters) ||
visitNodes(cbNodes, node.parameters) ||
visitNode(cbNode, node.type);
- case 147:
- case 146:
case 148:
+ case 147:
case 149:
case 150:
- case 179:
- case 220:
+ case 151:
case 180:
+ case 221:
+ case 181:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.asteriskToken) ||
@@ -10497,163 +11446,156 @@ var ts;
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.equalsGreaterThanToken) ||
visitNode(cbNode, node.body);
- case 155:
+ case 156:
return visitNode(cbNode, node.typeName) ||
visitNodes(cbNodes, node.typeArguments);
- case 154:
+ case 155:
return visitNode(cbNode, node.parameterName) ||
visitNode(cbNode, node.type);
- case 158:
- return visitNode(cbNode, node.exprName);
case 159:
- return visitNodes(cbNodes, node.members);
+ return visitNode(cbNode, node.exprName);
case 160:
- return visitNode(cbNode, node.elementType);
+ return visitNodes(cbNodes, node.members);
case 161:
- return visitNodes(cbNodes, node.elementTypes);
+ return visitNode(cbNode, node.elementType);
case 162:
+ return visitNodes(cbNodes, node.elementTypes);
case 163:
- return visitNodes(cbNodes, node.types);
case 164:
+ return visitNodes(cbNodes, node.types);
+ case 165:
return visitNode(cbNode, node.type);
- case 166:
- return visitNode(cbNode, node.literal);
case 167:
+ return visitNode(cbNode, node.literal);
case 168:
- return visitNodes(cbNodes, node.elements);
- case 170:
+ case 169:
return visitNodes(cbNodes, node.elements);
case 171:
- return visitNodes(cbNodes, node.properties);
+ return visitNodes(cbNodes, node.elements);
case 172:
- return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.name);
+ return visitNodes(cbNodes, node.properties);
case 173:
return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.argumentExpression);
+ visitNode(cbNode, node.name);
case 174:
+ return visitNode(cbNode, node.expression) ||
+ visitNode(cbNode, node.argumentExpression);
case 175:
+ case 176:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNodes, node.typeArguments) ||
visitNodes(cbNodes, node.arguments);
- case 176:
+ case 177:
return visitNode(cbNode, node.tag) ||
visitNode(cbNode, node.template);
- case 177:
+ case 178:
return visitNode(cbNode, node.type) ||
visitNode(cbNode, node.expression);
- case 178:
- return visitNode(cbNode, node.expression);
- case 181:
+ case 179:
return visitNode(cbNode, node.expression);
case 182:
return visitNode(cbNode, node.expression);
case 183:
return visitNode(cbNode, node.expression);
- case 185:
- return visitNode(cbNode, node.operand);
- case 190:
- return visitNode(cbNode, node.asteriskToken) ||
- visitNode(cbNode, node.expression);
case 184:
return visitNode(cbNode, node.expression);
case 186:
return visitNode(cbNode, node.operand);
+ case 191:
+ return visitNode(cbNode, node.asteriskToken) ||
+ visitNode(cbNode, node.expression);
+ case 185:
+ return visitNode(cbNode, node.expression);
case 187:
+ return visitNode(cbNode, node.operand);
+ case 188:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.operatorToken) ||
visitNode(cbNode, node.right);
- case 195:
+ case 196:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.type);
- case 196:
+ case 197:
return visitNode(cbNode, node.expression);
- case 188:
+ case 189:
return visitNode(cbNode, node.condition) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.whenTrue) ||
visitNode(cbNode, node.colonToken) ||
visitNode(cbNode, node.whenFalse);
- case 191:
+ case 192:
return visitNode(cbNode, node.expression);
- case 199:
- case 226:
+ case 200:
+ case 227:
return visitNodes(cbNodes, node.statements);
case 256:
return visitNodes(cbNodes, node.statements) ||
visitNode(cbNode, node.endOfFileToken);
- case 200:
+ case 201:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.declarationList);
- case 219:
+ case 220:
return visitNodes(cbNodes, node.declarations);
- case 202:
- return visitNode(cbNode, node.expression);
case 203:
+ return visitNode(cbNode, node.expression);
+ case 204:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.thenStatement) ||
visitNode(cbNode, node.elseStatement);
- case 204:
+ case 205:
return visitNode(cbNode, node.statement) ||
visitNode(cbNode, node.expression);
- case 205:
- return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.statement);
case 206:
- return visitNode(cbNode, node.initializer) ||
- visitNode(cbNode, node.condition) ||
- visitNode(cbNode, node.incrementor) ||
+ return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
case 207:
return visitNode(cbNode, node.initializer) ||
- visitNode(cbNode, node.expression) ||
+ visitNode(cbNode, node.condition) ||
+ visitNode(cbNode, node.incrementor) ||
visitNode(cbNode, node.statement);
case 208:
return visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
case 209:
- case 210:
- return visitNode(cbNode, node.label);
- case 211:
- return visitNode(cbNode, node.expression);
- case 212:
- return visitNode(cbNode, node.expression) ||
+ return visitNode(cbNode, node.initializer) ||
+ visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
+ case 210:
+ case 211:
+ return visitNode(cbNode, node.label);
+ case 212:
+ return visitNode(cbNode, node.expression);
case 213:
+ return visitNode(cbNode, node.expression) ||
+ visitNode(cbNode, node.statement);
+ case 214:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.caseBlock);
- case 227:
+ case 228:
return visitNodes(cbNodes, node.clauses);
case 249:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNodes, node.statements);
case 250:
return visitNodes(cbNodes, node.statements);
- case 214:
+ case 215:
return visitNode(cbNode, node.label) ||
visitNode(cbNode, node.statement);
- case 215:
- return visitNode(cbNode, node.expression);
case 216:
+ return visitNode(cbNode, node.expression);
+ case 217:
return visitNode(cbNode, node.tryBlock) ||
visitNode(cbNode, node.catchClause) ||
visitNode(cbNode, node.finallyBlock);
case 252:
return visitNode(cbNode, node.variableDeclaration) ||
visitNode(cbNode, node.block);
- case 143:
+ case 144:
return visitNode(cbNode, node.expression);
- case 221:
- case 192:
- return visitNodes(cbNodes, node.decorators) ||
- visitNodes(cbNodes, node.modifiers) ||
- visitNode(cbNode, node.name) ||
- visitNodes(cbNodes, node.typeParameters) ||
- visitNodes(cbNodes, node.heritageClauses) ||
- visitNodes(cbNodes, node.members);
case 222:
+ case 193:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
@@ -10665,8 +11607,15 @@ var ts;
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNodes(cbNodes, node.typeParameters) ||
- visitNode(cbNode, node.type);
+ visitNodes(cbNodes, node.heritageClauses) ||
+ visitNodes(cbNodes, node.members);
case 224:
+ return visitNodes(cbNodes, node.decorators) ||
+ visitNodes(cbNodes, node.modifiers) ||
+ visitNode(cbNode, node.name) ||
+ visitNodes(cbNodes, node.typeParameters) ||
+ visitNode(cbNode, node.type);
+ case 225:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
@@ -10674,65 +11623,65 @@ var ts;
case 255:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.initializer);
- case 225:
+ case 226:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.body);
- case 229:
+ case 230:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.moduleReference);
- case 230:
+ case 231:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.importClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 231:
+ case 232:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.namedBindings);
- case 228:
- return visitNode(cbNode, node.name);
- case 232:
+ case 229:
return visitNode(cbNode, node.name);
case 233:
- case 237:
+ return visitNode(cbNode, node.name);
+ case 234:
+ case 238:
return visitNodes(cbNodes, node.elements);
- case 236:
+ case 237:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.exportClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 234:
- case 238:
+ case 235:
+ case 239:
return visitNode(cbNode, node.propertyName) ||
visitNode(cbNode, node.name);
- case 235:
+ case 236:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.expression);
- case 189:
+ case 190:
return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans);
- case 197:
+ case 198:
return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal);
- case 140:
+ case 141:
return visitNode(cbNode, node.expression);
case 251:
return visitNodes(cbNodes, node.types);
- case 194:
+ case 195:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNodes, node.typeArguments);
- case 240:
- return visitNode(cbNode, node.expression);
- case 239:
- return visitNodes(cbNodes, node.decorators);
case 241:
+ return visitNode(cbNode, node.expression);
+ case 240:
+ return visitNodes(cbNodes, node.decorators);
+ case 242:
return visitNode(cbNode, node.openingElement) ||
visitNodes(cbNodes, node.children) ||
visitNode(cbNode, node.closingElement);
- case 242:
case 243:
+ case 244:
return visitNode(cbNode, node.tagName) ||
visitNodes(cbNodes, node.attributes);
case 246:
@@ -10834,7 +11783,7 @@ var ts;
ts.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests;
var Parser;
(function (Parser) {
- var scanner = ts.createScanner(2, true);
+ var scanner = ts.createScanner(4, true);
var disallowInAndDecoratorContext = 32768 | 131072;
var NodeConstructor;
var TokenConstructor;
@@ -10851,9 +11800,9 @@ var ts;
var parsingContext;
var contextFlags;
var parseErrorBeforeNextFinishedNode = false;
- function parseSourceFile(fileName, _sourceText, languageVersion, _syntaxCursor, setParentNodes, scriptKind) {
+ function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind) {
scriptKind = ts.ensureScriptKind(fileName, scriptKind);
- initializeState(fileName, _sourceText, languageVersion, _syntaxCursor, scriptKind);
+ initializeState(sourceText, languageVersion, syntaxCursor, scriptKind);
var result = parseSourceFileWorker(fileName, languageVersion, setParentNodes, scriptKind);
clearState();
return result;
@@ -10862,7 +11811,7 @@ var ts;
function getLanguageVariant(scriptKind) {
return scriptKind === 4 || scriptKind === 2 || scriptKind === 1 ? 1 : 0;
}
- function initializeState(fileName, _sourceText, languageVersion, _syntaxCursor, scriptKind) {
+ function initializeState(_sourceText, languageVersion, _syntaxCursor, scriptKind) {
NodeConstructor = ts.objectAllocator.getNodeConstructor();
TokenConstructor = ts.objectAllocator.getTokenConstructor();
IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor();
@@ -11105,16 +12054,16 @@ var ts;
return speculationHelper(callback, false);
}
function isIdentifier() {
- if (token() === 69) {
+ if (token() === 70) {
return true;
}
- if (token() === 114 && inYieldContext()) {
+ if (token() === 115 && inYieldContext()) {
return false;
}
- if (token() === 119 && inAwaitContext()) {
+ if (token() === 120 && inAwaitContext()) {
return false;
}
- return token() > 105;
+ return token() > 106;
}
function parseExpected(kind, diagnosticMessage, shouldAdvance) {
if (shouldAdvance === void 0) { shouldAdvance = true; }
@@ -11155,20 +12104,20 @@ var ts;
return finishNode(node);
}
function canParseSemicolon() {
- if (token() === 23) {
+ if (token() === 24) {
return true;
}
- return token() === 16 || token() === 1 || scanner.hasPrecedingLineBreak();
+ return token() === 17 || token() === 1 || scanner.hasPrecedingLineBreak();
}
function parseSemicolon() {
if (canParseSemicolon()) {
- if (token() === 23) {
+ if (token() === 24) {
nextToken();
}
return true;
}
else {
- return parseExpected(23);
+ return parseExpected(24);
}
}
function createNode(kind, pos) {
@@ -11176,8 +12125,8 @@ var ts;
if (!(pos >= 0)) {
pos = scanner.getStartPos();
}
- return kind >= 139 ? new NodeConstructor(kind, pos, pos) :
- kind === 69 ? new IdentifierConstructor(kind, pos, pos) :
+ return kind >= 140 ? new NodeConstructor(kind, pos, pos) :
+ kind === 70 ? new IdentifierConstructor(kind, pos, pos) :
new TokenConstructor(kind, pos, pos);
}
function createNodeArray(elements, pos) {
@@ -11218,15 +12167,15 @@ var ts;
function createIdentifier(isIdentifier, diagnosticMessage) {
identifierCount++;
if (isIdentifier) {
- var node = createNode(69);
- if (token() !== 69) {
+ var node = createNode(70);
+ if (token() !== 70) {
node.originalKeywordKind = token();
}
node.text = internIdentifier(scanner.getTokenValue());
nextToken();
return finishNode(node);
}
- return createMissingNode(69, false, diagnosticMessage || ts.Diagnostics.Identifier_expected);
+ return createMissingNode(70, false, diagnosticMessage || ts.Diagnostics.Identifier_expected);
}
function parseIdentifier(diagnosticMessage) {
return createIdentifier(isIdentifier(), diagnosticMessage);
@@ -11243,7 +12192,7 @@ var ts;
if (token() === 9 || token() === 8) {
return parseLiteralNode(true);
}
- if (allowComputedPropertyNames && token() === 19) {
+ if (allowComputedPropertyNames && token() === 20) {
return parseComputedPropertyName();
}
return parseIdentifierName();
@@ -11258,10 +12207,10 @@ var ts;
return token() === 9 || token() === 8 || ts.tokenIsIdentifierOrKeyword(token());
}
function parseComputedPropertyName() {
- var node = createNode(140);
- parseExpected(19);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(141);
parseExpected(20);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(21);
return finishNode(node);
}
function parseContextualModifier(t) {
@@ -11275,20 +12224,20 @@ var ts;
return canFollowModifier();
}
function nextTokenCanFollowModifier() {
- if (token() === 74) {
- return nextToken() === 81;
+ if (token() === 75) {
+ return nextToken() === 82;
}
- if (token() === 82) {
+ if (token() === 83) {
nextToken();
- if (token() === 77) {
+ if (token() === 78) {
return lookAhead(nextTokenIsClassOrFunctionOrAsync);
}
- return token() !== 37 && token() !== 116 && token() !== 15 && canFollowModifier();
+ return token() !== 38 && token() !== 117 && token() !== 16 && canFollowModifier();
}
- if (token() === 77) {
+ if (token() === 78) {
return nextTokenIsClassOrFunctionOrAsync();
}
- if (token() === 113) {
+ if (token() === 114) {
nextToken();
return canFollowModifier();
}
@@ -11298,16 +12247,16 @@ var ts;
return ts.isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 19
- || token() === 15
- || token() === 37
- || token() === 22
+ return token() === 20
+ || token() === 16
+ || token() === 38
+ || token() === 23
|| isLiteralPropertyName();
}
function nextTokenIsClassOrFunctionOrAsync() {
nextToken();
- return token() === 73 || token() === 87 ||
- (token() === 118 && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
+ return token() === 74 || token() === 88 ||
+ (token() === 119 && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
}
function isListElement(parsingContext, inErrorRecovery) {
var node = currentNode(parsingContext);
@@ -11318,21 +12267,21 @@ var ts;
case 0:
case 1:
case 3:
- return !(token() === 23 && inErrorRecovery) && isStartOfStatement();
+ return !(token() === 24 && inErrorRecovery) && isStartOfStatement();
case 2:
- return token() === 71 || token() === 77;
+ return token() === 72 || token() === 78;
case 4:
return lookAhead(isTypeMemberStart);
case 5:
- return lookAhead(isClassMemberStart) || (token() === 23 && !inErrorRecovery);
+ return lookAhead(isClassMemberStart) || (token() === 24 && !inErrorRecovery);
case 6:
- return token() === 19 || isLiteralPropertyName();
+ return token() === 20 || isLiteralPropertyName();
case 12:
- return token() === 19 || token() === 37 || isLiteralPropertyName();
+ return token() === 20 || token() === 38 || isLiteralPropertyName();
case 9:
- return token() === 19 || isLiteralPropertyName();
+ return token() === 20 || isLiteralPropertyName();
case 7:
- if (token() === 15) {
+ if (token() === 16) {
return lookAhead(isValidHeritageClauseObjectLiteral);
}
if (!inErrorRecovery) {
@@ -11344,23 +12293,23 @@ var ts;
case 8:
return isIdentifierOrPattern();
case 10:
- return token() === 24 || token() === 22 || isIdentifierOrPattern();
+ return token() === 25 || token() === 23 || isIdentifierOrPattern();
case 17:
return isIdentifier();
case 11:
case 15:
- return token() === 24 || token() === 22 || isStartOfExpression();
+ return token() === 25 || token() === 23 || isStartOfExpression();
case 16:
return isStartOfParameter();
case 18:
case 19:
- return token() === 24 || isStartOfType();
+ return token() === 25 || isStartOfType();
case 20:
return isHeritageClause();
case 21:
return ts.tokenIsIdentifierOrKeyword(token());
case 13:
- return ts.tokenIsIdentifierOrKeyword(token()) || token() === 15;
+ return ts.tokenIsIdentifierOrKeyword(token()) || token() === 16;
case 14:
return true;
case 22:
@@ -11373,10 +12322,10 @@ var ts;
ts.Debug.fail("Non-exhaustive case in 'isListElement'.");
}
function isValidHeritageClauseObjectLiteral() {
- ts.Debug.assert(token() === 15);
- if (nextToken() === 16) {
+ ts.Debug.assert(token() === 16);
+ if (nextToken() === 17) {
var next = nextToken();
- return next === 24 || next === 15 || next === 83 || next === 106;
+ return next === 25 || next === 16 || next === 84 || next === 107;
}
return true;
}
@@ -11389,8 +12338,8 @@ var ts;
return ts.tokenIsIdentifierOrKeyword(token());
}
function isHeritageClauseExtendsOrImplementsKeyword() {
- if (token() === 106 ||
- token() === 83) {
+ if (token() === 107 ||
+ token() === 84) {
return lookAhead(nextTokenIsStartOfExpression);
}
return false;
@@ -11412,39 +12361,39 @@ var ts;
case 12:
case 9:
case 21:
- return token() === 16;
+ return token() === 17;
case 3:
- return token() === 16 || token() === 71 || token() === 77;
+ return token() === 17 || token() === 72 || token() === 78;
case 7:
- return token() === 15 || token() === 83 || token() === 106;
+ return token() === 16 || token() === 84 || token() === 107;
case 8:
return isVariableDeclaratorListTerminator();
case 17:
- return token() === 27 || token() === 17 || token() === 15 || token() === 83 || token() === 106;
+ return token() === 28 || token() === 18 || token() === 16 || token() === 84 || token() === 107;
case 11:
- return token() === 18 || token() === 23;
+ return token() === 19 || token() === 24;
case 15:
case 19:
case 10:
- return token() === 20;
+ return token() === 21;
case 16:
- return token() === 18 || token() === 20;
+ return token() === 19 || token() === 21;
case 18:
- return token() !== 24;
+ return token() !== 25;
case 20:
- return token() === 15 || token() === 16;
+ return token() === 16 || token() === 17;
case 13:
- return token() === 27 || token() === 39;
+ return token() === 28 || token() === 40;
case 14:
- return token() === 25 && lookAhead(nextTokenIsSlash);
+ return token() === 26 && lookAhead(nextTokenIsSlash);
case 22:
- return token() === 18 || token() === 54 || token() === 16;
+ return token() === 19 || token() === 55 || token() === 17;
case 23:
- return token() === 27 || token() === 16;
+ return token() === 28 || token() === 17;
case 25:
- return token() === 20 || token() === 16;
+ return token() === 21 || token() === 17;
case 24:
- return token() === 16;
+ return token() === 17;
}
}
function isVariableDeclaratorListTerminator() {
@@ -11454,7 +12403,7 @@ var ts;
if (isInOrOfKeyword(token())) {
return true;
}
- if (token() === 34) {
+ if (token() === 35) {
return true;
}
return false;
@@ -11558,17 +12507,17 @@ var ts;
function isReusableClassMember(node) {
if (node) {
switch (node.kind) {
- case 148:
- case 153:
case 149:
+ case 154:
case 150:
- case 145:
- case 198:
+ case 151:
+ case 146:
+ case 199:
return true;
- case 147:
+ case 148:
var methodDeclaration = node;
- var nameIsConstructor = methodDeclaration.name.kind === 69 &&
- methodDeclaration.name.originalKeywordKind === 121;
+ var nameIsConstructor = methodDeclaration.name.kind === 70 &&
+ methodDeclaration.name.originalKeywordKind === 122;
return !nameIsConstructor;
}
}
@@ -11587,35 +12536,35 @@ var ts;
function isReusableStatement(node) {
if (node) {
switch (node.kind) {
- case 220:
+ case 221:
+ case 201:
case 200:
- case 199:
+ case 204:
case 203:
- case 202:
- case 215:
+ case 216:
+ case 212:
+ case 214:
case 211:
- case 213:
case 210:
+ case 208:
case 209:
case 207:
- case 208:
case 206:
- case 205:
- case 212:
- case 201:
- case 216:
- case 214:
- case 204:
+ case 213:
+ case 202:
case 217:
+ case 215:
+ case 205:
+ case 218:
+ case 231:
case 230:
- case 229:
+ case 237:
case 236:
- case 235:
- case 225:
- case 221:
+ case 226:
case 222:
- case 224:
case 223:
+ case 225:
+ case 224:
return true;
}
}
@@ -11627,25 +12576,25 @@ var ts;
function isReusableTypeMember(node) {
if (node) {
switch (node.kind) {
- case 152:
- case 146:
case 153:
- case 144:
- case 151:
+ case 147:
+ case 154:
+ case 145:
+ case 152:
return true;
}
}
return false;
}
function isReusableVariableDeclaration(node) {
- if (node.kind !== 218) {
+ if (node.kind !== 219) {
return false;
}
var variableDeclarator = node;
return variableDeclarator.initializer === undefined;
}
function isReusableParameter(node) {
- if (node.kind !== 142) {
+ if (node.kind !== 143) {
return false;
}
var parameter = node;
@@ -11699,15 +12648,15 @@ var ts;
if (isListElement(kind, false)) {
result.push(parseListElement(kind, parseElement));
commaStart = scanner.getTokenPos();
- if (parseOptional(24)) {
+ if (parseOptional(25)) {
continue;
}
commaStart = -1;
if (isListTerminator(kind)) {
break;
}
- parseExpected(24);
- if (considerSemicolonAsDelimiter && token() === 23 && !scanner.hasPrecedingLineBreak()) {
+ parseExpected(25);
+ if (considerSemicolonAsDelimiter && token() === 24 && !scanner.hasPrecedingLineBreak()) {
nextToken();
}
continue;
@@ -11739,8 +12688,8 @@ var ts;
}
function parseEntityName(allowReservedWords, diagnosticMessage) {
var entity = parseIdentifier(diagnosticMessage);
- while (parseOptional(21)) {
- var node = createNode(139, entity.pos);
+ while (parseOptional(22)) {
+ var node = createNode(140, entity.pos);
node.left = entity;
node.right = parseRightSideOfDot(allowReservedWords);
entity = finishNode(node);
@@ -11751,33 +12700,33 @@ var ts;
if (scanner.hasPrecedingLineBreak() && ts.tokenIsIdentifierOrKeyword(token())) {
var matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);
if (matchesPattern) {
- return createMissingNode(69, true, ts.Diagnostics.Identifier_expected);
+ return createMissingNode(70, true, ts.Diagnostics.Identifier_expected);
}
}
return allowIdentifierNames ? parseIdentifierName() : parseIdentifier();
}
function parseTemplateExpression() {
- var template = createNode(189);
+ var template = createNode(190);
template.head = parseTemplateHead();
- ts.Debug.assert(template.head.kind === 12, "Template head has wrong token kind");
+ ts.Debug.assert(template.head.kind === 13, "Template head has wrong token kind");
var templateSpans = createNodeArray();
do {
templateSpans.push(parseTemplateSpan());
- } while (ts.lastOrUndefined(templateSpans).literal.kind === 13);
+ } while (ts.lastOrUndefined(templateSpans).literal.kind === 14);
templateSpans.end = getNodeEnd();
template.templateSpans = templateSpans;
return finishNode(template);
}
function parseTemplateSpan() {
- var span = createNode(197);
+ var span = createNode(198);
span.expression = allowInAnd(parseExpression);
var literal;
- if (token() === 16) {
+ if (token() === 17) {
reScanTemplateToken();
literal = parseTemplateMiddleOrTemplateTail();
}
else {
- literal = parseExpectedToken(14, false, ts.Diagnostics._0_expected, ts.tokenToString(16));
+ literal = parseExpectedToken(15, false, ts.Diagnostics._0_expected, ts.tokenToString(17));
}
span.literal = literal;
return finishNode(span);
@@ -11787,12 +12736,12 @@ var ts;
}
function parseTemplateHead() {
var fragment = parseLiteralLikeNode(token(), false);
- ts.Debug.assert(fragment.kind === 12, "Template head has wrong token kind");
+ ts.Debug.assert(fragment.kind === 13, "Template head has wrong token kind");
return fragment;
}
function parseTemplateMiddleOrTemplateTail() {
var fragment = parseLiteralLikeNode(token(), false);
- ts.Debug.assert(fragment.kind === 13 || fragment.kind === 14, "Template fragment has wrong token kind");
+ ts.Debug.assert(fragment.kind === 14 || fragment.kind === 15, "Template fragment has wrong token kind");
return fragment;
}
function parseLiteralLikeNode(kind, internName) {
@@ -11817,35 +12766,35 @@ var ts;
}
function parseTypeReference() {
var typeName = parseEntityName(false, ts.Diagnostics.Type_expected);
- var node = createNode(155, typeName.pos);
+ var node = createNode(156, typeName.pos);
node.typeName = typeName;
- if (!scanner.hasPrecedingLineBreak() && token() === 25) {
- node.typeArguments = parseBracketedList(18, parseType, 25, 27);
+ if (!scanner.hasPrecedingLineBreak() && token() === 26) {
+ node.typeArguments = parseBracketedList(18, parseType, 26, 28);
}
return finishNode(node);
}
function parseThisTypePredicate(lhs) {
nextToken();
- var node = createNode(154, lhs.pos);
+ var node = createNode(155, lhs.pos);
node.parameterName = lhs;
node.type = parseType();
return finishNode(node);
}
function parseThisTypeNode() {
- var node = createNode(165);
+ var node = createNode(166);
nextToken();
return finishNode(node);
}
function parseTypeQuery() {
- var node = createNode(158);
- parseExpected(101);
+ var node = createNode(159);
+ parseExpected(102);
node.exprName = parseEntityName(true);
return finishNode(node);
}
function parseTypeParameter() {
- var node = createNode(141);
+ var node = createNode(142);
node.name = parseIdentifier();
- if (parseOptional(83)) {
+ if (parseOptional(84)) {
if (isStartOfType() || !isStartOfExpression()) {
node.constraint = parseType();
}
@@ -11856,34 +12805,34 @@ var ts;
return finishNode(node);
}
function parseTypeParameters() {
- if (token() === 25) {
- return parseBracketedList(17, parseTypeParameter, 25, 27);
+ if (token() === 26) {
+ return parseBracketedList(17, parseTypeParameter, 26, 28);
}
}
function parseParameterType() {
- if (parseOptional(54)) {
+ if (parseOptional(55)) {
return parseType();
}
return undefined;
}
function isStartOfParameter() {
- return token() === 22 || isIdentifierOrPattern() || ts.isModifierKind(token()) || token() === 55 || token() === 97;
+ return token() === 23 || isIdentifierOrPattern() || ts.isModifierKind(token()) || token() === 56 || token() === 98;
}
function parseParameter() {
- var node = createNode(142);
- if (token() === 97) {
+ var node = createNode(143);
+ if (token() === 98) {
node.name = createIdentifier(true, undefined);
node.type = parseParameterType();
return finishNode(node);
}
node.decorators = parseDecorators();
node.modifiers = parseModifiers();
- node.dotDotDotToken = parseOptionalToken(22);
+ node.dotDotDotToken = parseOptionalToken(23);
node.name = parseIdentifierOrPattern();
if (ts.getFullWidth(node.name) === 0 && !ts.hasModifiers(node) && ts.isModifierKind(token())) {
nextToken();
}
- node.questionToken = parseOptionalToken(53);
+ node.questionToken = parseOptionalToken(54);
node.type = parseParameterType();
node.initializer = parseBindingElementInitializer(true);
return addJSDocComment(finishNode(node));
@@ -11895,7 +12844,7 @@ var ts;
return parseInitializer(true);
}
function fillSignature(returnToken, yieldContext, awaitContext, requireCompleteParameterList, signature) {
- var returnTokenRequired = returnToken === 34;
+ var returnTokenRequired = returnToken === 35;
signature.typeParameters = parseTypeParameters();
signature.parameters = parseParameterList(yieldContext, awaitContext, requireCompleteParameterList);
if (returnTokenRequired) {
@@ -11907,7 +12856,7 @@ var ts;
}
}
function parseParameterList(yieldContext, awaitContext, requireCompleteParameterList) {
- if (parseExpected(17)) {
+ if (parseExpected(18)) {
var savedYieldContext = inYieldContext();
var savedAwaitContext = inAwaitContext();
setYieldContext(yieldContext);
@@ -11915,7 +12864,7 @@ var ts;
var result = parseDelimitedList(16, parseParameter);
setYieldContext(savedYieldContext);
setAwaitContext(savedAwaitContext);
- if (!parseExpected(18) && requireCompleteParameterList) {
+ if (!parseExpected(19) && requireCompleteParameterList) {
return undefined;
}
return result;
@@ -11923,29 +12872,29 @@ var ts;
return requireCompleteParameterList ? undefined : createMissingList();
}
function parseTypeMemberSemicolon() {
- if (parseOptional(24)) {
+ if (parseOptional(25)) {
return;
}
parseSemicolon();
}
function parseSignatureMember(kind) {
var node = createNode(kind);
- if (kind === 152) {
- parseExpected(92);
+ if (kind === 153) {
+ parseExpected(93);
}
- fillSignature(54, false, false, false, node);
+ fillSignature(55, false, false, false, node);
parseTypeMemberSemicolon();
return addJSDocComment(finishNode(node));
}
function isIndexSignature() {
- if (token() !== 19) {
+ if (token() !== 20) {
return false;
}
return lookAhead(isUnambiguouslyIndexSignature);
}
function isUnambiguouslyIndexSignature() {
nextToken();
- if (token() === 22 || token() === 20) {
+ if (token() === 23 || token() === 21) {
return true;
}
if (ts.isModifierKind(token())) {
@@ -11960,43 +12909,43 @@ var ts;
else {
nextToken();
}
- if (token() === 54 || token() === 24) {
+ if (token() === 55 || token() === 25) {
return true;
}
- if (token() !== 53) {
+ if (token() !== 54) {
return false;
}
nextToken();
- return token() === 54 || token() === 24 || token() === 20;
+ return token() === 55 || token() === 25 || token() === 21;
}
function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(153, fullStart);
+ var node = createNode(154, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- node.parameters = parseBracketedList(16, parseParameter, 19, 20);
+ node.parameters = parseBracketedList(16, parseParameter, 20, 21);
node.type = parseTypeAnnotation();
parseTypeMemberSemicolon();
return finishNode(node);
}
function parsePropertyOrMethodSignature(fullStart, modifiers) {
var name = parsePropertyName();
- var questionToken = parseOptionalToken(53);
- if (token() === 17 || token() === 25) {
- var method = createNode(146, fullStart);
+ var questionToken = parseOptionalToken(54);
+ if (token() === 18 || token() === 26) {
+ var method = createNode(147, fullStart);
method.modifiers = modifiers;
method.name = name;
method.questionToken = questionToken;
- fillSignature(54, false, false, false, method);
+ fillSignature(55, false, false, false, method);
parseTypeMemberSemicolon();
return addJSDocComment(finishNode(method));
}
else {
- var property = createNode(144, fullStart);
+ var property = createNode(145, fullStart);
property.modifiers = modifiers;
property.name = name;
property.questionToken = questionToken;
property.type = parseTypeAnnotation();
- if (token() === 56) {
+ if (token() === 57) {
property.initializer = parseNonParameterInitializer();
}
parseTypeMemberSemicolon();
@@ -12005,14 +12954,14 @@ var ts;
}
function isTypeMemberStart() {
var idToken;
- if (token() === 17 || token() === 25) {
+ if (token() === 18 || token() === 26) {
return true;
}
while (ts.isModifierKind(token())) {
idToken = token();
nextToken();
}
- if (token() === 19) {
+ if (token() === 20) {
return true;
}
if (isLiteralPropertyName()) {
@@ -12020,22 +12969,22 @@ var ts;
nextToken();
}
if (idToken) {
- return token() === 17 ||
- token() === 25 ||
- token() === 53 ||
+ return token() === 18 ||
+ token() === 26 ||
token() === 54 ||
- token() === 24 ||
+ token() === 55 ||
+ token() === 25 ||
canParseSemicolon();
}
return false;
}
function parseTypeMember() {
- if (token() === 17 || token() === 25) {
- return parseSignatureMember(151);
- }
- if (token() === 92 && lookAhead(isStartOfConstructSignature)) {
+ if (token() === 18 || token() === 26) {
return parseSignatureMember(152);
}
+ if (token() === 93 && lookAhead(isStartOfConstructSignature)) {
+ return parseSignatureMember(153);
+ }
var fullStart = getNodePos();
var modifiers = parseModifiers();
if (isIndexSignature()) {
@@ -12045,18 +12994,18 @@ var ts;
}
function isStartOfConstructSignature() {
nextToken();
- return token() === 17 || token() === 25;
+ return token() === 18 || token() === 26;
}
function parseTypeLiteral() {
- var node = createNode(159);
+ var node = createNode(160);
node.members = parseObjectTypeMembers();
return finishNode(node);
}
function parseObjectTypeMembers() {
var members;
- if (parseExpected(15)) {
+ if (parseExpected(16)) {
members = parseList(4, parseTypeMember);
- parseExpected(16);
+ parseExpected(17);
}
else {
members = createMissingList();
@@ -12064,31 +13013,31 @@ var ts;
return members;
}
function parseTupleType() {
- var node = createNode(161);
- node.elementTypes = parseBracketedList(19, parseType, 19, 20);
+ var node = createNode(162);
+ node.elementTypes = parseBracketedList(19, parseType, 20, 21);
return finishNode(node);
}
function parseParenthesizedType() {
- var node = createNode(164);
- parseExpected(17);
- node.type = parseType();
+ var node = createNode(165);
parseExpected(18);
+ node.type = parseType();
+ parseExpected(19);
return finishNode(node);
}
function parseFunctionOrConstructorType(kind) {
var node = createNode(kind);
- if (kind === 157) {
- parseExpected(92);
+ if (kind === 158) {
+ parseExpected(93);
}
- fillSignature(34, false, false, false, node);
+ fillSignature(35, false, false, false, node);
return finishNode(node);
}
function parseKeywordAndNoDot() {
var node = parseTokenNode();
- return token() === 21 ? undefined : node;
+ return token() === 22 ? undefined : node;
}
function parseLiteralTypeNode() {
- var node = createNode(166);
+ var node = createNode(167);
node.literal = parseSimpleUnaryExpression();
finishNode(node);
return node;
@@ -12098,41 +13047,41 @@ var ts;
}
function parseNonArrayType() {
switch (token()) {
- case 117:
- case 132:
- case 130:
- case 120:
+ case 118:
case 133:
- case 135:
- case 127:
+ case 131:
+ case 121:
+ case 134:
+ case 136:
+ case 128:
var node = tryParse(parseKeywordAndNoDot);
return node || parseTypeReference();
case 9:
case 8:
- case 99:
- case 84:
+ case 100:
+ case 85:
return parseLiteralTypeNode();
- case 36:
+ case 37:
return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode() : parseTypeReference();
- case 103:
- case 93:
+ case 104:
+ case 94:
return parseTokenNode();
- case 97: {
+ case 98: {
var thisKeyword = parseThisTypeNode();
- if (token() === 124 && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 125 && !scanner.hasPrecedingLineBreak()) {
return parseThisTypePredicate(thisKeyword);
}
else {
return thisKeyword;
}
}
- case 101:
+ case 102:
return parseTypeQuery();
- case 15:
+ case 16:
return parseTypeLiteral();
- case 19:
+ case 20:
return parseTupleType();
- case 17:
+ case 18:
return parseParenthesizedType();
default:
return parseTypeReference();
@@ -12140,29 +13089,29 @@ var ts;
}
function isStartOfType() {
switch (token()) {
- case 117:
- case 132:
- case 130:
- case 120:
+ case 118:
case 133:
- case 103:
- case 135:
+ case 131:
+ case 121:
+ case 134:
+ case 104:
+ case 136:
+ case 94:
+ case 98:
+ case 102:
+ case 128:
+ case 16:
+ case 20:
+ case 26:
case 93:
- case 97:
- case 101:
- case 127:
- case 15:
- case 19:
- case 25:
- case 92:
case 9:
case 8:
- case 99:
- case 84:
+ case 100:
+ case 85:
return true;
- case 36:
+ case 37:
return lookAhead(nextTokenIsNumericLiteral);
- case 17:
+ case 18:
return lookAhead(isStartOfParenthesizedOrFunctionType);
default:
return isIdentifier();
@@ -12170,13 +13119,13 @@ var ts;
}
function isStartOfParenthesizedOrFunctionType() {
nextToken();
- return token() === 18 || isStartOfParameter() || isStartOfType();
+ return token() === 19 || isStartOfParameter() || isStartOfType();
}
function parseArrayTypeOrHigher() {
var type = parseNonArrayType();
- while (!scanner.hasPrecedingLineBreak() && parseOptional(19)) {
- parseExpected(20);
- var node = createNode(160, type.pos);
+ while (!scanner.hasPrecedingLineBreak() && parseOptional(20)) {
+ parseExpected(21);
+ var node = createNode(161, type.pos);
node.elementType = type;
type = finishNode(node);
}
@@ -12197,26 +13146,26 @@ var ts;
return type;
}
function parseIntersectionTypeOrHigher() {
- return parseUnionOrIntersectionType(163, parseArrayTypeOrHigher, 46);
+ return parseUnionOrIntersectionType(164, parseArrayTypeOrHigher, 47);
}
function parseUnionTypeOrHigher() {
- return parseUnionOrIntersectionType(162, parseIntersectionTypeOrHigher, 47);
+ return parseUnionOrIntersectionType(163, parseIntersectionTypeOrHigher, 48);
}
function isStartOfFunctionType() {
- if (token() === 25) {
+ if (token() === 26) {
return true;
}
- return token() === 17 && lookAhead(isUnambiguouslyStartOfFunctionType);
+ return token() === 18 && lookAhead(isUnambiguouslyStartOfFunctionType);
}
function skipParameterStart() {
if (ts.isModifierKind(token())) {
parseModifiers();
}
- if (isIdentifier() || token() === 97) {
+ if (isIdentifier() || token() === 98) {
nextToken();
return true;
}
- if (token() === 19 || token() === 15) {
+ if (token() === 20 || token() === 16) {
var previousErrorCount = parseDiagnostics.length;
parseIdentifierOrPattern();
return previousErrorCount === parseDiagnostics.length;
@@ -12225,17 +13174,17 @@ var ts;
}
function isUnambiguouslyStartOfFunctionType() {
nextToken();
- if (token() === 18 || token() === 22) {
+ if (token() === 19 || token() === 23) {
return true;
}
if (skipParameterStart()) {
- if (token() === 54 || token() === 24 ||
- token() === 53 || token() === 56) {
+ if (token() === 55 || token() === 25 ||
+ token() === 54 || token() === 57) {
return true;
}
- if (token() === 18) {
+ if (token() === 19) {
nextToken();
- if (token() === 34) {
+ if (token() === 35) {
return true;
}
}
@@ -12246,7 +13195,7 @@ var ts;
var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix);
var type = parseType();
if (typePredicateVariable) {
- var node = createNode(154, typePredicateVariable.pos);
+ var node = createNode(155, typePredicateVariable.pos);
node.parameterName = typePredicateVariable;
node.type = type;
return finishNode(node);
@@ -12257,7 +13206,7 @@ var ts;
}
function parseTypePredicatePrefix() {
var id = parseIdentifier();
- if (token() === 124 && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 125 && !scanner.hasPrecedingLineBreak()) {
nextToken();
return id;
}
@@ -12267,36 +13216,36 @@ var ts;
}
function parseTypeWorker() {
if (isStartOfFunctionType()) {
- return parseFunctionOrConstructorType(156);
- }
- if (token() === 92) {
return parseFunctionOrConstructorType(157);
}
+ if (token() === 93) {
+ return parseFunctionOrConstructorType(158);
+ }
return parseUnionTypeOrHigher();
}
function parseTypeAnnotation() {
- return parseOptional(54) ? parseType() : undefined;
+ return parseOptional(55) ? parseType() : undefined;
}
function isStartOfLeftHandSideExpression() {
switch (token()) {
- case 97:
- case 95:
- case 93:
- case 99:
- case 84:
+ case 98:
+ case 96:
+ case 94:
+ case 100:
+ case 85:
case 8:
case 9:
- case 11:
case 12:
- case 17:
- case 19:
- case 15:
- case 87:
- case 73:
- case 92:
- case 39:
- case 61:
- case 69:
+ case 13:
+ case 18:
+ case 20:
+ case 16:
+ case 88:
+ case 74:
+ case 93:
+ case 40:
+ case 62:
+ case 70:
return true;
default:
return isIdentifier();
@@ -12307,18 +13256,18 @@ var ts;
return true;
}
switch (token()) {
- case 35:
case 36:
+ case 37:
+ case 51:
case 50:
- case 49:
- case 78:
- case 101:
- case 103:
- case 41:
+ case 79:
+ case 102:
+ case 104:
case 42:
- case 25:
- case 119:
- case 114:
+ case 43:
+ case 26:
+ case 120:
+ case 115:
return true;
default:
if (isBinaryOperator()) {
@@ -12328,10 +13277,10 @@ var ts;
}
}
function isStartOfExpressionStatement() {
- return token() !== 15 &&
- token() !== 87 &&
- token() !== 73 &&
- token() !== 55 &&
+ return token() !== 16 &&
+ token() !== 88 &&
+ token() !== 74 &&
+ token() !== 56 &&
isStartOfExpression();
}
function parseExpression() {
@@ -12341,7 +13290,7 @@ var ts;
}
var expr = parseAssignmentExpressionOrHigher();
var operatorToken;
- while ((operatorToken = parseOptionalToken(24))) {
+ while ((operatorToken = parseOptionalToken(25))) {
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher());
}
if (saveDecoratorContext) {
@@ -12350,12 +13299,12 @@ var ts;
return expr;
}
function parseInitializer(inParameter) {
- if (token() !== 56) {
- if (scanner.hasPrecedingLineBreak() || (inParameter && token() === 15) || !isStartOfExpression()) {
+ if (token() !== 57) {
+ if (scanner.hasPrecedingLineBreak() || (inParameter && token() === 16) || !isStartOfExpression()) {
return undefined;
}
}
- parseExpected(56);
+ parseExpected(57);
return parseAssignmentExpressionOrHigher();
}
function parseAssignmentExpressionOrHigher() {
@@ -12367,7 +13316,7 @@ var ts;
return arrowExpression;
}
var expr = parseBinaryExpressionOrHigher(0);
- if (expr.kind === 69 && token() === 34) {
+ if (expr.kind === 70 && token() === 35) {
return parseSimpleArrowFunctionExpression(expr);
}
if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) {
@@ -12376,7 +13325,7 @@ var ts;
return parseConditionalExpressionRest(expr);
}
function isYieldExpression() {
- if (token() === 114) {
+ if (token() === 115) {
if (inYieldContext()) {
return true;
}
@@ -12389,11 +13338,11 @@ var ts;
return !scanner.hasPrecedingLineBreak() && isIdentifier();
}
function parseYieldExpression() {
- var node = createNode(190);
+ var node = createNode(191);
nextToken();
if (!scanner.hasPrecedingLineBreak() &&
- (token() === 37 || isStartOfExpression())) {
- node.asteriskToken = parseOptionalToken(37);
+ (token() === 38 || isStartOfExpression())) {
+ node.asteriskToken = parseOptionalToken(38);
node.expression = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
@@ -12402,21 +13351,21 @@ var ts;
}
}
function parseSimpleArrowFunctionExpression(identifier, asyncModifier) {
- ts.Debug.assert(token() === 34, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
+ ts.Debug.assert(token() === 35, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
var node;
if (asyncModifier) {
- node = createNode(180, asyncModifier.pos);
+ node = createNode(181, asyncModifier.pos);
node.modifiers = asyncModifier;
}
else {
- node = createNode(180, identifier.pos);
+ node = createNode(181, identifier.pos);
}
- var parameter = createNode(142, identifier.pos);
+ var parameter = createNode(143, identifier.pos);
parameter.name = identifier;
finishNode(parameter);
node.parameters = createNodeArray([parameter], parameter.pos);
node.parameters.end = parameter.end;
- node.equalsGreaterThanToken = parseExpectedToken(34, false, ts.Diagnostics._0_expected, "=>");
+ node.equalsGreaterThanToken = parseExpectedToken(35, false, ts.Diagnostics._0_expected, "=>");
node.body = parseArrowFunctionExpressionBody(!!asyncModifier);
return addJSDocComment(finishNode(node));
}
@@ -12433,78 +13382,78 @@ var ts;
}
var isAsync = !!(ts.getModifierFlags(arrowFunction) & 256);
var lastToken = token();
- arrowFunction.equalsGreaterThanToken = parseExpectedToken(34, false, ts.Diagnostics._0_expected, "=>");
- arrowFunction.body = (lastToken === 34 || lastToken === 15)
+ arrowFunction.equalsGreaterThanToken = parseExpectedToken(35, false, ts.Diagnostics._0_expected, "=>");
+ arrowFunction.body = (lastToken === 35 || lastToken === 16)
? parseArrowFunctionExpressionBody(isAsync)
: parseIdentifier();
return addJSDocComment(finishNode(arrowFunction));
}
function isParenthesizedArrowFunctionExpression() {
- if (token() === 17 || token() === 25 || token() === 118) {
+ if (token() === 18 || token() === 26 || token() === 119) {
return lookAhead(isParenthesizedArrowFunctionExpressionWorker);
}
- if (token() === 34) {
+ if (token() === 35) {
return 1;
}
return 0;
}
function isParenthesizedArrowFunctionExpressionWorker() {
- if (token() === 118) {
+ if (token() === 119) {
nextToken();
if (scanner.hasPrecedingLineBreak()) {
return 0;
}
- if (token() !== 17 && token() !== 25) {
+ if (token() !== 18 && token() !== 26) {
return 0;
}
}
var first = token();
var second = nextToken();
- if (first === 17) {
- if (second === 18) {
+ if (first === 18) {
+ if (second === 19) {
var third = nextToken();
switch (third) {
- case 34:
- case 54:
- case 15:
+ case 35:
+ case 55:
+ case 16:
return 1;
default:
return 0;
}
}
- if (second === 19 || second === 15) {
+ if (second === 20 || second === 16) {
return 2;
}
- if (second === 22) {
+ if (second === 23) {
return 1;
}
if (!isIdentifier()) {
return 0;
}
- if (nextToken() === 54) {
+ if (nextToken() === 55) {
return 1;
}
return 2;
}
else {
- ts.Debug.assert(first === 25);
+ ts.Debug.assert(first === 26);
if (!isIdentifier()) {
return 0;
}
if (sourceFile.languageVariant === 1) {
var isArrowFunctionInJsx = lookAhead(function () {
var third = nextToken();
- if (third === 83) {
+ if (third === 84) {
var fourth = nextToken();
switch (fourth) {
- case 56:
- case 27:
+ case 57:
+ case 28:
return false;
default:
return true;
}
}
- else if (third === 24) {
+ else if (third === 25) {
return true;
}
return false;
@@ -12521,7 +13470,7 @@ var ts;
return parseParenthesizedArrowFunctionExpressionHead(false);
}
function tryParseAsyncSimpleArrowFunctionExpression() {
- if (token() === 118) {
+ if (token() === 119) {
var isUnParenthesizedAsyncArrowFunction = lookAhead(isUnParenthesizedAsyncArrowFunctionWorker);
if (isUnParenthesizedAsyncArrowFunction === 1) {
var asyncModifier = parseModifiersForArrowFunction();
@@ -12532,38 +13481,38 @@ var ts;
return undefined;
}
function isUnParenthesizedAsyncArrowFunctionWorker() {
- if (token() === 118) {
+ if (token() === 119) {
nextToken();
- if (scanner.hasPrecedingLineBreak() || token() === 34) {
+ if (scanner.hasPrecedingLineBreak() || token() === 35) {
return 0;
}
var expr = parseBinaryExpressionOrHigher(0);
- if (!scanner.hasPrecedingLineBreak() && expr.kind === 69 && token() === 34) {
+ if (!scanner.hasPrecedingLineBreak() && expr.kind === 70 && token() === 35) {
return 1;
}
}
return 0;
}
function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) {
- var node = createNode(180);
+ var node = createNode(181);
node.modifiers = parseModifiersForArrowFunction();
var isAsync = !!(ts.getModifierFlags(node) & 256);
- fillSignature(54, false, isAsync, !allowAmbiguity, node);
+ fillSignature(55, false, isAsync, !allowAmbiguity, node);
if (!node.parameters) {
return undefined;
}
- if (!allowAmbiguity && token() !== 34 && token() !== 15) {
+ if (!allowAmbiguity && token() !== 35 && token() !== 16) {
return undefined;
}
return node;
}
function parseArrowFunctionExpressionBody(isAsync) {
- if (token() === 15) {
+ if (token() === 16) {
return parseFunctionBlock(false, isAsync, false);
}
- if (token() !== 23 &&
- token() !== 87 &&
- token() !== 73 &&
+ if (token() !== 24 &&
+ token() !== 88 &&
+ token() !== 74 &&
isStartOfStatement() &&
!isStartOfExpressionStatement()) {
return parseFunctionBlock(false, isAsync, true);
@@ -12573,15 +13522,15 @@ var ts;
: doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
}
function parseConditionalExpressionRest(leftOperand) {
- var questionToken = parseOptionalToken(53);
+ var questionToken = parseOptionalToken(54);
if (!questionToken) {
return leftOperand;
}
- var node = createNode(188, leftOperand.pos);
+ var node = createNode(189, leftOperand.pos);
node.condition = leftOperand;
node.questionToken = questionToken;
node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher);
- node.colonToken = parseExpectedToken(54, false, ts.Diagnostics._0_expected, ts.tokenToString(54));
+ node.colonToken = parseExpectedToken(55, false, ts.Diagnostics._0_expected, ts.tokenToString(55));
node.whenFalse = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
@@ -12590,22 +13539,22 @@ var ts;
return parseBinaryExpressionRest(precedence, leftOperand);
}
function isInOrOfKeyword(t) {
- return t === 90 || t === 138;
+ return t === 91 || t === 139;
}
function parseBinaryExpressionRest(precedence, leftOperand) {
while (true) {
reScanGreaterToken();
var newPrecedence = getBinaryOperatorPrecedence();
- var consumeCurrentOperator = token() === 38 ?
+ var consumeCurrentOperator = token() === 39 ?
newPrecedence >= precedence :
newPrecedence > precedence;
if (!consumeCurrentOperator) {
break;
}
- if (token() === 90 && inDisallowInContext()) {
+ if (token() === 91 && inDisallowInContext()) {
break;
}
- if (token() === 116) {
+ if (token() === 117) {
if (scanner.hasPrecedingLineBreak()) {
break;
}
@@ -12621,92 +13570,92 @@ var ts;
return leftOperand;
}
function isBinaryOperator() {
- if (inDisallowInContext() && token() === 90) {
+ if (inDisallowInContext() && token() === 91) {
return false;
}
return getBinaryOperatorPrecedence() > 0;
}
function getBinaryOperatorPrecedence() {
switch (token()) {
- case 52:
+ case 53:
return 1;
- case 51:
+ case 52:
return 2;
- case 47:
- return 3;
case 48:
+ return 3;
+ case 49:
return 4;
- case 46:
+ case 47:
return 5;
- case 30:
case 31:
case 32:
case 33:
+ case 34:
return 6;
- case 25:
- case 27:
+ case 26:
case 28:
case 29:
+ case 30:
+ case 92:
case 91:
- case 90:
- case 116:
+ case 117:
return 7;
- case 43:
case 44:
case 45:
+ case 46:
return 8;
- case 35:
case 36:
- return 9;
case 37:
- case 39:
- case 40:
- return 10;
+ return 9;
case 38:
+ case 40:
+ case 41:
+ return 10;
+ case 39:
return 11;
}
return -1;
}
function makeBinaryExpression(left, operatorToken, right) {
- var node = createNode(187, left.pos);
+ var node = createNode(188, left.pos);
node.left = left;
node.operatorToken = operatorToken;
node.right = right;
return finishNode(node);
}
function makeAsExpression(left, right) {
- var node = createNode(195, left.pos);
+ var node = createNode(196, left.pos);
node.expression = left;
node.type = right;
return finishNode(node);
}
function parsePrefixUnaryExpression() {
- var node = createNode(185);
+ var node = createNode(186);
node.operator = token();
nextToken();
node.operand = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseDeleteExpression() {
- var node = createNode(181);
- nextToken();
- node.expression = parseSimpleUnaryExpression();
- return finishNode(node);
- }
- function parseTypeOfExpression() {
var node = createNode(182);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
- function parseVoidExpression() {
+ function parseTypeOfExpression() {
var node = createNode(183);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
+ function parseVoidExpression() {
+ var node = createNode(184);
+ nextToken();
+ node.expression = parseSimpleUnaryExpression();
+ return finishNode(node);
+ }
function isAwaitExpression() {
- if (token() === 119) {
+ if (token() === 120) {
if (inAwaitContext()) {
return true;
}
@@ -12715,7 +13664,7 @@ var ts;
return false;
}
function parseAwaitExpression() {
- var node = createNode(184);
+ var node = createNode(185);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
@@ -12723,15 +13672,15 @@ var ts;
function parseUnaryExpressionOrHigher() {
if (isUpdateExpression()) {
var incrementExpression = parseIncrementExpression();
- return token() === 38 ?
+ return token() === 39 ?
parseBinaryExpressionRest(getBinaryOperatorPrecedence(), incrementExpression) :
incrementExpression;
}
var unaryOperator = token();
var simpleUnaryExpression = parseSimpleUnaryExpression();
- if (token() === 38) {
+ if (token() === 39) {
var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos);
- if (simpleUnaryExpression.kind === 177) {
+ if (simpleUnaryExpression.kind === 178) {
parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses);
}
else {
@@ -12742,20 +13691,20 @@ var ts;
}
function parseSimpleUnaryExpression() {
switch (token()) {
- case 35:
case 36:
+ case 37:
+ case 51:
case 50:
- case 49:
return parsePrefixUnaryExpression();
- case 78:
+ case 79:
return parseDeleteExpression();
- case 101:
+ case 102:
return parseTypeOfExpression();
- case 103:
+ case 104:
return parseVoidExpression();
- case 25:
+ case 26:
return parseTypeAssertion();
- case 119:
+ case 120:
if (isAwaitExpression()) {
return parseAwaitExpression();
}
@@ -12765,16 +13714,16 @@ var ts;
}
function isUpdateExpression() {
switch (token()) {
- case 35:
case 36:
+ case 37:
+ case 51:
case 50:
- case 49:
- case 78:
- case 101:
- case 103:
- case 119:
+ case 79:
+ case 102:
+ case 104:
+ case 120:
return false;
- case 25:
+ case 26:
if (sourceFile.languageVariant !== 1) {
return false;
}
@@ -12783,20 +13732,20 @@ var ts;
}
}
function parseIncrementExpression() {
- if (token() === 41 || token() === 42) {
- var node = createNode(185);
+ if (token() === 42 || token() === 43) {
+ var node = createNode(186);
node.operator = token();
nextToken();
node.operand = parseLeftHandSideExpressionOrHigher();
return finishNode(node);
}
- else if (sourceFile.languageVariant === 1 && token() === 25 && lookAhead(nextTokenIsIdentifierOrKeyword)) {
+ else if (sourceFile.languageVariant === 1 && token() === 26 && lookAhead(nextTokenIsIdentifierOrKeyword)) {
return parseJsxElementOrSelfClosingElement(true);
}
var expression = parseLeftHandSideExpressionOrHigher();
ts.Debug.assert(ts.isLeftHandSideExpression(expression));
- if ((token() === 41 || token() === 42) && !scanner.hasPrecedingLineBreak()) {
- var node = createNode(186, expression.pos);
+ if ((token() === 42 || token() === 43) && !scanner.hasPrecedingLineBreak()) {
+ var node = createNode(187, expression.pos);
node.operand = expression;
node.operator = token();
nextToken();
@@ -12805,7 +13754,7 @@ var ts;
return expression;
}
function parseLeftHandSideExpressionOrHigher() {
- var expression = token() === 95
+ var expression = token() === 96
? parseSuperExpression()
: parseMemberExpressionOrHigher();
return parseCallExpressionRest(expression);
@@ -12816,12 +13765,12 @@ var ts;
}
function parseSuperExpression() {
var expression = parseTokenNode();
- if (token() === 17 || token() === 21 || token() === 19) {
+ if (token() === 18 || token() === 22 || token() === 20) {
return expression;
}
- var node = createNode(172, expression.pos);
+ var node = createNode(173, expression.pos);
node.expression = expression;
- parseExpectedToken(21, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
+ parseExpectedToken(22, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
node.name = parseRightSideOfDot(true);
return finishNode(node);
}
@@ -12829,10 +13778,10 @@ var ts;
if (lhs.kind !== rhs.kind) {
return false;
}
- if (lhs.kind === 69) {
+ if (lhs.kind === 70) {
return lhs.text === rhs.text;
}
- if (lhs.kind === 97) {
+ if (lhs.kind === 98) {
return true;
}
return lhs.name.text === rhs.name.text &&
@@ -12841,8 +13790,8 @@ var ts;
function parseJsxElementOrSelfClosingElement(inExpressionContext) {
var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext);
var result;
- if (opening.kind === 243) {
- var node = createNode(241, opening.pos);
+ if (opening.kind === 244) {
+ var node = createNode(242, opening.pos);
node.openingElement = opening;
node.children = parseJsxChildren(node.openingElement.tagName);
node.closingElement = parseJsxClosingElement(inExpressionContext);
@@ -12852,18 +13801,18 @@ var ts;
result = finishNode(node);
}
else {
- ts.Debug.assert(opening.kind === 242);
+ ts.Debug.assert(opening.kind === 243);
result = opening;
}
- if (inExpressionContext && token() === 25) {
+ if (inExpressionContext && token() === 26) {
var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(true); });
if (invalidElement) {
parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element);
- var badNode = createNode(187, result.pos);
+ var badNode = createNode(188, result.pos);
badNode.end = invalidElement.end;
badNode.left = result;
badNode.right = invalidElement;
- badNode.operatorToken = createMissingNode(24, false, undefined);
+ badNode.operatorToken = createMissingNode(25, false, undefined);
badNode.operatorToken.pos = badNode.operatorToken.end = badNode.right.pos;
return badNode;
}
@@ -12871,17 +13820,17 @@ var ts;
return result;
}
function parseJsxText() {
- var node = createNode(244, scanner.getStartPos());
+ var node = createNode(10, scanner.getStartPos());
currentToken = scanner.scanJsxToken();
return finishNode(node);
}
function parseJsxChild() {
switch (token()) {
- case 244:
+ case 10:
return parseJsxText();
- case 15:
+ case 16:
return parseJsxExpression(false);
- case 25:
+ case 26:
return parseJsxElementOrSelfClosingElement(false);
}
ts.Debug.fail("Unknown JSX child kind " + token());
@@ -12892,7 +13841,7 @@ var ts;
parsingContext |= 1 << 14;
while (true) {
currentToken = scanner.reScanJsxToken();
- if (token() === 26) {
+ if (token() === 27) {
break;
}
else if (token() === 1) {
@@ -12907,24 +13856,24 @@ var ts;
}
function parseJsxOpeningOrSelfClosingElement(inExpressionContext) {
var fullStart = scanner.getStartPos();
- parseExpected(25);
+ parseExpected(26);
var tagName = parseJsxElementName();
var attributes = parseList(13, parseJsxAttribute);
var node;
- if (token() === 27) {
- node = createNode(243, fullStart);
+ if (token() === 28) {
+ node = createNode(244, fullStart);
scanJsxText();
}
else {
- parseExpected(39);
+ parseExpected(40);
if (inExpressionContext) {
- parseExpected(27);
+ parseExpected(28);
}
else {
- parseExpected(27, undefined, false);
+ parseExpected(28, undefined, false);
scanJsxText();
}
- node = createNode(242, fullStart);
+ node = createNode(243, fullStart);
}
node.tagName = tagName;
node.attributes = attributes;
@@ -12932,10 +13881,10 @@ var ts;
}
function parseJsxElementName() {
scanJsxIdentifier();
- var expression = token() === 97 ?
+ var expression = token() === 98 ?
parseTokenNode() : parseIdentifierName();
- while (parseOptional(21)) {
- var propertyAccess = createNode(172, expression.pos);
+ while (parseOptional(22)) {
+ var propertyAccess = createNode(173, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(true);
expression = finishNode(propertyAccess);
@@ -12944,27 +13893,27 @@ var ts;
}
function parseJsxExpression(inExpressionContext) {
var node = createNode(248);
- parseExpected(15);
- if (token() !== 16) {
+ parseExpected(16);
+ if (token() !== 17) {
node.expression = parseAssignmentExpressionOrHigher();
}
if (inExpressionContext) {
- parseExpected(16);
+ parseExpected(17);
}
else {
- parseExpected(16, undefined, false);
+ parseExpected(17, undefined, false);
scanJsxText();
}
return finishNode(node);
}
function parseJsxAttribute() {
- if (token() === 15) {
+ if (token() === 16) {
return parseJsxSpreadAttribute();
}
scanJsxIdentifier();
var node = createNode(246);
node.name = parseIdentifierName();
- if (token() === 56) {
+ if (token() === 57) {
switch (scanJsxAttributeValue()) {
case 9:
node.initializer = parseLiteralNode();
@@ -12978,68 +13927,68 @@ var ts;
}
function parseJsxSpreadAttribute() {
var node = createNode(247);
- parseExpected(15);
- parseExpected(22);
- node.expression = parseExpression();
parseExpected(16);
+ parseExpected(23);
+ node.expression = parseExpression();
+ parseExpected(17);
return finishNode(node);
}
function parseJsxClosingElement(inExpressionContext) {
var node = createNode(245);
- parseExpected(26);
+ parseExpected(27);
node.tagName = parseJsxElementName();
if (inExpressionContext) {
- parseExpected(27);
+ parseExpected(28);
}
else {
- parseExpected(27, undefined, false);
+ parseExpected(28, undefined, false);
scanJsxText();
}
return finishNode(node);
}
function parseTypeAssertion() {
- var node = createNode(177);
- parseExpected(25);
+ var node = createNode(178);
+ parseExpected(26);
node.type = parseType();
- parseExpected(27);
+ parseExpected(28);
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseMemberExpressionRest(expression) {
while (true) {
- var dotToken = parseOptionalToken(21);
+ var dotToken = parseOptionalToken(22);
if (dotToken) {
- var propertyAccess = createNode(172, expression.pos);
+ var propertyAccess = createNode(173, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(true);
expression = finishNode(propertyAccess);
continue;
}
- if (token() === 49 && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 50 && !scanner.hasPrecedingLineBreak()) {
nextToken();
- var nonNullExpression = createNode(196, expression.pos);
+ var nonNullExpression = createNode(197, expression.pos);
nonNullExpression.expression = expression;
expression = finishNode(nonNullExpression);
continue;
}
- if (!inDecoratorContext() && parseOptional(19)) {
- var indexedAccess = createNode(173, expression.pos);
+ if (!inDecoratorContext() && parseOptional(20)) {
+ var indexedAccess = createNode(174, expression.pos);
indexedAccess.expression = expression;
- if (token() !== 20) {
+ if (token() !== 21) {
indexedAccess.argumentExpression = allowInAnd(parseExpression);
if (indexedAccess.argumentExpression.kind === 9 || indexedAccess.argumentExpression.kind === 8) {
var literal = indexedAccess.argumentExpression;
literal.text = internIdentifier(literal.text);
}
}
- parseExpected(20);
+ parseExpected(21);
expression = finishNode(indexedAccess);
continue;
}
- if (token() === 11 || token() === 12) {
- var tagExpression = createNode(176, expression.pos);
+ if (token() === 12 || token() === 13) {
+ var tagExpression = createNode(177, expression.pos);
tagExpression.tag = expression;
- tagExpression.template = token() === 11
+ tagExpression.template = token() === 12
? parseLiteralNode()
: parseTemplateExpression();
expression = finishNode(tagExpression);
@@ -13051,20 +14000,20 @@ var ts;
function parseCallExpressionRest(expression) {
while (true) {
expression = parseMemberExpressionRest(expression);
- if (token() === 25) {
+ if (token() === 26) {
var typeArguments = tryParse(parseTypeArgumentsInExpression);
if (!typeArguments) {
return expression;
}
- var callExpr = createNode(174, expression.pos);
+ var callExpr = createNode(175, expression.pos);
callExpr.expression = expression;
callExpr.typeArguments = typeArguments;
callExpr.arguments = parseArgumentList();
expression = finishNode(callExpr);
continue;
}
- else if (token() === 17) {
- var callExpr = createNode(174, expression.pos);
+ else if (token() === 18) {
+ var callExpr = createNode(175, expression.pos);
callExpr.expression = expression;
callExpr.arguments = parseArgumentList();
expression = finishNode(callExpr);
@@ -13074,17 +14023,17 @@ var ts;
}
}
function parseArgumentList() {
- parseExpected(17);
- var result = parseDelimitedList(11, parseArgumentExpression);
parseExpected(18);
+ var result = parseDelimitedList(11, parseArgumentExpression);
+ parseExpected(19);
return result;
}
function parseTypeArgumentsInExpression() {
- if (!parseOptional(25)) {
+ if (!parseOptional(26)) {
return undefined;
}
var typeArguments = parseDelimitedList(18, parseType);
- if (!parseExpected(27)) {
+ if (!parseExpected(28)) {
return undefined;
}
return typeArguments && canFollowTypeArgumentsInExpression()
@@ -13093,27 +14042,27 @@ var ts;
}
function canFollowTypeArgumentsInExpression() {
switch (token()) {
- case 17:
- case 21:
case 18:
- case 20:
+ case 22:
+ case 19:
+ case 21:
+ case 55:
+ case 24:
case 54:
- case 23:
- case 53:
- case 30:
- case 32:
case 31:
case 33:
- case 51:
+ case 32:
+ case 34:
case 52:
- case 48:
- case 46:
+ case 53:
+ case 49:
case 47:
- case 16:
+ case 48:
+ case 17:
case 1:
return true;
- case 24:
- case 15:
+ case 25:
+ case 16:
default:
return false;
}
@@ -13122,80 +14071,80 @@ var ts;
switch (token()) {
case 8:
case 9:
- case 11:
+ case 12:
return parseLiteralNode();
- case 97:
- case 95:
- case 93:
- case 99:
- case 84:
+ case 98:
+ case 96:
+ case 94:
+ case 100:
+ case 85:
return parseTokenNode();
- case 17:
+ case 18:
return parseParenthesizedExpression();
- case 19:
+ case 20:
return parseArrayLiteralExpression();
- case 15:
+ case 16:
return parseObjectLiteralExpression();
- case 118:
+ case 119:
if (!lookAhead(nextTokenIsFunctionKeywordOnSameLine)) {
break;
}
return parseFunctionExpression();
- case 73:
+ case 74:
return parseClassExpression();
- case 87:
+ case 88:
return parseFunctionExpression();
- case 92:
+ case 93:
return parseNewExpression();
- case 39:
- case 61:
- if (reScanSlashToken() === 10) {
+ case 40:
+ case 62:
+ if (reScanSlashToken() === 11) {
return parseLiteralNode();
}
break;
- case 12:
+ case 13:
return parseTemplateExpression();
}
return parseIdentifier(ts.Diagnostics.Expression_expected);
}
function parseParenthesizedExpression() {
- var node = createNode(178);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(179);
parseExpected(18);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
return finishNode(node);
}
function parseSpreadElement() {
- var node = createNode(191);
- parseExpected(22);
+ var node = createNode(192);
+ parseExpected(23);
node.expression = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
function parseArgumentOrArrayLiteralElement() {
- return token() === 22 ? parseSpreadElement() :
- token() === 24 ? createNode(193) :
+ return token() === 23 ? parseSpreadElement() :
+ token() === 25 ? createNode(194) :
parseAssignmentExpressionOrHigher();
}
function parseArgumentExpression() {
return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement);
}
function parseArrayLiteralExpression() {
- var node = createNode(170);
- parseExpected(19);
+ var node = createNode(171);
+ parseExpected(20);
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
}
node.elements = parseDelimitedList(15, parseArgumentOrArrayLiteralElement);
- parseExpected(20);
+ parseExpected(21);
return finishNode(node);
}
function tryParseAccessorDeclaration(fullStart, decorators, modifiers) {
- if (parseContextualModifier(123)) {
- return parseAccessorDeclaration(149, fullStart, decorators, modifiers);
- }
- else if (parseContextualModifier(131)) {
+ if (parseContextualModifier(124)) {
return parseAccessorDeclaration(150, fullStart, decorators, modifiers);
}
+ else if (parseContextualModifier(132)) {
+ return parseAccessorDeclaration(151, fullStart, decorators, modifiers);
+ }
return undefined;
}
function parseObjectLiteralElement() {
@@ -13206,19 +14155,19 @@ var ts;
if (accessor) {
return accessor;
}
- var asteriskToken = parseOptionalToken(37);
+ var asteriskToken = parseOptionalToken(38);
var tokenIsIdentifier = isIdentifier();
var propertyName = parsePropertyName();
- var questionToken = parseOptionalToken(53);
- if (asteriskToken || token() === 17 || token() === 25) {
+ var questionToken = parseOptionalToken(54);
+ if (asteriskToken || token() === 18 || token() === 26) {
return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, propertyName, questionToken);
}
- var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 24 || token() === 16 || token() === 56);
+ var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 25 || token() === 17 || token() === 57);
if (isShorthandPropertyAssignment) {
var shorthandDeclaration = createNode(254, fullStart);
shorthandDeclaration.name = propertyName;
shorthandDeclaration.questionToken = questionToken;
- var equalsToken = parseOptionalToken(56);
+ var equalsToken = parseOptionalToken(57);
if (equalsToken) {
shorthandDeclaration.equalsToken = equalsToken;
shorthandDeclaration.objectAssignmentInitializer = allowInAnd(parseAssignmentExpressionOrHigher);
@@ -13230,19 +14179,19 @@ var ts;
propertyAssignment.modifiers = modifiers;
propertyAssignment.name = propertyName;
propertyAssignment.questionToken = questionToken;
- parseExpected(54);
+ parseExpected(55);
propertyAssignment.initializer = allowInAnd(parseAssignmentExpressionOrHigher);
return addJSDocComment(finishNode(propertyAssignment));
}
}
function parseObjectLiteralExpression() {
- var node = createNode(171);
- parseExpected(15);
+ var node = createNode(172);
+ parseExpected(16);
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
}
node.properties = parseDelimitedList(12, parseObjectLiteralElement, true);
- parseExpected(16);
+ parseExpected(17);
return finishNode(node);
}
function parseFunctionExpression() {
@@ -13250,10 +14199,10 @@ var ts;
if (saveDecoratorContext) {
setDecoratorContext(false);
}
- var node = createNode(179);
+ var node = createNode(180);
node.modifiers = parseModifiers();
- parseExpected(87);
- node.asteriskToken = parseOptionalToken(37);
+ parseExpected(88);
+ node.asteriskToken = parseOptionalToken(38);
var isGenerator = !!node.asteriskToken;
var isAsync = !!(ts.getModifierFlags(node) & 256);
node.name =
@@ -13261,7 +14210,7 @@ var ts;
isGenerator ? doInYieldContext(parseOptionalIdentifier) :
isAsync ? doInAwaitContext(parseOptionalIdentifier) :
parseOptionalIdentifier();
- fillSignature(54, isGenerator, isAsync, false, node);
+ fillSignature(55, isGenerator, isAsync, false, node);
node.body = parseFunctionBlock(isGenerator, isAsync, false);
if (saveDecoratorContext) {
setDecoratorContext(true);
@@ -13272,23 +14221,23 @@ var ts;
return isIdentifier() ? parseIdentifier() : undefined;
}
function parseNewExpression() {
- var node = createNode(175);
- parseExpected(92);
+ var node = createNode(176);
+ parseExpected(93);
node.expression = parseMemberExpressionOrHigher();
node.typeArguments = tryParse(parseTypeArgumentsInExpression);
- if (node.typeArguments || token() === 17) {
+ if (node.typeArguments || token() === 18) {
node.arguments = parseArgumentList();
}
return finishNode(node);
}
function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
- var node = createNode(199);
- if (parseExpected(15, diagnosticMessage) || ignoreMissingOpenBrace) {
+ var node = createNode(200);
+ if (parseExpected(16, diagnosticMessage) || ignoreMissingOpenBrace) {
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
}
node.statements = parseList(1, parseStatement);
- parseExpected(16);
+ parseExpected(17);
}
else {
node.statements = createMissingList();
@@ -13313,47 +14262,47 @@ var ts;
return block;
}
function parseEmptyStatement() {
- var node = createNode(201);
- parseExpected(23);
+ var node = createNode(202);
+ parseExpected(24);
return finishNode(node);
}
function parseIfStatement() {
- var node = createNode(203);
- parseExpected(88);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(204);
+ parseExpected(89);
parseExpected(18);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
node.thenStatement = parseStatement();
- node.elseStatement = parseOptional(80) ? parseStatement() : undefined;
+ node.elseStatement = parseOptional(81) ? parseStatement() : undefined;
return finishNode(node);
}
function parseDoStatement() {
- var node = createNode(204);
- parseExpected(79);
+ var node = createNode(205);
+ parseExpected(80);
node.statement = parseStatement();
- parseExpected(104);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ parseExpected(105);
parseExpected(18);
- parseOptional(23);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
+ parseOptional(24);
return finishNode(node);
}
function parseWhileStatement() {
- var node = createNode(205);
- parseExpected(104);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(206);
+ parseExpected(105);
parseExpected(18);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
node.statement = parseStatement();
return finishNode(node);
}
function parseForOrForInOrForOfStatement() {
var pos = getNodePos();
- parseExpected(86);
- parseExpected(17);
+ parseExpected(87);
+ parseExpected(18);
var initializer = undefined;
- if (token() !== 23) {
- if (token() === 102 || token() === 108 || token() === 74) {
+ if (token() !== 24) {
+ if (token() === 103 || token() === 109 || token() === 75) {
initializer = parseVariableDeclarationList(true);
}
else {
@@ -13361,32 +14310,32 @@ var ts;
}
}
var forOrForInOrForOfStatement;
- if (parseOptional(90)) {
- var forInStatement = createNode(207, pos);
+ if (parseOptional(91)) {
+ var forInStatement = createNode(208, pos);
forInStatement.initializer = initializer;
forInStatement.expression = allowInAnd(parseExpression);
- parseExpected(18);
+ parseExpected(19);
forOrForInOrForOfStatement = forInStatement;
}
- else if (parseOptional(138)) {
- var forOfStatement = createNode(208, pos);
+ else if (parseOptional(139)) {
+ var forOfStatement = createNode(209, pos);
forOfStatement.initializer = initializer;
forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher);
- parseExpected(18);
+ parseExpected(19);
forOrForInOrForOfStatement = forOfStatement;
}
else {
- var forStatement = createNode(206, pos);
+ var forStatement = createNode(207, pos);
forStatement.initializer = initializer;
- parseExpected(23);
- if (token() !== 23 && token() !== 18) {
+ parseExpected(24);
+ if (token() !== 24 && token() !== 19) {
forStatement.condition = allowInAnd(parseExpression);
}
- parseExpected(23);
- if (token() !== 18) {
+ parseExpected(24);
+ if (token() !== 19) {
forStatement.incrementor = allowInAnd(parseExpression);
}
- parseExpected(18);
+ parseExpected(19);
forOrForInOrForOfStatement = forStatement;
}
forOrForInOrForOfStatement.statement = parseStatement();
@@ -13394,7 +14343,7 @@ var ts;
}
function parseBreakOrContinueStatement(kind) {
var node = createNode(kind);
- parseExpected(kind === 210 ? 70 : 75);
+ parseExpected(kind === 211 ? 71 : 76);
if (!canParseSemicolon()) {
node.label = parseIdentifier();
}
@@ -13402,8 +14351,8 @@ var ts;
return finishNode(node);
}
function parseReturnStatement() {
- var node = createNode(211);
- parseExpected(94);
+ var node = createNode(212);
+ parseExpected(95);
if (!canParseSemicolon()) {
node.expression = allowInAnd(parseExpression);
}
@@ -13411,90 +14360,90 @@ var ts;
return finishNode(node);
}
function parseWithStatement() {
- var node = createNode(212);
- parseExpected(105);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(213);
+ parseExpected(106);
parseExpected(18);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
node.statement = parseStatement();
return finishNode(node);
}
function parseCaseClause() {
var node = createNode(249);
- parseExpected(71);
+ parseExpected(72);
node.expression = allowInAnd(parseExpression);
- parseExpected(54);
+ parseExpected(55);
node.statements = parseList(3, parseStatement);
return finishNode(node);
}
function parseDefaultClause() {
var node = createNode(250);
- parseExpected(77);
- parseExpected(54);
+ parseExpected(78);
+ parseExpected(55);
node.statements = parseList(3, parseStatement);
return finishNode(node);
}
function parseCaseOrDefaultClause() {
- return token() === 71 ? parseCaseClause() : parseDefaultClause();
+ return token() === 72 ? parseCaseClause() : parseDefaultClause();
}
function parseSwitchStatement() {
- var node = createNode(213);
- parseExpected(96);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(214);
+ parseExpected(97);
parseExpected(18);
- var caseBlock = createNode(227, scanner.getStartPos());
- parseExpected(15);
- caseBlock.clauses = parseList(2, parseCaseOrDefaultClause);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
+ var caseBlock = createNode(228, scanner.getStartPos());
parseExpected(16);
+ caseBlock.clauses = parseList(2, parseCaseOrDefaultClause);
+ parseExpected(17);
node.caseBlock = finishNode(caseBlock);
return finishNode(node);
}
function parseThrowStatement() {
- var node = createNode(215);
- parseExpected(98);
+ var node = createNode(216);
+ parseExpected(99);
node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression);
parseSemicolon();
return finishNode(node);
}
function parseTryStatement() {
- var node = createNode(216);
- parseExpected(100);
+ var node = createNode(217);
+ parseExpected(101);
node.tryBlock = parseBlock(false);
- node.catchClause = token() === 72 ? parseCatchClause() : undefined;
- if (!node.catchClause || token() === 85) {
- parseExpected(85);
+ node.catchClause = token() === 73 ? parseCatchClause() : undefined;
+ if (!node.catchClause || token() === 86) {
+ parseExpected(86);
node.finallyBlock = parseBlock(false);
}
return finishNode(node);
}
function parseCatchClause() {
var result = createNode(252);
- parseExpected(72);
- if (parseExpected(17)) {
+ parseExpected(73);
+ if (parseExpected(18)) {
result.variableDeclaration = parseVariableDeclaration();
}
- parseExpected(18);
+ parseExpected(19);
result.block = parseBlock(false);
return finishNode(result);
}
function parseDebuggerStatement() {
- var node = createNode(217);
- parseExpected(76);
+ var node = createNode(218);
+ parseExpected(77);
parseSemicolon();
return finishNode(node);
}
function parseExpressionOrLabeledStatement() {
var fullStart = scanner.getStartPos();
var expression = allowInAnd(parseExpression);
- if (expression.kind === 69 && parseOptional(54)) {
- var labeledStatement = createNode(214, fullStart);
+ if (expression.kind === 70 && parseOptional(55)) {
+ var labeledStatement = createNode(215, fullStart);
labeledStatement.label = expression;
labeledStatement.statement = parseStatement();
return addJSDocComment(finishNode(labeledStatement));
}
else {
- var expressionStatement = createNode(202, fullStart);
+ var expressionStatement = createNode(203, fullStart);
expressionStatement.expression = expression;
parseSemicolon();
return addJSDocComment(finishNode(expressionStatement));
@@ -13506,7 +14455,7 @@ var ts;
}
function nextTokenIsFunctionKeywordOnSameLine() {
nextToken();
- return token() === 87 && !scanner.hasPrecedingLineBreak();
+ return token() === 88 && !scanner.hasPrecedingLineBreak();
}
function nextTokenIsIdentifierOrKeywordOrNumberOnSameLine() {
nextToken();
@@ -13515,47 +14464,47 @@ var ts;
function isDeclaration() {
while (true) {
switch (token()) {
- case 102:
- case 108:
+ case 103:
+ case 109:
+ case 75:
+ case 88:
case 74:
- case 87:
- case 73:
- case 81:
+ case 82:
return true;
- case 107:
- case 134:
+ case 108:
+ case 135:
return nextTokenIsIdentifierOnSameLine();
- case 125:
case 126:
+ case 127:
return nextTokenIsIdentifierOrStringLiteralOnSameLine();
- case 115:
- case 118:
- case 122:
- case 110:
+ case 116:
+ case 119:
+ case 123:
case 111:
case 112:
- case 128:
+ case 113:
+ case 129:
nextToken();
if (scanner.hasPrecedingLineBreak()) {
return false;
}
continue;
- case 137:
+ case 138:
nextToken();
- return token() === 15 || token() === 69 || token() === 82;
- case 89:
+ return token() === 16 || token() === 70 || token() === 83;
+ case 90:
nextToken();
- return token() === 9 || token() === 37 ||
- token() === 15 || ts.tokenIsIdentifierOrKeyword(token());
- case 82:
+ return token() === 9 || token() === 38 ||
+ token() === 16 || ts.tokenIsIdentifierOrKeyword(token());
+ case 83:
nextToken();
- if (token() === 56 || token() === 37 ||
- token() === 15 || token() === 77 ||
- token() === 116) {
+ if (token() === 57 || token() === 38 ||
+ token() === 16 || token() === 78 ||
+ token() === 117) {
return true;
}
continue;
- case 113:
+ case 114:
nextToken();
continue;
default:
@@ -13568,46 +14517,46 @@ var ts;
}
function isStartOfStatement() {
switch (token()) {
- case 55:
- case 23:
- case 15:
- case 102:
- case 108:
- case 87:
- case 73:
- case 81:
+ case 56:
+ case 24:
+ case 16:
+ case 103:
+ case 109:
case 88:
- case 79:
- case 104:
- case 86:
- case 75:
- case 70:
- case 94:
- case 105:
- case 96:
- case 98:
- case 100:
- case 76:
- case 72:
- case 85:
- return true;
case 74:
case 82:
case 89:
+ case 80:
+ case 105:
+ case 87:
+ case 76:
+ case 71:
+ case 95:
+ case 106:
+ case 97:
+ case 99:
+ case 101:
+ case 77:
+ case 73:
+ case 86:
+ return true;
+ case 75:
+ case 83:
+ case 90:
return isStartOfDeclaration();
- case 118:
- case 122:
- case 107:
- case 125:
+ case 119:
+ case 123:
+ case 108:
case 126:
- case 134:
- case 137:
+ case 127:
+ case 135:
+ case 138:
return true;
- case 112:
- case 110:
- case 111:
case 113:
- case 128:
+ case 111:
+ case 112:
+ case 114:
+ case 129:
return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);
default:
return isStartOfExpression();
@@ -13615,73 +14564,73 @@ var ts;
}
function nextTokenIsIdentifierOrStartOfDestructuring() {
nextToken();
- return isIdentifier() || token() === 15 || token() === 19;
+ return isIdentifier() || token() === 16 || token() === 20;
}
function isLetDeclaration() {
return lookAhead(nextTokenIsIdentifierOrStartOfDestructuring);
}
function parseStatement() {
switch (token()) {
- case 23:
+ case 24:
return parseEmptyStatement();
- case 15:
+ case 16:
return parseBlock(false);
- case 102:
+ case 103:
return parseVariableStatement(scanner.getStartPos(), undefined, undefined);
- case 108:
+ case 109:
if (isLetDeclaration()) {
return parseVariableStatement(scanner.getStartPos(), undefined, undefined);
}
break;
- case 87:
- return parseFunctionDeclaration(scanner.getStartPos(), undefined, undefined);
- case 73:
- return parseClassDeclaration(scanner.getStartPos(), undefined, undefined);
case 88:
- return parseIfStatement();
- case 79:
- return parseDoStatement();
- case 104:
- return parseWhileStatement();
- case 86:
- return parseForOrForInOrForOfStatement();
- case 75:
- return parseBreakOrContinueStatement(209);
- case 70:
- return parseBreakOrContinueStatement(210);
- case 94:
- return parseReturnStatement();
- case 105:
- return parseWithStatement();
- case 96:
- return parseSwitchStatement();
- case 98:
- return parseThrowStatement();
- case 100:
- case 72:
- case 85:
- return parseTryStatement();
- case 76:
- return parseDebuggerStatement();
- case 55:
- return parseDeclaration();
- case 118:
- case 107:
- case 134:
- case 125:
- case 126:
- case 122:
+ return parseFunctionDeclaration(scanner.getStartPos(), undefined, undefined);
case 74:
- case 81:
- case 82:
+ return parseClassDeclaration(scanner.getStartPos(), undefined, undefined);
case 89:
- case 110:
+ return parseIfStatement();
+ case 80:
+ return parseDoStatement();
+ case 105:
+ return parseWhileStatement();
+ case 87:
+ return parseForOrForInOrForOfStatement();
+ case 76:
+ return parseBreakOrContinueStatement(210);
+ case 71:
+ return parseBreakOrContinueStatement(211);
+ case 95:
+ return parseReturnStatement();
+ case 106:
+ return parseWithStatement();
+ case 97:
+ return parseSwitchStatement();
+ case 99:
+ return parseThrowStatement();
+ case 101:
+ case 73:
+ case 86:
+ return parseTryStatement();
+ case 77:
+ return parseDebuggerStatement();
+ case 56:
+ return parseDeclaration();
+ case 119:
+ case 108:
+ case 135:
+ case 126:
+ case 127:
+ case 123:
+ case 75:
+ case 82:
+ case 83:
+ case 90:
case 111:
case 112:
- case 115:
case 113:
- case 128:
- case 137:
+ case 116:
+ case 114:
+ case 129:
+ case 138:
if (isStartOfDeclaration()) {
return parseDeclaration();
}
@@ -13694,40 +14643,40 @@ var ts;
var decorators = parseDecorators();
var modifiers = parseModifiers();
switch (token()) {
- case 102:
- case 108:
- case 74:
+ case 103:
+ case 109:
+ case 75:
return parseVariableStatement(fullStart, decorators, modifiers);
- case 87:
+ case 88:
return parseFunctionDeclaration(fullStart, decorators, modifiers);
- case 73:
+ case 74:
return parseClassDeclaration(fullStart, decorators, modifiers);
- case 107:
+ case 108:
return parseInterfaceDeclaration(fullStart, decorators, modifiers);
- case 134:
+ case 135:
return parseTypeAliasDeclaration(fullStart, decorators, modifiers);
- case 81:
- return parseEnumDeclaration(fullStart, decorators, modifiers);
- case 137:
- case 125:
- case 126:
- return parseModuleDeclaration(fullStart, decorators, modifiers);
- case 89:
- return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers);
case 82:
+ return parseEnumDeclaration(fullStart, decorators, modifiers);
+ case 138:
+ case 126:
+ case 127:
+ return parseModuleDeclaration(fullStart, decorators, modifiers);
+ case 90:
+ return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers);
+ case 83:
nextToken();
switch (token()) {
- case 77:
- case 56:
+ case 78:
+ case 57:
return parseExportAssignment(fullStart, decorators, modifiers);
- case 116:
+ case 117:
return parseNamespaceExportDeclaration(fullStart, decorators, modifiers);
default:
return parseExportDeclaration(fullStart, decorators, modifiers);
}
default:
if (decorators || modifiers) {
- var node = createMissingNode(239, true, ts.Diagnostics.Declaration_expected);
+ var node = createMissingNode(240, true, ts.Diagnostics.Declaration_expected);
node.pos = fullStart;
node.decorators = decorators;
node.modifiers = modifiers;
@@ -13740,31 +14689,31 @@ var ts;
return !scanner.hasPrecedingLineBreak() && (isIdentifier() || token() === 9);
}
function parseFunctionBlockOrSemicolon(isGenerator, isAsync, diagnosticMessage) {
- if (token() !== 15 && canParseSemicolon()) {
+ if (token() !== 16 && canParseSemicolon()) {
parseSemicolon();
return;
}
return parseFunctionBlock(isGenerator, isAsync, false, diagnosticMessage);
}
function parseArrayBindingElement() {
- if (token() === 24) {
- return createNode(193);
+ if (token() === 25) {
+ return createNode(194);
}
- var node = createNode(169);
- node.dotDotDotToken = parseOptionalToken(22);
+ var node = createNode(170);
+ node.dotDotDotToken = parseOptionalToken(23);
node.name = parseIdentifierOrPattern();
node.initializer = parseBindingElementInitializer(false);
return finishNode(node);
}
function parseObjectBindingElement() {
- var node = createNode(169);
+ var node = createNode(170);
var tokenIsIdentifier = isIdentifier();
var propertyName = parsePropertyName();
- if (tokenIsIdentifier && token() !== 54) {
+ if (tokenIsIdentifier && token() !== 55) {
node.name = propertyName;
}
else {
- parseExpected(54);
+ parseExpected(55);
node.propertyName = propertyName;
node.name = parseIdentifierOrPattern();
}
@@ -13772,33 +14721,33 @@ var ts;
return finishNode(node);
}
function parseObjectBindingPattern() {
- var node = createNode(167);
- parseExpected(15);
- node.elements = parseDelimitedList(9, parseObjectBindingElement);
+ var node = createNode(168);
parseExpected(16);
+ node.elements = parseDelimitedList(9, parseObjectBindingElement);
+ parseExpected(17);
return finishNode(node);
}
function parseArrayBindingPattern() {
- var node = createNode(168);
- parseExpected(19);
- node.elements = parseDelimitedList(10, parseArrayBindingElement);
+ var node = createNode(169);
parseExpected(20);
+ node.elements = parseDelimitedList(10, parseArrayBindingElement);
+ parseExpected(21);
return finishNode(node);
}
function isIdentifierOrPattern() {
- return token() === 15 || token() === 19 || isIdentifier();
+ return token() === 16 || token() === 20 || isIdentifier();
}
function parseIdentifierOrPattern() {
- if (token() === 19) {
+ if (token() === 20) {
return parseArrayBindingPattern();
}
- if (token() === 15) {
+ if (token() === 16) {
return parseObjectBindingPattern();
}
return parseIdentifier();
}
function parseVariableDeclaration() {
- var node = createNode(218);
+ var node = createNode(219);
node.name = parseIdentifierOrPattern();
node.type = parseTypeAnnotation();
if (!isInOrOfKeyword(token())) {
@@ -13807,21 +14756,21 @@ var ts;
return finishNode(node);
}
function parseVariableDeclarationList(inForStatementInitializer) {
- var node = createNode(219);
+ var node = createNode(220);
switch (token()) {
- case 102:
+ case 103:
break;
- case 108:
+ case 109:
node.flags |= 1;
break;
- case 74:
+ case 75:
node.flags |= 2;
break;
default:
ts.Debug.fail();
}
nextToken();
- if (token() === 138 && lookAhead(canFollowContextualOfKeyword)) {
+ if (token() === 139 && lookAhead(canFollowContextualOfKeyword)) {
node.declarations = createMissingList();
}
else {
@@ -13833,10 +14782,10 @@ var ts;
return finishNode(node);
}
function canFollowContextualOfKeyword() {
- return nextTokenIsIdentifier() && nextToken() === 18;
+ return nextTokenIsIdentifier() && nextToken() === 19;
}
function parseVariableStatement(fullStart, decorators, modifiers) {
- var node = createNode(200, fullStart);
+ var node = createNode(201, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
node.declarationList = parseVariableDeclarationList(false);
@@ -13844,29 +14793,29 @@ var ts;
return addJSDocComment(finishNode(node));
}
function parseFunctionDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(220, fullStart);
+ var node = createNode(221, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(87);
- node.asteriskToken = parseOptionalToken(37);
+ parseExpected(88);
+ node.asteriskToken = parseOptionalToken(38);
node.name = ts.hasModifier(node, 512) ? parseOptionalIdentifier() : parseIdentifier();
var isGenerator = !!node.asteriskToken;
var isAsync = ts.hasModifier(node, 256);
- fillSignature(54, isGenerator, isAsync, false, node);
+ fillSignature(55, isGenerator, isAsync, false, node);
node.body = parseFunctionBlockOrSemicolon(isGenerator, isAsync, ts.Diagnostics.or_expected);
return addJSDocComment(finishNode(node));
}
function parseConstructorDeclaration(pos, decorators, modifiers) {
- var node = createNode(148, pos);
+ var node = createNode(149, pos);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(121);
- fillSignature(54, false, false, false, node);
+ parseExpected(122);
+ fillSignature(55, false, false, false, node);
node.body = parseFunctionBlockOrSemicolon(false, false, ts.Diagnostics.or_expected);
return addJSDocComment(finishNode(node));
}
function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) {
- var method = createNode(147, fullStart);
+ var method = createNode(148, fullStart);
method.decorators = decorators;
method.modifiers = modifiers;
method.asteriskToken = asteriskToken;
@@ -13874,12 +14823,12 @@ var ts;
method.questionToken = questionToken;
var isGenerator = !!asteriskToken;
var isAsync = ts.hasModifier(method, 256);
- fillSignature(54, isGenerator, isAsync, false, method);
+ fillSignature(55, isGenerator, isAsync, false, method);
method.body = parseFunctionBlockOrSemicolon(isGenerator, isAsync, diagnosticMessage);
return addJSDocComment(finishNode(method));
}
function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) {
- var property = createNode(145, fullStart);
+ var property = createNode(146, fullStart);
property.decorators = decorators;
property.modifiers = modifiers;
property.name = name;
@@ -13892,10 +14841,10 @@ var ts;
return addJSDocComment(finishNode(property));
}
function parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers) {
- var asteriskToken = parseOptionalToken(37);
+ var asteriskToken = parseOptionalToken(38);
var name = parsePropertyName();
- var questionToken = parseOptionalToken(53);
- if (asteriskToken || token() === 17 || token() === 25) {
+ var questionToken = parseOptionalToken(54);
+ if (asteriskToken || token() === 18 || token() === 26) {
return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, ts.Diagnostics.or_expected);
}
else {
@@ -13910,17 +14859,17 @@ var ts;
node.decorators = decorators;
node.modifiers = modifiers;
node.name = parsePropertyName();
- fillSignature(54, false, false, false, node);
+ fillSignature(55, false, false, false, node);
node.body = parseFunctionBlockOrSemicolon(false, false);
return addJSDocComment(finishNode(node));
}
function isClassMemberModifier(idToken) {
switch (idToken) {
- case 112:
- case 110:
- case 111:
case 113:
- case 128:
+ case 111:
+ case 112:
+ case 114:
+ case 129:
return true;
default:
return false;
@@ -13928,7 +14877,7 @@ var ts;
}
function isClassMemberStart() {
var idToken;
- if (token() === 55) {
+ if (token() === 56) {
return true;
}
while (ts.isModifierKind(token())) {
@@ -13938,26 +14887,26 @@ var ts;
}
nextToken();
}
- if (token() === 37) {
+ if (token() === 38) {
return true;
}
if (isLiteralPropertyName()) {
idToken = token();
nextToken();
}
- if (token() === 19) {
+ if (token() === 20) {
return true;
}
if (idToken !== undefined) {
- if (!ts.isKeyword(idToken) || idToken === 131 || idToken === 123) {
+ if (!ts.isKeyword(idToken) || idToken === 132 || idToken === 124) {
return true;
}
switch (token()) {
- case 17:
- case 25:
+ case 18:
+ case 26:
+ case 55:
+ case 57:
case 54:
- case 56:
- case 53:
return true;
default:
return canParseSemicolon();
@@ -13969,10 +14918,10 @@ var ts;
var decorators;
while (true) {
var decoratorStart = getNodePos();
- if (!parseOptional(55)) {
+ if (!parseOptional(56)) {
break;
}
- var decorator = createNode(143, decoratorStart);
+ var decorator = createNode(144, decoratorStart);
decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher);
finishNode(decorator);
if (!decorators) {
@@ -13992,7 +14941,7 @@ var ts;
while (true) {
var modifierStart = scanner.getStartPos();
var modifierKind = token();
- if (token() === 74 && permitInvalidConstAsModifier) {
+ if (token() === 75 && permitInvalidConstAsModifier) {
if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) {
break;
}
@@ -14017,7 +14966,7 @@ var ts;
}
function parseModifiersForArrowFunction() {
var modifiers;
- if (token() === 118) {
+ if (token() === 119) {
var modifierStart = scanner.getStartPos();
var modifierKind = token();
nextToken();
@@ -14028,8 +14977,8 @@ var ts;
return modifiers;
}
function parseClassElement() {
- if (token() === 23) {
- var result = createNode(198);
+ if (token() === 24) {
+ var result = createNode(199);
nextToken();
return finishNode(result);
}
@@ -14040,7 +14989,7 @@ var ts;
if (accessor) {
return accessor;
}
- if (token() === 121) {
+ if (token() === 122) {
return parseConstructorDeclaration(fullStart, decorators, modifiers);
}
if (isIndexSignature()) {
@@ -14049,33 +14998,33 @@ var ts;
if (ts.tokenIsIdentifierOrKeyword(token()) ||
token() === 9 ||
token() === 8 ||
- token() === 37 ||
- token() === 19) {
+ token() === 38 ||
+ token() === 20) {
return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers);
}
if (decorators || modifiers) {
- var name_10 = createMissingNode(69, true, ts.Diagnostics.Declaration_expected);
+ var name_10 = createMissingNode(70, true, ts.Diagnostics.Declaration_expected);
return parsePropertyDeclaration(fullStart, decorators, modifiers, name_10, undefined);
}
ts.Debug.fail("Should not have attempted to parse class member declaration.");
}
function parseClassExpression() {
- return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 192);
+ return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 193);
}
function parseClassDeclaration(fullStart, decorators, modifiers) {
- return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 221);
+ return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 222);
}
function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) {
var node = createNode(kind, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(73);
+ parseExpected(74);
node.name = parseNameOfClassDeclarationOrExpression();
node.typeParameters = parseTypeParameters();
- node.heritageClauses = parseHeritageClauses(true);
- if (parseExpected(15)) {
+ node.heritageClauses = parseHeritageClauses();
+ if (parseExpected(16)) {
node.members = parseClassMembers();
- parseExpected(16);
+ parseExpected(17);
}
else {
node.members = createMissingList();
@@ -14088,16 +15037,16 @@ var ts;
: undefined;
}
function isImplementsClause() {
- return token() === 106 && lookAhead(nextTokenIsIdentifierOrKeyword);
+ return token() === 107 && lookAhead(nextTokenIsIdentifierOrKeyword);
}
- function parseHeritageClauses(isClassHeritageClause) {
+ function parseHeritageClauses() {
if (isHeritageClause()) {
return parseList(20, parseHeritageClause);
}
return undefined;
}
function parseHeritageClause() {
- if (token() === 83 || token() === 106) {
+ if (token() === 84 || token() === 107) {
var node = createNode(251);
node.token = token();
nextToken();
@@ -14107,38 +15056,38 @@ var ts;
return undefined;
}
function parseExpressionWithTypeArguments() {
- var node = createNode(194);
+ var node = createNode(195);
node.expression = parseLeftHandSideExpressionOrHigher();
- if (token() === 25) {
- node.typeArguments = parseBracketedList(18, parseType, 25, 27);
+ if (token() === 26) {
+ node.typeArguments = parseBracketedList(18, parseType, 26, 28);
}
return finishNode(node);
}
function isHeritageClause() {
- return token() === 83 || token() === 106;
+ return token() === 84 || token() === 107;
}
function parseClassMembers() {
return parseList(5, parseClassElement);
}
function parseInterfaceDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(222, fullStart);
+ var node = createNode(223, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(107);
+ parseExpected(108);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
- node.heritageClauses = parseHeritageClauses(false);
+ node.heritageClauses = parseHeritageClauses();
node.members = parseObjectTypeMembers();
return addJSDocComment(finishNode(node));
}
function parseTypeAliasDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(223, fullStart);
+ var node = createNode(224, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(134);
+ parseExpected(135);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
- parseExpected(56);
+ parseExpected(57);
node.type = parseType();
parseSemicolon();
return addJSDocComment(finishNode(node));
@@ -14150,14 +15099,14 @@ var ts;
return addJSDocComment(finishNode(node));
}
function parseEnumDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(224, fullStart);
+ var node = createNode(225, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(81);
+ parseExpected(82);
node.name = parseIdentifier();
- if (parseExpected(15)) {
+ if (parseExpected(16)) {
node.members = parseDelimitedList(6, parseEnumMember);
- parseExpected(16);
+ parseExpected(17);
}
else {
node.members = createMissingList();
@@ -14165,10 +15114,10 @@ var ts;
return addJSDocComment(finishNode(node));
}
function parseModuleBlock() {
- var node = createNode(226, scanner.getStartPos());
- if (parseExpected(15)) {
+ var node = createNode(227, scanner.getStartPos());
+ if (parseExpected(16)) {
node.statements = parseList(1, parseStatement);
- parseExpected(16);
+ parseExpected(17);
}
else {
node.statements = createMissingList();
@@ -14176,29 +15125,29 @@ var ts;
return finishNode(node);
}
function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) {
- var node = createNode(225, fullStart);
+ var node = createNode(226, fullStart);
var namespaceFlag = flags & 16;
node.decorators = decorators;
node.modifiers = modifiers;
node.flags |= flags;
node.name = parseIdentifier();
- node.body = parseOptional(21)
+ node.body = parseOptional(22)
? parseModuleOrNamespaceDeclaration(getNodePos(), undefined, undefined, 4 | namespaceFlag)
: parseModuleBlock();
return addJSDocComment(finishNode(node));
}
function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(225, fullStart);
+ var node = createNode(226, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- if (token() === 137) {
+ if (token() === 138) {
node.name = parseIdentifier();
node.flags |= 512;
}
else {
node.name = parseLiteralNode(true);
}
- if (token() === 15) {
+ if (token() === 16) {
node.body = parseModuleBlock();
}
else {
@@ -14208,14 +15157,14 @@ var ts;
}
function parseModuleDeclaration(fullStart, decorators, modifiers) {
var flags = 0;
- if (token() === 137) {
+ if (token() === 138) {
return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers);
}
- else if (parseOptional(126)) {
+ else if (parseOptional(127)) {
flags |= 16;
}
else {
- parseExpected(125);
+ parseExpected(126);
if (token() === 9) {
return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers);
}
@@ -14223,63 +15172,63 @@ var ts;
return parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags);
}
function isExternalModuleReference() {
- return token() === 129 &&
+ return token() === 130 &&
lookAhead(nextTokenIsOpenParen);
}
function nextTokenIsOpenParen() {
- return nextToken() === 17;
+ return nextToken() === 18;
}
function nextTokenIsSlash() {
- return nextToken() === 39;
+ return nextToken() === 40;
}
function parseNamespaceExportDeclaration(fullStart, decorators, modifiers) {
- var exportDeclaration = createNode(228, fullStart);
+ var exportDeclaration = createNode(229, fullStart);
exportDeclaration.decorators = decorators;
exportDeclaration.modifiers = modifiers;
- parseExpected(116);
- parseExpected(126);
+ parseExpected(117);
+ parseExpected(127);
exportDeclaration.name = parseIdentifier();
- parseExpected(23);
+ parseExpected(24);
return finishNode(exportDeclaration);
}
function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) {
- parseExpected(89);
+ parseExpected(90);
var afterImportPos = scanner.getStartPos();
var identifier;
if (isIdentifier()) {
identifier = parseIdentifier();
- if (token() !== 24 && token() !== 136) {
- var importEqualsDeclaration = createNode(229, fullStart);
+ if (token() !== 25 && token() !== 137) {
+ var importEqualsDeclaration = createNode(230, fullStart);
importEqualsDeclaration.decorators = decorators;
importEqualsDeclaration.modifiers = modifiers;
importEqualsDeclaration.name = identifier;
- parseExpected(56);
+ parseExpected(57);
importEqualsDeclaration.moduleReference = parseModuleReference();
parseSemicolon();
return addJSDocComment(finishNode(importEqualsDeclaration));
}
}
- var importDeclaration = createNode(230, fullStart);
+ var importDeclaration = createNode(231, fullStart);
importDeclaration.decorators = decorators;
importDeclaration.modifiers = modifiers;
if (identifier ||
- token() === 37 ||
- token() === 15) {
+ token() === 38 ||
+ token() === 16) {
importDeclaration.importClause = parseImportClause(identifier, afterImportPos);
- parseExpected(136);
+ parseExpected(137);
}
importDeclaration.moduleSpecifier = parseModuleSpecifier();
parseSemicolon();
return finishNode(importDeclaration);
}
function parseImportClause(identifier, fullStart) {
- var importClause = createNode(231, fullStart);
+ var importClause = createNode(232, fullStart);
if (identifier) {
importClause.name = identifier;
}
if (!importClause.name ||
- parseOptional(24)) {
- importClause.namedBindings = token() === 37 ? parseNamespaceImport() : parseNamedImportsOrExports(233);
+ parseOptional(25)) {
+ importClause.namedBindings = token() === 38 ? parseNamespaceImport() : parseNamedImportsOrExports(234);
}
return finishNode(importClause);
}
@@ -14289,11 +15238,11 @@ var ts;
: parseEntityName(false);
}
function parseExternalModuleReference() {
- var node = createNode(240);
- parseExpected(129);
- parseExpected(17);
- node.expression = parseModuleSpecifier();
+ var node = createNode(241);
+ parseExpected(130);
parseExpected(18);
+ node.expression = parseModuleSpecifier();
+ parseExpected(19);
return finishNode(node);
}
function parseModuleSpecifier() {
@@ -14307,22 +15256,22 @@ var ts;
}
}
function parseNamespaceImport() {
- var namespaceImport = createNode(232);
- parseExpected(37);
- parseExpected(116);
+ var namespaceImport = createNode(233);
+ parseExpected(38);
+ parseExpected(117);
namespaceImport.name = parseIdentifier();
return finishNode(namespaceImport);
}
function parseNamedImportsOrExports(kind) {
var node = createNode(kind);
- node.elements = parseBracketedList(21, kind === 233 ? parseImportSpecifier : parseExportSpecifier, 15, 16);
+ node.elements = parseBracketedList(21, kind === 234 ? parseImportSpecifier : parseExportSpecifier, 16, 17);
return finishNode(node);
}
function parseExportSpecifier() {
- return parseImportOrExportSpecifier(238);
+ return parseImportOrExportSpecifier(239);
}
function parseImportSpecifier() {
- return parseImportOrExportSpecifier(234);
+ return parseImportOrExportSpecifier(235);
}
function parseImportOrExportSpecifier(kind) {
var node = createNode(kind);
@@ -14330,9 +15279,9 @@ var ts;
var checkIdentifierStart = scanner.getTokenPos();
var checkIdentifierEnd = scanner.getTextPos();
var identifierName = parseIdentifierName();
- if (token() === 116) {
+ if (token() === 117) {
node.propertyName = identifierName;
- parseExpected(116);
+ parseExpected(117);
checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();
checkIdentifierStart = scanner.getTokenPos();
checkIdentifierEnd = scanner.getTextPos();
@@ -14341,23 +15290,23 @@ var ts;
else {
node.name = identifierName;
}
- if (kind === 234 && checkIdentifierIsKeyword) {
+ if (kind === 235 && checkIdentifierIsKeyword) {
parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected);
}
return finishNode(node);
}
function parseExportDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(236, fullStart);
+ var node = createNode(237, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- if (parseOptional(37)) {
- parseExpected(136);
+ if (parseOptional(38)) {
+ parseExpected(137);
node.moduleSpecifier = parseModuleSpecifier();
}
else {
- node.exportClause = parseNamedImportsOrExports(237);
- if (token() === 136 || (token() === 9 && !scanner.hasPrecedingLineBreak())) {
- parseExpected(136);
+ node.exportClause = parseNamedImportsOrExports(238);
+ if (token() === 137 || (token() === 9 && !scanner.hasPrecedingLineBreak())) {
+ parseExpected(137);
node.moduleSpecifier = parseModuleSpecifier();
}
}
@@ -14365,14 +15314,14 @@ var ts;
return finishNode(node);
}
function parseExportAssignment(fullStart, decorators, modifiers) {
- var node = createNode(235, fullStart);
+ var node = createNode(236, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- if (parseOptional(56)) {
+ if (parseOptional(57)) {
node.isExportEquals = true;
}
else {
- parseExpected(77);
+ parseExpected(78);
}
node.expression = parseAssignmentExpressionOrHigher();
parseSemicolon();
@@ -14444,36 +15393,72 @@ var ts;
function setExternalModuleIndicator(sourceFile) {
sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) {
return ts.hasModifier(node, 1)
- || node.kind === 229 && node.moduleReference.kind === 240
- || node.kind === 230
- || node.kind === 235
+ || node.kind === 230 && node.moduleReference.kind === 241
+ || node.kind === 231
|| node.kind === 236
+ || node.kind === 237
? node
: undefined;
});
}
+ var ParsingContext;
+ (function (ParsingContext) {
+ ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements";
+ ParsingContext[ParsingContext["BlockStatements"] = 1] = "BlockStatements";
+ ParsingContext[ParsingContext["SwitchClauses"] = 2] = "SwitchClauses";
+ ParsingContext[ParsingContext["SwitchClauseStatements"] = 3] = "SwitchClauseStatements";
+ ParsingContext[ParsingContext["TypeMembers"] = 4] = "TypeMembers";
+ ParsingContext[ParsingContext["ClassMembers"] = 5] = "ClassMembers";
+ ParsingContext[ParsingContext["EnumMembers"] = 6] = "EnumMembers";
+ ParsingContext[ParsingContext["HeritageClauseElement"] = 7] = "HeritageClauseElement";
+ ParsingContext[ParsingContext["VariableDeclarations"] = 8] = "VariableDeclarations";
+ ParsingContext[ParsingContext["ObjectBindingElements"] = 9] = "ObjectBindingElements";
+ ParsingContext[ParsingContext["ArrayBindingElements"] = 10] = "ArrayBindingElements";
+ ParsingContext[ParsingContext["ArgumentExpressions"] = 11] = "ArgumentExpressions";
+ ParsingContext[ParsingContext["ObjectLiteralMembers"] = 12] = "ObjectLiteralMembers";
+ ParsingContext[ParsingContext["JsxAttributes"] = 13] = "JsxAttributes";
+ ParsingContext[ParsingContext["JsxChildren"] = 14] = "JsxChildren";
+ ParsingContext[ParsingContext["ArrayLiteralMembers"] = 15] = "ArrayLiteralMembers";
+ ParsingContext[ParsingContext["Parameters"] = 16] = "Parameters";
+ ParsingContext[ParsingContext["TypeParameters"] = 17] = "TypeParameters";
+ ParsingContext[ParsingContext["TypeArguments"] = 18] = "TypeArguments";
+ ParsingContext[ParsingContext["TupleElementTypes"] = 19] = "TupleElementTypes";
+ ParsingContext[ParsingContext["HeritageClauses"] = 20] = "HeritageClauses";
+ ParsingContext[ParsingContext["ImportOrExportSpecifiers"] = 21] = "ImportOrExportSpecifiers";
+ ParsingContext[ParsingContext["JSDocFunctionParameters"] = 22] = "JSDocFunctionParameters";
+ ParsingContext[ParsingContext["JSDocTypeArguments"] = 23] = "JSDocTypeArguments";
+ ParsingContext[ParsingContext["JSDocRecordMembers"] = 24] = "JSDocRecordMembers";
+ ParsingContext[ParsingContext["JSDocTupleTypes"] = 25] = "JSDocTupleTypes";
+ ParsingContext[ParsingContext["Count"] = 26] = "Count";
+ })(ParsingContext || (ParsingContext = {}));
+ var Tristate;
+ (function (Tristate) {
+ Tristate[Tristate["False"] = 0] = "False";
+ Tristate[Tristate["True"] = 1] = "True";
+ Tristate[Tristate["Unknown"] = 2] = "Unknown";
+ })(Tristate || (Tristate = {}));
var JSDocParser;
(function (JSDocParser) {
function isJSDocType() {
switch (token()) {
- case 37:
- case 53:
- case 17:
- case 19:
- case 49:
- case 15:
- case 87:
- case 22:
- case 92:
- case 97:
+ case 38:
+ case 54:
+ case 18:
+ case 20:
+ case 50:
+ case 16:
+ case 88:
+ case 23:
+ case 93:
+ case 98:
return true;
}
return ts.tokenIsIdentifierOrKeyword(token());
}
JSDocParser.isJSDocType = isJSDocType;
function parseJSDocTypeExpressionForTests(content, start, length) {
- initializeState("file.js", content, 2, undefined, 1);
- sourceFile = createSourceFile("file.js", 2, 1);
+ initializeState(content, 4, undefined, 1);
+ sourceFile = createSourceFile("file.js", 4, 1);
scanner.setText(content, start, length);
currentToken = scanner.scan();
var jsDocTypeExpression = parseJSDocTypeExpression();
@@ -14484,21 +15469,21 @@ var ts;
JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests;
function parseJSDocTypeExpression() {
var result = createNode(257, scanner.getTokenPos());
- parseExpected(15);
- result.type = parseJSDocTopLevelType();
parseExpected(16);
+ result.type = parseJSDocTopLevelType();
+ parseExpected(17);
fixupParentReferences(result);
return finishNode(result);
}
JSDocParser.parseJSDocTypeExpression = parseJSDocTypeExpression;
function parseJSDocTopLevelType() {
var type = parseJSDocType();
- if (token() === 47) {
+ if (token() === 48) {
var unionType = createNode(261, type.pos);
unionType.types = parseJSDocTypeList(type);
type = finishNode(unionType);
}
- if (token() === 56) {
+ if (token() === 57) {
var optionalType = createNode(268, type.pos);
nextToken();
optionalType.type = type;
@@ -14509,20 +15494,20 @@ var ts;
function parseJSDocType() {
var type = parseBasicTypeExpression();
while (true) {
- if (token() === 19) {
+ if (token() === 20) {
var arrayType = createNode(260, type.pos);
arrayType.elementType = type;
nextToken();
- parseExpected(20);
+ parseExpected(21);
type = finishNode(arrayType);
}
- else if (token() === 53) {
+ else if (token() === 54) {
var nullableType = createNode(263, type.pos);
nullableType.type = type;
nextToken();
type = finishNode(nullableType);
}
- else if (token() === 49) {
+ else if (token() === 50) {
var nonNullableType = createNode(264, type.pos);
nonNullableType.type = type;
nextToken();
@@ -14536,40 +15521,40 @@ var ts;
}
function parseBasicTypeExpression() {
switch (token()) {
- case 37:
+ case 38:
return parseJSDocAllType();
- case 53:
+ case 54:
return parseJSDocUnknownOrNullableType();
- case 17:
+ case 18:
return parseJSDocUnionType();
- case 19:
+ case 20:
return parseJSDocTupleType();
- case 49:
+ case 50:
return parseJSDocNonNullableType();
- case 15:
+ case 16:
return parseJSDocRecordType();
- case 87:
+ case 88:
return parseJSDocFunctionType();
- case 22:
+ case 23:
return parseJSDocVariadicType();
- case 92:
- return parseJSDocConstructorType();
- case 97:
- return parseJSDocThisType();
- case 117:
- case 132:
- case 130:
- case 120:
- case 133:
- case 103:
case 93:
- case 135:
- case 127:
+ return parseJSDocConstructorType();
+ case 98:
+ return parseJSDocThisType();
+ case 118:
+ case 133:
+ case 131:
+ case 121:
+ case 134:
+ case 104:
+ case 94:
+ case 136:
+ case 128:
return parseTokenNode();
case 9:
case 8:
- case 99:
- case 84:
+ case 100:
+ case 85:
return parseJSDocLiteralType();
}
return parseJSDocTypeReference();
@@ -14577,14 +15562,14 @@ var ts;
function parseJSDocThisType() {
var result = createNode(272);
nextToken();
- parseExpected(54);
+ parseExpected(55);
result.type = parseJSDocType();
return finishNode(result);
}
function parseJSDocConstructorType() {
var result = createNode(271);
nextToken();
- parseExpected(54);
+ parseExpected(55);
result.type = parseJSDocType();
return finishNode(result);
}
@@ -14597,33 +15582,33 @@ var ts;
function parseJSDocFunctionType() {
var result = createNode(269);
nextToken();
- parseExpected(17);
+ parseExpected(18);
result.parameters = parseDelimitedList(22, parseJSDocParameter);
checkForTrailingComma(result.parameters);
- parseExpected(18);
- if (token() === 54) {
+ parseExpected(19);
+ if (token() === 55) {
nextToken();
result.type = parseJSDocType();
}
return finishNode(result);
}
function parseJSDocParameter() {
- var parameter = createNode(142);
+ var parameter = createNode(143);
parameter.type = parseJSDocType();
- if (parseOptional(56)) {
- parameter.questionToken = createNode(56);
+ if (parseOptional(57)) {
+ parameter.questionToken = createNode(57);
}
return finishNode(parameter);
}
function parseJSDocTypeReference() {
var result = createNode(267);
result.name = parseSimplePropertyName();
- if (token() === 25) {
+ if (token() === 26) {
result.typeArguments = parseTypeArguments();
}
else {
- while (parseOptional(21)) {
- if (token() === 25) {
+ while (parseOptional(22)) {
+ if (token() === 26) {
result.typeArguments = parseTypeArguments();
break;
}
@@ -14639,7 +15624,7 @@ var ts;
var typeArguments = parseDelimitedList(23, parseJSDocType);
checkForTrailingComma(typeArguments);
checkForEmptyTypeArgumentList(typeArguments);
- parseExpected(27);
+ parseExpected(28);
return typeArguments;
}
function checkForEmptyTypeArgumentList(typeArguments) {
@@ -14650,7 +15635,7 @@ var ts;
}
}
function parseQualifiedName(left) {
- var result = createNode(139, left.pos);
+ var result = createNode(140, left.pos);
result.left = left;
result.right = parseIdentifierName();
return finishNode(result);
@@ -14671,7 +15656,7 @@ var ts;
nextToken();
result.types = parseDelimitedList(25, parseJSDocType);
checkForTrailingComma(result.types);
- parseExpected(20);
+ parseExpected(21);
return finishNode(result);
}
function checkForTrailingComma(list) {
@@ -14684,13 +15669,13 @@ var ts;
var result = createNode(261);
nextToken();
result.types = parseJSDocTypeList(parseJSDocType());
- parseExpected(18);
+ parseExpected(19);
return finishNode(result);
}
function parseJSDocTypeList(firstType) {
ts.Debug.assert(!!firstType);
var types = createNodeArray([firstType], firstType.pos);
- while (parseOptional(47)) {
+ while (parseOptional(48)) {
types.push(parseJSDocType());
}
types.end = scanner.getStartPos();
@@ -14709,12 +15694,12 @@ var ts;
function parseJSDocUnknownOrNullableType() {
var pos = scanner.getStartPos();
nextToken();
- if (token() === 24 ||
- token() === 16 ||
- token() === 18 ||
- token() === 27 ||
- token() === 56 ||
- token() === 47) {
+ if (token() === 25 ||
+ token() === 17 ||
+ token() === 19 ||
+ token() === 28 ||
+ token() === 57 ||
+ token() === 48) {
var result = createNode(259, pos);
return finishNode(result);
}
@@ -14725,7 +15710,7 @@ var ts;
}
}
function parseIsolatedJSDocComment(content, start, length) {
- initializeState("file.js", content, 2, undefined, 1);
+ initializeState(content, 4, undefined, 1);
sourceFile = { languageVariant: 0, text: content };
var jsDoc = parseJSDocCommentWorker(start, length);
var diagnostics = parseDiagnostics;
@@ -14747,6 +15732,12 @@ var ts;
return comment;
}
JSDocParser.parseJSDocComment = parseJSDocComment;
+ var JSDocState;
+ (function (JSDocState) {
+ JSDocState[JSDocState["BeginningOfLine"] = 0] = "BeginningOfLine";
+ JSDocState[JSDocState["SawAsterisk"] = 1] = "SawAsterisk";
+ JSDocState[JSDocState["SavingComments"] = 2] = "SavingComments";
+ })(JSDocState || (JSDocState = {}));
function parseJSDocCommentWorker(start, length) {
var content = sourceText;
start = start || 0;
@@ -14783,7 +15774,7 @@ var ts;
}
while (token() !== 1) {
switch (token()) {
- case 55:
+ case 56:
if (state === 0 || state === 1) {
removeTrailingNewlines(comments);
parseTag(indent);
@@ -14801,7 +15792,7 @@ var ts;
state = 0;
indent = 0;
break;
- case 37:
+ case 38:
var asterisk = scanner.getTokenText();
if (state === 1) {
state = 2;
@@ -14812,7 +15803,7 @@ var ts;
indent += asterisk.length;
}
break;
- case 69:
+ case 70:
pushComment(scanner.getTokenText());
state = 2;
break;
@@ -14869,8 +15860,8 @@ var ts;
}
}
function parseTag(indent) {
- ts.Debug.assert(token() === 55);
- var atToken = createNode(55, scanner.getTokenPos());
+ ts.Debug.assert(token() === 56);
+ var atToken = createNode(56, scanner.getTokenPos());
atToken.end = scanner.getTextPos();
nextJSDocToken();
var tagName = parseJSDocIdentifierName();
@@ -14921,7 +15912,7 @@ var ts;
comments.push(text);
indent += text.length;
}
- while (token() !== 55 && token() !== 1) {
+ while (token() !== 56 && token() !== 1) {
switch (token()) {
case 4:
if (state >= 1) {
@@ -14930,7 +15921,7 @@ var ts;
}
indent = 0;
break;
- case 55:
+ case 56:
break;
case 5:
if (state === 2) {
@@ -14944,7 +15935,7 @@ var ts;
indent += whitespace.length;
}
break;
- case 37:
+ case 38:
if (state === 0) {
state = 1;
indent += scanner.getTokenText().length;
@@ -14955,7 +15946,7 @@ var ts;
pushComment(scanner.getTokenText());
break;
}
- if (token() === 55) {
+ if (token() === 56) {
break;
}
nextJSDocToken();
@@ -14983,7 +15974,7 @@ var ts;
function tryParseTypeExpression() {
return tryParse(function () {
skipWhitespace();
- if (token() !== 15) {
+ if (token() !== 16) {
return undefined;
}
return parseJSDocTypeExpression();
@@ -14994,14 +15985,14 @@ var ts;
skipWhitespace();
var name;
var isBracketed;
- if (parseOptionalToken(19)) {
+ if (parseOptionalToken(20)) {
name = parseJSDocIdentifierName();
skipWhitespace();
isBracketed = true;
- if (parseOptionalToken(56)) {
+ if (parseOptionalToken(57)) {
parseExpression();
}
- parseExpected(20);
+ parseExpected(21);
}
else if (ts.tokenIsIdentifierOrKeyword(token())) {
name = parseJSDocIdentifierName();
@@ -15078,7 +16069,7 @@ var ts;
if (typeExpression) {
if (typeExpression.type.kind === 267) {
var jsDocTypeReference = typeExpression.type;
- if (jsDocTypeReference.name.kind === 69) {
+ if (jsDocTypeReference.name.kind === 70) {
var name_11 = jsDocTypeReference.name;
if (name_11.text === "Object") {
typedefTag.jsDocTypeLiteral = scanChildTags();
@@ -15102,7 +16093,7 @@ var ts;
while (token() !== 1 && !parentTagTerminated) {
nextJSDocToken();
switch (token()) {
- case 55:
+ case 56:
if (canParseTag) {
parentTagTerminated = !tryParseChildTag(jsDocTypeLiteral);
if (!parentTagTerminated) {
@@ -15116,13 +16107,13 @@ var ts;
canParseTag = true;
seenAsterisk = false;
break;
- case 37:
+ case 38:
if (seenAsterisk) {
canParseTag = false;
}
seenAsterisk = true;
break;
- case 69:
+ case 70:
canParseTag = false;
case 1:
break;
@@ -15133,8 +16124,8 @@ var ts;
}
}
function tryParseChildTag(parentTag) {
- ts.Debug.assert(token() === 55);
- var atToken = createNode(55, scanner.getStartPos());
+ ts.Debug.assert(token() === 56);
+ var atToken = createNode(56, scanner.getStartPos());
atToken.end = scanner.getTextPos();
nextJSDocToken();
var tagName = parseJSDocIdentifierName();
@@ -15172,11 +16163,11 @@ var ts;
parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected);
return undefined;
}
- var typeParameter = createNode(141, name_12.pos);
+ var typeParameter = createNode(142, name_12.pos);
typeParameter.name = name_12;
finishNode(typeParameter);
typeParameters.push(typeParameter);
- if (token() === 24) {
+ if (token() === 25) {
nextJSDocToken();
skipWhitespace();
}
@@ -15205,7 +16196,7 @@ var ts;
}
var pos = scanner.getTokenPos();
var end = scanner.getTextPos();
- var result = createNode(69, pos);
+ var result = createNode(70, pos);
result.text = content.substring(pos, end);
finishNode(result, end);
nextJSDocToken();
@@ -15276,8 +16267,8 @@ var ts;
array._children = undefined;
array.pos += delta;
array.end += delta;
- for (var _i = 0, array_8 = array; _i < array_8.length; _i++) {
- var node = array_8[_i];
+ for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {
+ var node = array_9[_i];
visitNode(node);
}
}
@@ -15286,7 +16277,7 @@ var ts;
switch (node.kind) {
case 9:
case 8:
- case 69:
+ case 70:
return true;
}
return false;
@@ -15349,8 +16340,8 @@ var ts;
array.intersectsChange = true;
array._children = undefined;
adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
- for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {
- var node = array_9[_i];
+ for (var _i = 0, array_10 = array; _i < array_10.length; _i++) {
+ var node = array_10[_i];
visitNode(node);
}
return;
@@ -15498,21 +16489,31 @@ var ts;
}
}
}
+ var InvalidPosition;
+ (function (InvalidPosition) {
+ InvalidPosition[InvalidPosition["Value"] = -1] = "Value";
+ })(InvalidPosition || (InvalidPosition = {}));
})(IncrementalParser || (IncrementalParser = {}));
})(ts || (ts = {}));
var ts;
(function (ts) {
+ (function (ModuleInstanceState) {
+ ModuleInstanceState[ModuleInstanceState["NonInstantiated"] = 0] = "NonInstantiated";
+ ModuleInstanceState[ModuleInstanceState["Instantiated"] = 1] = "Instantiated";
+ ModuleInstanceState[ModuleInstanceState["ConstEnumOnly"] = 2] = "ConstEnumOnly";
+ })(ts.ModuleInstanceState || (ts.ModuleInstanceState = {}));
+ var ModuleInstanceState = ts.ModuleInstanceState;
function getModuleInstanceState(node) {
- if (node.kind === 222 || node.kind === 223) {
+ if (node.kind === 223 || node.kind === 224) {
return 0;
}
else if (ts.isConstEnumDeclaration(node)) {
return 2;
}
- else if ((node.kind === 230 || node.kind === 229) && !(ts.hasModifier(node, 1))) {
+ else if ((node.kind === 231 || node.kind === 230) && !(ts.hasModifier(node, 1))) {
return 0;
}
- else if (node.kind === 226) {
+ else if (node.kind === 227) {
var state_1 = 0;
ts.forEachChild(node, function (n) {
switch (getModuleInstanceState(n)) {
@@ -15528,7 +16529,7 @@ var ts;
});
return state_1;
}
- else if (node.kind === 225) {
+ else if (node.kind === 226) {
var body = node.body;
return body ? getModuleInstanceState(body) : 1;
}
@@ -15537,6 +16538,18 @@ var ts;
}
}
ts.getModuleInstanceState = getModuleInstanceState;
+ var ContainerFlags;
+ (function (ContainerFlags) {
+ ContainerFlags[ContainerFlags["None"] = 0] = "None";
+ ContainerFlags[ContainerFlags["IsContainer"] = 1] = "IsContainer";
+ ContainerFlags[ContainerFlags["IsBlockScopedContainer"] = 2] = "IsBlockScopedContainer";
+ ContainerFlags[ContainerFlags["IsControlFlowContainer"] = 4] = "IsControlFlowContainer";
+ ContainerFlags[ContainerFlags["IsFunctionLike"] = 8] = "IsFunctionLike";
+ ContainerFlags[ContainerFlags["IsFunctionExpression"] = 16] = "IsFunctionExpression";
+ ContainerFlags[ContainerFlags["HasLocals"] = 32] = "HasLocals";
+ ContainerFlags[ContainerFlags["IsInterface"] = 64] = "IsInterface";
+ ContainerFlags[ContainerFlags["IsObjectLiteralOrClassExpressionMethod"] = 128] = "IsObjectLiteralOrClassExpressionMethod";
+ })(ContainerFlags || (ContainerFlags = {}));
var binder = createBinder();
function bindSourceFile(file, options) {
ts.performance.mark("beforeBind");
@@ -15634,7 +16647,7 @@ var ts;
if (symbolFlags & 107455) {
var valueDeclaration = symbol.valueDeclaration;
if (!valueDeclaration ||
- (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 225)) {
+ (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 226)) {
symbol.valueDeclaration = node;
}
}
@@ -15644,7 +16657,7 @@ var ts;
if (ts.isAmbientModule(node)) {
return ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + node.name.text + "\"";
}
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
var nameExpression = node.name.expression;
if (ts.isStringOrNumericLiteral(nameExpression.kind)) {
return nameExpression.text;
@@ -15655,21 +16668,21 @@ var ts;
return node.name.text;
}
switch (node.kind) {
- case 148:
+ case 149:
return "__constructor";
- case 156:
- case 151:
- return "__call";
case 157:
case 152:
- return "__new";
+ return "__call";
+ case 158:
case 153:
+ return "__new";
+ case 154:
return "__index";
- case 236:
+ case 237:
return "__export";
- case 235:
+ case 236:
return node.isExportEquals ? "export=" : "default";
- case 187:
+ case 188:
switch (ts.getSpecialPropertyAssignmentKind(node)) {
case 2:
return "export=";
@@ -15681,12 +16694,12 @@ var ts;
}
ts.Debug.fail("Unknown binary declaration kind");
break;
- case 220:
case 221:
+ case 222:
return ts.hasModifier(node, 512) ? "default" : undefined;
case 269:
return ts.isJSDocConstructSignature(node) ? "__new" : "__call";
- case 142:
+ case 143:
ts.Debug.assert(node.parent.kind === 269);
var functionType = node.parent;
var index = ts.indexOf(functionType.parameters, node);
@@ -15694,10 +16707,10 @@ var ts;
case 279:
var parentNode = node.parent && node.parent.parent;
var nameFromParentNode = void 0;
- if (parentNode && parentNode.kind === 200) {
+ if (parentNode && parentNode.kind === 201) {
if (parentNode.declarationList.declarations.length > 0) {
var nameIdentifier = parentNode.declarationList.declarations[0].name;
- if (nameIdentifier.kind === 69) {
+ if (nameIdentifier.kind === 70) {
nameFromParentNode = nameIdentifier.text;
}
}
@@ -15738,7 +16751,7 @@ var ts;
}
else {
if (symbol.declarations && symbol.declarations.length &&
- (isDefaultExport || (node.kind === 235 && !node.isExportEquals))) {
+ (isDefaultExport || (node.kind === 236 && !node.isExportEquals))) {
message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports;
}
}
@@ -15758,7 +16771,7 @@ var ts;
function declareModuleMember(node, symbolFlags, symbolExcludes) {
var hasExportModifier = ts.getCombinedModifierFlags(node) & 1;
if (symbolFlags & 8388608) {
- if (node.kind === 238 || (node.kind === 229 && hasExportModifier)) {
+ if (node.kind === 239 || (node.kind === 230 && hasExportModifier)) {
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
}
else {
@@ -15875,64 +16888,64 @@ var ts;
return;
}
switch (node.kind) {
- case 205:
+ case 206:
bindWhileStatement(node);
break;
- case 204:
+ case 205:
bindDoStatement(node);
break;
- case 206:
+ case 207:
bindForStatement(node);
break;
- case 207:
case 208:
+ case 209:
bindForInOrForOfStatement(node);
break;
- case 203:
+ case 204:
bindIfStatement(node);
break;
- case 211:
- case 215:
+ case 212:
+ case 216:
bindReturnOrThrow(node);
break;
+ case 211:
case 210:
- case 209:
bindBreakOrContinueStatement(node);
break;
- case 216:
+ case 217:
bindTryStatement(node);
break;
- case 213:
+ case 214:
bindSwitchStatement(node);
break;
- case 227:
+ case 228:
bindCaseBlock(node);
break;
case 249:
bindCaseClause(node);
break;
- case 214:
+ case 215:
bindLabeledStatement(node);
break;
- case 185:
+ case 186:
bindPrefixUnaryExpressionFlow(node);
break;
- case 186:
+ case 187:
bindPostfixUnaryExpressionFlow(node);
break;
- case 187:
+ case 188:
bindBinaryExpressionFlow(node);
break;
- case 181:
+ case 182:
bindDeleteExpressionFlow(node);
break;
- case 188:
+ case 189:
bindConditionalExpressionFlow(node);
break;
- case 218:
+ case 219:
bindVariableDeclarationFlow(node);
break;
- case 174:
+ case 175:
bindCallExpressionFlow(node);
break;
default:
@@ -15942,25 +16955,25 @@ var ts;
}
function isNarrowingExpression(expr) {
switch (expr.kind) {
- case 69:
- case 97:
- case 172:
+ case 70:
+ case 98:
+ case 173:
return isNarrowableReference(expr);
- case 174:
+ case 175:
return hasNarrowableArgument(expr);
- case 178:
+ case 179:
return isNarrowingExpression(expr.expression);
- case 187:
+ case 188:
return isNarrowingBinaryExpression(expr);
- case 185:
- return expr.operator === 49 && isNarrowingExpression(expr.operand);
+ case 186:
+ return expr.operator === 50 && isNarrowingExpression(expr.operand);
}
return false;
}
function isNarrowableReference(expr) {
- return expr.kind === 69 ||
- expr.kind === 97 ||
- expr.kind === 172 && isNarrowableReference(expr.expression);
+ return expr.kind === 70 ||
+ expr.kind === 98 ||
+ expr.kind === 173 && isNarrowableReference(expr.expression);
}
function hasNarrowableArgument(expr) {
if (expr.arguments) {
@@ -15971,41 +16984,41 @@ var ts;
}
}
}
- if (expr.expression.kind === 172 &&
+ if (expr.expression.kind === 173 &&
isNarrowableReference(expr.expression.expression)) {
return true;
}
return false;
}
function isNarrowingTypeofOperands(expr1, expr2) {
- return expr1.kind === 182 && isNarrowableOperand(expr1.expression) && expr2.kind === 9;
+ return expr1.kind === 183 && isNarrowableOperand(expr1.expression) && expr2.kind === 9;
}
function isNarrowingBinaryExpression(expr) {
switch (expr.operatorToken.kind) {
- case 56:
+ case 57:
return isNarrowableReference(expr.left);
- case 30:
case 31:
case 32:
case 33:
+ case 34:
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) ||
isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right);
- case 91:
+ case 92:
return isNarrowableOperand(expr.left);
- case 24:
+ case 25:
return isNarrowingExpression(expr.right);
}
return false;
}
function isNarrowableOperand(expr) {
switch (expr.kind) {
- case 178:
+ case 179:
return isNarrowableOperand(expr.expression);
- case 187:
+ case 188:
switch (expr.operatorToken.kind) {
- case 56:
+ case 57:
return isNarrowableOperand(expr.left);
- case 24:
+ case 25:
return isNarrowableOperand(expr.right);
}
}
@@ -16024,7 +17037,7 @@ var ts;
};
}
function setFlowNodeReferenced(flow) {
- flow.flags |= flow.flags & 256 ? 512 : 256;
+ flow.flags |= flow.flags & 512 ? 1024 : 512;
}
function addAntecedent(label, antecedent) {
if (!(antecedent.flags & 1) && !ts.contains(label.antecedents, antecedent)) {
@@ -16039,8 +17052,8 @@ var ts;
if (!expression) {
return flags & 32 ? antecedent : unreachableFlow;
}
- if (expression.kind === 99 && flags & 64 ||
- expression.kind === 84 && flags & 32) {
+ if (expression.kind === 100 && flags & 64 ||
+ expression.kind === 85 && flags & 32) {
return unreachableFlow;
}
if (!isNarrowingExpression(expression)) {
@@ -16074,6 +17087,14 @@ var ts;
node: node
};
}
+ function createFlowArrayMutation(antecedent, node) {
+ setFlowNodeReferenced(antecedent);
+ return {
+ flags: 256,
+ antecedent: antecedent,
+ node: node
+ };
+ }
function finishFlowLabel(flow) {
var antecedents = flow.antecedents;
if (!antecedents) {
@@ -16087,34 +17108,34 @@ var ts;
function isStatementCondition(node) {
var parent = node.parent;
switch (parent.kind) {
- case 203:
- case 205:
case 204:
- return parent.expression === node;
case 206:
- case 188:
+ case 205:
+ return parent.expression === node;
+ case 207:
+ case 189:
return parent.condition === node;
}
return false;
}
function isLogicalExpression(node) {
while (true) {
- if (node.kind === 178) {
+ if (node.kind === 179) {
node = node.expression;
}
- else if (node.kind === 185 && node.operator === 49) {
+ else if (node.kind === 186 && node.operator === 50) {
node = node.operand;
}
else {
- return node.kind === 187 && (node.operatorToken.kind === 51 ||
- node.operatorToken.kind === 52);
+ return node.kind === 188 && (node.operatorToken.kind === 52 ||
+ node.operatorToken.kind === 53);
}
}
}
function isTopLevelLogicalExpression(node) {
- while (node.parent.kind === 178 ||
- node.parent.kind === 185 &&
- node.parent.operator === 49) {
+ while (node.parent.kind === 179 ||
+ node.parent.kind === 186 &&
+ node.parent.operator === 50) {
node = node.parent;
}
return !isStatementCondition(node) && !isLogicalExpression(node.parent);
@@ -16187,7 +17208,7 @@ var ts;
bind(node.expression);
addAntecedent(postLoopLabel, currentFlow);
bind(node.initializer);
- if (node.initializer.kind !== 219) {
+ if (node.initializer.kind !== 220) {
bindAssignmentTargetFlow(node.initializer);
}
bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
@@ -16209,7 +17230,7 @@ var ts;
}
function bindReturnOrThrow(node) {
bind(node.expression);
- if (node.kind === 211) {
+ if (node.kind === 212) {
hasExplicitReturn = true;
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
@@ -16229,7 +17250,7 @@ var ts;
return undefined;
}
function bindbreakOrContinueFlow(node, breakTarget, continueTarget) {
- var flowLabel = node.kind === 210 ? breakTarget : continueTarget;
+ var flowLabel = node.kind === 211 ? breakTarget : continueTarget;
if (flowLabel) {
addAntecedent(flowLabel, currentFlow);
currentFlow = unreachableFlow;
@@ -16249,21 +17270,32 @@ var ts;
}
}
function bindTryStatement(node) {
- var postFinallyLabel = createBranchLabel();
+ var preFinallyLabel = createBranchLabel();
var preTryFlow = currentFlow;
bind(node.tryBlock);
- addAntecedent(postFinallyLabel, currentFlow);
+ addAntecedent(preFinallyLabel, currentFlow);
+ var flowAfterTry = currentFlow;
+ var flowAfterCatch = unreachableFlow;
if (node.catchClause) {
currentFlow = preTryFlow;
bind(node.catchClause);
- addAntecedent(postFinallyLabel, currentFlow);
+ addAntecedent(preFinallyLabel, currentFlow);
+ flowAfterCatch = currentFlow;
}
if (node.finallyBlock) {
- currentFlow = preTryFlow;
+ addAntecedent(preFinallyLabel, preTryFlow);
+ currentFlow = finishFlowLabel(preFinallyLabel);
bind(node.finallyBlock);
+ if (!(currentFlow.flags & 1)) {
+ if ((flowAfterTry.flags & 1) && (flowAfterCatch.flags & 1)) {
+ currentFlow = flowAfterTry === reportedUnreachableFlow || flowAfterCatch === reportedUnreachableFlow
+ ? reportedUnreachableFlow
+ : unreachableFlow;
+ }
+ }
}
- if (!node.finallyBlock || !(currentFlow.flags & 1)) {
- currentFlow = finishFlowLabel(postFinallyLabel);
+ else {
+ currentFlow = finishFlowLabel(preFinallyLabel);
}
}
function bindSwitchStatement(node) {
@@ -16340,7 +17372,7 @@ var ts;
currentFlow = finishFlowLabel(postStatementLabel);
}
function bindDestructuringTargetFlow(node) {
- if (node.kind === 187 && node.operatorToken.kind === 56) {
+ if (node.kind === 188 && node.operatorToken.kind === 57) {
bindAssignmentTargetFlow(node.left);
}
else {
@@ -16351,10 +17383,10 @@ var ts;
if (isNarrowableReference(node)) {
currentFlow = createFlowAssignment(currentFlow, node);
}
- else if (node.kind === 170) {
+ else if (node.kind === 171) {
for (var _i = 0, _a = node.elements; _i < _a.length; _i++) {
var e = _a[_i];
- if (e.kind === 191) {
+ if (e.kind === 192) {
bindAssignmentTargetFlow(e.expression);
}
else {
@@ -16362,7 +17394,7 @@ var ts;
}
}
}
- else if (node.kind === 171) {
+ else if (node.kind === 172) {
for (var _b = 0, _c = node.properties; _b < _c.length; _b++) {
var p = _c[_b];
if (p.kind === 253) {
@@ -16376,7 +17408,7 @@ var ts;
}
function bindLogicalExpression(node, trueTarget, falseTarget) {
var preRightLabel = createBranchLabel();
- if (node.operatorToken.kind === 51) {
+ if (node.operatorToken.kind === 52) {
bindCondition(node.left, preRightLabel, falseTarget);
}
else {
@@ -16387,7 +17419,7 @@ var ts;
bindCondition(node.right, trueTarget, falseTarget);
}
function bindPrefixUnaryExpressionFlow(node) {
- if (node.operator === 49) {
+ if (node.operator === 50) {
var saveTrueTarget = currentTrueTarget;
currentTrueTarget = currentFalseTarget;
currentFalseTarget = saveTrueTarget;
@@ -16397,20 +17429,20 @@ var ts;
}
else {
ts.forEachChild(node, bind);
- if (node.operator === 41 || node.operator === 42) {
+ if (node.operator === 42 || node.operator === 43) {
bindAssignmentTargetFlow(node.operand);
}
}
}
function bindPostfixUnaryExpressionFlow(node) {
ts.forEachChild(node, bind);
- if (node.operator === 41 || node.operator === 42) {
+ if (node.operator === 42 || node.operator === 43) {
bindAssignmentTargetFlow(node.operand);
}
}
function bindBinaryExpressionFlow(node) {
var operator = node.operatorToken.kind;
- if (operator === 51 || operator === 52) {
+ if (operator === 52 || operator === 53) {
if (isTopLevelLogicalExpression(node)) {
var postExpressionLabel = createBranchLabel();
bindLogicalExpression(node, postExpressionLabel, postExpressionLabel);
@@ -16422,14 +17454,20 @@ var ts;
}
else {
ts.forEachChild(node, bind);
- if (operator === 56 && !ts.isAssignmentTarget(node)) {
+ if (operator === 57 && !ts.isAssignmentTarget(node)) {
bindAssignmentTargetFlow(node.left);
+ if (node.left.kind === 174) {
+ var elementAccess = node.left;
+ if (isNarrowableOperand(elementAccess.expression)) {
+ currentFlow = createFlowArrayMutation(currentFlow, node);
+ }
+ }
}
}
}
function bindDeleteExpressionFlow(node) {
ts.forEachChild(node, bind);
- if (node.expression.kind === 172) {
+ if (node.expression.kind === 173) {
bindAssignmentTargetFlow(node.expression);
}
}
@@ -16460,16 +17498,16 @@ var ts;
}
function bindVariableDeclarationFlow(node) {
ts.forEachChild(node, bind);
- if (node.initializer || node.parent.parent.kind === 207 || node.parent.parent.kind === 208) {
+ if (node.initializer || node.parent.parent.kind === 208 || node.parent.parent.kind === 209) {
bindInitializedVariableFlow(node);
}
}
function bindCallExpressionFlow(node) {
var expr = node.expression;
- while (expr.kind === 178) {
+ while (expr.kind === 179) {
expr = expr.expression;
}
- if (expr.kind === 179 || expr.kind === 180) {
+ if (expr.kind === 180 || expr.kind === 181) {
ts.forEach(node.typeArguments, bind);
ts.forEach(node.arguments, bind);
bind(node.expression);
@@ -16477,54 +17515,60 @@ var ts;
else {
ts.forEachChild(node, bind);
}
+ if (node.expression.kind === 173) {
+ var propertyAccess = node.expression;
+ if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) {
+ currentFlow = createFlowArrayMutation(currentFlow, node);
+ }
+ }
}
function getContainerFlags(node) {
switch (node.kind) {
- case 192:
- case 221:
- case 224:
- case 171:
- case 159:
+ case 193:
+ case 222:
+ case 225:
+ case 172:
+ case 160:
case 281:
case 265:
return 1;
- case 222:
+ case 223:
return 1 | 64;
case 269:
- case 225:
- case 223:
+ case 226:
+ case 224:
return 1 | 32;
case 256:
return 1 | 4 | 32;
- case 147:
+ case 148:
if (ts.isObjectLiteralOrClassExpressionMethod(node)) {
return 1 | 4 | 32 | 8 | 128;
}
- case 148:
- case 220:
- case 146:
case 149:
+ case 221:
+ case 147:
case 150:
case 151:
case 152:
case 153:
- case 156:
+ case 154:
case 157:
+ case 158:
return 1 | 4 | 32 | 8;
- case 179:
case 180:
+ case 181:
return 1 | 4 | 32 | 8 | 16;
- case 226:
+ case 227:
return 4;
- case 145:
+ case 146:
return node.initializer ? 4 : 0;
case 252:
- case 206:
case 207:
case 208:
- case 227:
+ case 209:
+ case 228:
return 2;
- case 199:
+ case 200:
return ts.isFunctionLike(node.parent) ? 0 : 2;
}
return 0;
@@ -16540,36 +17584,36 @@ var ts;
}
function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) {
switch (container.kind) {
- case 225:
+ case 226:
return declareModuleMember(node, symbolFlags, symbolExcludes);
case 256:
return declareSourceFileMember(node, symbolFlags, symbolExcludes);
- case 192:
- case 221:
- return declareClassMember(node, symbolFlags, symbolExcludes);
- case 224:
- return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
- case 159:
- case 171:
+ case 193:
case 222:
+ return declareClassMember(node, symbolFlags, symbolExcludes);
+ case 225:
+ return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
+ case 160:
+ case 172:
+ case 223:
case 265:
case 281:
return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
- case 156:
case 157:
- case 151:
+ case 158:
case 152:
case 153:
- case 147:
- case 146:
+ case 154:
case 148:
+ case 147:
case 149:
case 150:
- case 220:
- case 179:
+ case 151:
+ case 221:
case 180:
+ case 181:
case 269:
- case 223:
+ case 224:
return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes);
}
}
@@ -16585,10 +17629,10 @@ var ts;
}
function hasExportDeclarations(node) {
var body = node.kind === 256 ? node : node.body;
- if (body && (body.kind === 256 || body.kind === 226)) {
+ if (body && (body.kind === 256 || body.kind === 227)) {
for (var _i = 0, _a = body.statements; _i < _a.length; _i++) {
var stat = _a[_i];
- if (stat.kind === 236 || stat.kind === 235) {
+ if (stat.kind === 237 || stat.kind === 236) {
return true;
}
}
@@ -16660,15 +17704,20 @@ var ts;
typeLiteralSymbol.members[symbol.name] = symbol;
}
function bindObjectLiteralExpression(node) {
+ var ElementKind;
+ (function (ElementKind) {
+ ElementKind[ElementKind["Property"] = 1] = "Property";
+ ElementKind[ElementKind["Accessor"] = 2] = "Accessor";
+ })(ElementKind || (ElementKind = {}));
if (inStrictMode) {
var seen = ts.createMap();
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var prop = _a[_i];
- if (prop.name.kind !== 69) {
+ if (prop.name.kind !== 70) {
continue;
}
var identifier = prop.name;
- var currentKind = prop.kind === 253 || prop.kind === 254 || prop.kind === 147
+ var currentKind = prop.kind === 253 || prop.kind === 254 || prop.kind === 148
? 1
: 2;
var existingKind = seen[identifier.text];
@@ -16690,7 +17739,7 @@ var ts;
}
function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) {
switch (blockScopeContainer.kind) {
- case 225:
+ case 226:
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
case 256:
@@ -16711,8 +17760,8 @@ var ts;
}
function checkStrictModeIdentifier(node) {
if (inStrictMode &&
- node.originalKeywordKind >= 106 &&
- node.originalKeywordKind <= 114 &&
+ node.originalKeywordKind >= 107 &&
+ node.originalKeywordKind <= 115 &&
!ts.isIdentifierName(node) &&
!ts.isInAmbientContext(node)) {
if (!file.parseDiagnostics.length) {
@@ -16740,17 +17789,17 @@ var ts;
}
}
function checkStrictModeDeleteExpression(node) {
- if (inStrictMode && node.expression.kind === 69) {
+ if (inStrictMode && node.expression.kind === 70) {
var span_2 = ts.getErrorSpanForNode(file, node.expression);
file.bindDiagnostics.push(ts.createFileDiagnostic(file, span_2.start, span_2.length, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode));
}
}
function isEvalOrArgumentsIdentifier(node) {
- return node.kind === 69 &&
+ return node.kind === 70 &&
(node.text === "eval" || node.text === "arguments");
}
function checkStrictModeEvalOrArguments(contextNode, name) {
- if (name && name.kind === 69) {
+ if (name && name.kind === 70) {
var identifier = name;
if (isEvalOrArgumentsIdentifier(identifier)) {
var span_3 = ts.getErrorSpanForNode(file, name);
@@ -16784,7 +17833,7 @@ var ts;
function checkStrictModeFunctionDeclaration(node) {
if (languageVersion < 2) {
if (blockScopeContainer.kind !== 256 &&
- blockScopeContainer.kind !== 225 &&
+ blockScopeContainer.kind !== 226 &&
!ts.isFunctionLike(blockScopeContainer)) {
var errorSpan = ts.getErrorSpanForNode(file, node);
file.bindDiagnostics.push(ts.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node)));
@@ -16803,7 +17852,7 @@ var ts;
}
function checkStrictModePrefixUnaryExpression(node) {
if (inStrictMode) {
- if (node.operator === 41 || node.operator === 42) {
+ if (node.operator === 42 || node.operator === 43) {
checkStrictModeEvalOrArguments(node, node.operand);
}
}
@@ -16827,7 +17876,7 @@ var ts;
node.parent = parent;
var saveInStrictMode = inStrictMode;
bindWorker(node);
- if (node.kind > 138) {
+ if (node.kind > 139) {
var saveParent = parent;
parent = node;
var containerFlags = getContainerFlags(node);
@@ -16864,18 +17913,18 @@ var ts;
}
function bindWorker(node) {
switch (node.kind) {
- case 69:
- case 97:
+ case 70:
+ case 98:
if (currentFlow && (ts.isExpression(node) || parent.kind === 254)) {
node.flowNode = currentFlow;
}
return checkStrictModeIdentifier(node);
- case 172:
+ case 173:
if (currentFlow && isNarrowableReference(node)) {
node.flowNode = currentFlow;
}
break;
- case 187:
+ case 188:
if (ts.isInJavaScriptFile(node)) {
var specialKind = ts.getSpecialPropertyAssignmentKind(node);
switch (specialKind) {
@@ -16900,30 +17949,30 @@ var ts;
return checkStrictModeBinaryExpression(node);
case 252:
return checkStrictModeCatchClause(node);
- case 181:
+ case 182:
return checkStrictModeDeleteExpression(node);
case 8:
return checkStrictModeNumericLiteral(node);
- case 186:
+ case 187:
return checkStrictModePostfixUnaryExpression(node);
- case 185:
+ case 186:
return checkStrictModePrefixUnaryExpression(node);
- case 212:
+ case 213:
return checkStrictModeWithStatement(node);
- case 165:
+ case 166:
seenThisKeyword = true;
return;
- case 154:
+ case 155:
return checkTypePredicate(node);
- case 141:
- return declareSymbolAndAddToSymbolTable(node, 262144, 530920);
case 142:
+ return declareSymbolAndAddToSymbolTable(node, 262144, 530920);
+ case 143:
return bindParameter(node);
- case 218:
- case 169:
+ case 219:
+ case 170:
return bindVariableDeclarationOrBindingElement(node);
+ case 146:
case 145:
- case 144:
case 266:
return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 0);
case 280:
@@ -16936,82 +17985,82 @@ var ts;
case 247:
emitFlags |= 16384;
return;
- case 151:
case 152:
case 153:
+ case 154:
return declareSymbolAndAddToSymbolTable(node, 131072, 0);
- case 147:
- case 146:
- return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263);
- case 220:
- return bindFunctionDeclaration(node);
case 148:
- return declareSymbolAndAddToSymbolTable(node, 16384, 0);
+ case 147:
+ return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263);
+ case 221:
+ return bindFunctionDeclaration(node);
case 149:
- return bindPropertyOrMethodOrAccessor(node, 32768, 41919);
+ return declareSymbolAndAddToSymbolTable(node, 16384, 0);
case 150:
+ return bindPropertyOrMethodOrAccessor(node, 32768, 41919);
+ case 151:
return bindPropertyOrMethodOrAccessor(node, 65536, 74687);
- case 156:
case 157:
+ case 158:
case 269:
return bindFunctionOrConstructorType(node);
- case 159:
+ case 160:
case 281:
case 265:
return bindAnonymousDeclaration(node, 2048, "__type");
- case 171:
+ case 172:
return bindObjectLiteralExpression(node);
- case 179:
case 180:
+ case 181:
return bindFunctionExpression(node);
- case 174:
+ case 175:
if (ts.isInJavaScriptFile(node)) {
bindCallExpression(node);
}
break;
- case 192:
- case 221:
+ case 193:
+ case 222:
inStrictMode = true;
return bindClassLikeDeclaration(node);
- case 222:
+ case 223:
return bindBlockScopedDeclaration(node, 64, 792968);
case 279:
- case 223:
- return bindBlockScopedDeclaration(node, 524288, 793064);
case 224:
- return bindEnumDeclaration(node);
+ return bindBlockScopedDeclaration(node, 524288, 793064);
case 225:
+ return bindEnumDeclaration(node);
+ case 226:
return bindModuleDeclaration(node);
- case 229:
- case 232:
- case 234:
- case 238:
- return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608);
- case 228:
- return bindNamespaceExportDeclaration(node);
- case 231:
- return bindImportClause(node);
- case 236:
- return bindExportDeclaration(node);
+ case 230:
+ case 233:
case 235:
+ case 239:
+ return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608);
+ case 229:
+ return bindNamespaceExportDeclaration(node);
+ case 232:
+ return bindImportClause(node);
+ case 237:
+ return bindExportDeclaration(node);
+ case 236:
return bindExportAssignment(node);
case 256:
updateStrictModeStatementList(node.statements);
return bindSourceFileIfExternalModule();
- case 199:
+ case 200:
if (!ts.isFunctionLike(node.parent)) {
return;
}
- case 226:
+ case 227:
return updateStrictModeStatementList(node.statements);
}
}
function checkTypePredicate(node) {
var parameterName = node.parameterName, type = node.type;
- if (parameterName && parameterName.kind === 69) {
+ if (parameterName && parameterName.kind === 70) {
checkStrictModeIdentifier(parameterName);
}
- if (parameterName && parameterName.kind === 165) {
+ if (parameterName && parameterName.kind === 166) {
seenThisKeyword = true;
}
bind(type);
@@ -17030,7 +18079,7 @@ var ts;
bindAnonymousDeclaration(node, 8388608, getDeclarationName(node));
}
else {
- var flags = node.kind === 235 && ts.exportAssignmentIsAlias(node)
+ var flags = node.kind === 236 && ts.exportAssignmentIsAlias(node)
? 8388608
: 4;
declareSymbol(container.symbol.exports, container.symbol, node, flags, 4 | 8388608 | 32 | 16);
@@ -17074,7 +18123,9 @@ var ts;
function setCommonJsModuleIndicator(node) {
if (!file.commonJsModuleIndicator) {
file.commonJsModuleIndicator = node;
- bindSourceFileAsExternalModule();
+ if (!file.externalModuleIndicator) {
+ bindSourceFileAsExternalModule();
+ }
}
}
function bindExportsPropertyAssignment(node) {
@@ -17087,11 +18138,11 @@ var ts;
}
function bindThisPropertyAssignment(node) {
ts.Debug.assert(ts.isInJavaScriptFile(node));
- if (container.kind === 220 || container.kind === 179) {
+ if (container.kind === 221 || container.kind === 180) {
container.symbol.members = container.symbol.members || ts.createMap();
declareSymbol(container.symbol.members, container.symbol, node, 4, 0 & ~4);
}
- else if (container.kind === 148) {
+ else if (container.kind === 149) {
var saveContainer = container;
container = container.parent;
var symbol = bindPropertyOrMethodOrAccessor(node, 4, 0);
@@ -17131,7 +18182,7 @@ var ts;
emitFlags |= 2048;
}
}
- if (node.kind === 221) {
+ if (node.kind === 222) {
bindBlockScopedDeclaration(node, 32, 899519);
}
else {
@@ -17249,15 +18300,15 @@ var ts;
return false;
}
if (currentFlow === unreachableFlow) {
- var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 201) ||
- node.kind === 221 ||
- (node.kind === 225 && shouldReportErrorOnModuleDeclaration(node)) ||
- (node.kind === 224 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums));
+ var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 202) ||
+ node.kind === 222 ||
+ (node.kind === 226 && shouldReportErrorOnModuleDeclaration(node)) ||
+ (node.kind === 225 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums));
if (reportError) {
currentFlow = reportedUnreachableFlow;
var reportUnreachableCode = !options.allowUnreachableCode &&
!ts.isInAmbientContext(node) &&
- (node.kind !== 200 ||
+ (node.kind !== 201 ||
ts.getCombinedNodeFlags(node.declarationList) & 3 ||
ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; }));
if (reportUnreachableCode) {
@@ -17271,52 +18322,54 @@ var ts;
function computeTransformFlagsForNode(node, subtreeFlags) {
var kind = node.kind;
switch (kind) {
- case 174:
+ case 175:
return computeCallExpression(node, subtreeFlags);
- case 225:
+ case 176:
+ return computeNewExpression(node, subtreeFlags);
+ case 226:
return computeModuleDeclaration(node, subtreeFlags);
- case 178:
- return computeParenthesizedExpression(node, subtreeFlags);
- case 187:
- return computeBinaryExpression(node, subtreeFlags);
- case 202:
- return computeExpressionStatement(node, subtreeFlags);
- case 142:
- return computeParameter(node, subtreeFlags);
- case 180:
- return computeArrowFunction(node, subtreeFlags);
case 179:
+ return computeParenthesizedExpression(node, subtreeFlags);
+ case 188:
+ return computeBinaryExpression(node, subtreeFlags);
+ case 203:
+ return computeExpressionStatement(node, subtreeFlags);
+ case 143:
+ return computeParameter(node, subtreeFlags);
+ case 181:
+ return computeArrowFunction(node, subtreeFlags);
+ case 180:
return computeFunctionExpression(node, subtreeFlags);
- case 220:
- return computeFunctionDeclaration(node, subtreeFlags);
- case 218:
- return computeVariableDeclaration(node, subtreeFlags);
- case 219:
- return computeVariableDeclarationList(node, subtreeFlags);
- case 200:
- return computeVariableStatement(node, subtreeFlags);
- case 214:
- return computeLabeledStatement(node, subtreeFlags);
case 221:
+ return computeFunctionDeclaration(node, subtreeFlags);
+ case 219:
+ return computeVariableDeclaration(node, subtreeFlags);
+ case 220:
+ return computeVariableDeclarationList(node, subtreeFlags);
+ case 201:
+ return computeVariableStatement(node, subtreeFlags);
+ case 215:
+ return computeLabeledStatement(node, subtreeFlags);
+ case 222:
return computeClassDeclaration(node, subtreeFlags);
- case 192:
+ case 193:
return computeClassExpression(node, subtreeFlags);
case 251:
return computeHeritageClause(node, subtreeFlags);
- case 194:
+ case 195:
return computeExpressionWithTypeArguments(node, subtreeFlags);
- case 148:
- return computeConstructor(node, subtreeFlags);
- case 145:
- return computePropertyDeclaration(node, subtreeFlags);
- case 147:
- return computeMethod(node, subtreeFlags);
case 149:
+ return computeConstructor(node, subtreeFlags);
+ case 146:
+ return computePropertyDeclaration(node, subtreeFlags);
+ case 148:
+ return computeMethod(node, subtreeFlags);
case 150:
+ case 151:
return computeAccessor(node, subtreeFlags);
- case 229:
+ case 230:
return computeImportEquals(node, subtreeFlags);
- case 172:
+ case 173:
return computePropertyAccess(node, subtreeFlags);
default:
return computeOther(node, kind, subtreeFlags);
@@ -17327,40 +18380,54 @@ var ts;
var transformFlags = subtreeFlags;
var expression = node.expression;
var expressionKind = expression.kind;
- if (subtreeFlags & 262144
+ if (node.typeArguments) {
+ transformFlags |= 3;
+ }
+ if (subtreeFlags & 1048576
|| isSuperOrSuperProperty(expression, expressionKind)) {
- transformFlags |= 192;
+ transformFlags |= 768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~537133909;
+ return transformFlags & ~537922901;
}
function isSuperOrSuperProperty(node, kind) {
switch (kind) {
- case 95:
+ case 96:
return true;
- case 172:
case 173:
+ case 174:
var expression = node.expression;
var expressionKind = expression.kind;
- return expressionKind === 95;
+ return expressionKind === 96;
}
return false;
}
+ function computeNewExpression(node, subtreeFlags) {
+ var transformFlags = subtreeFlags;
+ if (node.typeArguments) {
+ transformFlags |= 3;
+ }
+ if (subtreeFlags & 1048576) {
+ transformFlags |= 768;
+ }
+ node.transformFlags = transformFlags | 536870912;
+ return transformFlags & ~537922901;
+ }
function computeBinaryExpression(node, subtreeFlags) {
var transformFlags = subtreeFlags;
var operatorTokenKind = node.operatorToken.kind;
var leftKind = node.left.kind;
- if (operatorTokenKind === 56
- && (leftKind === 171
- || leftKind === 170)) {
- transformFlags |= 192 | 256;
+ if (operatorTokenKind === 57
+ && (leftKind === 172
+ || leftKind === 171)) {
+ transformFlags |= 768 | 1024;
}
- else if (operatorTokenKind === 38
- || operatorTokenKind === 60) {
- transformFlags |= 48;
+ else if (operatorTokenKind === 39
+ || operatorTokenKind === 61) {
+ transformFlags |= 192;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeParameter(node, subtreeFlags) {
var transformFlags = subtreeFlags;
@@ -17368,35 +18435,35 @@ var ts;
var name = node.name;
var initializer = node.initializer;
var dotDotDotToken = node.dotDotDotToken;
- if (node.questionToken) {
- transformFlags |= 3;
- }
- if (subtreeFlags & 2048 || ts.isThisIdentifier(name)) {
+ if (node.questionToken
+ || node.type
+ || subtreeFlags & 8192
+ || ts.isThisIdentifier(name)) {
transformFlags |= 3;
}
if (modifierFlags & 92) {
- transformFlags |= 3 | 131072;
+ transformFlags |= 3 | 524288;
}
- if (subtreeFlags & 2097152 || initializer || dotDotDotToken) {
- transformFlags |= 192 | 65536;
+ if (subtreeFlags & 8388608 || initializer || dotDotDotToken) {
+ transformFlags |= 768 | 262144;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~538968917;
+ return transformFlags & ~545262933;
}
function computeParenthesizedExpression(node, subtreeFlags) {
var transformFlags = subtreeFlags;
var expression = node.expression;
var expressionKind = expression.kind;
var expressionTransformFlags = expression.transformFlags;
- if (expressionKind === 195
- || expressionKind === 177) {
+ if (expressionKind === 196
+ || expressionKind === 178) {
transformFlags |= 3;
}
- if (expressionTransformFlags & 256) {
- transformFlags |= 256;
+ if (expressionTransformFlags & 1024) {
+ transformFlags |= 1024;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeClassDeclaration(node, subtreeFlags) {
var transformFlags;
@@ -17405,36 +18472,38 @@ var ts;
transformFlags = 3;
}
else {
- transformFlags = subtreeFlags | 192;
- if ((subtreeFlags & 137216)
- || (modifierFlags & 1)) {
+ transformFlags = subtreeFlags | 768;
+ if ((subtreeFlags & 548864)
+ || (modifierFlags & 1)
+ || node.typeParameters) {
transformFlags |= 3;
}
- if (subtreeFlags & 32768) {
- transformFlags |= 8192;
+ if (subtreeFlags & 131072) {
+ transformFlags |= 32768;
}
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~537590613;
+ return transformFlags & ~539749717;
}
function computeClassExpression(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
- if (subtreeFlags & 137216) {
+ var transformFlags = subtreeFlags | 768;
+ if (subtreeFlags & 548864
+ || node.typeParameters) {
transformFlags |= 3;
}
- if (subtreeFlags & 32768) {
- transformFlags |= 8192;
+ if (subtreeFlags & 131072) {
+ transformFlags |= 32768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~537590613;
+ return transformFlags & ~539749717;
}
function computeHeritageClause(node, subtreeFlags) {
var transformFlags = subtreeFlags;
switch (node.token) {
- case 83:
- transformFlags |= 192;
+ case 84:
+ transformFlags |= 768;
break;
- case 106:
+ case 107:
transformFlags |= 3;
break;
default:
@@ -17442,135 +18511,148 @@ var ts;
break;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeExpressionWithTypeArguments(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
+ var transformFlags = subtreeFlags | 768;
if (node.typeArguments) {
transformFlags |= 3;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeConstructor(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- var body = node.body;
- if (body === undefined) {
+ if (ts.hasModifier(node, 2270)
+ || !node.body) {
transformFlags |= 3;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550593365;
+ return transformFlags & ~591760725;
}
function computeMethod(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
- var modifierFlags = ts.getModifierFlags(node);
- var body = node.body;
- var typeParameters = node.typeParameters;
- var asteriskToken = node.asteriskToken;
- if (!body
- || typeParameters
- || (modifierFlags & (256 | 128))
- || (subtreeFlags & 2048)) {
+ var transformFlags = subtreeFlags | 768;
+ if (node.decorators
+ || ts.hasModifier(node, 2270)
+ || node.typeParameters
+ || node.type
+ || !node.body) {
transformFlags |= 3;
}
- if (asteriskToken && ts.getEmitFlags(node) & 2097152) {
- transformFlags |= 1536;
+ if (ts.hasModifier(node, 256)) {
+ transformFlags |= 48;
+ }
+ if (node.asteriskToken && ts.getEmitFlags(node) & 2097152) {
+ transformFlags |= 6144;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550593365;
+ return transformFlags & ~591760725;
}
function computeAccessor(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- var modifierFlags = ts.getModifierFlags(node);
- var body = node.body;
- if (!body
- || (modifierFlags & (256 | 128))
- || (subtreeFlags & 2048)) {
+ if (node.decorators
+ || ts.hasModifier(node, 2270)
+ || node.type
+ || !node.body) {
transformFlags |= 3;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550593365;
+ return transformFlags & ~591760725;
}
function computePropertyDeclaration(node, subtreeFlags) {
var transformFlags = subtreeFlags | 3;
if (node.initializer) {
- transformFlags |= 4096;
+ transformFlags |= 16384;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeFunctionDeclaration(node, subtreeFlags) {
var transformFlags;
var modifierFlags = ts.getModifierFlags(node);
var body = node.body;
- var asteriskToken = node.asteriskToken;
if (!body || (modifierFlags & 2)) {
transformFlags = 3;
}
else {
- transformFlags = subtreeFlags | 8388608;
+ transformFlags = subtreeFlags | 33554432;
if (modifierFlags & 1) {
- transformFlags |= 3 | 192;
+ transformFlags |= 3 | 768;
}
- if (modifierFlags & 256) {
+ if (modifierFlags & 2270
+ || node.typeParameters
+ || node.type) {
transformFlags |= 3;
}
- if (subtreeFlags & 81920) {
- transformFlags |= 192;
+ if (modifierFlags & 256) {
+ transformFlags |= 48;
}
- if (asteriskToken && ts.getEmitFlags(node) & 2097152) {
- transformFlags |= 1536;
+ if (subtreeFlags & 327680) {
+ transformFlags |= 768;
+ }
+ if (node.asteriskToken && ts.getEmitFlags(node) & 2097152) {
+ transformFlags |= 6144;
}
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550726485;
+ return transformFlags & ~592293205;
}
function computeFunctionExpression(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- var modifierFlags = ts.getModifierFlags(node);
- var asteriskToken = node.asteriskToken;
- if (modifierFlags & 256) {
+ if (ts.hasModifier(node, 2270)
+ || node.typeParameters
+ || node.type) {
transformFlags |= 3;
}
- if (subtreeFlags & 81920) {
- transformFlags |= 192;
+ if (ts.hasModifier(node, 256)) {
+ transformFlags |= 48;
}
- if (asteriskToken && ts.getEmitFlags(node) & 2097152) {
- transformFlags |= 1536;
+ if (subtreeFlags & 327680) {
+ transformFlags |= 768;
+ }
+ if (node.asteriskToken && ts.getEmitFlags(node) & 2097152) {
+ transformFlags |= 6144;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550726485;
+ return transformFlags & ~592293205;
}
function computeArrowFunction(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
- var modifierFlags = ts.getModifierFlags(node);
- if (modifierFlags & 256) {
+ var transformFlags = subtreeFlags | 768;
+ if (ts.hasModifier(node, 2270)
+ || node.typeParameters
+ || node.type) {
transformFlags |= 3;
}
- if (subtreeFlags & 8192) {
- transformFlags |= 16384;
+ if (ts.hasModifier(node, 256)) {
+ transformFlags |= 48;
+ }
+ if (subtreeFlags & 32768) {
+ transformFlags |= 65536;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550710101;
+ return transformFlags & ~592227669;
}
function computePropertyAccess(node, subtreeFlags) {
var transformFlags = subtreeFlags;
var expression = node.expression;
var expressionKind = expression.kind;
- if (expressionKind === 95) {
- transformFlags |= 8192;
+ if (expressionKind === 96) {
+ transformFlags |= 32768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeVariableDeclaration(node, subtreeFlags) {
var transformFlags = subtreeFlags;
var nameKind = node.name.kind;
- if (nameKind === 167 || nameKind === 168) {
- transformFlags |= 192 | 2097152;
+ if (nameKind === 168 || nameKind === 169) {
+ transformFlags |= 768 | 8388608;
+ }
+ if (node.type) {
+ transformFlags |= 3;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeVariableStatement(node, subtreeFlags) {
var transformFlags;
@@ -17582,23 +18664,23 @@ var ts;
else {
transformFlags = subtreeFlags;
if (modifierFlags & 1) {
- transformFlags |= 192 | 3;
+ transformFlags |= 768 | 3;
}
- if (declarationListTransformFlags & 2097152) {
- transformFlags |= 192;
+ if (declarationListTransformFlags & 8388608) {
+ transformFlags |= 768;
}
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeLabeledStatement(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- if (subtreeFlags & 1048576
+ if (subtreeFlags & 4194304
&& ts.isIterationStatement(node, true)) {
- transformFlags |= 192;
+ transformFlags |= 768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeImportEquals(node, subtreeFlags) {
var transformFlags = subtreeFlags;
@@ -17606,15 +18688,15 @@ var ts;
transformFlags |= 3;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeExpressionStatement(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- if (node.expression.transformFlags & 256) {
- transformFlags |= 192;
+ if (node.expression.transformFlags & 1024) {
+ transformFlags |= 768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeModuleDeclaration(node, subtreeFlags) {
var transformFlags = 3;
@@ -17623,77 +18705,78 @@ var ts;
transformFlags |= subtreeFlags;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~546335573;
+ return transformFlags & ~574729557;
}
function computeVariableDeclarationList(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 8388608;
- if (subtreeFlags & 2097152) {
- transformFlags |= 192;
+ var transformFlags = subtreeFlags | 33554432;
+ if (subtreeFlags & 8388608) {
+ transformFlags |= 768;
}
if (node.flags & 3) {
- transformFlags |= 192 | 1048576;
+ transformFlags |= 768 | 4194304;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~538968917;
+ return transformFlags & ~545262933;
}
function computeOther(node, kind, subtreeFlags) {
var transformFlags = subtreeFlags;
- var excludeFlags = 536871765;
+ var excludeFlags = 536874325;
switch (kind) {
- case 112:
- case 110:
+ case 119:
+ case 185:
+ transformFlags |= 48;
+ break;
+ case 113:
case 111:
- case 115:
- case 122:
- case 118:
- case 74:
- case 184:
- case 224:
+ case 112:
+ case 116:
+ case 123:
+ case 75:
+ case 225:
case 255:
- case 177:
- case 195:
+ case 178:
case 196:
- case 128:
+ case 197:
+ case 129:
transformFlags |= 3;
break;
- case 241:
case 242:
case 243:
case 244:
+ case 10:
case 245:
case 246:
case 247:
case 248:
transformFlags |= 12;
break;
- case 82:
- transformFlags |= 192 | 3;
+ case 83:
+ transformFlags |= 768 | 3;
break;
- case 77:
- case 11:
+ case 78:
case 12:
case 13:
case 14:
- case 189:
- case 176:
- case 254:
- case 208:
- transformFlags |= 192;
- break;
+ case 15:
case 190:
- transformFlags |= 192 | 4194304;
+ case 177:
+ case 254:
+ case 209:
+ transformFlags |= 768;
break;
- case 117:
- case 130:
- case 127:
- case 132:
- case 120:
+ case 191:
+ transformFlags |= 768 | 16777216;
+ break;
+ case 118:
+ case 131:
+ case 128:
case 133:
- case 103:
- case 141:
- case 144:
- case 146:
- case 151:
+ case 121:
+ case 134:
+ case 104:
+ case 142:
+ case 145:
+ case 147:
case 152:
case 153:
case 154:
@@ -17707,68 +18790,69 @@ var ts;
case 162:
case 163:
case 164:
- case 222:
- case 223:
case 165:
+ case 223:
+ case 224:
case 166:
+ case 167:
transformFlags = 3;
excludeFlags = -3;
break;
- case 140:
- transformFlags |= 524288;
- if (subtreeFlags & 8192) {
+ case 141:
+ transformFlags |= 2097152;
+ if (subtreeFlags & 32768) {
+ transformFlags |= 131072;
+ }
+ break;
+ case 192:
+ transformFlags |= 1048576;
+ break;
+ case 96:
+ transformFlags |= 768;
+ break;
+ case 98:
+ transformFlags |= 32768;
+ break;
+ case 168:
+ case 169:
+ transformFlags |= 768 | 8388608;
+ break;
+ case 144:
+ transformFlags |= 3 | 8192;
+ break;
+ case 172:
+ excludeFlags = 539110741;
+ if (subtreeFlags & 2097152) {
+ transformFlags |= 768;
+ }
+ if (subtreeFlags & 131072) {
transformFlags |= 32768;
}
break;
- case 191:
- transformFlags |= 262144;
- break;
- case 95:
- transformFlags |= 192;
- break;
- case 97:
- transformFlags |= 8192;
- break;
- case 167:
- case 168:
- transformFlags |= 192 | 2097152;
- break;
- case 143:
- transformFlags |= 3 | 2048;
- break;
case 171:
- excludeFlags = 537430869;
- if (subtreeFlags & 524288) {
- transformFlags |= 192;
- }
- if (subtreeFlags & 32768) {
- transformFlags |= 8192;
+ case 176:
+ excludeFlags = 537922901;
+ if (subtreeFlags & 1048576) {
+ transformFlags |= 768;
}
break;
- case 170:
- case 175:
- excludeFlags = 537133909;
- if (subtreeFlags & 262144) {
- transformFlags |= 192;
- }
- break;
- case 204:
case 205:
case 206:
case 207:
- if (subtreeFlags & 1048576) {
- transformFlags |= 192;
+ case 208:
+ if (subtreeFlags & 4194304) {
+ transformFlags |= 768;
}
break;
case 256:
- if (subtreeFlags & 16384) {
- transformFlags |= 192;
+ if (subtreeFlags & 65536) {
+ transformFlags |= 768;
}
break;
- case 211:
- case 209:
+ case 212:
case 210:
- transformFlags |= 8388608;
+ case 211:
+ transformFlags |= 33554432;
break;
}
node.transformFlags = transformFlags | 536870912;
@@ -17777,7 +18861,7 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
- function trace(host, message) {
+ function trace(host) {
host.trace(ts.formatMessage.apply(undefined, arguments));
}
ts.trace = trace;
@@ -18422,6 +19506,7 @@ var ts;
var intersectionTypes = ts.createMap();
var stringLiteralTypes = ts.createMap();
var numericLiteralTypes = ts.createMap();
+ var evolvingArrayTypes = [];
var unknownSymbol = createSymbol(4 | 67108864, "unknown");
var resolvingSymbol = createSymbol(67108864, "__resolving__");
var anyType = createIntrinsicType(1, "any");
@@ -18465,6 +19550,7 @@ var ts;
var globalBooleanType;
var globalRegExpType;
var anyArrayType;
+ var autoArrayType;
var anyReadonlyArrayType;
var getGlobalTemplateStringsArrayType;
var getGlobalESSymbolType;
@@ -18505,6 +19591,66 @@ var ts;
var potentialThisCollisions = [];
var awaitedTypeStack = [];
var diagnostics = ts.createDiagnosticCollection();
+ var TypeFacts;
+ (function (TypeFacts) {
+ TypeFacts[TypeFacts["None"] = 0] = "None";
+ TypeFacts[TypeFacts["TypeofEQString"] = 1] = "TypeofEQString";
+ TypeFacts[TypeFacts["TypeofEQNumber"] = 2] = "TypeofEQNumber";
+ TypeFacts[TypeFacts["TypeofEQBoolean"] = 4] = "TypeofEQBoolean";
+ TypeFacts[TypeFacts["TypeofEQSymbol"] = 8] = "TypeofEQSymbol";
+ TypeFacts[TypeFacts["TypeofEQObject"] = 16] = "TypeofEQObject";
+ TypeFacts[TypeFacts["TypeofEQFunction"] = 32] = "TypeofEQFunction";
+ TypeFacts[TypeFacts["TypeofEQHostObject"] = 64] = "TypeofEQHostObject";
+ TypeFacts[TypeFacts["TypeofNEString"] = 128] = "TypeofNEString";
+ TypeFacts[TypeFacts["TypeofNENumber"] = 256] = "TypeofNENumber";
+ TypeFacts[TypeFacts["TypeofNEBoolean"] = 512] = "TypeofNEBoolean";
+ TypeFacts[TypeFacts["TypeofNESymbol"] = 1024] = "TypeofNESymbol";
+ TypeFacts[TypeFacts["TypeofNEObject"] = 2048] = "TypeofNEObject";
+ TypeFacts[TypeFacts["TypeofNEFunction"] = 4096] = "TypeofNEFunction";
+ TypeFacts[TypeFacts["TypeofNEHostObject"] = 8192] = "TypeofNEHostObject";
+ TypeFacts[TypeFacts["EQUndefined"] = 16384] = "EQUndefined";
+ TypeFacts[TypeFacts["EQNull"] = 32768] = "EQNull";
+ TypeFacts[TypeFacts["EQUndefinedOrNull"] = 65536] = "EQUndefinedOrNull";
+ TypeFacts[TypeFacts["NEUndefined"] = 131072] = "NEUndefined";
+ TypeFacts[TypeFacts["NENull"] = 262144] = "NENull";
+ TypeFacts[TypeFacts["NEUndefinedOrNull"] = 524288] = "NEUndefinedOrNull";
+ TypeFacts[TypeFacts["Truthy"] = 1048576] = "Truthy";
+ TypeFacts[TypeFacts["Falsy"] = 2097152] = "Falsy";
+ TypeFacts[TypeFacts["Discriminatable"] = 4194304] = "Discriminatable";
+ TypeFacts[TypeFacts["All"] = 8388607] = "All";
+ TypeFacts[TypeFacts["BaseStringStrictFacts"] = 933633] = "BaseStringStrictFacts";
+ TypeFacts[TypeFacts["BaseStringFacts"] = 3145473] = "BaseStringFacts";
+ TypeFacts[TypeFacts["StringStrictFacts"] = 4079361] = "StringStrictFacts";
+ TypeFacts[TypeFacts["StringFacts"] = 4194049] = "StringFacts";
+ TypeFacts[TypeFacts["EmptyStringStrictFacts"] = 3030785] = "EmptyStringStrictFacts";
+ TypeFacts[TypeFacts["EmptyStringFacts"] = 3145473] = "EmptyStringFacts";
+ TypeFacts[TypeFacts["NonEmptyStringStrictFacts"] = 1982209] = "NonEmptyStringStrictFacts";
+ TypeFacts[TypeFacts["NonEmptyStringFacts"] = 4194049] = "NonEmptyStringFacts";
+ TypeFacts[TypeFacts["BaseNumberStrictFacts"] = 933506] = "BaseNumberStrictFacts";
+ TypeFacts[TypeFacts["BaseNumberFacts"] = 3145346] = "BaseNumberFacts";
+ TypeFacts[TypeFacts["NumberStrictFacts"] = 4079234] = "NumberStrictFacts";
+ TypeFacts[TypeFacts["NumberFacts"] = 4193922] = "NumberFacts";
+ TypeFacts[TypeFacts["ZeroStrictFacts"] = 3030658] = "ZeroStrictFacts";
+ TypeFacts[TypeFacts["ZeroFacts"] = 3145346] = "ZeroFacts";
+ TypeFacts[TypeFacts["NonZeroStrictFacts"] = 1982082] = "NonZeroStrictFacts";
+ TypeFacts[TypeFacts["NonZeroFacts"] = 4193922] = "NonZeroFacts";
+ TypeFacts[TypeFacts["BaseBooleanStrictFacts"] = 933252] = "BaseBooleanStrictFacts";
+ TypeFacts[TypeFacts["BaseBooleanFacts"] = 3145092] = "BaseBooleanFacts";
+ TypeFacts[TypeFacts["BooleanStrictFacts"] = 4078980] = "BooleanStrictFacts";
+ TypeFacts[TypeFacts["BooleanFacts"] = 4193668] = "BooleanFacts";
+ TypeFacts[TypeFacts["FalseStrictFacts"] = 3030404] = "FalseStrictFacts";
+ TypeFacts[TypeFacts["FalseFacts"] = 3145092] = "FalseFacts";
+ TypeFacts[TypeFacts["TrueStrictFacts"] = 1981828] = "TrueStrictFacts";
+ TypeFacts[TypeFacts["TrueFacts"] = 4193668] = "TrueFacts";
+ TypeFacts[TypeFacts["SymbolStrictFacts"] = 1981320] = "SymbolStrictFacts";
+ TypeFacts[TypeFacts["SymbolFacts"] = 4193160] = "SymbolFacts";
+ TypeFacts[TypeFacts["ObjectStrictFacts"] = 6166480] = "ObjectStrictFacts";
+ TypeFacts[TypeFacts["ObjectFacts"] = 8378320] = "ObjectFacts";
+ TypeFacts[TypeFacts["FunctionStrictFacts"] = 6164448] = "FunctionStrictFacts";
+ TypeFacts[TypeFacts["FunctionFacts"] = 8376288] = "FunctionFacts";
+ TypeFacts[TypeFacts["UndefinedFacts"] = 2457472] = "UndefinedFacts";
+ TypeFacts[TypeFacts["NullFacts"] = 2340752] = "NullFacts";
+ })(TypeFacts || (TypeFacts = {}));
var typeofEQFacts = ts.createMap({
"string": 1,
"number": 2,
@@ -18547,6 +19693,13 @@ var ts;
var identityRelation = ts.createMap();
var enumRelation = ts.createMap();
var _displayBuilder;
+ var TypeSystemPropertyName;
+ (function (TypeSystemPropertyName) {
+ TypeSystemPropertyName[TypeSystemPropertyName["Type"] = 0] = "Type";
+ TypeSystemPropertyName[TypeSystemPropertyName["ResolvedBaseConstructorType"] = 1] = "ResolvedBaseConstructorType";
+ TypeSystemPropertyName[TypeSystemPropertyName["DeclaredType"] = 2] = "DeclaredType";
+ TypeSystemPropertyName[TypeSystemPropertyName["ResolvedReturnType"] = 3] = "ResolvedReturnType";
+ })(TypeSystemPropertyName || (TypeSystemPropertyName = {}));
var builtinGlobals = ts.createMap();
builtinGlobals[undefinedSymbol.name] = undefinedSymbol;
initializeTypeChecker();
@@ -18631,7 +19784,7 @@ var ts;
target.flags |= source.flags;
if (source.valueDeclaration &&
(!target.valueDeclaration ||
- (target.valueDeclaration.kind === 225 && source.valueDeclaration.kind !== 225))) {
+ (target.valueDeclaration.kind === 226 && source.valueDeclaration.kind !== 226))) {
target.valueDeclaration = source.valueDeclaration;
}
ts.forEach(source.declarations, function (node) {
@@ -18766,24 +19919,24 @@ var ts;
return ts.indexOf(sourceFiles, declarationFile) <= ts.indexOf(sourceFiles, useFile);
}
if (declaration.pos <= usage.pos) {
- return declaration.kind !== 218 ||
+ return declaration.kind !== 219 ||
!isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
}
return isUsedInFunctionOrNonStaticProperty(declaration, usage);
function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) {
var container = ts.getEnclosingBlockScopeContainer(declaration);
switch (declaration.parent.parent.kind) {
- case 200:
- case 206:
- case 208:
+ case 201:
+ case 207:
+ case 209:
if (isSameScopeDescendentOf(usage, declaration, container)) {
return true;
}
break;
}
switch (declaration.parent.parent.kind) {
- case 207:
case 208:
+ case 209:
if (isSameScopeDescendentOf(usage, declaration.parent.parent.expression, container)) {
return true;
}
@@ -18801,7 +19954,7 @@ var ts;
return true;
}
var initializerOfNonStaticProperty = current.parent &&
- current.parent.kind === 145 &&
+ current.parent.kind === 146 &&
(ts.getModifierFlags(current.parent) & 32) === 0 &&
current.parent.initializer === current;
if (initializerOfNonStaticProperty) {
@@ -18827,15 +19980,15 @@ var ts;
if (meaning & result.flags & 793064 && lastLocation.kind !== 273) {
useResult = result.flags & 262144
? lastLocation === location.type ||
- lastLocation.kind === 142 ||
- lastLocation.kind === 141
+ lastLocation.kind === 143 ||
+ lastLocation.kind === 142
: false;
}
if (meaning & 107455 && result.flags & 1) {
useResult =
- lastLocation.kind === 142 ||
+ lastLocation.kind === 143 ||
(lastLocation === location.type &&
- result.valueDeclaration.kind === 142);
+ result.valueDeclaration.kind === 143);
}
}
if (useResult) {
@@ -18851,7 +20004,7 @@ var ts;
if (!ts.isExternalOrCommonJsModule(location))
break;
isInExternalModule = true;
- case 225:
+ case 226:
var moduleExports = getSymbolOfNode(location).exports;
if (location.kind === 256 || ts.isAmbientModule(location)) {
if (result = moduleExports["default"]) {
@@ -18863,7 +20016,7 @@ var ts;
}
if (moduleExports[name] &&
moduleExports[name].flags === 8388608 &&
- ts.getDeclarationOfKind(moduleExports[name], 238)) {
+ ts.getDeclarationOfKind(moduleExports[name], 239)) {
break;
}
}
@@ -18871,13 +20024,13 @@ var ts;
break loop;
}
break;
- case 224:
+ case 225:
if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) {
break loop;
}
break;
+ case 146:
case 145:
- case 144:
if (ts.isClassLike(location.parent) && !(ts.getModifierFlags(location) & 32)) {
var ctor = findConstructorDeclaration(location.parent);
if (ctor && ctor.locals) {
@@ -18887,9 +20040,9 @@ var ts;
}
}
break;
- case 221:
- case 192:
case 222:
+ case 193:
+ case 223:
if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793064)) {
if (lastLocation && ts.getModifierFlags(lastLocation) & 32) {
error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters);
@@ -18897,7 +20050,7 @@ var ts;
}
break loop;
}
- if (location.kind === 192 && meaning & 32) {
+ if (location.kind === 193 && meaning & 32) {
var className = location.name;
if (className && name === className.text) {
result = location.symbol;
@@ -18905,28 +20058,28 @@ var ts;
}
}
break;
- case 140:
+ case 141:
grandparent = location.parent.parent;
- if (ts.isClassLike(grandparent) || grandparent.kind === 222) {
+ if (ts.isClassLike(grandparent) || grandparent.kind === 223) {
if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793064)) {
error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
return undefined;
}
}
break;
- case 147:
- case 146:
case 148:
+ case 147:
case 149:
case 150:
- case 220:
- case 180:
+ case 151:
+ case 221:
+ case 181:
if (meaning & 3 && name === "arguments") {
result = argumentsSymbol;
break loop;
}
break;
- case 179:
+ case 180:
if (meaning & 3 && name === "arguments") {
result = argumentsSymbol;
break loop;
@@ -18939,8 +20092,8 @@ var ts;
}
}
break;
- case 143:
- if (location.parent && location.parent.kind === 142) {
+ case 144:
+ if (location.parent && location.parent.kind === 143) {
location = location.parent;
}
if (location.parent && ts.isClassElement(location.parent)) {
@@ -18982,7 +20135,7 @@ var ts;
}
if (result && isInExternalModule && (meaning & 107455) === 107455) {
var decls = result.declarations;
- if (decls && decls.length === 1 && decls[0].kind === 228) {
+ if (decls && decls.length === 1 && decls[0].kind === 229) {
error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, name);
}
}
@@ -18990,7 +20143,7 @@ var ts;
return result;
}
function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) {
- if ((errorLocation.kind === 69 && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) {
+ if ((errorLocation.kind === 70 && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) {
return false;
}
var container = ts.getThisContainer(errorLocation, true);
@@ -19028,10 +20181,10 @@ var ts;
}
function getEntityNameForExtendingInterface(node) {
switch (node.kind) {
- case 69:
- case 172:
+ case 70:
+ case 173:
return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined;
- case 194:
+ case 195:
ts.Debug.assert(ts.isEntityNameExpression(node.expression));
return node.expression;
default:
@@ -19052,7 +20205,7 @@ var ts;
ts.Debug.assert((result.flags & 2) !== 0);
var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; });
ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined");
- if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 218), errorLocation)) {
+ if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 219), errorLocation)) {
error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name));
}
}
@@ -19069,10 +20222,10 @@ var ts;
}
function getAnyImportSyntax(node) {
if (ts.isAliasSymbolDeclaration(node)) {
- if (node.kind === 229) {
+ if (node.kind === 230) {
return node;
}
- while (node && node.kind !== 230) {
+ while (node && node.kind !== 231) {
node = node.parent;
}
return node;
@@ -19082,10 +20235,10 @@ var ts;
return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; });
}
function getTargetOfImportEqualsDeclaration(node) {
- if (node.moduleReference.kind === 240) {
+ if (node.moduleReference.kind === 241) {
return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)));
}
- return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node);
+ return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference);
}
function getTargetOfImportClause(node) {
var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
@@ -19186,19 +20339,19 @@ var ts;
}
function getTargetOfAliasDeclaration(node) {
switch (node.kind) {
- case 229:
+ case 230:
return getTargetOfImportEqualsDeclaration(node);
- case 231:
- return getTargetOfImportClause(node);
case 232:
+ return getTargetOfImportClause(node);
+ case 233:
return getTargetOfNamespaceImport(node);
- case 234:
- return getTargetOfImportSpecifier(node);
- case 238:
- return getTargetOfExportSpecifier(node);
case 235:
+ return getTargetOfImportSpecifier(node);
+ case 239:
+ return getTargetOfExportSpecifier(node);
+ case 236:
return getTargetOfExportAssignment(node);
- case 228:
+ case 229:
return getTargetOfNamespaceExportDeclaration(node);
}
}
@@ -19242,10 +20395,10 @@ var ts;
links.referenced = true;
var node = getDeclarationOfAliasSymbol(symbol);
ts.Debug.assert(!!node);
- if (node.kind === 235) {
+ if (node.kind === 236) {
checkExpressionCached(node.expression);
}
- else if (node.kind === 238) {
+ else if (node.kind === 239) {
checkExpressionCached(node.propertyName || node.name);
}
else if (ts.isInternalModuleImportEqualsDeclaration(node)) {
@@ -19253,15 +20406,15 @@ var ts;
}
}
}
- function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration, dontResolveAlias) {
- if (entityName.kind === 69 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
+ function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, dontResolveAlias) {
+ if (entityName.kind === 70 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
entityName = entityName.parent;
}
- if (entityName.kind === 69 || entityName.parent.kind === 139) {
+ if (entityName.kind === 70 || entityName.parent.kind === 140) {
return resolveEntityName(entityName, 1920, false, dontResolveAlias);
}
else {
- ts.Debug.assert(entityName.parent.kind === 229);
+ ts.Debug.assert(entityName.parent.kind === 230);
return resolveEntityName(entityName, 107455 | 793064 | 1920, false, dontResolveAlias);
}
}
@@ -19273,16 +20426,16 @@ var ts;
return undefined;
}
var symbol;
- if (name.kind === 69) {
+ if (name.kind === 70) {
var message = meaning === 1920 ? ts.Diagnostics.Cannot_find_namespace_0 : ts.Diagnostics.Cannot_find_name_0;
symbol = resolveName(location || name, name.text, meaning, ignoreErrors ? undefined : message, name);
if (!symbol) {
return undefined;
}
}
- else if (name.kind === 139 || name.kind === 172) {
- var left = name.kind === 139 ? name.left : name.expression;
- var right = name.kind === 139 ? name.right : name.name;
+ else if (name.kind === 140 || name.kind === 173) {
+ var left = name.kind === 140 ? name.left : name.expression;
+ var right = name.kind === 140 ? name.right : name.name;
var namespace = resolveEntityName(left, 1920, ignoreErrors, false, location);
if (!namespace || ts.nodeIsMissing(right)) {
return undefined;
@@ -19465,7 +20618,7 @@ var ts;
var members = node.members;
for (var _i = 0, members_1 = members; _i < members_1.length; _i++) {
var member = members_1[_i];
- if (member.kind === 148 && ts.nodeIsPresent(member.body)) {
+ if (member.kind === 149 && ts.nodeIsPresent(member.body)) {
return member;
}
}
@@ -19539,7 +20692,7 @@ var ts;
if (!ts.isExternalOrCommonJsModule(location_1)) {
break;
}
- case 225:
+ case 226:
if (result = callback(getSymbolOfNode(location_1).exports)) {
return result;
}
@@ -19572,7 +20725,7 @@ var ts;
return ts.forEachProperty(symbols, function (symbolFromSymbolTable) {
if (symbolFromSymbolTable.flags & 8388608
&& symbolFromSymbolTable.name !== "export="
- && !ts.getDeclarationOfKind(symbolFromSymbolTable, 238)) {
+ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 239)) {
if (!useOnlyExternalAliasing ||
ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) {
var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
@@ -19603,7 +20756,7 @@ var ts;
if (symbolFromSymbolTable === symbol) {
return true;
}
- symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 238)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
+ symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 239)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
if (symbolFromSymbolTable.flags & meaning) {
qualify = true;
return true;
@@ -19617,10 +20770,10 @@ var ts;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
switch (declaration.kind) {
- case 145:
- case 147:
- case 149:
+ case 146:
+ case 148:
case 150:
+ case 151:
continue;
default:
return false;
@@ -19642,7 +20795,7 @@ var ts;
return {
accessibility: 1,
errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning),
- errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1920) : undefined
+ errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1920) : undefined,
};
}
return hasAccessibleDeclarations;
@@ -19663,7 +20816,7 @@ var ts;
}
return {
accessibility: 1,
- errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning)
+ errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning),
};
}
return { accessibility: 0 };
@@ -19710,11 +20863,11 @@ var ts;
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
var meaning;
- if (entityName.parent.kind === 158 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) {
+ if (entityName.parent.kind === 159 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) {
meaning = 107455 | 1048576;
}
- else if (entityName.kind === 139 || entityName.kind === 172 ||
- entityName.parent.kind === 229) {
+ else if (entityName.kind === 140 || entityName.kind === 173 ||
+ entityName.parent.kind === 230) {
meaning = 1920;
}
else {
@@ -19806,10 +20959,10 @@ var ts;
function getTypeAliasForTypeLiteral(type) {
if (type.symbol && type.symbol.flags & 2048) {
var node = type.symbol.declarations[0].parent;
- while (node.kind === 164) {
+ while (node.kind === 165) {
node = node.parent;
}
- if (node.kind === 223) {
+ if (node.kind === 224) {
return getSymbolOfNode(node);
}
}
@@ -19817,7 +20970,7 @@ var ts;
}
function isTopLevelInExternalModuleAugmentation(node) {
return node && node.parent &&
- node.parent.kind === 226 &&
+ node.parent.kind === 227 &&
ts.isExternalModuleAugmentation(node.parent.parent);
}
function literalTypeToString(type) {
@@ -19831,10 +20984,10 @@ var ts;
return ts.declarationNameToString(declaration.name);
}
switch (declaration.kind) {
- case 192:
+ case 193:
return "(Anonymous class)";
- case 179:
case 180:
+ case 181:
return "(Anonymous function)";
}
}
@@ -19848,17 +21001,17 @@ var ts;
var firstChar = symbolName.charCodeAt(0);
var needsElementAccess = !ts.isIdentifierStart(firstChar, languageVersion);
if (needsElementAccess) {
- writePunctuation(writer, 19);
+ writePunctuation(writer, 20);
if (ts.isSingleOrDoubleQuote(firstChar)) {
writer.writeStringLiteral(symbolName);
}
else {
writer.writeSymbol(symbolName, symbol);
}
- writePunctuation(writer, 20);
+ writePunctuation(writer, 21);
}
else {
- writePunctuation(writer, 21);
+ writePunctuation(writer, 22);
writer.writeSymbol(symbolName, symbol);
}
}
@@ -19934,7 +21087,7 @@ var ts;
}
else if (type.flags & 256) {
buildSymbolDisplay(getParentOfSymbol(type.symbol), writer, enclosingDeclaration, 793064, 0, nextFlags);
- writePunctuation(writer, 21);
+ writePunctuation(writer, 22);
appendSymbolNameOnly(type.symbol, writer);
}
else if (type.flags & (32768 | 65536 | 16 | 16384)) {
@@ -19955,23 +21108,23 @@ var ts;
writer.writeStringLiteral(literalTypeToString(type));
}
else {
- writePunctuation(writer, 15);
- writeSpace(writer);
- writePunctuation(writer, 22);
- writeSpace(writer);
writePunctuation(writer, 16);
+ writeSpace(writer);
+ writePunctuation(writer, 23);
+ writeSpace(writer);
+ writePunctuation(writer, 17);
}
}
function writeTypeList(types, delimiter) {
for (var i = 0; i < types.length; i++) {
if (i > 0) {
- if (delimiter !== 24) {
+ if (delimiter !== 25) {
writeSpace(writer);
}
writePunctuation(writer, delimiter);
writeSpace(writer);
}
- writeType(types[i], delimiter === 24 ? 0 : 64);
+ writeType(types[i], delimiter === 25 ? 0 : 64);
}
}
function writeSymbolTypeReference(symbol, typeArguments, pos, end, flags) {
@@ -19979,29 +21132,29 @@ var ts;
buildSymbolDisplay(symbol, writer, enclosingDeclaration, 793064, 0, flags);
}
if (pos < end) {
- writePunctuation(writer, 25);
+ writePunctuation(writer, 26);
writeType(typeArguments[pos], 256);
pos++;
while (pos < end) {
- writePunctuation(writer, 24);
+ writePunctuation(writer, 25);
writeSpace(writer);
writeType(typeArguments[pos], 0);
pos++;
}
- writePunctuation(writer, 27);
+ writePunctuation(writer, 28);
}
}
function writeTypeReference(type, flags) {
var typeArguments = type.typeArguments || emptyArray;
if (type.target === globalArrayType && !(flags & 1)) {
writeType(typeArguments[0], 64);
- writePunctuation(writer, 19);
writePunctuation(writer, 20);
+ writePunctuation(writer, 21);
}
else if (type.target.flags & 262144) {
- writePunctuation(writer, 19);
- writeTypeList(type.typeArguments.slice(0, getTypeReferenceArity(type)), 24);
writePunctuation(writer, 20);
+ writeTypeList(type.typeArguments.slice(0, getTypeReferenceArity(type)), 25);
+ writePunctuation(writer, 21);
}
else {
var outerTypeParameters = type.target.outerTypeParameters;
@@ -20016,7 +21169,7 @@ var ts;
} while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent_9);
if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) {
writeSymbolTypeReference(parent_9, typeArguments, start, i, flags);
- writePunctuation(writer, 21);
+ writePunctuation(writer, 22);
}
}
}
@@ -20026,16 +21179,16 @@ var ts;
}
function writeUnionOrIntersectionType(type, flags) {
if (flags & 64) {
- writePunctuation(writer, 17);
+ writePunctuation(writer, 18);
}
if (type.flags & 524288) {
- writeTypeList(formatUnionTypes(type.types), 47);
+ writeTypeList(formatUnionTypes(type.types), 48);
}
else {
- writeTypeList(type.types, 46);
+ writeTypeList(type.types, 47);
}
if (flags & 64) {
- writePunctuation(writer, 18);
+ writePunctuation(writer, 19);
}
}
function writeAnonymousType(type, flags) {
@@ -20053,7 +21206,7 @@ var ts;
buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793064, 0, flags);
}
else {
- writeKeyword(writer, 117);
+ writeKeyword(writer, 118);
}
}
else {
@@ -20074,7 +21227,7 @@ var ts;
var isNonLocalFunctionSymbol = !!(symbol.flags & 16) &&
(symbol.parent ||
ts.forEach(symbol.declarations, function (declaration) {
- return declaration.parent.kind === 256 || declaration.parent.kind === 226;
+ return declaration.parent.kind === 256 || declaration.parent.kind === 227;
}));
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
return !!(flags & 2) ||
@@ -20083,37 +21236,37 @@ var ts;
}
}
function writeTypeOfSymbol(type, typeFormatFlags) {
- writeKeyword(writer, 101);
+ writeKeyword(writer, 102);
writeSpace(writer);
buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455, 0, typeFormatFlags);
}
function writeIndexSignature(info, keyword) {
if (info) {
if (info.isReadonly) {
- writeKeyword(writer, 128);
+ writeKeyword(writer, 129);
writeSpace(writer);
}
- writePunctuation(writer, 19);
+ writePunctuation(writer, 20);
writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x");
- writePunctuation(writer, 54);
+ writePunctuation(writer, 55);
writeSpace(writer);
writeKeyword(writer, keyword);
- writePunctuation(writer, 20);
- writePunctuation(writer, 54);
+ writePunctuation(writer, 21);
+ writePunctuation(writer, 55);
writeSpace(writer);
writeType(info.type, 0);
- writePunctuation(writer, 23);
+ writePunctuation(writer, 24);
writer.writeLine();
}
}
function writePropertyWithModifiers(prop) {
if (isReadonlySymbol(prop)) {
- writeKeyword(writer, 128);
+ writeKeyword(writer, 129);
writeSpace(writer);
}
buildSymbolDisplay(prop, writer);
if (prop.flags & 536870912) {
- writePunctuation(writer, 53);
+ writePunctuation(writer, 54);
}
}
function shouldAddParenthesisAroundFunctionType(callSignature, flags) {
@@ -20131,53 +21284,53 @@ var ts;
var resolved = resolveStructuredTypeMembers(type);
if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) {
if (!resolved.callSignatures.length && !resolved.constructSignatures.length) {
- writePunctuation(writer, 15);
writePunctuation(writer, 16);
+ writePunctuation(writer, 17);
return;
}
if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) {
var parenthesizeSignature = shouldAddParenthesisAroundFunctionType(resolved.callSignatures[0], flags);
if (parenthesizeSignature) {
- writePunctuation(writer, 17);
+ writePunctuation(writer, 18);
}
buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, undefined, symbolStack);
if (parenthesizeSignature) {
- writePunctuation(writer, 18);
+ writePunctuation(writer, 19);
}
return;
}
if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) {
if (flags & 64) {
- writePunctuation(writer, 17);
+ writePunctuation(writer, 18);
}
- writeKeyword(writer, 92);
+ writeKeyword(writer, 93);
writeSpace(writer);
buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, undefined, symbolStack);
if (flags & 64) {
- writePunctuation(writer, 18);
+ writePunctuation(writer, 19);
}
return;
}
}
var saveInObjectTypeLiteral = inObjectTypeLiteral;
inObjectTypeLiteral = true;
- writePunctuation(writer, 15);
+ writePunctuation(writer, 16);
writer.writeLine();
writer.increaseIndent();
for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) {
var signature = _a[_i];
buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack);
- writePunctuation(writer, 23);
+ writePunctuation(writer, 24);
writer.writeLine();
}
for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) {
var signature = _c[_b];
buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, 1, symbolStack);
- writePunctuation(writer, 23);
+ writePunctuation(writer, 24);
writer.writeLine();
}
- writeIndexSignature(resolved.stringIndexInfo, 132);
- writeIndexSignature(resolved.numberIndexInfo, 130);
+ writeIndexSignature(resolved.stringIndexInfo, 133);
+ writeIndexSignature(resolved.numberIndexInfo, 131);
for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) {
var p = _e[_d];
var t = getTypeOfSymbol(p);
@@ -20187,21 +21340,21 @@ var ts;
var signature = signatures_1[_f];
writePropertyWithModifiers(p);
buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack);
- writePunctuation(writer, 23);
+ writePunctuation(writer, 24);
writer.writeLine();
}
}
else {
writePropertyWithModifiers(p);
- writePunctuation(writer, 54);
+ writePunctuation(writer, 55);
writeSpace(writer);
writeType(t, 0);
- writePunctuation(writer, 23);
+ writePunctuation(writer, 24);
writer.writeLine();
}
}
writer.decreaseIndent();
- writePunctuation(writer, 16);
+ writePunctuation(writer, 17);
inObjectTypeLiteral = saveInObjectTypeLiteral;
}
}
@@ -20216,7 +21369,7 @@ var ts;
var constraint = getConstraintOfTypeParameter(tp);
if (constraint) {
writeSpace(writer);
- writeKeyword(writer, 83);
+ writeKeyword(writer, 84);
writeSpace(writer);
buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, symbolStack);
}
@@ -20224,7 +21377,7 @@ var ts;
function buildParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack) {
var parameterNode = p.valueDeclaration;
if (ts.isRestParameter(parameterNode)) {
- writePunctuation(writer, 22);
+ writePunctuation(writer, 23);
}
if (ts.isBindingPattern(parameterNode.name)) {
buildBindingPatternDisplay(parameterNode.name, writer, enclosingDeclaration, flags, symbolStack);
@@ -20233,36 +21386,36 @@ var ts;
appendSymbolNameOnly(p, writer);
}
if (isOptionalParameter(parameterNode)) {
- writePunctuation(writer, 53);
+ writePunctuation(writer, 54);
}
- writePunctuation(writer, 54);
+ writePunctuation(writer, 55);
writeSpace(writer);
buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, symbolStack);
}
function buildBindingPatternDisplay(bindingPattern, writer, enclosingDeclaration, flags, symbolStack) {
- if (bindingPattern.kind === 167) {
- writePunctuation(writer, 15);
- buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); });
+ if (bindingPattern.kind === 168) {
writePunctuation(writer, 16);
+ buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); });
+ writePunctuation(writer, 17);
}
- else if (bindingPattern.kind === 168) {
- writePunctuation(writer, 19);
+ else if (bindingPattern.kind === 169) {
+ writePunctuation(writer, 20);
var elements = bindingPattern.elements;
buildDisplayForCommaSeparatedList(elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); });
if (elements && elements.hasTrailingComma) {
- writePunctuation(writer, 24);
+ writePunctuation(writer, 25);
}
- writePunctuation(writer, 20);
+ writePunctuation(writer, 21);
}
}
function buildBindingElementDisplay(bindingElement, writer, enclosingDeclaration, flags, symbolStack) {
if (ts.isOmittedExpression(bindingElement)) {
return;
}
- ts.Debug.assert(bindingElement.kind === 169);
+ ts.Debug.assert(bindingElement.kind === 170);
if (bindingElement.propertyName) {
writer.writeSymbol(ts.getTextOfNode(bindingElement.propertyName), bindingElement.symbol);
- writePunctuation(writer, 54);
+ writePunctuation(writer, 55);
writeSpace(writer);
}
if (ts.isBindingPattern(bindingElement.name)) {
@@ -20270,75 +21423,75 @@ var ts;
}
else {
if (bindingElement.dotDotDotToken) {
- writePunctuation(writer, 22);
+ writePunctuation(writer, 23);
}
appendSymbolNameOnly(bindingElement.symbol, writer);
}
}
function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, symbolStack) {
if (typeParameters && typeParameters.length) {
- writePunctuation(writer, 25);
+ writePunctuation(writer, 26);
buildDisplayForCommaSeparatedList(typeParameters, writer, function (p) { return buildTypeParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack); });
- writePunctuation(writer, 27);
+ writePunctuation(writer, 28);
}
}
function buildDisplayForCommaSeparatedList(list, writer, action) {
for (var i = 0; i < list.length; i++) {
if (i > 0) {
- writePunctuation(writer, 24);
+ writePunctuation(writer, 25);
writeSpace(writer);
}
action(list[i]);
}
}
- function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration, flags, symbolStack) {
+ function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration) {
if (typeParameters && typeParameters.length) {
- writePunctuation(writer, 25);
- var flags_1 = 256;
+ writePunctuation(writer, 26);
+ var flags = 256;
for (var i = 0; i < typeParameters.length; i++) {
if (i > 0) {
- writePunctuation(writer, 24);
+ writePunctuation(writer, 25);
writeSpace(writer);
- flags_1 = 0;
+ flags = 0;
}
- buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, flags_1);
+ buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, flags);
}
- writePunctuation(writer, 27);
+ writePunctuation(writer, 28);
}
}
function buildDisplayForParametersAndDelimiters(thisParameter, parameters, writer, enclosingDeclaration, flags, symbolStack) {
- writePunctuation(writer, 17);
+ writePunctuation(writer, 18);
if (thisParameter) {
buildParameterDisplay(thisParameter, writer, enclosingDeclaration, flags, symbolStack);
}
for (var i = 0; i < parameters.length; i++) {
if (i > 0 || thisParameter) {
- writePunctuation(writer, 24);
+ writePunctuation(writer, 25);
writeSpace(writer);
}
buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, symbolStack);
}
- writePunctuation(writer, 18);
+ writePunctuation(writer, 19);
}
function buildTypePredicateDisplay(predicate, writer, enclosingDeclaration, flags, symbolStack) {
if (ts.isIdentifierTypePredicate(predicate)) {
writer.writeParameter(predicate.parameterName);
}
else {
- writeKeyword(writer, 97);
+ writeKeyword(writer, 98);
}
writeSpace(writer);
- writeKeyword(writer, 124);
+ writeKeyword(writer, 125);
writeSpace(writer);
buildTypeDisplay(predicate.type, writer, enclosingDeclaration, flags, symbolStack);
}
function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) {
if (flags & 8) {
writeSpace(writer);
- writePunctuation(writer, 34);
+ writePunctuation(writer, 35);
}
else {
- writePunctuation(writer, 54);
+ writePunctuation(writer, 55);
}
writeSpace(writer);
if (signature.typePredicate) {
@@ -20351,7 +21504,7 @@ var ts;
}
function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind, symbolStack) {
if (kind === 1) {
- writeKeyword(writer, 92);
+ writeKeyword(writer, 93);
writeSpace(writer);
}
if (signature.target && (flags & 32)) {
@@ -20387,64 +21540,64 @@ var ts;
return false;
function determineIfDeclarationIsVisible() {
switch (node.kind) {
- case 169:
+ case 170:
return isDeclarationVisible(node.parent.parent);
- case 218:
+ case 219:
if (ts.isBindingPattern(node.name) &&
!node.name.elements.length) {
return false;
}
- case 225:
- case 221:
+ case 226:
case 222:
case 223:
- case 220:
case 224:
- case 229:
+ case 221:
+ case 225:
+ case 230:
if (ts.isExternalModuleAugmentation(node)) {
return true;
}
var parent_10 = getDeclarationContainer(node);
if (!(ts.getCombinedModifierFlags(node) & 1) &&
- !(node.kind !== 229 && parent_10.kind !== 256 && ts.isInAmbientContext(parent_10))) {
+ !(node.kind !== 230 && parent_10.kind !== 256 && ts.isInAmbientContext(parent_10))) {
return isGlobalSourceFile(parent_10);
}
return isDeclarationVisible(parent_10);
- case 145:
- case 144:
- case 149:
- case 150:
- case 147:
case 146:
+ case 145:
+ case 150:
+ case 151:
+ case 148:
+ case 147:
if (ts.getModifierFlags(node) & (8 | 16)) {
return false;
}
- case 148:
- case 152:
- case 151:
+ case 149:
case 153:
- case 142:
- case 226:
- case 156:
+ case 152:
+ case 154:
+ case 143:
+ case 227:
case 157:
- case 159:
- case 155:
+ case 158:
case 160:
+ case 156:
case 161:
case 162:
case 163:
case 164:
+ case 165:
return isDeclarationVisible(node.parent);
- case 231:
case 232:
- case 234:
- return false;
- case 141:
- case 256:
- case 228:
- return true;
+ case 233:
case 235:
return false;
+ case 142:
+ case 256:
+ case 229:
+ return true;
+ case 236:
+ return false;
default:
return false;
}
@@ -20452,10 +21605,10 @@ var ts;
}
function collectLinkedAliases(node) {
var exportSymbol;
- if (node.parent && node.parent.kind === 235) {
+ if (node.parent && node.parent.kind === 236) {
exportSymbol = resolveName(node.parent, node.text, 107455 | 793064 | 1920 | 8388608, ts.Diagnostics.Cannot_find_name_0, node);
}
- else if (node.parent.kind === 238) {
+ else if (node.parent.kind === 239) {
var exportSpecifier = node.parent;
exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ?
getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) :
@@ -20534,12 +21687,12 @@ var ts;
node = ts.getRootDeclaration(node);
while (node) {
switch (node.kind) {
- case 218:
case 219:
+ case 220:
+ case 235:
case 234:
case 233:
case 232:
- case 231:
node = node.parent;
break;
default:
@@ -20567,12 +21720,12 @@ var ts;
}
function getTextOfPropertyName(name) {
switch (name.kind) {
- case 69:
+ case 70:
return name.text;
case 9:
case 8:
return name.text;
- case 140:
+ case 141:
if (ts.isStringOrNumericLiteral(name.expression.kind)) {
return name.expression.text;
}
@@ -20580,7 +21733,7 @@ var ts;
return undefined;
}
function isComputedNonLiteralName(name) {
- return name.kind === 140 && !ts.isStringOrNumericLiteral(name.expression.kind);
+ return name.kind === 141 && !ts.isStringOrNumericLiteral(name.expression.kind);
}
function getTypeForBindingElement(declaration) {
var pattern = declaration.parent;
@@ -20595,7 +21748,7 @@ var ts;
return parentType;
}
var type;
- if (pattern.kind === 167) {
+ if (pattern.kind === 168) {
var name_14 = declaration.propertyName || declaration.name;
if (isComputedNonLiteralName(name_14)) {
return anyType;
@@ -20651,15 +21804,15 @@ var ts;
if (typeTag && typeTag.typeExpression) {
return typeTag.typeExpression.type;
}
- if (declaration.kind === 218 &&
- declaration.parent.kind === 219 &&
- declaration.parent.parent.kind === 200) {
+ if (declaration.kind === 219 &&
+ declaration.parent.kind === 220 &&
+ declaration.parent.parent.kind === 201) {
var annotation = ts.getJSDocTypeTag(declaration.parent.parent);
if (annotation && annotation.typeExpression) {
return annotation.typeExpression.type;
}
}
- else if (declaration.kind === 142) {
+ else if (declaration.kind === 143) {
var paramTag = ts.getCorrespondingJSDocParameterTag(declaration);
if (paramTag && paramTag.typeExpression) {
return paramTag.typeExpression.type;
@@ -20667,9 +21820,13 @@ var ts;
}
return undefined;
}
- function isAutoVariableInitializer(initializer) {
- var expr = initializer && ts.skipParentheses(initializer);
- return !expr || expr.kind === 93 || expr.kind === 69 && getResolvedSymbol(expr) === undefinedSymbol;
+ function isNullOrUndefined(node) {
+ var expr = ts.skipParentheses(node);
+ return expr.kind === 94 || expr.kind === 70 && getResolvedSymbol(expr) === undefinedSymbol;
+ }
+ function isEmptyArrayLiteral(node) {
+ var expr = ts.skipParentheses(node);
+ return expr.kind === 171 && expr.elements.length === 0;
}
function addOptionality(type, optional) {
return strictNullChecks && optional ? includeFalsyTypes(type, 2048) : type;
@@ -20681,10 +21838,10 @@ var ts;
return type;
}
}
- if (declaration.parent.parent.kind === 207) {
+ if (declaration.parent.parent.kind === 208) {
return stringType;
}
- if (declaration.parent.parent.kind === 208) {
+ if (declaration.parent.parent.kind === 209) {
return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType;
}
if (ts.isBindingPattern(declaration.parent)) {
@@ -20693,15 +21850,19 @@ var ts;
if (declaration.type) {
return addOptionality(getTypeFromTypeNode(declaration.type), declaration.questionToken && includeOptionality);
}
- if (declaration.kind === 218 && !ts.isBindingPattern(declaration.name) &&
- !(ts.getCombinedNodeFlags(declaration) & 2) && !(ts.getCombinedModifierFlags(declaration) & 1) &&
- !ts.isInAmbientContext(declaration) && isAutoVariableInitializer(declaration.initializer)) {
- return autoType;
+ if (declaration.kind === 219 && !ts.isBindingPattern(declaration.name) &&
+ !(ts.getCombinedModifierFlags(declaration) & 1) && !ts.isInAmbientContext(declaration)) {
+ if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) {
+ return autoType;
+ }
+ if (declaration.initializer && isEmptyArrayLiteral(declaration.initializer)) {
+ return autoArrayType;
+ }
}
- if (declaration.kind === 142) {
+ if (declaration.kind === 143) {
var func = declaration.parent;
- if (func.kind === 150 && !ts.hasDynamicName(func)) {
- var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 149);
+ if (func.kind === 151 && !ts.hasDynamicName(func)) {
+ var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 150);
if (getter) {
var getterSignature = getSignatureFromDeclaration(getter);
var thisParameter = getAccessorThisParameter(func);
@@ -20714,8 +21875,7 @@ var ts;
}
var type = void 0;
if (declaration.symbol.name === "this") {
- var thisParameter = getContextualThisParameter(func);
- type = thisParameter ? getTypeOfSymbol(thisParameter) : undefined;
+ type = getContextualThisParameterType(func);
}
else {
type = getContextuallyTypedParameterType(declaration);
@@ -20788,7 +21948,7 @@ var ts;
return result;
}
function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) {
- return pattern.kind === 167
+ return pattern.kind === 168
? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors)
: getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors);
}
@@ -20813,7 +21973,7 @@ var ts;
}
function declarationBelongsToPrivateAmbientMember(declaration) {
var root = ts.getRootDeclaration(declaration);
- var memberDeclaration = root.kind === 142 ? root.parent : root;
+ var memberDeclaration = root.kind === 143 ? root.parent : root;
return isPrivateWithinAmbient(memberDeclaration);
}
function getTypeOfVariableOrParameterOrProperty(symbol) {
@@ -20826,7 +21986,7 @@ var ts;
if (declaration.parent.kind === 252) {
return links.type = anyType;
}
- if (declaration.kind === 235) {
+ if (declaration.kind === 236) {
return links.type = checkExpression(declaration.expression);
}
if (declaration.flags & 1048576 && declaration.kind === 280 && declaration.typeExpression) {
@@ -20836,15 +21996,15 @@ var ts;
return unknownType;
}
var type = void 0;
- if (declaration.kind === 187 ||
- declaration.kind === 172 && declaration.parent.kind === 187) {
+ if (declaration.kind === 188 ||
+ declaration.kind === 173 && declaration.parent.kind === 188) {
if (declaration.flags & 1048576) {
var typeTag = ts.getJSDocTypeTag(declaration.parent);
if (typeTag && typeTag.typeExpression) {
return links.type = getTypeFromTypeNode(typeTag.typeExpression.type);
}
}
- var declaredTypes = ts.map(symbol.declarations, function (decl) { return decl.kind === 187 ?
+ var declaredTypes = ts.map(symbol.declarations, function (decl) { return decl.kind === 188 ?
checkExpressionCached(decl.right) :
checkExpressionCached(decl.parent.right); });
type = getUnionType(declaredTypes, true);
@@ -20870,7 +22030,7 @@ var ts;
}
function getAnnotatedAccessorType(accessor) {
if (accessor) {
- if (accessor.kind === 149) {
+ if (accessor.kind === 150) {
return accessor.type && getTypeFromTypeNode(accessor.type);
}
else {
@@ -20890,8 +22050,8 @@ var ts;
function getTypeOfAccessors(symbol) {
var links = getSymbolLinks(symbol);
if (!links.type) {
- var getter = ts.getDeclarationOfKind(symbol, 149);
- var setter = ts.getDeclarationOfKind(symbol, 150);
+ var getter = ts.getDeclarationOfKind(symbol, 150);
+ var setter = ts.getDeclarationOfKind(symbol, 151);
if (getter && getter.flags & 1048576) {
var jsDocType = getTypeForVariableLikeDeclarationFromJSDocComment(getter);
if (jsDocType) {
@@ -20932,7 +22092,7 @@ var ts;
if (!popTypeResolution()) {
type = anyType;
if (compilerOptions.noImplicitAny) {
- var getter_1 = ts.getDeclarationOfKind(symbol, 149);
+ var getter_1 = ts.getDeclarationOfKind(symbol, 150);
error(getter_1, ts.Diagnostics._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, symbolToString(symbol));
}
}
@@ -20943,7 +22103,7 @@ var ts;
function getTypeOfFuncClassEnumModule(symbol) {
var links = getSymbolLinks(symbol);
if (!links.type) {
- if (symbol.valueDeclaration.kind === 225 && ts.isShorthandAmbientModuleSymbol(symbol)) {
+ if (symbol.valueDeclaration.kind === 226 && ts.isShorthandAmbientModuleSymbol(symbol)) {
links.type = anyType;
}
else {
@@ -21028,9 +22188,9 @@ var ts;
if (!node) {
return typeParameters;
}
- if (node.kind === 221 || node.kind === 192 ||
- node.kind === 220 || node.kind === 179 ||
- node.kind === 147 || node.kind === 180) {
+ if (node.kind === 222 || node.kind === 193 ||
+ node.kind === 221 || node.kind === 180 ||
+ node.kind === 148 || node.kind === 181) {
var declarations = node.typeParameters;
if (declarations) {
return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations);
@@ -21039,15 +22199,15 @@ var ts;
}
}
function getOuterTypeParametersOfClassOrInterface(symbol) {
- var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 222);
+ var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 223);
return appendOuterTypeParameters(undefined, declaration);
}
function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) {
var result;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var node = _a[_i];
- if (node.kind === 222 || node.kind === 221 ||
- node.kind === 192 || node.kind === 223) {
+ if (node.kind === 223 || node.kind === 222 ||
+ node.kind === 193 || node.kind === 224) {
var declaration = node;
if (declaration.typeParameters) {
result = appendTypeParameters(result, declaration.typeParameters);
@@ -21173,7 +22333,7 @@ var ts;
type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray;
for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 222 && ts.getInterfaceBaseTypeNodes(declaration)) {
+ if (declaration.kind === 223 && ts.getInterfaceBaseTypeNodes(declaration)) {
for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) {
var node = _c[_b];
var baseType = getTypeFromTypeNode(node);
@@ -21202,7 +22362,7 @@ var ts;
function isIndependentInterface(symbol) {
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 222) {
+ if (declaration.kind === 223) {
if (declaration.flags & 64) {
return false;
}
@@ -21264,7 +22424,7 @@ var ts;
}
}
else {
- declaration = ts.getDeclarationOfKind(symbol, 223);
+ declaration = ts.getDeclarationOfKind(symbol, 224);
type = getTypeFromTypeNode(declaration.type, symbol, typeParameters);
}
if (popTypeResolution()) {
@@ -21288,14 +22448,14 @@ var ts;
return !ts.isInAmbientContext(member);
}
return expr.kind === 8 ||
- expr.kind === 185 && expr.operator === 36 &&
+ expr.kind === 186 && expr.operator === 37 &&
expr.operand.kind === 8 ||
- expr.kind === 69 && !!symbol.exports[expr.text];
+ expr.kind === 70 && !!symbol.exports[expr.text];
}
function enumHasLiteralMembers(symbol) {
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 224) {
+ if (declaration.kind === 225) {
for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
var member = _c[_b];
if (!isLiteralEnumMember(symbol, member)) {
@@ -21323,7 +22483,7 @@ var ts;
var memberTypes = ts.createMap();
for (var _i = 0, _a = enumType.symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 224) {
+ if (declaration.kind === 225) {
computeEnumMemberValues(declaration);
for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
var member = _c[_b];
@@ -21361,7 +22521,7 @@ var ts;
if (!links.declaredType) {
var type = createType(16384);
type.symbol = symbol;
- if (!ts.getDeclarationOfKind(symbol, 141).constraint) {
+ if (!ts.getDeclarationOfKind(symbol, 142).constraint) {
type.constraint = noConstraintType;
}
links.declaredType = type;
@@ -21410,20 +22570,20 @@ var ts;
}
function isIndependentType(node) {
switch (node.kind) {
- case 117:
- case 132:
- case 130:
- case 120:
+ case 118:
case 133:
- case 103:
- case 135:
- case 93:
- case 127:
- case 166:
+ case 131:
+ case 121:
+ case 134:
+ case 104:
+ case 136:
+ case 94:
+ case 128:
+ case 167:
return true;
- case 160:
+ case 161:
return isIndependentType(node.elementType);
- case 155:
+ case 156:
return isIndependentTypeReference(node);
}
return false;
@@ -21432,7 +22592,7 @@ var ts;
return node.type && isIndependentType(node.type) || !node.type && !node.initializer;
}
function isIndependentFunctionLikeDeclaration(node) {
- if (node.kind !== 148 && (!node.type || !isIndependentType(node.type))) {
+ if (node.kind !== 149 && (!node.type || !isIndependentType(node.type))) {
return false;
}
for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
@@ -21448,12 +22608,12 @@ var ts;
var declaration = symbol.declarations[0];
if (declaration) {
switch (declaration.kind) {
- case 145:
- case 144:
- return isIndependentVariableLikeDeclaration(declaration);
- case 147:
case 146:
+ case 145:
+ return isIndependentVariableLikeDeclaration(declaration);
case 148:
+ case 147:
+ case 149:
return isIndependentFunctionLikeDeclaration(declaration);
}
}
@@ -22019,7 +23179,7 @@ var ts;
return false;
}
function createTypePredicateFromTypePredicateNode(node) {
- if (node.parameterName.kind === 69) {
+ if (node.parameterName.kind === 70) {
var parameterName = node.parameterName;
return {
kind: 1,
@@ -22058,7 +23218,7 @@ var ts;
else {
parameters.push(paramSymbol);
}
- if (param.type && param.type.kind === 166) {
+ if (param.type && param.type.kind === 167) {
hasLiteralTypes = true;
}
if (param.initializer || param.questionToken || param.dotDotDotToken || isJSDocOptionalParameter(param)) {
@@ -22070,10 +23230,10 @@ var ts;
minArgumentCount = -1;
}
}
- if ((declaration.kind === 149 || declaration.kind === 150) &&
+ if ((declaration.kind === 150 || declaration.kind === 151) &&
!ts.hasDynamicName(declaration) &&
(!hasThisParameter || !thisParameter)) {
- var otherKind = declaration.kind === 149 ? 150 : 149;
+ var otherKind = declaration.kind === 150 ? 151 : 150;
var other = ts.getDeclarationOfKind(declaration.symbol, otherKind);
if (other) {
thisParameter = getAnnotatedAccessorThisParameter(other);
@@ -22085,24 +23245,21 @@ var ts;
if (isJSConstructSignature) {
minArgumentCount--;
}
- if (!thisParameter && ts.isObjectLiteralMethod(declaration)) {
- thisParameter = getContextualThisParameter(declaration);
- }
- var classType = declaration.kind === 148 ?
+ var classType = declaration.kind === 149 ?
getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol))
: undefined;
var typeParameters = classType ? classType.localTypeParameters :
declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) :
getTypeParametersFromJSDocTemplate(declaration);
- var returnType = getSignatureReturnTypeFromDeclaration(declaration, minArgumentCount, isJSConstructSignature, classType);
- var typePredicate = declaration.type && declaration.type.kind === 154 ?
+ var returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType);
+ var typePredicate = declaration.type && declaration.type.kind === 155 ?
createTypePredicateFromTypePredicateNode(declaration.type) :
undefined;
links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, ts.hasRestParameter(declaration), hasLiteralTypes);
}
return links.resolvedSignature;
}
- function getSignatureReturnTypeFromDeclaration(declaration, minArgumentCount, isJSConstructSignature, classType) {
+ function getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType) {
if (isJSConstructSignature) {
return getTypeFromTypeNode(declaration.parameters[0].type);
}
@@ -22118,8 +23275,8 @@ var ts;
return type;
}
}
- if (declaration.kind === 149 && !ts.hasDynamicName(declaration)) {
- var setter = ts.getDeclarationOfKind(declaration.symbol, 150);
+ if (declaration.kind === 150 && !ts.hasDynamicName(declaration)) {
+ var setter = ts.getDeclarationOfKind(declaration.symbol, 151);
return getAnnotatedAccessorType(setter);
}
if (ts.nodeIsMissing(declaration.body)) {
@@ -22133,19 +23290,19 @@ var ts;
for (var i = 0, len = symbol.declarations.length; i < len; i++) {
var node = symbol.declarations[i];
switch (node.kind) {
- case 156:
case 157:
- case 220:
- case 147:
- case 146:
+ case 158:
+ case 221:
case 148:
- case 151:
+ case 147:
+ case 149:
case 152:
case 153:
- case 149:
+ case 154:
case 150:
- case 179:
+ case 151:
case 180:
+ case 181:
case 269:
if (i > 0 && node.body) {
var previous = symbol.declarations[i - 1];
@@ -22226,7 +23383,7 @@ var ts;
}
function getOrCreateTypeFromSignature(signature) {
if (!signature.isolatedSignatureType) {
- var isConstructor = signature.declaration.kind === 148 || signature.declaration.kind === 152;
+ var isConstructor = signature.declaration.kind === 149 || signature.declaration.kind === 153;
var type = createObjectType(2097152);
type.members = emptySymbols;
type.properties = emptyArray;
@@ -22240,7 +23397,7 @@ var ts;
return symbol.members["__index"];
}
function getIndexDeclarationOfSymbol(symbol, kind) {
- var syntaxKind = kind === 1 ? 130 : 132;
+ var syntaxKind = kind === 1 ? 131 : 133;
var indexSymbol = getIndexSymbol(symbol);
if (indexSymbol) {
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
@@ -22267,7 +23424,7 @@ var ts;
return undefined;
}
function getConstraintDeclaration(type) {
- return ts.getDeclarationOfKind(type.symbol, 141).constraint;
+ return ts.getDeclarationOfKind(type.symbol, 142).constraint;
}
function hasConstraintReferenceTo(type, target) {
var checked;
@@ -22300,7 +23457,7 @@ var ts;
return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint;
}
function getParentSymbolOfTypeParameter(typeParameter) {
- return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 141).parent);
+ return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 142).parent);
}
function getTypeListId(types) {
var result = "";
@@ -22400,11 +23557,11 @@ var ts;
}
function getTypeReferenceName(node) {
switch (node.kind) {
- case 155:
+ case 156:
return node.typeName;
case 267:
return node.name;
- case 194:
+ case 195:
var expr = node.expression;
if (ts.isEntityNameExpression(expr)) {
return expr;
@@ -22412,7 +23569,7 @@ var ts;
}
return undefined;
}
- function resolveTypeReferenceName(node, typeReferenceName) {
+ function resolveTypeReferenceName(typeReferenceName) {
if (!typeReferenceName) {
return unknownSymbol;
}
@@ -22440,11 +23597,11 @@ var ts;
var type = void 0;
if (node.kind === 267) {
var typeReferenceName = getTypeReferenceName(node);
- symbol = resolveTypeReferenceName(node, typeReferenceName);
+ symbol = resolveTypeReferenceName(typeReferenceName);
type = getTypeReferenceType(node, symbol);
}
else {
- var typeNameOrExpression = node.kind === 155
+ var typeNameOrExpression = node.kind === 156
? node.typeName
: ts.isEntityNameExpression(node.expression)
? node.expression
@@ -22473,9 +23630,9 @@ var ts;
for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) {
var declaration = declarations_3[_i];
switch (declaration.kind) {
- case 221:
case 222:
- case 224:
+ case 223:
+ case 225:
return declaration;
}
}
@@ -22850,9 +24007,9 @@ var ts;
function getThisType(node) {
var container = ts.getThisContainer(node, false);
var parent = container && container.parent;
- if (parent && (ts.isClassLike(parent) || parent.kind === 222)) {
+ if (parent && (ts.isClassLike(parent) || parent.kind === 223)) {
if (!(ts.getModifierFlags(container) & 32) &&
- (container.kind !== 148 || ts.isNodeDescendantOf(node, container.body))) {
+ (container.kind !== 149 || ts.isNodeDescendantOf(node, container.body))) {
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType;
}
}
@@ -22871,25 +24028,25 @@ var ts;
}
function getTypeFromTypeNode(node, aliasSymbol, aliasTypeArguments) {
switch (node.kind) {
- case 117:
+ case 118:
case 258:
case 259:
return anyType;
- case 132:
- return stringType;
- case 130:
- return numberType;
- case 120:
- return booleanType;
case 133:
+ return stringType;
+ case 131:
+ return numberType;
+ case 121:
+ return booleanType;
+ case 134:
return esSymbolType;
- case 103:
+ case 104:
return voidType;
- case 135:
+ case 136:
return undefinedType;
- case 93:
+ case 94:
return nullType;
- case 127:
+ case 128:
return neverType;
case 283:
return nullType;
@@ -22897,33 +24054,33 @@ var ts;
return undefinedType;
case 285:
return neverType;
- case 165:
- case 97:
- return getTypeFromThisTypeNode(node);
case 166:
+ case 98:
+ return getTypeFromThisTypeNode(node);
+ case 167:
return getTypeFromLiteralTypeNode(node);
case 282:
return getTypeFromLiteralTypeNode(node.literal);
- case 155:
+ case 156:
case 267:
return getTypeFromTypeReference(node);
- case 154:
+ case 155:
return booleanType;
- case 194:
+ case 195:
return getTypeFromTypeReference(node);
- case 158:
+ case 159:
return getTypeFromTypeQueryNode(node);
- case 160:
+ case 161:
case 260:
return getTypeFromArrayTypeNode(node);
- case 161:
- return getTypeFromTupleTypeNode(node);
case 162:
+ return getTypeFromTupleTypeNode(node);
+ case 163:
case 261:
return getTypeFromUnionTypeNode(node, aliasSymbol, aliasTypeArguments);
- case 163:
- return getTypeFromIntersectionTypeNode(node, aliasSymbol, aliasTypeArguments);
case 164:
+ return getTypeFromIntersectionTypeNode(node, aliasSymbol, aliasTypeArguments);
+ case 165:
case 263:
case 264:
case 271:
@@ -22932,14 +24089,14 @@ var ts;
return getTypeFromTypeNode(node.type);
case 265:
return getTypeFromTypeNode(node.literal);
- case 156:
case 157:
- case 159:
+ case 158:
+ case 160:
case 281:
case 269:
return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node, aliasSymbol, aliasTypeArguments);
- case 69:
- case 139:
+ case 70:
+ case 140:
var symbol = getSymbolAtLocation(node);
return symbol && getDeclaredTypeOfSymbol(symbol);
case 262:
@@ -23095,23 +24252,23 @@ var ts;
var node = symbol.declarations[0].parent;
while (node) {
switch (node.kind) {
- case 156:
case 157:
- case 220:
- case 147:
- case 146:
+ case 158:
+ case 221:
case 148:
- case 151:
+ case 147:
+ case 149:
case 152:
case 153:
- case 149:
+ case 154:
case 150:
- case 179:
+ case 151:
case 180:
- case 221:
- case 192:
+ case 181:
case 222:
+ case 193:
case 223:
+ case 224:
var declaration = node;
if (declaration.typeParameters) {
for (var _i = 0, _a = declaration.typeParameters; _i < _a.length; _i++) {
@@ -23121,14 +24278,14 @@ var ts;
}
}
}
- if (ts.isClassLike(node) || node.kind === 222) {
+ if (ts.isClassLike(node) || node.kind === 223) {
var thisType = getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
if (thisType && ts.contains(mappedTypes, thisType)) {
return true;
}
}
break;
- case 225:
+ case 226:
case 256:
return false;
}
@@ -23163,35 +24320,43 @@ var ts;
return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration);
}
function isContextSensitive(node) {
- ts.Debug.assert(node.kind !== 147 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 148 || ts.isObjectLiteralMethod(node));
switch (node.kind) {
- case 179:
case 180:
+ case 181:
return isContextSensitiveFunctionLikeDeclaration(node);
- case 171:
+ case 172:
return ts.forEach(node.properties, isContextSensitive);
- case 170:
+ case 171:
return ts.forEach(node.elements, isContextSensitive);
- case 188:
+ case 189:
return isContextSensitive(node.whenTrue) ||
isContextSensitive(node.whenFalse);
- case 187:
- return node.operatorToken.kind === 52 &&
+ case 188:
+ return node.operatorToken.kind === 53 &&
(isContextSensitive(node.left) || isContextSensitive(node.right));
case 253:
return isContextSensitive(node.initializer);
+ case 148:
case 147:
- case 146:
return isContextSensitiveFunctionLikeDeclaration(node);
- case 178:
+ case 179:
return isContextSensitive(node.expression);
}
return false;
}
function isContextSensitiveFunctionLikeDeclaration(node) {
- var areAllParametersUntyped = !ts.forEach(node.parameters, function (p) { return p.type; });
- var isNullaryArrow = node.kind === 180 && !node.parameters.length;
- return !node.typeParameters && areAllParametersUntyped && !isNullaryArrow;
+ if (node.typeParameters) {
+ return false;
+ }
+ if (ts.forEach(node.parameters, function (p) { return !p.type; })) {
+ return true;
+ }
+ if (node.kind === 181) {
+ return false;
+ }
+ var parameter = ts.firstOrUndefined(node.parameters);
+ return !(parameter && ts.parameterIsThisKeyword(parameter));
}
function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
return (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func);
@@ -23611,8 +24776,8 @@ var ts;
}
if (source.flags & 524288 && target.flags & 524288 ||
source.flags & 1048576 && target.flags & 1048576) {
- if (result = eachTypeRelatedToSomeType(source, target, false)) {
- if (result &= eachTypeRelatedToSomeType(target, source, false)) {
+ if (result = eachTypeRelatedToSomeType(source, target)) {
+ if (result &= eachTypeRelatedToSomeType(target, source)) {
return result;
}
}
@@ -23663,7 +24828,7 @@ var ts;
}
return false;
}
- function eachTypeRelatedToSomeType(source, target, reportErrors) {
+ function eachTypeRelatedToSomeType(source, target) {
var result = -1;
var sourceTypes = source.types;
for (var _i = 0, sourceTypes_1 = sourceTypes; _i < sourceTypes_1.length; _i++) {
@@ -24260,7 +25425,7 @@ var ts;
type.flags & 64 ? numberType :
type.flags & 128 ? booleanType :
type.flags & 256 ? type.baseType :
- type.flags & 524288 && !(type.flags & 16) ? getUnionType(ts.map(type.types, getBaseTypeOfLiteralType)) :
+ type.flags & 524288 && !(type.flags & 16) ? getUnionType(ts.sameMap(type.types, getBaseTypeOfLiteralType)) :
type;
}
function getWidenedLiteralType(type) {
@@ -24268,7 +25433,7 @@ var ts;
type.flags & 64 && type.flags & 16777216 ? numberType :
type.flags & 128 ? booleanType :
type.flags & 256 ? type.baseType :
- type.flags & 524288 && !(type.flags & 16) ? getUnionType(ts.map(type.types, getWidenedLiteralType)) :
+ type.flags & 524288 && !(type.flags & 16) ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) :
type;
}
function isTupleType(type) {
@@ -24379,10 +25544,10 @@ var ts;
return getWidenedTypeOfObjectLiteral(type);
}
if (type.flags & 524288) {
- return getUnionType(ts.map(type.types, getWidenedConstituentType));
+ return getUnionType(ts.sameMap(type.types, getWidenedConstituentType));
}
if (isArrayType(type) || isTupleType(type)) {
- return createTypeReference(type.target, ts.map(type.typeArguments, getWidenedType));
+ return createTypeReference(type.target, ts.sameMap(type.typeArguments, getWidenedType));
}
}
return type;
@@ -24423,25 +25588,25 @@ var ts;
var typeAsString = typeToString(getWidenedType(type));
var diagnostic;
switch (declaration.kind) {
+ case 146:
case 145:
- case 144:
diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type;
break;
- case 142:
+ case 143:
diagnostic = declaration.dotDotDotToken ?
ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type :
ts.Diagnostics.Parameter_0_implicitly_has_an_1_type;
break;
- case 169:
+ case 170:
diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type;
break;
- case 220:
+ case 221:
+ case 148:
case 147:
- case 146:
- case 149:
case 150:
- case 179:
+ case 151:
case 180:
+ case 181:
if (!declaration.name) {
error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
return;
@@ -24486,7 +25651,7 @@ var ts;
signature: signature,
inferUnionTypes: inferUnionTypes,
inferences: inferences,
- inferredTypes: new Array(signature.typeParameters.length)
+ inferredTypes: new Array(signature.typeParameters.length),
};
}
function createTypeInferencesObject() {
@@ -24494,7 +25659,7 @@ var ts;
primary: undefined,
secondary: undefined,
topLevel: true,
- isFixed: false
+ isFixed: false,
};
}
function couldContainTypeParameters(type) {
@@ -24735,7 +25900,7 @@ var ts;
var widenLiteralTypes = context.inferences[index].topLevel &&
!hasPrimitiveConstraint(signature.typeParameters[index]) &&
(context.inferences[index].isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), signature.typeParameters[index]));
- var baseInferences = widenLiteralTypes ? ts.map(inferences, getWidenedLiteralType) : inferences;
+ var baseInferences = widenLiteralTypes ? ts.sameMap(inferences, getWidenedLiteralType) : inferences;
var unionOrSuperType = context.inferUnionTypes ? getUnionType(baseInferences, true) : getCommonSupertype(baseInferences);
inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : unknownType;
inferenceSucceeded = !!unionOrSuperType;
@@ -24776,10 +25941,10 @@ var ts;
function isInTypeQuery(node) {
while (node) {
switch (node.kind) {
- case 158:
+ case 159:
return true;
- case 69:
- case 139:
+ case 70:
+ case 140:
node = node.parent;
continue;
default:
@@ -24789,14 +25954,14 @@ var ts;
ts.Debug.fail("should not get here");
}
function getFlowCacheKey(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
var symbol = getResolvedSymbol(node);
return symbol !== unknownSymbol ? "" + getSymbolId(symbol) : undefined;
}
- if (node.kind === 97) {
+ if (node.kind === 98) {
return "0";
}
- if (node.kind === 172) {
+ if (node.kind === 173) {
var key = getFlowCacheKey(node.expression);
return key && key + "." + node.name.text;
}
@@ -24804,31 +25969,31 @@ var ts;
}
function getLeftmostIdentifierOrThis(node) {
switch (node.kind) {
- case 69:
- case 97:
+ case 70:
+ case 98:
return node;
- case 172:
+ case 173:
return getLeftmostIdentifierOrThis(node.expression);
}
return undefined;
}
function isMatchingReference(source, target) {
switch (source.kind) {
- case 69:
- return target.kind === 69 && getResolvedSymbol(source) === getResolvedSymbol(target) ||
- (target.kind === 218 || target.kind === 169) &&
+ case 70:
+ return target.kind === 70 && getResolvedSymbol(source) === getResolvedSymbol(target) ||
+ (target.kind === 219 || target.kind === 170) &&
getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
- case 97:
- return target.kind === 97;
- case 172:
- return target.kind === 172 &&
+ case 98:
+ return target.kind === 98;
+ case 173:
+ return target.kind === 173 &&
source.name.text === target.name.text &&
isMatchingReference(source.expression, target.expression);
}
return false;
}
function containsMatchingReference(source, target) {
- while (source.kind === 172) {
+ while (source.kind === 173) {
source = source.expression;
if (isMatchingReference(source, target)) {
return true;
@@ -24837,15 +26002,15 @@ var ts;
return false;
}
function containsMatchingReferenceDiscriminant(source, target) {
- return target.kind === 172 &&
+ return target.kind === 173 &&
containsMatchingReference(source, target.expression) &&
isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.text);
}
function getDeclaredTypeOfReference(expr) {
- if (expr.kind === 69) {
+ if (expr.kind === 70) {
return getTypeOfSymbol(getResolvedSymbol(expr));
}
- if (expr.kind === 172) {
+ if (expr.kind === 173) {
var type = getDeclaredTypeOfReference(expr.expression);
return type && getTypeOfPropertyOfType(type, expr.name.text);
}
@@ -24875,7 +26040,7 @@ var ts;
}
}
}
- if (callExpression.expression.kind === 172 &&
+ if (callExpression.expression.kind === 173 &&
isOrContainsMatchingReference(reference, callExpression.expression.expression)) {
return true;
}
@@ -25001,7 +26166,7 @@ var ts;
return createArrayType(checkIteratedTypeOrElementType(type, undefined, false) || unknownType);
}
function getAssignedTypeOfBinaryExpression(node) {
- return node.parent.kind === 170 || node.parent.kind === 253 ?
+ return node.parent.kind === 171 || node.parent.kind === 253 ?
getTypeWithDefault(getAssignedType(node), node.right) :
checkExpression(node.right);
}
@@ -25020,17 +26185,17 @@ var ts;
function getAssignedType(node) {
var parent = node.parent;
switch (parent.kind) {
- case 207:
- return stringType;
case 208:
+ return stringType;
+ case 209:
return checkRightHandSideOfForOf(parent.expression) || unknownType;
- case 187:
+ case 188:
return getAssignedTypeOfBinaryExpression(parent);
- case 181:
+ case 182:
return undefinedType;
- case 170:
+ case 171:
return getAssignedTypeOfArrayLiteralElement(parent, node);
- case 191:
+ case 192:
return getAssignedTypeOfSpreadElement(parent);
case 253:
return getAssignedTypeOfPropertyAssignment(parent);
@@ -25042,7 +26207,7 @@ var ts;
function getInitialTypeOfBindingElement(node) {
var pattern = node.parent;
var parentType = getInitialType(pattern.parent);
- var type = pattern.kind === 167 ?
+ var type = pattern.kind === 168 ?
getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) :
!node.dotDotDotToken ?
getTypeOfDestructuredArrayElement(parentType, ts.indexOf(pattern.elements, node)) :
@@ -25057,38 +26222,51 @@ var ts;
if (node.initializer) {
return getTypeOfInitializer(node.initializer);
}
- if (node.parent.parent.kind === 207) {
+ if (node.parent.parent.kind === 208) {
return stringType;
}
- if (node.parent.parent.kind === 208) {
+ if (node.parent.parent.kind === 209) {
return checkRightHandSideOfForOf(node.parent.parent.expression) || unknownType;
}
return unknownType;
}
function getInitialType(node) {
- return node.kind === 218 ?
+ return node.kind === 219 ?
getInitialTypeOfVariableDeclaration(node) :
getInitialTypeOfBindingElement(node);
}
function getInitialOrAssignedType(node) {
- return node.kind === 218 || node.kind === 169 ?
+ return node.kind === 219 || node.kind === 170 ?
getInitialType(node) :
getAssignedType(node);
}
+ function isEmptyArrayAssignment(node) {
+ return node.kind === 219 && node.initializer &&
+ isEmptyArrayLiteral(node.initializer) ||
+ node.kind !== 170 && node.parent.kind === 188 &&
+ isEmptyArrayLiteral(node.parent.right);
+ }
function getReferenceCandidate(node) {
switch (node.kind) {
- case 178:
+ case 179:
return getReferenceCandidate(node.expression);
- case 187:
+ case 188:
switch (node.operatorToken.kind) {
- case 56:
+ case 57:
return getReferenceCandidate(node.left);
- case 24:
+ case 25:
return getReferenceCandidate(node.right);
}
}
return node;
}
+ function getReferenceRoot(node) {
+ var parent = node.parent;
+ return parent.kind === 179 ||
+ parent.kind === 188 && parent.operatorToken.kind === 57 && parent.left === node ||
+ parent.kind === 188 && parent.operatorToken.kind === 25 && parent.right === node ?
+ getReferenceRoot(parent) : node;
+ }
function getTypeOfSwitchClause(clause) {
if (clause.kind === 249) {
var caseType = getRegularTypeOfLiteralType(checkExpression(clause.expression));
@@ -25159,24 +26337,88 @@ var ts;
function createFlowType(type, incomplete) {
return incomplete ? { flags: 0, type: type } : type;
}
+ function createEvolvingArrayType(elementType) {
+ var result = createObjectType(2097152);
+ result.elementType = elementType;
+ return result;
+ }
+ function getEvolvingArrayType(elementType) {
+ return evolvingArrayTypes[elementType.id] || (evolvingArrayTypes[elementType.id] = createEvolvingArrayType(elementType));
+ }
+ function addEvolvingArrayElementType(evolvingArrayType, node) {
+ var elementType = getBaseTypeOfLiteralType(checkExpression(node));
+ return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType]));
+ }
+ function isEvolvingArrayType(type) {
+ return !!(type.flags & 2097152 && type.elementType);
+ }
+ function createFinalArrayType(elementType) {
+ return elementType.flags & 8192 ?
+ autoArrayType :
+ createArrayType(elementType.flags & 524288 ?
+ getUnionType(elementType.types, true) :
+ elementType);
+ }
+ function getFinalArrayType(evolvingArrayType) {
+ return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType));
+ }
+ function finalizeEvolvingArrayType(type) {
+ return isEvolvingArrayType(type) ? getFinalArrayType(type) : type;
+ }
+ function getElementTypeOfEvolvingArrayType(type) {
+ return isEvolvingArrayType(type) ? type.elementType : neverType;
+ }
+ function isEvolvingArrayTypeList(types) {
+ var hasEvolvingArrayType = false;
+ for (var _i = 0, types_12 = types; _i < types_12.length; _i++) {
+ var t = types_12[_i];
+ if (!(t.flags & 8192)) {
+ if (!isEvolvingArrayType(t)) {
+ return false;
+ }
+ hasEvolvingArrayType = true;
+ }
+ }
+ return hasEvolvingArrayType;
+ }
+ function getUnionOrEvolvingArrayType(types, subtypeReduction) {
+ return isEvolvingArrayTypeList(types) ?
+ getEvolvingArrayType(getUnionType(ts.map(types, getElementTypeOfEvolvingArrayType))) :
+ getUnionType(ts.sameMap(types, finalizeEvolvingArrayType), subtypeReduction);
+ }
+ function isEvolvingArrayOperationTarget(node) {
+ var root = getReferenceRoot(node);
+ var parent = root.parent;
+ var isLengthPushOrUnshift = parent.kind === 173 && (parent.name.text === "length" ||
+ parent.parent.kind === 175 && ts.isPushOrUnshiftIdentifier(parent.name));
+ var isElementAssignment = parent.kind === 174 &&
+ parent.expression === root &&
+ parent.parent.kind === 188 &&
+ parent.parent.operatorToken.kind === 57 &&
+ parent.parent.left === parent &&
+ !ts.isAssignmentTarget(parent.parent) &&
+ isTypeAnyOrAllConstituentTypesHaveKind(checkExpression(parent.argumentExpression), 340 | 2048);
+ return isLengthPushOrUnshift || isElementAssignment;
+ }
function getFlowTypeOfReference(reference, declaredType, assumeInitialized, flowContainer) {
var key;
if (!reference.flowNode || assumeInitialized && !(declaredType.flags & 4178943)) {
return declaredType;
}
var initialType = assumeInitialized ? declaredType :
- declaredType === autoType ? undefinedType :
+ declaredType === autoType || declaredType === autoArrayType ? undefinedType :
includeFalsyTypes(declaredType, 2048);
var visitedFlowStart = visitedFlowCount;
- var result = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode));
+ var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode));
visitedFlowCount = visitedFlowStart;
- if (reference.parent.kind === 196 && getTypeWithFacts(result, 524288).flags & 8192) {
+ var resultType = isEvolvingArrayType(evolvedType) && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType);
+ if (reference.parent.kind === 197 && getTypeWithFacts(resultType, 524288).flags & 8192) {
return declaredType;
}
- return result;
+ return resultType;
function getTypeAtFlowNode(flow) {
while (true) {
- if (flow.flags & 512) {
+ if (flow.flags & 1024) {
for (var i = visitedFlowStart; i < visitedFlowCount; i++) {
if (visitedFlowNodes[i] === flow) {
return visitedFlowTypes[i];
@@ -25206,18 +26448,25 @@ var ts;
getTypeAtFlowBranchLabel(flow) :
getTypeAtFlowLoopLabel(flow);
}
+ else if (flow.flags & 256) {
+ type = getTypeAtFlowArrayMutation(flow);
+ if (!type) {
+ flow = flow.antecedent;
+ continue;
+ }
+ }
else if (flow.flags & 2) {
var container = flow.container;
- if (container && container !== flowContainer && reference.kind !== 172) {
+ if (container && container !== flowContainer && reference.kind !== 173) {
flow = container.flowNode;
continue;
}
type = initialType;
}
else {
- type = declaredType;
+ type = convertAutoToAny(declaredType);
}
- if (flow.flags & 512) {
+ if (flow.flags & 1024) {
visitedFlowNodes[visitedFlowCount] = flow;
visitedFlowTypes[visitedFlowCount] = type;
visitedFlowCount++;
@@ -25228,30 +26477,70 @@ var ts;
function getTypeAtFlowAssignment(flow) {
var node = flow.node;
if (isMatchingReference(reference, node)) {
- if (node.parent.kind === 185 || node.parent.kind === 186) {
+ if (node.parent.kind === 186 || node.parent.kind === 187) {
var flowType = getTypeAtFlowNode(flow.antecedent);
return createFlowType(getBaseTypeOfLiteralType(getTypeFromFlowType(flowType)), isIncomplete(flowType));
}
- return declaredType === autoType ? getBaseTypeOfLiteralType(getInitialOrAssignedType(node)) :
- declaredType.flags & 524288 ? getAssignmentReducedType(declaredType, getInitialOrAssignedType(node)) :
- declaredType;
+ if (declaredType === autoType || declaredType === autoArrayType) {
+ if (isEmptyArrayAssignment(node)) {
+ return getEvolvingArrayType(neverType);
+ }
+ var assignedType = getBaseTypeOfLiteralType(getInitialOrAssignedType(node));
+ return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
+ }
+ if (declaredType.flags & 524288) {
+ return getAssignmentReducedType(declaredType, getInitialOrAssignedType(node));
+ }
+ return declaredType;
}
if (containsMatchingReference(reference, node)) {
return declaredType;
}
return undefined;
}
+ function getTypeAtFlowArrayMutation(flow) {
+ var node = flow.node;
+ var expr = node.kind === 175 ?
+ node.expression.expression :
+ node.left.expression;
+ if (isMatchingReference(reference, getReferenceCandidate(expr))) {
+ var flowType = getTypeAtFlowNode(flow.antecedent);
+ var type = getTypeFromFlowType(flowType);
+ if (isEvolvingArrayType(type)) {
+ var evolvedType_1 = type;
+ if (node.kind === 175) {
+ for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) {
+ var arg = _a[_i];
+ evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg);
+ }
+ }
+ else {
+ var indexType = checkExpression(node.left.argumentExpression);
+ if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 340 | 2048)) {
+ evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, node.right);
+ }
+ }
+ return evolvedType_1 === type ? flowType : createFlowType(evolvedType_1, isIncomplete(flowType));
+ }
+ return flowType;
+ }
+ return undefined;
+ }
function getTypeAtFlowCondition(flow) {
var flowType = getTypeAtFlowNode(flow.antecedent);
var type = getTypeFromFlowType(flowType);
- if (!(type.flags & 8192)) {
- var assumeTrue = (flow.flags & 32) !== 0;
- type = narrowType(type, flow.expression, assumeTrue);
- if (type.flags & 8192 && isIncomplete(flowType)) {
- type = silentNeverType;
- }
+ if (type.flags & 8192) {
+ return flowType;
}
- return createFlowType(type, isIncomplete(flowType));
+ var assumeTrue = (flow.flags & 32) !== 0;
+ var nonEvolvingType = finalizeEvolvingArrayType(type);
+ var narrowedType = narrowType(nonEvolvingType, flow.expression, assumeTrue);
+ if (narrowedType === nonEvolvingType) {
+ return flowType;
+ }
+ var incomplete = isIncomplete(flowType);
+ var resultType = incomplete && narrowedType.flags & 8192 ? silentNeverType : narrowedType;
+ return createFlowType(resultType, incomplete);
}
function getTypeAtSwitchClause(flow) {
var flowType = getTypeAtFlowNode(flow.antecedent);
@@ -25286,7 +26575,7 @@ var ts;
seenIncomplete = true;
}
}
- return createFlowType(getUnionType(antecedentTypes, subtypeReduction), seenIncomplete);
+ return createFlowType(getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction), seenIncomplete);
}
function getTypeAtFlowLoopLabel(flow) {
var id = getFlowNodeId(flow);
@@ -25298,8 +26587,8 @@ var ts;
return cache[key];
}
for (var i = flowLoopStart; i < flowLoopCount; i++) {
- if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key) {
- return createFlowType(getUnionType(flowLoopTypes[i]), true);
+ if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key && flowLoopTypes[i].length) {
+ return createFlowType(getUnionOrEvolvingArrayType(flowLoopTypes[i], false), true);
}
}
var antecedentTypes = [];
@@ -25330,14 +26619,14 @@ var ts;
break;
}
}
- var result = getUnionType(antecedentTypes, subtypeReduction);
+ var result = getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction);
if (isIncomplete(firstAntecedentType)) {
return createFlowType(result, true);
}
return cache[key] = result;
}
function isMatchingReferenceDiscriminant(expr) {
- return expr.kind === 172 &&
+ return expr.kind === 173 &&
declaredType.flags & 524288 &&
isMatchingReference(reference, expr.expression) &&
isDiscriminantProperty(declaredType, expr.name.text);
@@ -25362,19 +26651,19 @@ var ts;
}
function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
switch (expr.operatorToken.kind) {
- case 56:
+ case 57:
return narrowTypeByTruthiness(type, expr.left, assumeTrue);
- case 30:
case 31:
case 32:
case 33:
+ case 34:
var operator_1 = expr.operatorToken.kind;
var left_1 = getReferenceCandidate(expr.left);
var right_1 = getReferenceCandidate(expr.right);
- if (left_1.kind === 182 && right_1.kind === 9) {
+ if (left_1.kind === 183 && right_1.kind === 9) {
return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue);
}
- if (right_1.kind === 182 && left_1.kind === 9) {
+ if (right_1.kind === 183 && left_1.kind === 9) {
return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue);
}
if (isMatchingReference(reference, left_1)) {
@@ -25393,9 +26682,9 @@ var ts;
return declaredType;
}
break;
- case 91:
+ case 92:
return narrowTypeByInstanceof(type, expr, assumeTrue);
- case 24:
+ case 25:
return narrowType(type, expr.right, assumeTrue);
}
return type;
@@ -25404,7 +26693,7 @@ var ts;
if (type.flags & 1) {
return type;
}
- if (operator === 31 || operator === 33) {
+ if (operator === 32 || operator === 34) {
assumeTrue = !assumeTrue;
}
var valueType = checkExpression(value);
@@ -25412,10 +26701,10 @@ var ts;
if (!strictNullChecks) {
return type;
}
- var doubleEquals = operator === 30 || operator === 31;
+ var doubleEquals = operator === 31 || operator === 32;
var facts = doubleEquals ?
assumeTrue ? 65536 : 524288 :
- value.kind === 93 ?
+ value.kind === 94 ?
assumeTrue ? 32768 : 262144 :
assumeTrue ? 16384 : 131072;
return getTypeWithFacts(type, facts);
@@ -25441,7 +26730,7 @@ var ts;
}
return type;
}
- if (operator === 31 || operator === 33) {
+ if (operator === 32 || operator === 34) {
assumeTrue = !assumeTrue;
}
if (assumeTrue && !(type.flags & 524288)) {
@@ -25552,7 +26841,7 @@ var ts;
}
else {
var invokedExpression = skipParenthesizedNodes(callExpression.expression);
- if (invokedExpression.kind === 173 || invokedExpression.kind === 172) {
+ if (invokedExpression.kind === 174 || invokedExpression.kind === 173) {
var accessExpression = invokedExpression;
var possibleReference = skipParenthesizedNodes(accessExpression.expression);
if (isMatchingReference(reference, possibleReference)) {
@@ -25567,18 +26856,18 @@ var ts;
}
function narrowType(type, expr, assumeTrue) {
switch (expr.kind) {
- case 69:
- case 97:
- case 172:
+ case 70:
+ case 98:
+ case 173:
return narrowTypeByTruthiness(type, expr, assumeTrue);
- case 174:
+ case 175:
return narrowTypeByTypePredicate(type, expr, assumeTrue);
- case 178:
+ case 179:
return narrowType(type, expr.expression, assumeTrue);
- case 187:
+ case 188:
return narrowTypeByBinaryExpression(type, expr, assumeTrue);
- case 185:
- if (expr.operator === 49) {
+ case 186:
+ if (expr.operator === 50) {
return narrowType(type, expr.operand, !assumeTrue);
}
break;
@@ -25587,7 +26876,7 @@ var ts;
}
}
function getTypeOfSymbolAtLocation(symbol, location) {
- if (location.kind === 69) {
+ if (location.kind === 70) {
if (ts.isRightSideOfQualifiedNameOrPropertyAccess(location)) {
location = location.parent;
}
@@ -25601,7 +26890,7 @@ var ts;
return getTypeOfSymbol(symbol);
}
function skipParenthesizedNodes(expression) {
- while (expression.kind === 178) {
+ while (expression.kind === 179) {
expression = expression.expression;
}
return expression;
@@ -25610,9 +26899,9 @@ var ts;
while (true) {
node = node.parent;
if (ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) ||
- node.kind === 226 ||
+ node.kind === 227 ||
node.kind === 256 ||
- node.kind === 145) {
+ node.kind === 146) {
return node;
}
}
@@ -25640,10 +26929,10 @@ var ts;
}
}
function markParameterAssignments(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
if (ts.isAssignmentTarget(node)) {
var symbol = getResolvedSymbol(node);
- if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 142) {
+ if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 143) {
symbol.isAssigned = true;
}
}
@@ -25652,12 +26941,15 @@ var ts;
ts.forEachChild(node, markParameterAssignments);
}
}
+ function isConstVariable(symbol) {
+ return symbol.flags & 3 && (getDeclarationNodeFlagsFromSymbol(symbol) & 2) !== 0 && getTypeOfSymbol(symbol) !== autoArrayType;
+ }
function checkIdentifier(node) {
var symbol = getResolvedSymbol(node);
if (symbol === argumentsSymbol) {
var container = ts.getContainingFunction(node);
if (languageVersion < 2) {
- if (container.kind === 180) {
+ if (container.kind === 181) {
error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
}
else if (ts.hasModifier(container, 256)) {
@@ -25675,7 +26967,7 @@ var ts;
if (localOrExportSymbol.flags & 32) {
var declaration_1 = localOrExportSymbol.valueDeclaration;
if (languageVersion === 2
- && declaration_1.kind === 221
+ && declaration_1.kind === 222
&& ts.nodeIsDecorated(declaration_1)) {
var container = ts.getContainingClass(node);
while (container !== undefined) {
@@ -25687,11 +26979,11 @@ var ts;
container = ts.getContainingClass(container);
}
}
- else if (declaration_1.kind === 192) {
+ else if (declaration_1.kind === 193) {
var container = ts.getThisContainer(node, false);
while (container !== undefined) {
if (container.parent === declaration_1) {
- if (container.kind === 145 && ts.hasModifier(container, 32)) {
+ if (container.kind === 146 && ts.hasModifier(container, 32)) {
getNodeLinks(declaration_1).flags |= 8388608;
getNodeLinks(node).flags |= 16777216;
}
@@ -25709,28 +27001,26 @@ var ts;
if (!(localOrExportSymbol.flags & 3) || ts.isAssignmentTarget(node) || !declaration) {
return type;
}
- var isParameter = ts.getRootDeclaration(declaration).kind === 142;
+ var isParameter = ts.getRootDeclaration(declaration).kind === 143;
var declarationContainer = getControlFlowContainer(declaration);
var flowContainer = getControlFlowContainer(node);
var isOuterVariable = flowContainer !== declarationContainer;
- while (flowContainer !== declarationContainer &&
- (flowContainer.kind === 179 ||
- flowContainer.kind === 180 ||
- ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) &&
- (isReadonlySymbol(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) {
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 180 ||
+ flowContainer.kind === 181 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) &&
+ (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) {
flowContainer = getControlFlowContainer(flowContainer);
}
var assumeInitialized = isParameter || isOuterVariable ||
- type !== autoType && (!strictNullChecks || (type.flags & 1) !== 0) ||
+ type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1) !== 0) ||
ts.isInAmbientContext(declaration);
var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer);
- if (type === autoType) {
- if (flowType === autoType) {
+ if (type === autoType || type === autoArrayType) {
+ if (flowType === autoType || flowType === autoArrayType) {
if (compilerOptions.noImplicitAny) {
- error(declaration.name, ts.Diagnostics.Variable_0_implicitly_has_type_any_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol));
- error(node, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(anyType));
+ error(declaration.name, ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType));
+ error(node, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType));
}
- return anyType;
+ return convertAutoToAny(flowType);
}
}
else if (!assumeInitialized && !(getFalsyFlags(type) & 2048) && getFalsyFlags(flowType) & 2048) {
@@ -25770,8 +27060,8 @@ var ts;
if (usedInFunction) {
getNodeLinks(current).flags |= 65536;
}
- if (container.kind === 206 &&
- ts.getAncestor(symbol.valueDeclaration, 219).parent === container &&
+ if (container.kind === 207 &&
+ ts.getAncestor(symbol.valueDeclaration, 220).parent === container &&
isAssignedInBodyOfForStatement(node, container)) {
getNodeLinks(symbol.valueDeclaration).flags |= 2097152;
}
@@ -25783,16 +27073,16 @@ var ts;
}
function isAssignedInBodyOfForStatement(node, container) {
var current = node;
- while (current.parent.kind === 178) {
+ while (current.parent.kind === 179) {
current = current.parent;
}
var isAssigned = false;
if (ts.isAssignmentTarget(current)) {
isAssigned = true;
}
- else if ((current.parent.kind === 185 || current.parent.kind === 186)) {
+ else if ((current.parent.kind === 186 || current.parent.kind === 187)) {
var expr = current.parent;
- isAssigned = expr.operator === 41 || expr.operator === 42;
+ isAssigned = expr.operator === 42 || expr.operator === 43;
}
if (!isAssigned) {
return false;
@@ -25809,7 +27099,7 @@ var ts;
}
function captureLexicalThis(node, container) {
getNodeLinks(node).flags |= 2;
- if (container.kind === 145 || container.kind === 148) {
+ if (container.kind === 146 || container.kind === 149) {
var classNode = container.parent;
getNodeLinks(classNode).flags |= 4;
}
@@ -25843,7 +27133,7 @@ var ts;
function checkThisExpression(node) {
var container = ts.getThisContainer(node, true);
var needToCaptureLexicalThis = false;
- if (container.kind === 148) {
+ if (container.kind === 149) {
var containingClassDecl = container.parent;
var baseTypeNode = ts.getClassExtendsHeritageClauseElement(containingClassDecl);
if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) {
@@ -25853,29 +27143,29 @@ var ts;
}
}
}
- if (container.kind === 180) {
+ if (container.kind === 181) {
container = ts.getThisContainer(container, false);
needToCaptureLexicalThis = (languageVersion < 2);
}
switch (container.kind) {
- case 225:
+ case 226:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);
break;
- case 224:
+ case 225:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location);
break;
- case 148:
+ case 149:
if (isInConstructorArgumentInitializer(node, container)) {
error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments);
}
break;
+ case 146:
case 145:
- case 144:
if (ts.getModifierFlags(container) & 32) {
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer);
}
break;
- case 140:
+ case 141:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name);
break;
}
@@ -25884,7 +27174,7 @@ var ts;
}
if (ts.isFunctionLike(container) &&
(!isInParameterInitializerBeforeContainingFunction(node) || ts.getThisParameter(container))) {
- if (container.kind === 179 &&
+ if (container.kind === 180 &&
ts.isInJavaScriptFile(container.parent) &&
ts.getSpecialPropertyAssignmentKind(container.parent) === 3) {
var className = container.parent
@@ -25896,7 +27186,7 @@ var ts;
return getInferredClassType(classSymbol);
}
}
- var thisType = getThisTypeOfDeclaration(container);
+ var thisType = getThisTypeOfDeclaration(container) || getContextualThisParameterType(container);
if (thisType) {
return thisType;
}
@@ -25928,18 +27218,18 @@ var ts;
}
function isInConstructorArgumentInitializer(node, constructorDecl) {
for (var n = node; n && n !== constructorDecl; n = n.parent) {
- if (n.kind === 142) {
+ if (n.kind === 143) {
return true;
}
}
return false;
}
function checkSuperExpression(node) {
- var isCallExpression = node.parent.kind === 174 && node.parent.expression === node;
+ var isCallExpression = node.parent.kind === 175 && node.parent.expression === node;
var container = ts.getSuperContainer(node, true);
var needToCaptureLexicalThis = false;
if (!isCallExpression) {
- while (container && container.kind === 180) {
+ while (container && container.kind === 181) {
container = ts.getSuperContainer(container, true);
needToCaptureLexicalThis = languageVersion < 2;
}
@@ -25948,16 +27238,16 @@ var ts;
var nodeCheckFlag = 0;
if (!canUseSuperExpression) {
var current = node;
- while (current && current !== container && current.kind !== 140) {
+ while (current && current !== container && current.kind !== 141) {
current = current.parent;
}
- if (current && current.kind === 140) {
+ if (current && current.kind === 141) {
error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name);
}
else if (isCallExpression) {
error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors);
}
- else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 171)) {
+ else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 172)) {
error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions);
}
else {
@@ -25972,7 +27262,7 @@ var ts;
nodeCheckFlag = 256;
}
getNodeLinks(node).flags |= nodeCheckFlag;
- if (container.kind === 147 && ts.getModifierFlags(container) & 256) {
+ if (container.kind === 148 && ts.getModifierFlags(container) & 256) {
if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) {
getNodeLinks(container).flags |= 4096;
}
@@ -25983,7 +27273,7 @@ var ts;
if (needToCaptureLexicalThis) {
captureLexicalThis(node.parent, container);
}
- if (container.parent.kind === 171) {
+ if (container.parent.kind === 172) {
if (languageVersion < 2) {
error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher);
return unknownType;
@@ -26001,7 +27291,7 @@ var ts;
}
return unknownType;
}
- if (container.kind === 148 && isInConstructorArgumentInitializer(node, container)) {
+ if (container.kind === 149 && isInConstructorArgumentInitializer(node, container)) {
error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
return unknownType;
}
@@ -26013,35 +27303,38 @@ var ts;
return false;
}
if (isCallExpression) {
- return container.kind === 148;
+ return container.kind === 149;
}
else {
- if (ts.isClassLike(container.parent) || container.parent.kind === 171) {
+ if (ts.isClassLike(container.parent) || container.parent.kind === 172) {
if (ts.getModifierFlags(container) & 32) {
- return container.kind === 147 ||
- container.kind === 146 ||
- container.kind === 149 ||
- container.kind === 150;
+ return container.kind === 148 ||
+ container.kind === 147 ||
+ container.kind === 150 ||
+ container.kind === 151;
}
else {
- return container.kind === 147 ||
- container.kind === 146 ||
- container.kind === 149 ||
+ return container.kind === 148 ||
+ container.kind === 147 ||
container.kind === 150 ||
+ container.kind === 151 ||
+ container.kind === 146 ||
container.kind === 145 ||
- container.kind === 144 ||
- container.kind === 148;
+ container.kind === 149;
}
}
}
return false;
}
}
- function getContextualThisParameter(func) {
- if (isContextSensitiveFunctionOrObjectLiteralMethod(func) && func.kind !== 180) {
+ function getContextualThisParameterType(func) {
+ if (isContextSensitiveFunctionOrObjectLiteralMethod(func) && func.kind !== 181) {
var contextualSignature = getContextualSignature(func);
if (contextualSignature) {
- return contextualSignature.thisParameter;
+ var thisParameter = contextualSignature.thisParameter;
+ if (thisParameter) {
+ return getTypeOfSymbol(thisParameter);
+ }
}
}
return undefined;
@@ -26091,7 +27384,7 @@ var ts;
if (declaration.type) {
return getTypeFromTypeNode(declaration.type);
}
- if (declaration.kind === 142) {
+ if (declaration.kind === 143) {
var type = getContextuallyTypedParameterType(declaration);
if (type) {
return type;
@@ -26143,7 +27436,7 @@ var ts;
}
function isInParameterInitializerBeforeContainingFunction(node) {
while (node.parent && !ts.isFunctionLike(node.parent)) {
- if (node.parent.kind === 142 && node.parent.initializer === node) {
+ if (node.parent.kind === 143 && node.parent.initializer === node) {
return true;
}
node = node.parent;
@@ -26152,8 +27445,8 @@ var ts;
}
function getContextualReturnType(functionDecl) {
if (functionDecl.type ||
- functionDecl.kind === 148 ||
- functionDecl.kind === 149 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 150))) {
+ functionDecl.kind === 149 ||
+ functionDecl.kind === 150 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 151))) {
return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl));
}
var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl);
@@ -26172,7 +27465,7 @@ var ts;
return undefined;
}
function getContextualTypeForSubstitutionExpression(template, substitutionExpression) {
- if (template.parent.kind === 176) {
+ if (template.parent.kind === 177) {
return getContextualTypeForArgument(template.parent, substitutionExpression);
}
return undefined;
@@ -26180,7 +27473,7 @@ var ts;
function getContextualTypeForBinaryOperand(node) {
var binaryExpression = node.parent;
var operator = binaryExpression.operatorToken.kind;
- if (operator >= 56 && operator <= 68) {
+ if (operator >= 57 && operator <= 69) {
if (ts.getSpecialPropertyAssignmentKind(binaryExpression) !== 0) {
return undefined;
}
@@ -26188,14 +27481,14 @@ var ts;
return checkExpression(binaryExpression.left);
}
}
- else if (operator === 52) {
+ else if (operator === 53) {
var type = getContextualType(binaryExpression);
if (!type && node === binaryExpression.right) {
type = checkExpression(binaryExpression.left);
}
return type;
}
- else if (operator === 51 || operator === 24) {
+ else if (operator === 52 || operator === 25) {
if (node === binaryExpression.right) {
return getContextualType(binaryExpression);
}
@@ -26209,8 +27502,8 @@ var ts;
var types = type.types;
var mappedType;
var mappedTypes;
- for (var _i = 0, types_12 = types; _i < types_12.length; _i++) {
- var current = types_12[_i];
+ for (var _i = 0, types_13 = types; _i < types_13.length; _i++) {
+ var current = types_13[_i];
var t = mapper(current);
if (t) {
if (!mappedType) {
@@ -26304,36 +27597,36 @@ var ts;
}
var parent = node.parent;
switch (parent.kind) {
- case 218:
- case 142:
+ case 219:
+ case 143:
+ case 146:
case 145:
- case 144:
- case 169:
+ case 170:
return getContextualTypeForInitializerExpression(node);
- case 180:
- case 211:
+ case 181:
+ case 212:
return getContextualTypeForReturnExpression(node);
- case 190:
+ case 191:
return getContextualTypeForYieldOperand(parent);
- case 174:
case 175:
+ case 176:
return getContextualTypeForArgument(parent, node);
- case 177:
- case 195:
+ case 178:
+ case 196:
return getTypeFromTypeNode(parent.type);
- case 187:
+ case 188:
return getContextualTypeForBinaryOperand(node);
case 253:
case 254:
return getContextualTypeForObjectLiteralElement(parent);
- case 170:
+ case 171:
return getContextualTypeForElementExpression(node);
- case 188:
+ case 189:
return getContextualTypeForConditionalOperand(node);
- case 197:
- ts.Debug.assert(parent.parent.kind === 189);
+ case 198:
+ ts.Debug.assert(parent.parent.kind === 190);
return getContextualTypeForSubstitutionExpression(parent.parent, node);
- case 178:
+ case 179:
return getContextualType(parent);
case 248:
return getContextualType(parent);
@@ -26353,7 +27646,7 @@ var ts;
}
}
function isFunctionExpressionOrArrowFunction(node) {
- return node.kind === 179 || node.kind === 180;
+ return node.kind === 180 || node.kind === 181;
}
function getContextualSignatureForFunctionLikeDeclaration(node) {
return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node)
@@ -26366,7 +27659,7 @@ var ts;
getApparentTypeOfContextualType(node);
}
function getContextualSignature(node) {
- ts.Debug.assert(node.kind !== 147 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 148 || ts.isObjectLiteralMethod(node));
var type = getContextualTypeForFunctionLikeDeclaration(node);
if (!type) {
return undefined;
@@ -26376,8 +27669,8 @@ var ts;
}
var signatureList;
var types = type.types;
- for (var _i = 0, types_13 = types; _i < types_13.length; _i++) {
- var current = types_13[_i];
+ for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
+ var current = types_14[_i];
var signature = getNonGenericSignature(current);
if (signature) {
if (!signatureList) {
@@ -26407,8 +27700,8 @@ var ts;
return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false);
}
function hasDefaultValue(node) {
- return (node.kind === 169 && !!node.initializer) ||
- (node.kind === 187 && node.operatorToken.kind === 56);
+ return (node.kind === 170 && !!node.initializer) ||
+ (node.kind === 188 && node.operatorToken.kind === 57);
}
function checkArrayLiteral(node, contextualMapper) {
var elements = node.elements;
@@ -26417,7 +27710,7 @@ var ts;
var inDestructuringPattern = ts.isAssignmentTarget(node);
for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {
var e = elements_1[_i];
- if (inDestructuringPattern && e.kind === 191) {
+ if (inDestructuringPattern && e.kind === 192) {
var restArrayType = checkExpression(e.expression, contextualMapper);
var restElementType = getIndexTypeOfType(restArrayType, 1) ||
(languageVersion >= 2 ? getElementTypeOfIterable(restArrayType, undefined) : undefined);
@@ -26429,7 +27722,7 @@ var ts;
var type = checkExpressionForMutableLocation(e, contextualMapper);
elementTypes.push(type);
}
- hasSpreadElement = hasSpreadElement || e.kind === 191;
+ hasSpreadElement = hasSpreadElement || e.kind === 192;
}
if (!hasSpreadElement) {
if (inDestructuringPattern && elementTypes.length) {
@@ -26440,7 +27733,7 @@ var ts;
var contextualType = getApparentTypeOfContextualType(node);
if (contextualType && contextualTypeIsTupleLikeType(contextualType)) {
var pattern = contextualType.pattern;
- if (pattern && (pattern.kind === 168 || pattern.kind === 170)) {
+ if (pattern && (pattern.kind === 169 || pattern.kind === 171)) {
var patternElements = pattern.elements;
for (var i = elementTypes.length; i < patternElements.length; i++) {
var patternElement = patternElements[i];
@@ -26448,7 +27741,7 @@ var ts;
elementTypes.push(contextualType.typeArguments[i]);
}
else {
- if (patternElement.kind !== 193) {
+ if (patternElement.kind !== 194) {
error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value);
}
elementTypes.push(unknownType);
@@ -26465,7 +27758,7 @@ var ts;
strictNullChecks ? neverType : undefinedWideningType);
}
function isNumericName(name) {
- return name.kind === 140 ? isNumericComputedName(name) : isNumericLiteralName(name.text);
+ return name.kind === 141 ? isNumericComputedName(name) : isNumericLiteralName(name.text);
}
function isNumericComputedName(name) {
return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), 340);
@@ -26509,7 +27802,7 @@ var ts;
var propertiesArray = [];
var contextualType = getApparentTypeOfContextualType(node);
var contextualTypeHasPattern = contextualType && contextualType.pattern &&
- (contextualType.pattern.kind === 167 || contextualType.pattern.kind === 171);
+ (contextualType.pattern.kind === 168 || contextualType.pattern.kind === 172);
var typeFlags = 0;
var patternWithComputedProperties = false;
var hasComputedStringProperty = false;
@@ -26524,7 +27817,7 @@ var ts;
if (memberDecl.kind === 253) {
type = checkPropertyAssignment(memberDecl, contextualMapper);
}
- else if (memberDecl.kind === 147) {
+ else if (memberDecl.kind === 148) {
type = checkObjectLiteralMethod(memberDecl, contextualMapper);
}
else {
@@ -26563,7 +27856,7 @@ var ts;
member = prop;
}
else {
- ts.Debug.assert(memberDecl.kind === 149 || memberDecl.kind === 150);
+ ts.Debug.assert(memberDecl.kind === 150 || memberDecl.kind === 151);
checkAccessorDeclaration(memberDecl);
}
if (ts.hasDynamicName(memberDecl)) {
@@ -26622,10 +27915,10 @@ var ts;
case 248:
checkJsxExpression(child);
break;
- case 241:
+ case 242:
checkJsxElement(child);
break;
- case 242:
+ case 243:
checkJsxSelfClosingElement(child);
break;
}
@@ -26636,7 +27929,7 @@ var ts;
return name.indexOf("-") < 0;
}
function isJsxIntrinsicIdentifier(tagName) {
- if (tagName.kind === 172 || tagName.kind === 97) {
+ if (tagName.kind === 173 || tagName.kind === 98) {
return false;
}
else {
@@ -26739,7 +28032,7 @@ var ts;
return unknownType;
}
}
- return getUnionType(signatures.map(getReturnTypeOfSignature), true);
+ return getUnionType(ts.map(signatures, getReturnTypeOfSignature), true);
}
function getJsxElementPropertiesName() {
var jsxNamespace = getGlobalSymbol(JsxNames.JSX, 1920, undefined);
@@ -26768,7 +28061,7 @@ var ts;
}
if (elemType.flags & 524288) {
var types = elemType.types;
- return getUnionType(types.map(function (type) {
+ return getUnionType(ts.map(types, function (type) {
return getResolvedJsxType(node, type, elemClassType);
}), true);
}
@@ -26944,7 +28237,7 @@ var ts;
}
}
function getDeclarationKindFromSymbol(s) {
- return s.valueDeclaration ? s.valueDeclaration.kind : 145;
+ return s.valueDeclaration ? s.valueDeclaration.kind : 146;
}
function getDeclarationModifierFlagsFromSymbol(s) {
return s.valueDeclaration ? ts.getCombinedModifierFlags(s.valueDeclaration) : s.flags & 134217728 ? 4 | 32 : 0;
@@ -26955,11 +28248,11 @@ var ts;
function checkClassPropertyAccess(node, left, type, prop) {
var flags = getDeclarationModifierFlagsFromSymbol(prop);
var declaringClass = getDeclaredTypeOfSymbol(getParentOfSymbol(prop));
- var errorNode = node.kind === 172 || node.kind === 218 ?
+ var errorNode = node.kind === 173 || node.kind === 219 ?
node.name :
node.right;
- if (left.kind === 95) {
- if (languageVersion < 2 && getDeclarationKindFromSymbol(prop) !== 147) {
+ if (left.kind === 96) {
+ if (languageVersion < 2 && getDeclarationKindFromSymbol(prop) !== 148) {
error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword);
return false;
}
@@ -26979,7 +28272,7 @@ var ts;
}
return true;
}
- if (left.kind === 95) {
+ if (left.kind === 96) {
return true;
}
var enclosingClass = forEachEnclosingClass(node, function (enclosingDeclaration) {
@@ -27053,7 +28346,7 @@ var ts;
checkClassPropertyAccess(node, left, apparentType, prop);
}
var propType = getTypeOfSymbol(prop);
- if (node.kind !== 172 || ts.isAssignmentTarget(node) ||
+ if (node.kind !== 173 || ts.isAssignmentTarget(node) ||
!(prop.flags & (3 | 4 | 98304)) &&
!(prop.flags & 8192 && propType.flags & 524288)) {
return propType;
@@ -27075,7 +28368,7 @@ var ts;
}
}
function isValidPropertyAccess(node, propertyName) {
- var left = node.kind === 172
+ var left = node.kind === 173
? node.expression
: node.left;
var type = checkExpression(left);
@@ -27089,13 +28382,13 @@ var ts;
}
function getForInVariableSymbol(node) {
var initializer = node.initializer;
- if (initializer.kind === 219) {
+ if (initializer.kind === 220) {
var variable = initializer.declarations[0];
if (variable && !ts.isBindingPattern(variable.name)) {
return getSymbolOfNode(variable);
}
}
- else if (initializer.kind === 69) {
+ else if (initializer.kind === 70) {
return getResolvedSymbol(initializer);
}
return undefined;
@@ -27105,13 +28398,13 @@ var ts;
}
function isForInVariableForNumericPropertyNames(expr) {
var e = skipParenthesizedNodes(expr);
- if (e.kind === 69) {
+ if (e.kind === 70) {
var symbol = getResolvedSymbol(e);
if (symbol.flags & 3) {
var child = expr;
var node = expr.parent;
while (node) {
- if (node.kind === 207 &&
+ if (node.kind === 208 &&
child === node.statement &&
getForInVariableSymbol(node) === symbol &&
hasNumericPropertyNames(checkExpression(node.expression))) {
@@ -27127,7 +28420,7 @@ var ts;
function checkIndexedAccess(node) {
if (!node.argumentExpression) {
var sourceFile = ts.getSourceFileOfNode(node);
- if (node.parent.kind === 175 && node.parent.expression === node) {
+ if (node.parent.kind === 176 && node.parent.expression === node) {
var start = ts.skipTrivia(sourceFile.text, node.expression.end);
var end = node.end;
grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead);
@@ -27191,7 +28484,7 @@ var ts;
if (indexArgumentExpression.kind === 9 || indexArgumentExpression.kind === 8) {
return indexArgumentExpression.text;
}
- if (indexArgumentExpression.kind === 173 || indexArgumentExpression.kind === 172) {
+ if (indexArgumentExpression.kind === 174 || indexArgumentExpression.kind === 173) {
var value = getConstantValue(indexArgumentExpression);
if (value !== undefined) {
return value.toString();
@@ -27234,10 +28527,10 @@ var ts;
return true;
}
function resolveUntypedCall(node) {
- if (node.kind === 176) {
+ if (node.kind === 177) {
checkExpression(node.template);
}
- else if (node.kind !== 143) {
+ else if (node.kind !== 144) {
ts.forEach(node.arguments, function (argument) {
checkExpression(argument);
});
@@ -27288,7 +28581,7 @@ var ts;
function getSpreadArgumentIndex(args) {
for (var i = 0; i < args.length; i++) {
var arg = args[i];
- if (arg && arg.kind === 191) {
+ if (arg && arg.kind === 192) {
return i;
}
}
@@ -27301,11 +28594,11 @@ var ts;
var callIsIncomplete;
var isDecorator;
var spreadArgIndex = -1;
- if (node.kind === 176) {
+ if (node.kind === 177) {
var tagExpression = node;
argCount = args.length;
typeArguments = undefined;
- if (tagExpression.template.kind === 189) {
+ if (tagExpression.template.kind === 190) {
var templateExpression = tagExpression.template;
var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans);
ts.Debug.assert(lastSpan !== undefined);
@@ -27313,11 +28606,11 @@ var ts;
}
else {
var templateLiteral = tagExpression.template;
- ts.Debug.assert(templateLiteral.kind === 11);
+ ts.Debug.assert(templateLiteral.kind === 12);
callIsIncomplete = !!templateLiteral.isUnterminated;
}
}
- else if (node.kind === 143) {
+ else if (node.kind === 144) {
isDecorator = true;
typeArguments = undefined;
argCount = getEffectiveArgumentCount(node, undefined, signature);
@@ -27325,7 +28618,7 @@ var ts;
else {
var callExpression = node;
if (!callExpression.arguments) {
- ts.Debug.assert(callExpression.kind === 175);
+ ts.Debug.assert(callExpression.kind === 176);
return signature.minArgumentCount === 0;
}
argCount = signatureHelpTrailingComma ? args.length + 1 : args.length;
@@ -27384,9 +28677,9 @@ var ts;
var argCount = getEffectiveArgumentCount(node, args, signature);
for (var i = 0; i < argCount; i++) {
var arg = getEffectiveArgument(node, args, i);
- if (arg === undefined || arg.kind !== 193) {
+ if (arg === undefined || arg.kind !== 194) {
var paramType = getTypeAtPosition(signature, i);
- var argType = getEffectiveArgumentType(node, i, arg);
+ var argType = getEffectiveArgumentType(node, i);
if (argType === undefined) {
var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper;
argType = checkExpressionWithContextualType(arg, paramType, mapper);
@@ -27431,7 +28724,7 @@ var ts;
}
function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) {
var thisType = getThisTypeOfSignature(signature);
- if (thisType && thisType !== voidType && node.kind !== 175) {
+ if (thisType && thisType !== voidType && node.kind !== 176) {
var thisArgumentNode = getThisArgumentOfCall(node);
var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType;
var errorNode = reportErrors ? (thisArgumentNode || node) : undefined;
@@ -27444,9 +28737,9 @@ var ts;
var argCount = getEffectiveArgumentCount(node, args, signature);
for (var i = 0; i < argCount; i++) {
var arg = getEffectiveArgument(node, args, i);
- if (arg === undefined || arg.kind !== 193) {
+ if (arg === undefined || arg.kind !== 194) {
var paramType = getTypeAtPosition(signature, i);
- var argType = getEffectiveArgumentType(node, i, arg);
+ var argType = getEffectiveArgumentType(node, i);
if (argType === undefined) {
argType = checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined);
}
@@ -27459,28 +28752,28 @@ var ts;
return true;
}
function getThisArgumentOfCall(node) {
- if (node.kind === 174) {
+ if (node.kind === 175) {
var callee = node.expression;
- if (callee.kind === 172) {
+ if (callee.kind === 173) {
return callee.expression;
}
- else if (callee.kind === 173) {
+ else if (callee.kind === 174) {
return callee.expression;
}
}
}
function getEffectiveCallArguments(node) {
var args;
- if (node.kind === 176) {
+ if (node.kind === 177) {
var template = node.template;
args = [undefined];
- if (template.kind === 189) {
+ if (template.kind === 190) {
ts.forEach(template.templateSpans, function (span) {
args.push(span.expression);
});
}
}
- else if (node.kind === 143) {
+ else if (node.kind === 144) {
return undefined;
}
else {
@@ -27489,21 +28782,21 @@ var ts;
return args;
}
function getEffectiveArgumentCount(node, args, signature) {
- if (node.kind === 143) {
+ if (node.kind === 144) {
switch (node.parent.kind) {
- case 221:
- case 192:
+ case 222:
+ case 193:
return 1;
- case 145:
+ case 146:
return 2;
- case 147:
- case 149:
+ case 148:
case 150:
+ case 151:
if (languageVersion === 0) {
return 2;
}
return signature.parameters.length >= 3 ? 3 : 2;
- case 142:
+ case 143:
return 3;
}
}
@@ -27512,48 +28805,48 @@ var ts;
}
}
function getEffectiveDecoratorFirstArgumentType(node) {
- if (node.kind === 221) {
+ if (node.kind === 222) {
var classSymbol = getSymbolOfNode(node);
return getTypeOfSymbol(classSymbol);
}
- if (node.kind === 142) {
+ if (node.kind === 143) {
node = node.parent;
- if (node.kind === 148) {
+ if (node.kind === 149) {
var classSymbol = getSymbolOfNode(node);
return getTypeOfSymbol(classSymbol);
}
}
- if (node.kind === 145 ||
- node.kind === 147 ||
- node.kind === 149 ||
- node.kind === 150) {
+ if (node.kind === 146 ||
+ node.kind === 148 ||
+ node.kind === 150 ||
+ node.kind === 151) {
return getParentTypeOfClassElement(node);
}
ts.Debug.fail("Unsupported decorator target.");
return unknownType;
}
function getEffectiveDecoratorSecondArgumentType(node) {
- if (node.kind === 221) {
+ if (node.kind === 222) {
ts.Debug.fail("Class decorators should not have a second synthetic argument.");
return unknownType;
}
- if (node.kind === 142) {
+ if (node.kind === 143) {
node = node.parent;
- if (node.kind === 148) {
+ if (node.kind === 149) {
return anyType;
}
}
- if (node.kind === 145 ||
- node.kind === 147 ||
- node.kind === 149 ||
- node.kind === 150) {
+ if (node.kind === 146 ||
+ node.kind === 148 ||
+ node.kind === 150 ||
+ node.kind === 151) {
var element = node;
switch (element.name.kind) {
- case 69:
+ case 70:
case 8:
case 9:
return getLiteralTypeForText(32, element.name.text);
- case 140:
+ case 141:
var nameType = checkComputedPropertyName(element.name);
if (isTypeOfKind(nameType, 512)) {
return nameType;
@@ -27570,20 +28863,20 @@ var ts;
return unknownType;
}
function getEffectiveDecoratorThirdArgumentType(node) {
- if (node.kind === 221) {
+ if (node.kind === 222) {
ts.Debug.fail("Class decorators should not have a third synthetic argument.");
return unknownType;
}
- if (node.kind === 142) {
+ if (node.kind === 143) {
return numberType;
}
- if (node.kind === 145) {
+ if (node.kind === 146) {
ts.Debug.fail("Property decorators should not have a third synthetic argument.");
return unknownType;
}
- if (node.kind === 147 ||
- node.kind === 149 ||
- node.kind === 150) {
+ if (node.kind === 148 ||
+ node.kind === 150 ||
+ node.kind === 151) {
var propertyType = getTypeOfNode(node);
return createTypedPropertyDescriptorType(propertyType);
}
@@ -27603,27 +28896,27 @@ var ts;
ts.Debug.fail("Decorators should not have a fourth synthetic argument.");
return unknownType;
}
- function getEffectiveArgumentType(node, argIndex, arg) {
- if (node.kind === 143) {
+ function getEffectiveArgumentType(node, argIndex) {
+ if (node.kind === 144) {
return getEffectiveDecoratorArgumentType(node, argIndex);
}
- else if (argIndex === 0 && node.kind === 176) {
+ else if (argIndex === 0 && node.kind === 177) {
return getGlobalTemplateStringsArrayType();
}
return undefined;
}
function getEffectiveArgument(node, args, argIndex) {
- if (node.kind === 143 ||
- (argIndex === 0 && node.kind === 176)) {
+ if (node.kind === 144 ||
+ (argIndex === 0 && node.kind === 177)) {
return undefined;
}
return args[argIndex];
}
function getEffectiveArgumentErrorNode(node, argIndex, arg) {
- if (node.kind === 143) {
+ if (node.kind === 144) {
return node.expression;
}
- else if (argIndex === 0 && node.kind === 176) {
+ else if (argIndex === 0 && node.kind === 177) {
return node.template;
}
else {
@@ -27631,12 +28924,12 @@ var ts;
}
}
function resolveCall(node, signatures, candidatesOutArray, headMessage) {
- var isTaggedTemplate = node.kind === 176;
- var isDecorator = node.kind === 143;
+ var isTaggedTemplate = node.kind === 177;
+ var isDecorator = node.kind === 144;
var typeArguments;
if (!isTaggedTemplate && !isDecorator) {
typeArguments = node.typeArguments;
- if (node.expression.kind !== 95) {
+ if (node.expression.kind !== 96) {
ts.forEach(typeArguments, checkSourceElement);
}
}
@@ -27662,7 +28955,7 @@ var ts;
var candidateForTypeArgumentError;
var resultOfFailedInference;
var result;
- var signatureHelpTrailingComma = candidatesOutArray && node.kind === 174 && node.arguments.hasTrailingComma;
+ var signatureHelpTrailingComma = candidatesOutArray && node.kind === 175 && node.arguments.hasTrailingComma;
if (candidates.length > 1) {
result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma);
}
@@ -27777,7 +29070,7 @@ var ts;
}
}
function resolveCallExpression(node, candidatesOutArray) {
- if (node.expression.kind === 95) {
+ if (node.expression.kind === 96) {
var superType = checkSuperExpression(node.expression);
if (superType !== unknownType) {
var baseTypeNode = ts.getClassExtendsHeritageClauseElement(ts.getContainingClass(node));
@@ -27930,16 +29223,16 @@ var ts;
}
function getDiagnosticHeadMessageForDecoratorResolution(node) {
switch (node.parent.kind) {
- case 221:
- case 192:
+ case 222:
+ case 193:
return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;
- case 142:
+ case 143:
return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;
- case 145:
+ case 146:
return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;
- case 147:
- case 149:
+ case 148:
case 150:
+ case 151:
return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;
}
}
@@ -27966,13 +29259,13 @@ var ts;
}
function resolveSignature(node, candidatesOutArray) {
switch (node.kind) {
- case 174:
- return resolveCallExpression(node, candidatesOutArray);
case 175:
- return resolveNewExpression(node, candidatesOutArray);
+ return resolveCallExpression(node, candidatesOutArray);
case 176:
+ return resolveNewExpression(node, candidatesOutArray);
+ case 177:
return resolveTaggedTemplateExpression(node, candidatesOutArray);
- case 143:
+ case 144:
return resolveDecorator(node, candidatesOutArray);
}
ts.Debug.fail("Branch in 'resolveSignature' should be unreachable.");
@@ -28001,17 +29294,17 @@ var ts;
function checkCallExpression(node) {
checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments);
var signature = getResolvedSignature(node);
- if (node.expression.kind === 95) {
+ if (node.expression.kind === 96) {
return voidType;
}
- if (node.kind === 175) {
+ if (node.kind === 176) {
var declaration = signature.declaration;
if (declaration &&
- declaration.kind !== 148 &&
- declaration.kind !== 152 &&
- declaration.kind !== 157 &&
+ declaration.kind !== 149 &&
+ declaration.kind !== 153 &&
+ declaration.kind !== 158 &&
!ts.isJSDocConstructSignature(declaration)) {
- var funcSymbol = node.expression.kind === 69 ?
+ var funcSymbol = node.expression.kind === 70 ?
getResolvedSymbol(node.expression) :
checkExpression(node.expression).symbol;
if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16 || ts.isDeclarationOfFunctionExpression(funcSymbol))) {
@@ -28023,7 +29316,9 @@ var ts;
return anyType;
}
}
- if (ts.isInJavaScriptFile(node) && ts.isRequireCall(node, true)) {
+ if (ts.isInJavaScriptFile(node) &&
+ ts.isRequireCall(node, true) &&
+ !resolveName(node.expression, node.expression.text, 107455, undefined, undefined)) {
return resolveExternalModuleTypeByLiteral(node.arguments[0]);
}
return getReturnTypeOfSignature(signature);
@@ -28063,21 +29358,36 @@ var ts;
}
function assignContextualParameterTypes(signature, context, mapper) {
var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0);
+ if (isInferentialContext(mapper)) {
+ for (var i = 0; i < len; i++) {
+ var declaration = signature.parameters[i].valueDeclaration;
+ if (declaration.type) {
+ inferTypes(mapper.context, getTypeFromTypeNode(declaration.type), getTypeAtPosition(context, i));
+ }
+ }
+ }
if (context.thisParameter) {
- if (!signature.thisParameter) {
- signature.thisParameter = createTransientSymbol(context.thisParameter, undefined);
+ var parameter = signature.thisParameter;
+ if (!parameter || parameter.valueDeclaration && !parameter.valueDeclaration.type) {
+ if (!parameter) {
+ signature.thisParameter = createTransientSymbol(context.thisParameter, undefined);
+ }
+ assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper);
}
- assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper);
}
for (var i = 0; i < len; i++) {
var parameter = signature.parameters[i];
- var contextualParameterType = getTypeAtPosition(context, i);
- assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper);
+ if (!parameter.valueDeclaration.type) {
+ var contextualParameterType = getTypeAtPosition(context, i);
+ assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper);
+ }
}
if (signature.hasRestParameter && isRestParameterIndex(context, signature.parameters.length - 1)) {
var parameter = ts.lastOrUndefined(signature.parameters);
- var contextualParameterType = getTypeOfSymbol(ts.lastOrUndefined(context.parameters));
- assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper);
+ if (!parameter.valueDeclaration.type) {
+ var contextualParameterType = getTypeOfSymbol(ts.lastOrUndefined(context.parameters));
+ assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper);
+ }
}
}
function assignBindingElementTypes(node) {
@@ -28085,7 +29395,7 @@ var ts;
for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) {
var element = _a[_i];
if (!ts.isOmittedExpression(element)) {
- if (element.name.kind === 69) {
+ if (element.name.kind === 70) {
getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
}
assignBindingElementTypes(element);
@@ -28098,8 +29408,8 @@ var ts;
if (!links.type) {
links.type = instantiateType(contextualType, mapper);
if (links.type === emptyObjectType &&
- (parameter.valueDeclaration.name.kind === 167 ||
- parameter.valueDeclaration.name.kind === 168)) {
+ (parameter.valueDeclaration.name.kind === 168 ||
+ parameter.valueDeclaration.name.kind === 169)) {
links.type = getTypeFromBindingPattern(parameter.valueDeclaration.name);
}
assignBindingElementTypes(parameter.valueDeclaration);
@@ -28138,7 +29448,7 @@ var ts;
}
var isAsync = ts.isAsyncFunctionLike(func);
var type;
- if (func.body.kind !== 199) {
+ if (func.body.kind !== 200) {
type = checkExpressionCached(func.body, contextualMapper);
if (isAsync) {
type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member);
@@ -28217,7 +29527,7 @@ var ts;
return false;
}
var lastStatement = ts.lastOrUndefined(func.body.statements);
- if (lastStatement && lastStatement.kind === 213 && isExhaustiveSwitchStatement(lastStatement)) {
+ if (lastStatement && lastStatement.kind === 214 && isExhaustiveSwitchStatement(lastStatement)) {
return false;
}
return true;
@@ -28246,7 +29556,7 @@ var ts;
}
});
if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever ||
- func.kind === 179 || func.kind === 180)) {
+ func.kind === 180 || func.kind === 181)) {
return undefined;
}
if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) {
@@ -28263,7 +29573,7 @@ var ts;
if (returnType && maybeTypeOfKind(returnType, 1 | 1024)) {
return;
}
- if (ts.nodeIsMissing(func.body) || func.body.kind !== 199 || !functionHasImplicitReturn(func)) {
+ if (ts.nodeIsMissing(func.body) || func.body.kind !== 200 || !functionHasImplicitReturn(func)) {
return;
}
var hasExplicitReturn = func.flags & 256;
@@ -28290,9 +29600,9 @@ var ts;
}
}
function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) {
- ts.Debug.assert(node.kind !== 147 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 148 || ts.isObjectLiteralMethod(node));
var hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
- if (!hasGrammarError && node.kind === 179) {
+ if (!hasGrammarError && node.kind === 180) {
checkGrammarForGenerator(node);
}
if (contextualMapper === identityMapper && isContextSensitive(node)) {
@@ -28326,14 +29636,14 @@ var ts;
}
}
}
- if (produceDiagnostics && node.kind !== 147) {
+ if (produceDiagnostics && node.kind !== 148) {
checkCollisionWithCapturedSuperVariable(node, node.name);
checkCollisionWithCapturedThisVariable(node, node.name);
}
return type;
}
function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) {
- ts.Debug.assert(node.kind !== 147 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 148 || ts.isObjectLiteralMethod(node));
var isAsync = ts.isAsyncFunctionLike(node);
var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type));
if (!node.asteriskToken) {
@@ -28343,7 +29653,7 @@ var ts;
if (!node.type) {
getReturnTypeOfSignature(getSignatureFromDeclaration(node));
}
- if (node.body.kind === 199) {
+ if (node.body.kind === 200) {
checkSourceElement(node.body);
}
else {
@@ -28378,10 +29688,10 @@ var ts;
function isReferenceToReadonlyEntity(expr, symbol) {
if (isReadonlySymbol(symbol)) {
if (symbol.flags & 4 &&
- (expr.kind === 172 || expr.kind === 173) &&
- expr.expression.kind === 97) {
+ (expr.kind === 173 || expr.kind === 174) &&
+ expr.expression.kind === 98) {
var func = ts.getContainingFunction(expr);
- if (!(func && func.kind === 148))
+ if (!(func && func.kind === 149))
return true;
return !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent);
}
@@ -28390,13 +29700,13 @@ var ts;
return false;
}
function isReferenceThroughNamespaceImport(expr) {
- if (expr.kind === 172 || expr.kind === 173) {
+ if (expr.kind === 173 || expr.kind === 174) {
var node = skipParenthesizedNodes(expr.expression);
- if (node.kind === 69) {
+ if (node.kind === 70) {
var symbol = getNodeLinks(node).resolvedSymbol;
if (symbol.flags & 8388608) {
var declaration = getDeclarationOfAliasSymbol(symbol);
- return declaration && declaration.kind === 232;
+ return declaration && declaration.kind === 233;
}
}
}
@@ -28404,7 +29714,7 @@ var ts;
}
function checkReferenceExpression(expr, invalidReferenceMessage, constantVariableMessage) {
var node = skipParenthesizedNodes(expr);
- if (node.kind !== 69 && node.kind !== 172 && node.kind !== 173) {
+ if (node.kind !== 70 && node.kind !== 173 && node.kind !== 174) {
error(expr, invalidReferenceMessage);
return false;
}
@@ -28412,7 +29722,7 @@ var ts;
var symbol = getExportSymbolOfValueSymbolIfExported(links.resolvedSymbol);
if (symbol) {
if (symbol !== unknownSymbol && symbol !== argumentsSymbol) {
- if (node.kind === 69 && !(symbol.flags & 3)) {
+ if (node.kind === 70 && !(symbol.flags & 3)) {
error(expr, invalidReferenceMessage);
return false;
}
@@ -28422,7 +29732,7 @@ var ts;
}
}
}
- else if (node.kind === 173) {
+ else if (node.kind === 174) {
if (links.resolvedIndexInfo && links.resolvedIndexInfo.isReadonly) {
error(expr, constantVariableMessage);
return false;
@@ -28459,24 +29769,24 @@ var ts;
if (operandType === silentNeverType) {
return silentNeverType;
}
- if (node.operator === 36 && node.operand.kind === 8) {
+ if (node.operator === 37 && node.operand.kind === 8) {
return getFreshTypeOfLiteralType(getLiteralTypeForText(64, "" + -node.operand.text));
}
switch (node.operator) {
- case 35:
case 36:
- case 50:
+ case 37:
+ case 51:
if (maybeTypeOfKind(operandType, 512)) {
error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator));
}
return numberType;
- case 49:
+ case 50:
var facts = getTypeFacts(operandType) & (1048576 | 2097152);
return facts === 1048576 ? falseType :
facts === 2097152 ? trueType :
booleanType;
- case 41:
case 42:
+ case 43:
var ok = checkArithmeticOperandType(node.operand, getNonNullableType(operandType), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type);
if (ok) {
checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant_or_a_read_only_property);
@@ -28502,8 +29812,8 @@ var ts;
}
if (type.flags & 1572864) {
var types = type.types;
- for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
- var t = types_14[_i];
+ for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
+ var t = types_15[_i];
if (maybeTypeOfKind(t, kind)) {
return true;
}
@@ -28517,8 +29827,8 @@ var ts;
}
if (type.flags & 524288) {
var types = type.types;
- for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
- var t = types_15[_i];
+ for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
+ var t = types_16[_i];
if (!isTypeOfKind(t, kind)) {
return false;
}
@@ -28527,8 +29837,8 @@ var ts;
}
if (type.flags & 1048576) {
var types = type.types;
- for (var _a = 0, types_16 = types; _a < types_16.length; _a++) {
- var t = types_16[_a];
+ for (var _a = 0, types_17 = types; _a < types_17.length; _a++) {
+ var t = types_17[_a];
if (isTypeOfKind(t, kind)) {
return true;
}
@@ -28566,18 +29876,18 @@ var ts;
}
return booleanType;
}
- function checkObjectLiteralAssignment(node, sourceType, contextualMapper) {
+ function checkObjectLiteralAssignment(node, sourceType) {
var properties = node.properties;
for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) {
var p = properties_4[_i];
- checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, contextualMapper);
+ checkObjectLiteralDestructuringPropertyAssignment(sourceType, p);
}
return sourceType;
}
- function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, contextualMapper) {
+ function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property) {
if (property.kind === 253 || property.kind === 254) {
var name_17 = property.name;
- if (name_17.kind === 140) {
+ if (name_17.kind === 141) {
checkComputedPropertyName(name_17);
}
if (isComputedNonLiteralName(name_17)) {
@@ -28616,8 +29926,8 @@ var ts;
function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, contextualMapper) {
var elements = node.elements;
var element = elements[elementIndex];
- if (element.kind !== 193) {
- if (element.kind !== 191) {
+ if (element.kind !== 194) {
+ if (element.kind !== 192) {
var propName = "" + elementIndex;
var type = isTypeAny(sourceType)
? sourceType
@@ -28643,7 +29953,7 @@ var ts;
}
else {
var restExpression = element.expression;
- if (restExpression.kind === 187 && restExpression.operatorToken.kind === 56) {
+ if (restExpression.kind === 188 && restExpression.operatorToken.kind === 57) {
error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer);
}
else {
@@ -28670,14 +29980,14 @@ var ts;
else {
target = exprOrAssignment;
}
- if (target.kind === 187 && target.operatorToken.kind === 56) {
+ if (target.kind === 188 && target.operatorToken.kind === 57) {
checkBinaryExpression(target, contextualMapper);
target = target.left;
}
- if (target.kind === 171) {
- return checkObjectLiteralAssignment(target, sourceType, contextualMapper);
+ if (target.kind === 172) {
+ return checkObjectLiteralAssignment(target, sourceType);
}
- if (target.kind === 170) {
+ if (target.kind === 171) {
return checkArrayLiteralAssignment(target, sourceType, contextualMapper);
}
return checkReferenceAssignment(target, sourceType, contextualMapper);
@@ -28692,49 +30002,49 @@ var ts;
function isSideEffectFree(node) {
node = ts.skipParentheses(node);
switch (node.kind) {
- case 69:
+ case 70:
case 9:
- case 10:
- case 176:
- case 189:
case 11:
+ case 177:
+ case 190:
+ case 12:
case 8:
- case 99:
- case 84:
- case 93:
- case 135:
- case 179:
- case 192:
+ case 100:
+ case 85:
+ case 94:
+ case 136:
case 180:
- case 170:
+ case 193:
+ case 181:
case 171:
- case 182:
- case 196:
+ case 172:
+ case 183:
+ case 197:
+ case 243:
case 242:
- case 241:
return true;
- case 188:
+ case 189:
return isSideEffectFree(node.whenTrue) &&
isSideEffectFree(node.whenFalse);
- case 187:
+ case 188:
if (ts.isAssignmentOperator(node.operatorToken.kind)) {
return false;
}
return isSideEffectFree(node.left) &&
isSideEffectFree(node.right);
- case 185:
case 186:
+ case 187:
switch (node.operator) {
- case 49:
- case 35:
- case 36:
case 50:
+ case 36:
+ case 37:
+ case 51:
return true;
}
return false;
- case 183:
- case 177:
- case 195:
+ case 184:
+ case 178:
+ case 196:
default:
return false;
}
@@ -28754,34 +30064,34 @@ var ts;
}
function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) {
var operator = operatorToken.kind;
- if (operator === 56 && (left.kind === 171 || left.kind === 170)) {
+ if (operator === 57 && (left.kind === 172 || left.kind === 171)) {
return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper);
}
var leftType = checkExpression(left, contextualMapper);
var rightType = checkExpression(right, contextualMapper);
switch (operator) {
- case 37:
case 38:
- case 59:
- case 60:
case 39:
+ case 60:
case 61:
case 40:
case 62:
- case 36:
- case 58:
- case 43:
+ case 41:
case 63:
+ case 37:
+ case 59:
case 44:
case 64:
case 45:
case 65:
- case 47:
- case 67:
- case 48:
- case 68:
case 46:
case 66:
+ case 48:
+ case 68:
+ case 49:
+ case 69:
+ case 47:
+ case 67:
if (leftType === silentNeverType || rightType === silentNeverType) {
return silentNeverType;
}
@@ -28805,8 +30115,8 @@ var ts;
}
}
return numberType;
- case 35:
- case 57:
+ case 36:
+ case 58:
if (leftType === silentNeverType || rightType === silentNeverType) {
return silentNeverType;
}
@@ -28835,24 +30145,24 @@ var ts;
reportOperatorError();
return anyType;
}
- if (operator === 57) {
+ if (operator === 58) {
checkAssignmentOperator(resultType);
}
return resultType;
- case 25:
- case 27:
+ case 26:
case 28:
case 29:
+ case 30:
if (checkForDisallowedESSymbolOperand(operator)) {
if (!isTypeComparableTo(leftType, rightType) && !isTypeComparableTo(rightType, leftType)) {
reportOperatorError();
}
}
return booleanType;
- case 30:
case 31:
case 32:
case 33:
+ case 34:
var leftIsLiteral = isLiteralType(leftType);
var rightIsLiteral = isLiteralType(rightType);
if (!leftIsLiteral || !rightIsLiteral) {
@@ -28863,22 +30173,22 @@ var ts;
reportOperatorError();
}
return booleanType;
- case 91:
+ case 92:
return checkInstanceOfExpression(left, right, leftType, rightType);
- case 90:
+ case 91:
return checkInExpression(left, right, leftType, rightType);
- case 51:
+ case 52:
return getTypeFacts(leftType) & 1048576 ?
includeFalsyTypes(rightType, getFalsyFlags(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType))) :
leftType;
- case 52:
+ case 53:
return getTypeFacts(leftType) & 2097152 ?
getBestChoiceType(removeDefinitelyFalsyTypes(leftType), rightType) :
leftType;
- case 56:
+ case 57:
checkAssignmentOperator(rightType);
return getRegularTypeOfObjectLiteral(rightType);
- case 24:
+ case 25:
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left)) {
error(left, ts.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);
}
@@ -28896,21 +30206,21 @@ var ts;
}
function getSuggestedBooleanOperator(operator) {
switch (operator) {
+ case 48:
+ case 68:
+ return 53;
+ case 49:
+ case 69:
+ return 34;
case 47:
case 67:
return 52;
- case 48:
- case 68:
- return 33;
- case 46:
- case 66:
- return 51;
default:
return undefined;
}
}
function checkAssignmentOperator(valueType) {
- if (produceDiagnostics && operator >= 56 && operator <= 68) {
+ if (produceDiagnostics && operator >= 57 && operator <= 69) {
var ok = checkReferenceExpression(left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant_or_a_read_only_property);
if (ok) {
checkTypeAssignableTo(valueType, leftType, left, undefined);
@@ -28982,9 +30292,9 @@ var ts;
return getFreshTypeOfLiteralType(getLiteralTypeForText(32, node.text));
case 8:
return getFreshTypeOfLiteralType(getLiteralTypeForText(64, node.text));
- case 99:
+ case 100:
return trueType;
- case 84:
+ case 85:
return falseType;
}
}
@@ -29013,7 +30323,7 @@ var ts;
}
function isTypeAssertion(node) {
node = skipParenthesizedNodes(node);
- return node.kind === 177 || node.kind === 195;
+ return node.kind === 178 || node.kind === 196;
}
function checkDeclarationInitializer(declaration) {
var type = checkExpressionCached(declaration.initializer);
@@ -29039,14 +30349,14 @@ var ts;
return isTypeAssertion(node) || isLiteralContextualType(getContextualType(node)) ? type : getWidenedLiteralType(type);
}
function checkPropertyAssignment(node, contextualMapper) {
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
checkComputedPropertyName(node.name);
}
return checkExpressionForMutableLocation(node.initializer, contextualMapper);
}
function checkObjectLiteralMethod(node, contextualMapper) {
checkGrammarMethod(node);
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
checkComputedPropertyName(node.name);
}
var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper);
@@ -29069,7 +30379,7 @@ var ts;
}
function checkExpression(node, contextualMapper) {
var type;
- if (node.kind === 139) {
+ if (node.kind === 140) {
type = checkQualifiedName(node);
}
else {
@@ -29077,9 +30387,9 @@ var ts;
type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper);
}
if (isConstEnumObjectType(type)) {
- var ok = (node.parent.kind === 172 && node.parent.expression === node) ||
- (node.parent.kind === 173 && node.parent.expression === node) ||
- ((node.kind === 69 || node.kind === 139) && isInRightSideOfImportOrExportAssignment(node));
+ var ok = (node.parent.kind === 173 && node.parent.expression === node) ||
+ (node.parent.kind === 174 && node.parent.expression === node) ||
+ ((node.kind === 70 || node.kind === 140) && isInRightSideOfImportOrExportAssignment(node));
if (!ok) {
error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment);
}
@@ -29088,79 +30398,79 @@ var ts;
}
function checkExpressionWorker(node, contextualMapper) {
switch (node.kind) {
- case 69:
+ case 70:
return checkIdentifier(node);
- case 97:
+ case 98:
return checkThisExpression(node);
- case 95:
+ case 96:
return checkSuperExpression(node);
- case 93:
+ case 94:
return nullWideningType;
case 9:
case 8:
- case 99:
- case 84:
+ case 100:
+ case 85:
return checkLiteralExpression(node);
- case 189:
- return checkTemplateExpression(node);
- case 11:
- return stringType;
- case 10:
- return globalRegExpType;
- case 170:
- return checkArrayLiteral(node, contextualMapper);
- case 171:
- return checkObjectLiteral(node, contextualMapper);
- case 172:
- return checkPropertyAccessExpression(node);
- case 173:
- return checkIndexedAccess(node);
- case 174:
- case 175:
- return checkCallExpression(node);
- case 176:
- return checkTaggedTemplateExpression(node);
- case 178:
- return checkExpression(node.expression, contextualMapper);
- case 192:
- return checkClassExpression(node);
- case 179:
- case 180:
- return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper);
- case 182:
- return checkTypeOfExpression(node);
- case 177:
- case 195:
- return checkAssertion(node);
- case 196:
- return checkNonNullAssertion(node);
- case 181:
- return checkDeleteExpression(node);
- case 183:
- return checkVoidExpression(node);
- case 184:
- return checkAwaitExpression(node);
- case 185:
- return checkPrefixUnaryExpression(node);
- case 186:
- return checkPostfixUnaryExpression(node);
- case 187:
- return checkBinaryExpression(node, contextualMapper);
- case 188:
- return checkConditionalExpression(node, contextualMapper);
- case 191:
- return checkSpreadElementExpression(node, contextualMapper);
- case 193:
- return undefinedWideningType;
case 190:
+ return checkTemplateExpression(node);
+ case 12:
+ return stringType;
+ case 11:
+ return globalRegExpType;
+ case 171:
+ return checkArrayLiteral(node, contextualMapper);
+ case 172:
+ return checkObjectLiteral(node, contextualMapper);
+ case 173:
+ return checkPropertyAccessExpression(node);
+ case 174:
+ return checkIndexedAccess(node);
+ case 175:
+ case 176:
+ return checkCallExpression(node);
+ case 177:
+ return checkTaggedTemplateExpression(node);
+ case 179:
+ return checkExpression(node.expression, contextualMapper);
+ case 193:
+ return checkClassExpression(node);
+ case 180:
+ case 181:
+ return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper);
+ case 183:
+ return checkTypeOfExpression(node);
+ case 178:
+ case 196:
+ return checkAssertion(node);
+ case 197:
+ return checkNonNullAssertion(node);
+ case 182:
+ return checkDeleteExpression(node);
+ case 184:
+ return checkVoidExpression(node);
+ case 185:
+ return checkAwaitExpression(node);
+ case 186:
+ return checkPrefixUnaryExpression(node);
+ case 187:
+ return checkPostfixUnaryExpression(node);
+ case 188:
+ return checkBinaryExpression(node, contextualMapper);
+ case 189:
+ return checkConditionalExpression(node, contextualMapper);
+ case 192:
+ return checkSpreadElementExpression(node, contextualMapper);
+ case 194:
+ return undefinedWideningType;
+ case 191:
return checkYieldExpression(node);
case 248:
return checkJsxExpression(node);
- case 241:
- return checkJsxElement(node);
case 242:
- return checkJsxSelfClosingElement(node);
+ return checkJsxElement(node);
case 243:
+ return checkJsxSelfClosingElement(node);
+ case 244:
ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement");
}
return unknownType;
@@ -29181,7 +30491,7 @@ var ts;
var func = ts.getContainingFunction(node);
if (ts.getModifierFlags(node) & 92) {
func = ts.getContainingFunction(node);
- if (!(func.kind === 148 && ts.nodeIsPresent(func.body))) {
+ if (!(func.kind === 149 && ts.nodeIsPresent(func.body))) {
error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
}
}
@@ -29192,7 +30502,7 @@ var ts;
if (ts.indexOf(func.parameters, node) !== 0) {
error(node, ts.Diagnostics.A_this_parameter_must_be_the_first_parameter);
}
- if (func.kind === 148 || func.kind === 152 || func.kind === 157) {
+ if (func.kind === 149 || func.kind === 153 || func.kind === 158) {
error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter);
}
}
@@ -29204,15 +30514,15 @@ var ts;
if (!node.asteriskToken || !node.body) {
return false;
}
- return node.kind === 147 ||
- node.kind === 220 ||
- node.kind === 179;
+ return node.kind === 148 ||
+ node.kind === 221 ||
+ node.kind === 180;
}
function getTypePredicateParameterIndex(parameterList, parameter) {
if (parameterList) {
for (var i = 0; i < parameterList.length; i++) {
var param = parameterList[i];
- if (param.name.kind === 69 &&
+ if (param.name.kind === 70 &&
param.name.text === parameter.text) {
return i;
}
@@ -29262,13 +30572,13 @@ var ts;
}
function getTypePredicateParent(node) {
switch (node.parent.kind) {
+ case 181:
+ case 152:
+ case 221:
case 180:
- case 151:
- case 220:
- case 179:
- case 156:
+ case 157:
+ case 148:
case 147:
- case 146:
var parent_12 = node.parent;
if (node === parent_12.type) {
return parent_12;
@@ -29282,13 +30592,13 @@ var ts;
continue;
}
var name_19 = element.name;
- if (name_19.kind === 69 &&
+ if (name_19.kind === 70 &&
name_19.text === predicateVariableName) {
error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName);
return true;
}
- else if (name_19.kind === 168 ||
- name_19.kind === 167) {
+ else if (name_19.kind === 169 ||
+ name_19.kind === 168) {
if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_19, predicateVariableNode, predicateVariableName)) {
return true;
}
@@ -29296,12 +30606,12 @@ var ts;
}
}
function checkSignatureDeclaration(node) {
- if (node.kind === 153) {
+ if (node.kind === 154) {
checkGrammarIndexSignature(node);
}
- else if (node.kind === 156 || node.kind === 220 || node.kind === 157 ||
- node.kind === 151 || node.kind === 148 ||
- node.kind === 152) {
+ else if (node.kind === 157 || node.kind === 221 || node.kind === 158 ||
+ node.kind === 152 || node.kind === 149 ||
+ node.kind === 153) {
checkGrammarFunctionLikeDeclaration(node);
}
checkTypeParameters(node.typeParameters);
@@ -29313,10 +30623,10 @@ var ts;
checkCollisionWithArgumentsInGeneratedCode(node);
if (compilerOptions.noImplicitAny && !node.type) {
switch (node.kind) {
- case 152:
+ case 153:
error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
- case 151:
+ case 152:
error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
}
@@ -29343,11 +30653,17 @@ var ts;
}
}
function checkClassForDuplicateDeclarations(node) {
+ var Accessor;
+ (function (Accessor) {
+ Accessor[Accessor["Getter"] = 1] = "Getter";
+ Accessor[Accessor["Setter"] = 2] = "Setter";
+ Accessor[Accessor["Property"] = 3] = "Property";
+ })(Accessor || (Accessor = {}));
var instanceNames = ts.createMap();
var staticNames = ts.createMap();
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind === 148) {
+ if (member.kind === 149) {
for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
var param = _c[_b];
if (ts.isParameterPropertyDeclaration(param)) {
@@ -29356,18 +30672,18 @@ var ts;
}
}
else {
- var isStatic = ts.forEach(member.modifiers, function (m) { return m.kind === 113; });
+ var isStatic = ts.forEach(member.modifiers, function (m) { return m.kind === 114; });
var names = isStatic ? staticNames : instanceNames;
var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name);
if (memberName) {
switch (member.kind) {
- case 149:
+ case 150:
addName(names, member.name, memberName, 1);
break;
- case 150:
+ case 151:
addName(names, member.name, memberName, 2);
break;
- case 145:
+ case 146:
addName(names, member.name, memberName, 3);
break;
}
@@ -29393,12 +30709,12 @@ var ts;
var names = ts.createMap();
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind == 144) {
+ if (member.kind == 145) {
var memberName = void 0;
switch (member.name.kind) {
case 9:
case 8:
- case 69:
+ case 70:
memberName = member.name.text;
break;
default:
@@ -29415,7 +30731,7 @@ var ts;
}
}
function checkTypeForDuplicateIndexSignatures(node) {
- if (node.kind === 222) {
+ if (node.kind === 223) {
var nodeSymbol = getSymbolOfNode(node);
if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) {
return;
@@ -29430,7 +30746,7 @@ var ts;
var declaration = decl;
if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
switch (declaration.parameters[0].type.kind) {
- case 132:
+ case 133:
if (!seenStringIndexer) {
seenStringIndexer = true;
}
@@ -29438,7 +30754,7 @@ var ts;
error(declaration, ts.Diagnostics.Duplicate_string_index_signature);
}
break;
- case 130:
+ case 131:
if (!seenNumericIndexer) {
seenNumericIndexer = true;
}
@@ -29494,15 +30810,15 @@ var ts;
return ts.forEachChild(n, containsSuperCall);
}
function markThisReferencesAsErrors(n) {
- if (n.kind === 97) {
+ if (n.kind === 98) {
error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location);
}
- else if (n.kind !== 179 && n.kind !== 220) {
+ else if (n.kind !== 180 && n.kind !== 221) {
ts.forEachChild(n, markThisReferencesAsErrors);
}
}
function isInstancePropertyWithInitializer(n) {
- return n.kind === 145 &&
+ return n.kind === 146 &&
!(ts.getModifierFlags(n) & 32) &&
!!n.initializer;
}
@@ -29522,7 +30838,7 @@ var ts;
var superCallStatement = void 0;
for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) {
var statement = statements_2[_i];
- if (statement.kind === 202 && ts.isSuperCall(statement.expression)) {
+ if (statement.kind === 203 && ts.isSuperCall(statement.expression)) {
superCallStatement = statement;
break;
}
@@ -29545,18 +30861,18 @@ var ts;
checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name);
checkDecorators(node);
checkSignatureDeclaration(node);
- if (node.kind === 149) {
+ if (node.kind === 150) {
if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 128)) {
if (!(node.flags & 256)) {
error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value);
}
}
}
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
checkComputedPropertyName(node.name);
}
if (!ts.hasDynamicName(node)) {
- var otherKind = node.kind === 149 ? 150 : 149;
+ var otherKind = node.kind === 150 ? 151 : 150;
var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind);
if (otherAccessor) {
if ((ts.getModifierFlags(node) & 28) !== (ts.getModifierFlags(otherAccessor) & 28)) {
@@ -29570,11 +30886,11 @@ var ts;
}
}
var returnType = getTypeOfAccessors(getSymbolOfNode(node));
- if (node.kind === 149) {
+ if (node.kind === 150) {
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
}
}
- if (node.parent.kind !== 171) {
+ if (node.parent.kind !== 172) {
checkSourceElement(node.body);
registerForUnusedIdentifiersCheck(node);
}
@@ -29660,9 +30976,9 @@ var ts;
}
function getEffectiveDeclarationFlags(n, flagsToCheck) {
var flags = ts.getCombinedModifierFlags(n);
- if (n.parent.kind !== 222 &&
- n.parent.kind !== 221 &&
- n.parent.kind !== 192 &&
+ if (n.parent.kind !== 223 &&
+ n.parent.kind !== 222 &&
+ n.parent.kind !== 193 &&
ts.isInAmbientContext(n)) {
if (!(flags & 2)) {
flags |= 1;
@@ -29739,7 +31055,7 @@ var ts;
if (subsequentNode.kind === node.kind) {
var errorNode_1 = subsequentNode.name || subsequentNode;
if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) {
- var reportError = (node.kind === 147 || node.kind === 146) &&
+ var reportError = (node.kind === 148 || node.kind === 147) &&
(ts.getModifierFlags(node) & 32) !== (ts.getModifierFlags(subsequentNode) & 32);
if (reportError) {
var diagnostic = ts.getModifierFlags(node) & 32 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
@@ -29772,11 +31088,11 @@ var ts;
var current = declarations_4[_i];
var node = current;
var inAmbientContext = ts.isInAmbientContext(node);
- var inAmbientContextOrInterface = node.parent.kind === 222 || node.parent.kind === 159 || inAmbientContext;
+ var inAmbientContextOrInterface = node.parent.kind === 223 || node.parent.kind === 160 || inAmbientContext;
if (inAmbientContextOrInterface) {
previousDeclaration = undefined;
}
- if (node.kind === 220 || node.kind === 147 || node.kind === 146 || node.kind === 148) {
+ if (node.kind === 221 || node.kind === 148 || node.kind === 147 || node.kind === 149) {
var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck);
someNodeFlags |= currentNodeFlags;
allNodeFlags &= currentNodeFlags;
@@ -29887,16 +31203,16 @@ var ts;
}
function getDeclarationSpaces(d) {
switch (d.kind) {
- case 222:
+ case 223:
return 2097152;
- case 225:
+ case 226:
return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0
? 4194304 | 1048576
: 4194304;
- case 221:
- case 224:
+ case 222:
+ case 225:
return 2097152 | 1048576;
- case 229:
+ case 230:
var result_2 = 0;
var target = resolveAlias(getSymbolOfNode(d));
ts.forEach(target.declarations, function (d) { result_2 |= getDeclarationSpaces(d); });
@@ -30044,22 +31360,22 @@ var ts;
var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
var errorInfo;
switch (node.parent.kind) {
- case 221:
+ case 222:
var classSymbol = getSymbolOfNode(node.parent);
var classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 142:
+ case 143:
expectedReturnType = voidType;
errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
break;
- case 145:
+ case 146:
expectedReturnType = voidType;
errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
break;
- case 147:
- case 149:
+ case 148:
case 150:
+ case 151:
var methodType = getTypeOfNode(node.parent);
var descriptorType = createTypedPropertyDescriptorType(methodType);
expectedReturnType = getUnionType([descriptorType, voidType]);
@@ -30068,9 +31384,9 @@ var ts;
checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, errorInfo);
}
function checkTypeNodeAsExpression(node) {
- if (node && node.kind === 155) {
+ if (node && node.kind === 156) {
var root = getFirstIdentifier(node.typeName);
- var meaning = root.parent.kind === 155 ? 793064 : 1920;
+ var meaning = root.parent.kind === 156 ? 793064 : 1920;
var rootSymbol = resolveName(root, root.text, meaning | 8388608, undefined, undefined);
if (rootSymbol && rootSymbol.flags & 8388608) {
var aliasTarget = resolveAlias(rootSymbol);
@@ -30104,20 +31420,20 @@ var ts;
}
if (compilerOptions.emitDecoratorMetadata) {
switch (node.kind) {
- case 221:
+ case 222:
var constructor = ts.getFirstConstructorWithBody(node);
if (constructor) {
checkParameterTypeAnnotationsAsExpressions(constructor);
}
break;
- case 147:
- case 149:
+ case 148:
case 150:
+ case 151:
checkParameterTypeAnnotationsAsExpressions(node);
checkReturnTypeAnnotationAsExpression(node);
break;
- case 145:
- case 142:
+ case 146:
+ case 143:
checkTypeAnnotationAsExpression(node);
break;
}
@@ -30137,7 +31453,7 @@ var ts;
checkDecorators(node);
checkSignatureDeclaration(node);
var isAsync = ts.isAsyncFunctionLike(node);
- if (node.name && node.name.kind === 140) {
+ if (node.name && node.name.kind === 141) {
checkComputedPropertyName(node.name);
}
if (!ts.hasDynamicName(node)) {
@@ -30180,42 +31496,42 @@ var ts;
var node = deferredUnusedIdentifierNodes_1[_i];
switch (node.kind) {
case 256:
- case 225:
+ case 226:
checkUnusedModuleMembers(node);
break;
- case 221:
- case 192:
+ case 222:
+ case 193:
checkUnusedClassMembers(node);
checkUnusedTypeParameters(node);
break;
- case 222:
+ case 223:
checkUnusedTypeParameters(node);
break;
- case 199:
- case 227:
- case 206:
+ case 200:
+ case 228:
case 207:
case 208:
+ case 209:
checkUnusedLocalsAndParameters(node);
break;
- case 148:
- case 179:
- case 220:
- case 180:
- case 147:
case 149:
+ case 180:
+ case 221:
+ case 181:
+ case 148:
case 150:
+ case 151:
if (node.body) {
checkUnusedLocalsAndParameters(node);
}
checkUnusedTypeParameters(node);
break;
- case 146:
- case 151:
+ case 147:
case 152:
case 153:
- case 156:
+ case 154:
case 157:
+ case 158:
checkUnusedTypeParameters(node);
break;
}
@@ -30224,11 +31540,11 @@ var ts;
}
}
function checkUnusedLocalsAndParameters(node) {
- if (node.parent.kind !== 222 && noUnusedIdentifiers && !ts.isInAmbientContext(node)) {
+ if (node.parent.kind !== 223 && noUnusedIdentifiers && !ts.isInAmbientContext(node)) {
var _loop_1 = function (key) {
var local = node.locals[key];
if (!local.isReferenced) {
- if (local.valueDeclaration && local.valueDeclaration.kind === 142) {
+ if (local.valueDeclaration && local.valueDeclaration.kind === 143) {
var parameter = local.valueDeclaration;
if (compilerOptions.noUnusedParameters &&
!ts.isParameterPropertyDeclaration(parameter) &&
@@ -30248,19 +31564,19 @@ var ts;
}
}
function parameterNameStartsWithUnderscore(parameter) {
- return parameter.name && parameter.name.kind === 69 && parameter.name.text.charCodeAt(0) === 95;
+ return parameter.name && parameter.name.kind === 70 && parameter.name.text.charCodeAt(0) === 95;
}
function checkUnusedClassMembers(node) {
if (compilerOptions.noUnusedLocals && !ts.isInAmbientContext(node)) {
if (node.members) {
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind === 147 || member.kind === 145) {
+ if (member.kind === 148 || member.kind === 146) {
if (!member.symbol.isReferenced && ts.getModifierFlags(member) & 8) {
error(member.name, ts.Diagnostics._0_is_declared_but_never_used, member.symbol.name);
}
}
- else if (member.kind === 148) {
+ else if (member.kind === 149) {
for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
var parameter = _c[_b];
if (!parameter.symbol.isReferenced && ts.getModifierFlags(parameter) & 8) {
@@ -30305,7 +31621,7 @@ var ts;
}
}
function checkBlock(node) {
- if (node.kind === 199) {
+ if (node.kind === 200) {
checkGrammarStatementInAmbientContext(node);
}
ts.forEach(node.statements, checkSourceElement);
@@ -30327,19 +31643,19 @@ var ts;
if (!(identifier && identifier.text === name)) {
return false;
}
- if (node.kind === 145 ||
- node.kind === 144 ||
+ if (node.kind === 146 ||
+ node.kind === 145 ||
+ node.kind === 148 ||
node.kind === 147 ||
- node.kind === 146 ||
- node.kind === 149 ||
- node.kind === 150) {
+ node.kind === 150 ||
+ node.kind === 151) {
return false;
}
if (ts.isInAmbientContext(node)) {
return false;
}
var root = ts.getRootDeclaration(node);
- if (root.kind === 142 && ts.nodeIsMissing(root.parent.body)) {
+ if (root.kind === 143 && ts.nodeIsMissing(root.parent.body)) {
return false;
}
return true;
@@ -30353,7 +31669,7 @@ var ts;
var current = node;
while (current) {
if (getNodeCheckFlags(current) & 4) {
- var isDeclaration_1 = node.kind !== 69;
+ var isDeclaration_1 = node.kind !== 70;
if (isDeclaration_1) {
error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference);
}
@@ -30374,7 +31690,7 @@ var ts;
return;
}
if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) {
- var isDeclaration_2 = node.kind !== 69;
+ var isDeclaration_2 = node.kind !== 70;
if (isDeclaration_2) {
error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference);
}
@@ -30384,13 +31700,13 @@ var ts;
}
}
function checkCollisionWithRequireExportsInGeneratedCode(node, name) {
- if (modulekind >= ts.ModuleKind.ES6) {
+ if (modulekind >= ts.ModuleKind.ES2015) {
return;
}
if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) {
return;
}
- if (node.kind === 225 && ts.getModuleInstanceState(node) !== 1) {
+ if (node.kind === 226 && ts.getModuleInstanceState(node) !== 1) {
return;
}
var parent = getDeclarationContainer(node);
@@ -30402,7 +31718,7 @@ var ts;
if (!needCollisionCheckForIdentifier(node, name, "Promise")) {
return;
}
- if (node.kind === 225 && ts.getModuleInstanceState(node) !== 1) {
+ if (node.kind === 226 && ts.getModuleInstanceState(node) !== 1) {
return;
}
var parent = getDeclarationContainer(node);
@@ -30414,7 +31730,7 @@ var ts;
if ((ts.getCombinedNodeFlags(node) & 3) !== 0 || ts.isParameterDeclaration(node)) {
return;
}
- if (node.kind === 218 && !node.initializer) {
+ if (node.kind === 219 && !node.initializer) {
return;
}
var symbol = getSymbolOfNode(node);
@@ -30424,14 +31740,14 @@ var ts;
localDeclarationSymbol !== symbol &&
localDeclarationSymbol.flags & 2) {
if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3) {
- var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 219);
- var container = varDeclList.parent.kind === 200 && varDeclList.parent.parent
+ var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 220);
+ var container = varDeclList.parent.kind === 201 && varDeclList.parent.parent
? varDeclList.parent.parent
: undefined;
var namesShareScope = container &&
- (container.kind === 199 && ts.isFunctionLike(container.parent) ||
+ (container.kind === 200 && ts.isFunctionLike(container.parent) ||
+ container.kind === 227 ||
container.kind === 226 ||
- container.kind === 225 ||
container.kind === 256);
if (!namesShareScope) {
var name_20 = symbolToString(localDeclarationSymbol);
@@ -30442,7 +31758,7 @@ var ts;
}
}
function checkParameterInitializer(node) {
- if (ts.getRootDeclaration(node).kind !== 142) {
+ if (ts.getRootDeclaration(node).kind !== 143) {
return;
}
var func = ts.getContainingFunction(node);
@@ -30451,10 +31767,10 @@ var ts;
if (ts.isTypeNode(n) || ts.isDeclarationName(n)) {
return;
}
- if (n.kind === 172) {
+ if (n.kind === 173) {
return visit(n.expression);
}
- else if (n.kind === 69) {
+ else if (n.kind === 70) {
var symbol = resolveName(n, n.text, 107455 | 8388608, undefined, undefined);
if (!symbol || symbol === unknownSymbol || !symbol.valueDeclaration) {
return;
@@ -30465,7 +31781,7 @@ var ts;
}
var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);
if (enclosingContainer === func) {
- if (symbol.valueDeclaration.kind === 142) {
+ if (symbol.valueDeclaration.kind === 143) {
if (symbol.valueDeclaration.pos < node.pos) {
return;
}
@@ -30474,7 +31790,7 @@ var ts;
if (ts.isFunctionLike(current.parent)) {
return;
}
- if (current.parent.kind === 145 &&
+ if (current.parent.kind === 146 &&
!(ts.hasModifier(current.parent, 32)) &&
ts.isClassLike(current.parent.parent)) {
return;
@@ -30491,19 +31807,19 @@ var ts;
}
}
function convertAutoToAny(type) {
- return type === autoType ? anyType : type;
+ return type === autoType ? anyType : type === autoArrayType ? anyArrayType : type;
}
function checkVariableLikeDeclaration(node) {
checkDecorators(node);
checkSourceElement(node.type);
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
checkComputedPropertyName(node.name);
if (node.initializer) {
checkExpressionCached(node.initializer);
}
}
- if (node.kind === 169) {
- if (node.propertyName && node.propertyName.kind === 140) {
+ if (node.kind === 170) {
+ if (node.propertyName && node.propertyName.kind === 141) {
checkComputedPropertyName(node.propertyName);
}
var parent_13 = node.parent.parent;
@@ -30517,12 +31833,12 @@ var ts;
if (ts.isBindingPattern(node.name)) {
ts.forEach(node.name.elements, checkSourceElement);
}
- if (node.initializer && ts.getRootDeclaration(node).kind === 142 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) {
+ if (node.initializer && ts.getRootDeclaration(node).kind === 143 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) {
error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation);
return;
}
if (ts.isBindingPattern(node.name)) {
- if (node.initializer && node.parent.parent.kind !== 207) {
+ if (node.initializer && node.parent.parent.kind !== 208) {
checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, undefined);
checkParameterInitializer(node);
}
@@ -30531,7 +31847,7 @@ var ts;
var symbol = getSymbolOfNode(node);
var type = convertAutoToAny(getTypeOfVariableOrParameterOrProperty(symbol));
if (node === symbol.valueDeclaration) {
- if (node.initializer && node.parent.parent.kind !== 207) {
+ if (node.initializer && node.parent.parent.kind !== 208) {
checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, undefined);
checkParameterInitializer(node);
}
@@ -30549,9 +31865,9 @@ var ts;
error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
}
}
- if (node.kind !== 145 && node.kind !== 144) {
+ if (node.kind !== 146 && node.kind !== 145) {
checkExportsOnMergedDeclarations(node);
- if (node.kind === 218 || node.kind === 169) {
+ if (node.kind === 219 || node.kind === 170) {
checkVarDeclaredNamesNotShadowed(node);
}
checkCollisionWithCapturedSuperVariable(node, node.name);
@@ -30561,8 +31877,8 @@ var ts;
}
}
function areDeclarationFlagsIdentical(left, right) {
- if ((left.kind === 142 && right.kind === 218) ||
- (left.kind === 218 && right.kind === 142)) {
+ if ((left.kind === 143 && right.kind === 219) ||
+ (left.kind === 219 && right.kind === 143)) {
return true;
}
if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) {
@@ -30589,7 +31905,7 @@ var ts;
ts.forEach(node.declarationList.declarations, checkSourceElement);
}
function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) {
- if (node.modifiers && node.parent.kind === 171) {
+ if (node.modifiers && node.parent.kind === 172) {
if (ts.isAsyncFunctionLike(node)) {
if (node.modifiers.length > 1) {
return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here);
@@ -30608,7 +31924,7 @@ var ts;
checkGrammarStatementInAmbientContext(node);
checkExpression(node.expression);
checkSourceElement(node.thenStatement);
- if (node.thenStatement.kind === 201) {
+ if (node.thenStatement.kind === 202) {
error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
}
checkSourceElement(node.elseStatement);
@@ -30625,12 +31941,12 @@ var ts;
}
function checkForStatement(node) {
if (!checkGrammarStatementInAmbientContext(node)) {
- if (node.initializer && node.initializer.kind === 219) {
+ if (node.initializer && node.initializer.kind === 220) {
checkGrammarVariableDeclarationList(node.initializer);
}
}
if (node.initializer) {
- if (node.initializer.kind === 219) {
+ if (node.initializer.kind === 220) {
ts.forEach(node.initializer.declarations, checkVariableDeclaration);
}
else {
@@ -30648,13 +31964,13 @@ var ts;
}
function checkForOfStatement(node) {
checkGrammarForInOrForOfStatement(node);
- if (node.initializer.kind === 219) {
+ if (node.initializer.kind === 220) {
checkForInOrForOfVariableDeclaration(node);
}
else {
var varExpr = node.initializer;
var iteratedType = checkRightHandSideOfForOf(node.expression);
- if (varExpr.kind === 170 || varExpr.kind === 171) {
+ if (varExpr.kind === 171 || varExpr.kind === 172) {
checkDestructuringAssignment(varExpr, iteratedType || unknownType);
}
else {
@@ -30672,7 +31988,7 @@ var ts;
}
function checkForInStatement(node) {
checkGrammarForInOrForOfStatement(node);
- if (node.initializer.kind === 219) {
+ if (node.initializer.kind === 220) {
var variable = node.initializer.declarations[0];
if (variable && ts.isBindingPattern(variable.name)) {
error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
@@ -30682,7 +31998,7 @@ var ts;
else {
var varExpr = node.initializer;
var leftType = checkExpression(varExpr);
- if (varExpr.kind === 170 || varExpr.kind === 171) {
+ if (varExpr.kind === 171 || varExpr.kind === 172) {
error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
}
else if (!isTypeAnyOrAllConstituentTypesHaveKind(leftType, 34)) {
@@ -30855,7 +32171,7 @@ var ts;
checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node);
}
function isGetAccessorWithAnnotatedSetAccessor(node) {
- return !!(node.kind === 149 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 150)));
+ return !!(node.kind === 150 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 151)));
}
function isUnwrappedReturnTypeVoidOrAny(func, returnType) {
var unwrappedReturnType = ts.isAsyncFunctionLike(func) ? getPromisedType(returnType) : returnType;
@@ -30877,12 +32193,12 @@ var ts;
if (func.asteriskToken) {
return;
}
- if (func.kind === 150) {
+ if (func.kind === 151) {
if (node.expression) {
error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value);
}
}
- else if (func.kind === 148) {
+ else if (func.kind === 149) {
if (node.expression && !checkTypeAssignableTo(exprType, returnType, node.expression)) {
error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
}
@@ -30900,7 +32216,7 @@ var ts;
}
}
}
- else if (func.kind !== 148 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) {
+ else if (func.kind !== 149 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) {
error(node, ts.Diagnostics.Not_all_code_paths_return_a_value);
}
}
@@ -30957,7 +32273,7 @@ var ts;
if (ts.isFunctionLike(current)) {
break;
}
- if (current.kind === 214 && current.label.text === node.label.text) {
+ if (current.kind === 215 && current.label.text === node.label.text) {
var sourceFile = ts.getSourceFileOfNode(node);
grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label));
break;
@@ -30983,7 +32299,7 @@ var ts;
var catchClause = node.catchClause;
if (catchClause) {
if (catchClause.variableDeclaration) {
- if (catchClause.variableDeclaration.name.kind !== 69) {
+ if (catchClause.variableDeclaration.name.kind !== 70) {
grammarErrorOnFirstToken(catchClause.variableDeclaration.name, ts.Diagnostics.Catch_clause_variable_name_must_be_an_identifier);
}
else if (catchClause.variableDeclaration.type) {
@@ -31051,7 +32367,7 @@ var ts;
return;
}
var errorNode;
- if (prop.valueDeclaration.name.kind === 140 || prop.parent === containingType.symbol) {
+ if (prop.valueDeclaration.name.kind === 141 || prop.parent === containingType.symbol) {
errorNode = prop.valueDeclaration;
}
else if (indexDeclaration) {
@@ -31102,7 +32418,7 @@ var ts;
var firstDecl;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 221 || declaration.kind === 222) {
+ if (declaration.kind === 222 || declaration.kind === 223) {
if (!firstDecl) {
firstDecl = declaration;
}
@@ -31239,7 +32555,7 @@ var ts;
if (derived === base) {
var derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol);
if (baseDeclarationFlags & 128 && (!derivedClassDecl || !(ts.getModifierFlags(derivedClassDecl) & 128))) {
- if (derivedClassDecl.kind === 192) {
+ if (derivedClassDecl.kind === 193) {
error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType));
}
else {
@@ -31283,7 +32599,7 @@ var ts;
}
}
function isAccessor(kind) {
- return kind === 149 || kind === 150;
+ return kind === 150 || kind === 151;
}
function areTypeParametersIdentical(list1, list2) {
if (!list1 && !list2) {
@@ -31350,7 +32666,7 @@ var ts;
checkExportsOnMergedDeclarations(node);
var symbol = getSymbolOfNode(node);
checkTypeParameterListsIdentical(node, symbol);
- var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 222);
+ var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 223);
if (node === firstInterfaceDecl) {
var type = getDeclaredTypeOfSymbol(symbol);
var typeWithThis = getTypeWithThisArgument(type);
@@ -31445,18 +32761,18 @@ var ts;
return value;
function evalConstant(e) {
switch (e.kind) {
- case 185:
+ case 186:
var value_1 = evalConstant(e.operand);
if (value_1 === undefined) {
return undefined;
}
switch (e.operator) {
- case 35: return value_1;
- case 36: return -value_1;
- case 50: return ~value_1;
+ case 36: return value_1;
+ case 37: return -value_1;
+ case 51: return ~value_1;
}
return undefined;
- case 187:
+ case 188:
var left = evalConstant(e.left);
if (left === undefined) {
return undefined;
@@ -31466,37 +32782,37 @@ var ts;
return undefined;
}
switch (e.operatorToken.kind) {
- case 47: return left | right;
- case 46: return left & right;
- case 44: return left >> right;
- case 45: return left >>> right;
- case 43: return left << right;
- case 48: return left ^ right;
- case 37: return left * right;
- case 39: return left / right;
- case 35: return left + right;
- case 36: return left - right;
- case 40: return left % right;
+ case 48: return left | right;
+ case 47: return left & right;
+ case 45: return left >> right;
+ case 46: return left >>> right;
+ case 44: return left << right;
+ case 49: return left ^ right;
+ case 38: return left * right;
+ case 40: return left / right;
+ case 36: return left + right;
+ case 37: return left - right;
+ case 41: return left % right;
}
return undefined;
case 8:
return +e.text;
- case 178:
+ case 179:
return evalConstant(e.expression);
- case 69:
+ case 70:
+ case 174:
case 173:
- case 172:
var member = initializer.parent;
var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent));
var enumType_1;
var propertyName = void 0;
- if (e.kind === 69) {
+ if (e.kind === 70) {
enumType_1 = currentType;
propertyName = e.text;
}
else {
var expression = void 0;
- if (e.kind === 173) {
+ if (e.kind === 174) {
if (e.argumentExpression === undefined ||
e.argumentExpression.kind !== 9) {
return undefined;
@@ -31510,10 +32826,10 @@ var ts;
}
var current = expression;
while (current) {
- if (current.kind === 69) {
+ if (current.kind === 70) {
break;
}
- else if (current.kind === 172) {
+ else if (current.kind === 173) {
current = current.expression;
}
else {
@@ -31573,7 +32889,7 @@ var ts;
}
var seenEnumMissingInitialInitializer_1 = false;
ts.forEach(enumSymbol.declarations, function (declaration) {
- if (declaration.kind !== 224) {
+ if (declaration.kind !== 225) {
return false;
}
var enumDeclaration = declaration;
@@ -31596,8 +32912,8 @@ var ts;
var declarations = symbol.declarations;
for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
var declaration = declarations_5[_i];
- if ((declaration.kind === 221 ||
- (declaration.kind === 220 && ts.nodeIsPresent(declaration.body))) &&
+ if ((declaration.kind === 222 ||
+ (declaration.kind === 221 && ts.nodeIsPresent(declaration.body))) &&
!ts.isInAmbientContext(declaration)) {
return declaration;
}
@@ -31656,7 +32972,7 @@ var ts;
error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged);
}
}
- var mergedClass = ts.getDeclarationOfKind(symbol, 221);
+ var mergedClass = ts.getDeclarationOfKind(symbol, 222);
if (mergedClass &&
inSameLexicalScope(node, mergedClass)) {
getNodeLinks(node).flags |= 32768;
@@ -31699,22 +33015,22 @@ var ts;
}
function checkModuleAugmentationElement(node, isGlobalAugmentation) {
switch (node.kind) {
- case 200:
+ case 201:
for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
var decl = _a[_i];
checkModuleAugmentationElement(decl, isGlobalAugmentation);
}
break;
- case 235:
case 236:
+ case 237:
grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);
break;
- case 229:
case 230:
+ case 231:
grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
break;
- case 169:
- case 218:
+ case 170:
+ case 219:
var name_22 = node.name;
if (ts.isBindingPattern(name_22)) {
for (var _b = 0, _c = name_22.elements; _b < _c.length; _b++) {
@@ -31723,12 +33039,12 @@ var ts;
}
break;
}
- case 221:
- case 224:
- case 220:
case 222:
case 225:
+ case 221:
case 223:
+ case 226:
+ case 224:
if (isGlobalAugmentation) {
return;
}
@@ -31744,17 +33060,17 @@ var ts;
}
function getFirstIdentifier(node) {
switch (node.kind) {
- case 69:
+ case 70:
return node;
- case 139:
+ case 140:
do {
node = node.left;
- } while (node.kind !== 69);
+ } while (node.kind !== 70);
return node;
- case 172:
+ case 173:
do {
node = node.expression;
- } while (node.kind !== 69);
+ } while (node.kind !== 70);
return node;
}
}
@@ -31764,9 +33080,9 @@ var ts;
error(moduleName, ts.Diagnostics.String_literal_expected);
return false;
}
- var inAmbientExternalModule = node.parent.kind === 226 && ts.isAmbientModule(node.parent.parent);
+ var inAmbientExternalModule = node.parent.kind === 227 && ts.isAmbientModule(node.parent.parent);
if (node.parent.kind !== 256 && !inAmbientExternalModule) {
- error(moduleName, node.kind === 236 ?
+ error(moduleName, node.kind === 237 ?
ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace :
ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
return false;
@@ -31787,7 +33103,7 @@ var ts;
(symbol.flags & 793064 ? 793064 : 0) |
(symbol.flags & 1920 ? 1920 : 0);
if (target.flags & excludedMeanings) {
- var message = node.kind === 238 ?
+ var message = node.kind === 239 ?
ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 :
ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
error(node, message, symbolToString(symbol));
@@ -31814,7 +33130,7 @@ var ts;
checkImportBinding(importClause);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 232) {
+ if (importClause.namedBindings.kind === 233) {
checkImportBinding(importClause.namedBindings);
}
else {
@@ -31849,7 +33165,7 @@ var ts;
}
}
else {
- if (modulekind === ts.ModuleKind.ES6 && !ts.isInAmbientContext(node)) {
+ if (modulekind === ts.ModuleKind.ES2015 && !ts.isInAmbientContext(node)) {
grammarErrorOnNode(node, ts.Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_2015_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
}
}
@@ -31865,7 +33181,7 @@ var ts;
if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
if (node.exportClause) {
ts.forEach(node.exportClause.elements, checkExportSpecifier);
- var inAmbientExternalModule = node.parent.kind === 226 && ts.isAmbientModule(node.parent.parent);
+ var inAmbientExternalModule = node.parent.kind === 227 && ts.isAmbientModule(node.parent.parent);
if (node.parent.kind !== 256 && !inAmbientExternalModule) {
error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
}
@@ -31879,7 +33195,7 @@ var ts;
}
}
function checkGrammarModuleElementContext(node, errorMessage) {
- var isInAppropriateContext = node.parent.kind === 256 || node.parent.kind === 226 || node.parent.kind === 225;
+ var isInAppropriateContext = node.parent.kind === 256 || node.parent.kind === 227 || node.parent.kind === 226;
if (!isInAppropriateContext) {
grammarErrorOnFirstToken(node, errorMessage);
}
@@ -31903,14 +33219,14 @@ var ts;
return;
}
var container = node.parent.kind === 256 ? node.parent : node.parent.parent;
- if (container.kind === 225 && !ts.isAmbientModule(container)) {
+ if (container.kind === 226 && !ts.isAmbientModule(container)) {
error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);
return;
}
if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) {
grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers);
}
- if (node.expression.kind === 69) {
+ if (node.expression.kind === 70) {
markExportAsReferenced(node);
}
else {
@@ -31918,7 +33234,7 @@ var ts;
}
checkExternalModuleExports(container);
if (node.isExportEquals && !ts.isInAmbientContext(node)) {
- if (modulekind === ts.ModuleKind.ES6) {
+ if (modulekind === ts.ModuleKind.ES2015) {
grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_2015_modules_Consider_using_export_default_or_another_module_format_instead);
}
else if (modulekind === ts.ModuleKind.System) {
@@ -31970,7 +33286,7 @@ var ts;
links.exportsChecked = true;
}
function isNotOverload(declaration) {
- return (declaration.kind !== 220 && declaration.kind !== 147) ||
+ return (declaration.kind !== 221 && declaration.kind !== 148) ||
!!declaration.body;
}
}
@@ -31981,118 +33297,118 @@ var ts;
var kind = node.kind;
if (cancellationToken) {
switch (kind) {
- case 225:
- case 221:
+ case 226:
case 222:
- case 220:
+ case 223:
+ case 221:
cancellationToken.throwIfCancellationRequested();
}
}
switch (kind) {
- case 141:
- return checkTypeParameter(node);
case 142:
+ return checkTypeParameter(node);
+ case 143:
return checkParameter(node);
+ case 146:
case 145:
- case 144:
return checkPropertyDeclaration(node);
- case 156:
case 157:
- case 151:
+ case 158:
case 152:
- return checkSignatureDeclaration(node);
case 153:
return checkSignatureDeclaration(node);
- case 147:
- case 146:
- return checkMethodDeclaration(node);
- case 148:
- return checkConstructorDeclaration(node);
- case 149:
- case 150:
- return checkAccessorDeclaration(node);
- case 155:
- return checkTypeReferenceNode(node);
case 154:
+ return checkSignatureDeclaration(node);
+ case 148:
+ case 147:
+ return checkMethodDeclaration(node);
+ case 149:
+ return checkConstructorDeclaration(node);
+ case 150:
+ case 151:
+ return checkAccessorDeclaration(node);
+ case 156:
+ return checkTypeReferenceNode(node);
+ case 155:
return checkTypePredicate(node);
- case 158:
- return checkTypeQuery(node);
case 159:
- return checkTypeLiteral(node);
+ return checkTypeQuery(node);
case 160:
- return checkArrayType(node);
+ return checkTypeLiteral(node);
case 161:
- return checkTupleType(node);
+ return checkArrayType(node);
case 162:
+ return checkTupleType(node);
case 163:
- return checkUnionOrIntersectionType(node);
case 164:
+ return checkUnionOrIntersectionType(node);
+ case 165:
return checkSourceElement(node.type);
- case 220:
- return checkFunctionDeclaration(node);
- case 199:
- case 226:
- return checkBlock(node);
- case 200:
- return checkVariableStatement(node);
- case 202:
- return checkExpressionStatement(node);
- case 203:
- return checkIfStatement(node);
- case 204:
- return checkDoStatement(node);
- case 205:
- return checkWhileStatement(node);
- case 206:
- return checkForStatement(node);
- case 207:
- return checkForInStatement(node);
- case 208:
- return checkForOfStatement(node);
- case 209:
- case 210:
- return checkBreakOrContinueStatement(node);
- case 211:
- return checkReturnStatement(node);
- case 212:
- return checkWithStatement(node);
- case 213:
- return checkSwitchStatement(node);
- case 214:
- return checkLabeledStatement(node);
- case 215:
- return checkThrowStatement(node);
- case 216:
- return checkTryStatement(node);
- case 218:
- return checkVariableDeclaration(node);
- case 169:
- return checkBindingElement(node);
case 221:
- return checkClassDeclaration(node);
- case 222:
- return checkInterfaceDeclaration(node);
- case 223:
- return checkTypeAliasDeclaration(node);
- case 224:
- return checkEnumDeclaration(node);
- case 225:
- return checkModuleDeclaration(node);
- case 230:
- return checkImportDeclaration(node);
- case 229:
- return checkImportEqualsDeclaration(node);
- case 236:
- return checkExportDeclaration(node);
- case 235:
- return checkExportAssignment(node);
+ return checkFunctionDeclaration(node);
+ case 200:
+ case 227:
+ return checkBlock(node);
case 201:
- checkGrammarStatementInAmbientContext(node);
- return;
+ return checkVariableStatement(node);
+ case 203:
+ return checkExpressionStatement(node);
+ case 204:
+ return checkIfStatement(node);
+ case 205:
+ return checkDoStatement(node);
+ case 206:
+ return checkWhileStatement(node);
+ case 207:
+ return checkForStatement(node);
+ case 208:
+ return checkForInStatement(node);
+ case 209:
+ return checkForOfStatement(node);
+ case 210:
+ case 211:
+ return checkBreakOrContinueStatement(node);
+ case 212:
+ return checkReturnStatement(node);
+ case 213:
+ return checkWithStatement(node);
+ case 214:
+ return checkSwitchStatement(node);
+ case 215:
+ return checkLabeledStatement(node);
+ case 216:
+ return checkThrowStatement(node);
case 217:
+ return checkTryStatement(node);
+ case 219:
+ return checkVariableDeclaration(node);
+ case 170:
+ return checkBindingElement(node);
+ case 222:
+ return checkClassDeclaration(node);
+ case 223:
+ return checkInterfaceDeclaration(node);
+ case 224:
+ return checkTypeAliasDeclaration(node);
+ case 225:
+ return checkEnumDeclaration(node);
+ case 226:
+ return checkModuleDeclaration(node);
+ case 231:
+ return checkImportDeclaration(node);
+ case 230:
+ return checkImportEqualsDeclaration(node);
+ case 237:
+ return checkExportDeclaration(node);
+ case 236:
+ return checkExportAssignment(node);
+ case 202:
checkGrammarStatementInAmbientContext(node);
return;
- case 239:
+ case 218:
+ checkGrammarStatementInAmbientContext(node);
+ return;
+ case 240:
return checkMissingDeclaration(node);
}
}
@@ -32105,17 +33421,17 @@ var ts;
for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) {
var node = deferredNodes_1[_i];
switch (node.kind) {
- case 179:
case 180:
+ case 181:
+ case 148:
case 147:
- case 146:
checkFunctionExpressionOrObjectLiteralMethodDeferred(node);
break;
- case 149:
case 150:
+ case 151:
checkAccessorDeferred(node);
break;
- case 192:
+ case 193:
checkClassExpressionDeferred(node);
break;
}
@@ -32187,7 +33503,7 @@ var ts;
function isInsideWithStatementBody(node) {
if (node) {
while (node.parent) {
- if (node.parent.kind === 212 && node.parent.statement === node) {
+ if (node.parent.kind === 213 && node.parent.statement === node) {
return true;
}
node = node.parent;
@@ -32213,24 +33529,24 @@ var ts;
if (!ts.isExternalOrCommonJsModule(location)) {
break;
}
- case 225:
+ case 226:
copySymbols(getSymbolOfNode(location).exports, meaning & 8914931);
break;
- case 224:
+ case 225:
copySymbols(getSymbolOfNode(location).exports, meaning & 8);
break;
- case 192:
+ case 193:
var className = location.name;
if (className) {
copySymbol(location.symbol, meaning);
}
- case 221:
case 222:
+ case 223:
if (!(memberFlags & 32)) {
copySymbols(getSymbolOfNode(location).members, meaning & 793064);
}
break;
- case 179:
+ case 180:
var funcName = location.name;
if (funcName) {
copySymbol(location.symbol, meaning);
@@ -32263,33 +33579,33 @@ var ts;
}
}
function isTypeDeclarationName(name) {
- return name.kind === 69 &&
+ return name.kind === 70 &&
isTypeDeclaration(name.parent) &&
name.parent.name === name;
}
function isTypeDeclaration(node) {
switch (node.kind) {
- case 141:
- case 221:
+ case 142:
case 222:
case 223:
case 224:
+ case 225:
return true;
}
}
function isTypeReferenceIdentifier(entityName) {
var node = entityName;
- while (node.parent && node.parent.kind === 139) {
+ while (node.parent && node.parent.kind === 140) {
node = node.parent;
}
- return node.parent && (node.parent.kind === 155 || node.parent.kind === 267);
+ return node.parent && (node.parent.kind === 156 || node.parent.kind === 267);
}
function isHeritageClauseElementIdentifier(entityName) {
var node = entityName;
- while (node.parent && node.parent.kind === 172) {
+ while (node.parent && node.parent.kind === 173) {
node = node.parent;
}
- return node.parent && node.parent.kind === 194;
+ return node.parent && node.parent.kind === 195;
}
function forEachEnclosingClass(node, callback) {
var result;
@@ -32306,13 +33622,13 @@ var ts;
return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; });
}
function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) {
- while (nodeOnRightSide.parent.kind === 139) {
+ while (nodeOnRightSide.parent.kind === 140) {
nodeOnRightSide = nodeOnRightSide.parent;
}
- if (nodeOnRightSide.parent.kind === 229) {
+ if (nodeOnRightSide.parent.kind === 230) {
return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent;
}
- if (nodeOnRightSide.parent.kind === 235) {
+ if (nodeOnRightSide.parent.kind === 236) {
return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent;
}
return undefined;
@@ -32324,7 +33640,7 @@ var ts;
if (ts.isDeclarationName(entityName)) {
return getSymbolOfNode(entityName.parent);
}
- if (ts.isInJavaScriptFile(entityName) && entityName.parent.kind === 172) {
+ if (ts.isInJavaScriptFile(entityName) && entityName.parent.kind === 173) {
var specialPropertyAssignmentKind = ts.getSpecialPropertyAssignmentKind(entityName.parent.parent);
switch (specialPropertyAssignmentKind) {
case 1:
@@ -32336,20 +33652,20 @@ var ts;
default:
}
}
- if (entityName.parent.kind === 235 && ts.isEntityNameExpression(entityName)) {
+ if (entityName.parent.kind === 236 && ts.isEntityNameExpression(entityName)) {
return resolveEntityName(entityName, 107455 | 793064 | 1920 | 8388608);
}
- if (entityName.kind !== 172 && isInRightSideOfImportOrExportAssignment(entityName)) {
- var importEqualsDeclaration = ts.getAncestor(entityName, 229);
+ if (entityName.kind !== 173 && isInRightSideOfImportOrExportAssignment(entityName)) {
+ var importEqualsDeclaration = ts.getAncestor(entityName, 230);
ts.Debug.assert(importEqualsDeclaration !== undefined);
- return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importEqualsDeclaration, true);
+ return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, true);
}
if (ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
entityName = entityName.parent;
}
if (isHeritageClauseElementIdentifier(entityName)) {
var meaning = 0;
- if (entityName.parent.kind === 194) {
+ if (entityName.parent.kind === 195) {
meaning = 793064;
if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) {
meaning |= 107455;
@@ -32365,20 +33681,20 @@ var ts;
if (ts.nodeIsMissing(entityName)) {
return undefined;
}
- if (entityName.kind === 69) {
+ if (entityName.kind === 70) {
if (ts.isJSXTagName(entityName) && isJsxIntrinsicIdentifier(entityName)) {
return getIntrinsicTagSymbol(entityName.parent);
}
return resolveEntityName(entityName, 107455, false, true);
}
- else if (entityName.kind === 172) {
+ else if (entityName.kind === 173) {
var symbol = getNodeLinks(entityName).resolvedSymbol;
if (!symbol) {
checkPropertyAccessExpression(entityName);
}
return getNodeLinks(entityName).resolvedSymbol;
}
- else if (entityName.kind === 139) {
+ else if (entityName.kind === 140) {
var symbol = getNodeLinks(entityName).resolvedSymbol;
if (!symbol) {
checkQualifiedName(entityName);
@@ -32387,13 +33703,13 @@ var ts;
}
}
else if (isTypeReferenceIdentifier(entityName)) {
- var meaning = (entityName.parent.kind === 155 || entityName.parent.kind === 267) ? 793064 : 1920;
+ var meaning = (entityName.parent.kind === 156 || entityName.parent.kind === 267) ? 793064 : 1920;
return resolveEntityName(entityName, meaning, false, true);
}
else if (entityName.parent.kind === 246) {
return getJsxAttributePropertySymbol(entityName.parent);
}
- if (entityName.parent.kind === 154) {
+ if (entityName.parent.kind === 155) {
return resolveEntityName(entityName, 1);
}
return undefined;
@@ -32411,12 +33727,12 @@ var ts;
else if (ts.isLiteralComputedPropertyDeclarationName(node)) {
return getSymbolOfNode(node.parent.parent);
}
- if (node.kind === 69) {
+ if (node.kind === 70) {
if (isInRightSideOfImportOrExportAssignment(node)) {
return getSymbolOfEntityNameOrPropertyAccessExpression(node);
}
- else if (node.parent.kind === 169 &&
- node.parent.parent.kind === 167 &&
+ else if (node.parent.kind === 170 &&
+ node.parent.parent.kind === 168 &&
node === node.parent.propertyName) {
var typeOfPattern = getTypeOfNode(node.parent.parent);
var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text);
@@ -32426,11 +33742,11 @@ var ts;
}
}
switch (node.kind) {
- case 69:
- case 172:
- case 139:
+ case 70:
+ case 173:
+ case 140:
return getSymbolOfEntityNameOrPropertyAccessExpression(node);
- case 97:
+ case 98:
var container = ts.getThisContainer(node, false);
if (ts.isFunctionLike(container)) {
var sig = getSignatureFromDeclaration(container);
@@ -32438,21 +33754,21 @@ var ts;
return sig.thisParameter;
}
}
- case 95:
+ case 96:
var type = ts.isPartOfExpression(node) ? checkExpression(node) : getTypeFromTypeNode(node);
return type.symbol;
- case 165:
+ case 166:
return getTypeFromTypeNode(node).symbol;
- case 121:
+ case 122:
var constructorDeclaration = node.parent;
- if (constructorDeclaration && constructorDeclaration.kind === 148) {
+ if (constructorDeclaration && constructorDeclaration.kind === 149) {
return constructorDeclaration.parent.symbol;
}
return undefined;
case 9:
if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) &&
ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||
- ((node.parent.kind === 230 || node.parent.kind === 236) &&
+ ((node.parent.kind === 231 || node.parent.kind === 237) &&
node.parent.moduleSpecifier === node)) {
return resolveExternalModuleName(node, node);
}
@@ -32460,7 +33776,7 @@ var ts;
return resolveExternalModuleName(node, node);
}
case 8:
- if (node.parent.kind === 173 && node.parent.argumentExpression === node) {
+ if (node.parent.kind === 174 && node.parent.argumentExpression === node) {
var objectType = checkExpression(node.parent.expression);
if (objectType === unknownType)
return undefined;
@@ -32524,12 +33840,12 @@ var ts;
return unknownType;
}
function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) {
- ts.Debug.assert(expr.kind === 171 || expr.kind === 170);
- if (expr.parent.kind === 208) {
+ ts.Debug.assert(expr.kind === 172 || expr.kind === 171);
+ if (expr.parent.kind === 209) {
var iteratedType = checkRightHandSideOfForOf(expr.parent.expression);
return checkDestructuringAssignment(expr, iteratedType || unknownType);
}
- if (expr.parent.kind === 187) {
+ if (expr.parent.kind === 188) {
var iteratedType = checkExpression(expr.parent.right);
return checkDestructuringAssignment(expr, iteratedType || unknownType);
}
@@ -32537,7 +33853,7 @@ var ts;
var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent);
return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent);
}
- ts.Debug.assert(expr.parent.kind === 170);
+ ts.Debug.assert(expr.parent.kind === 171);
var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent);
var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, false) || unknownType;
return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, ts.indexOf(expr.parent.elements, expr), elementType || unknownType);
@@ -32678,7 +33994,7 @@ var ts;
else if (nodeLinks_1.flags & 131072) {
var isDeclaredInLoop = nodeLinks_1.flags & 262144;
var inLoopInitializer = ts.isIterationStatement(container, false);
- var inLoopBodyBlock = container.kind === 199 && ts.isIterationStatement(container.parent, false);
+ var inLoopBodyBlock = container.kind === 200 && ts.isIterationStatement(container.parent, false);
links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock));
}
else {
@@ -32718,18 +34034,18 @@ var ts;
return true;
}
switch (node.kind) {
- case 229:
- case 231:
+ case 230:
case 232:
- case 234:
- case 238:
+ case 233:
+ case 235:
+ case 239:
return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol);
- case 236:
+ case 237:
var exportClause = node.exportClause;
return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration);
- case 235:
+ case 236:
return node.expression
- && node.expression.kind === 69
+ && node.expression.kind === 70
? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol)
: true;
}
@@ -32961,7 +34277,7 @@ var ts;
if (!fileToDirective) {
return undefined;
}
- var meaning = (node.kind === 172) || (node.kind === 69 && isInTypeQuery(node))
+ var meaning = (node.kind === 173) || (node.kind === 70 && isInTypeQuery(node))
? 107455 | 1048576
: 793064 | 1920;
var symbol = resolveEntityName(node, meaning, true);
@@ -33108,6 +34424,7 @@ var ts;
getGlobalIterableIteratorType = ts.memoize(function () { return emptyGenericType; });
}
anyArrayType = createArrayType(anyType);
+ autoArrayType = createArrayType(autoType);
var symbol = getGlobalSymbol("ReadonlyArray", 793064, undefined);
globalReadonlyArrayType = symbol && getTypeOfGlobalSymbol(symbol, 1);
anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType;
@@ -33167,14 +34484,14 @@ var ts;
return false;
}
if (!ts.nodeCanBeDecorated(node)) {
- if (node.kind === 147 && !ts.nodeIsPresent(node.body)) {
+ if (node.kind === 148 && !ts.nodeIsPresent(node.body)) {
return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload);
}
else {
return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here);
}
}
- else if (node.kind === 149 || node.kind === 150) {
+ else if (node.kind === 150 || node.kind === 151) {
var accessors = ts.getAllAccessorDeclarations(node.parent.members, node);
if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) {
return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
@@ -33191,28 +34508,28 @@ var ts;
var flags = 0;
for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) {
var modifier = _a[_i];
- if (modifier.kind !== 128) {
- if (node.kind === 144 || node.kind === 146) {
+ if (modifier.kind !== 129) {
+ if (node.kind === 145 || node.kind === 147) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind));
}
- if (node.kind === 153) {
+ if (node.kind === 154) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind));
}
}
switch (modifier.kind) {
- case 74:
- if (node.kind !== 224 && node.parent.kind === 221) {
- return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(74));
+ case 75:
+ if (node.kind !== 225 && node.parent.kind === 222) {
+ return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(75));
}
break;
+ case 113:
case 112:
case 111:
- case 110:
var text = visibilityToString(ts.modifierToFlag(modifier.kind));
- if (modifier.kind === 111) {
+ if (modifier.kind === 112) {
lastProtected = modifier;
}
- else if (modifier.kind === 110) {
+ else if (modifier.kind === 111) {
lastPrivate = modifier;
}
if (flags & 28) {
@@ -33227,11 +34544,11 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async");
}
- else if (node.parent.kind === 226 || node.parent.kind === 256) {
+ else if (node.parent.kind === 227 || node.parent.kind === 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
}
else if (flags & 128) {
- if (modifier.kind === 110) {
+ if (modifier.kind === 111) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract");
}
else {
@@ -33240,7 +34557,7 @@ var ts;
}
flags |= ts.modifierToFlag(modifier.kind);
break;
- case 113:
+ case 114:
if (flags & 32) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static");
}
@@ -33250,10 +34567,10 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async");
}
- else if (node.parent.kind === 226 || node.parent.kind === 256) {
+ else if (node.parent.kind === 227 || node.parent.kind === 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
}
- else if (node.kind === 142) {
+ else if (node.kind === 143) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static");
}
else if (flags & 128) {
@@ -33262,17 +34579,17 @@ var ts;
flags |= 32;
lastStatic = modifier;
break;
- case 128:
+ case 129:
if (flags & 64) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly");
}
- else if (node.kind !== 145 && node.kind !== 144 && node.kind !== 153 && node.kind !== 142) {
+ else if (node.kind !== 146 && node.kind !== 145 && node.kind !== 154 && node.kind !== 143) {
return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
}
flags |= 64;
lastReadonly = modifier;
break;
- case 82:
+ case 83:
if (flags & 1) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export");
}
@@ -33285,45 +34602,45 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async");
}
- else if (node.parent.kind === 221) {
+ else if (node.parent.kind === 222) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export");
}
- else if (node.kind === 142) {
+ else if (node.kind === 143) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export");
}
flags |= 1;
break;
- case 122:
+ case 123:
if (flags & 2) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare");
}
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
}
- else if (node.parent.kind === 221) {
+ else if (node.parent.kind === 222) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare");
}
- else if (node.kind === 142) {
+ else if (node.kind === 143) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare");
}
- else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 226) {
+ else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 227) {
return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
}
flags |= 2;
lastDeclare = modifier;
break;
- case 115:
+ case 116:
if (flags & 128) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract");
}
- if (node.kind !== 221) {
- if (node.kind !== 147 &&
- node.kind !== 145 &&
- node.kind !== 149 &&
- node.kind !== 150) {
+ if (node.kind !== 222) {
+ if (node.kind !== 148 &&
+ node.kind !== 146 &&
+ node.kind !== 150 &&
+ node.kind !== 151) {
return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
}
- if (!(node.parent.kind === 221 && ts.getModifierFlags(node.parent) & 128)) {
+ if (!(node.parent.kind === 222 && ts.getModifierFlags(node.parent) & 128)) {
return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);
}
if (flags & 32) {
@@ -33335,14 +34652,14 @@ var ts;
}
flags |= 128;
break;
- case 118:
+ case 119:
if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "async");
}
else if (flags & 2 || ts.isInAmbientContext(node.parent)) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
}
- else if (node.kind === 142) {
+ else if (node.kind === 143) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async");
}
flags |= 256;
@@ -33350,7 +34667,7 @@ var ts;
break;
}
}
- if (node.kind === 148) {
+ if (node.kind === 149) {
if (flags & 32) {
return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
}
@@ -33365,13 +34682,13 @@ var ts;
}
return;
}
- else if ((node.kind === 230 || node.kind === 229) && flags & 2) {
+ else if ((node.kind === 231 || node.kind === 230) && flags & 2) {
return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
}
- else if (node.kind === 142 && (flags & 92) && ts.isBindingPattern(node.name)) {
+ else if (node.kind === 143 && (flags & 92) && ts.isBindingPattern(node.name)) {
return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern);
}
- else if (node.kind === 142 && (flags & 92) && node.dotDotDotToken) {
+ else if (node.kind === 143 && (flags & 92) && node.dotDotDotToken) {
return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
}
if (flags & 256) {
@@ -33387,38 +34704,38 @@ var ts;
}
function shouldReportBadModifier(node) {
switch (node.kind) {
- case 149:
case 150:
- case 148:
- case 145:
- case 144:
- case 147:
+ case 151:
+ case 149:
case 146:
- case 153:
- case 225:
+ case 145:
+ case 148:
+ case 147:
+ case 154:
+ case 226:
+ case 231:
case 230:
- case 229:
+ case 237:
case 236:
- case 235:
- case 179:
case 180:
- case 142:
+ case 181:
+ case 143:
return false;
default:
- if (node.parent.kind === 226 || node.parent.kind === 256) {
+ if (node.parent.kind === 227 || node.parent.kind === 256) {
return false;
}
switch (node.kind) {
- case 220:
- return nodeHasAnyModifiersExcept(node, 118);
case 221:
- return nodeHasAnyModifiersExcept(node, 115);
+ return nodeHasAnyModifiersExcept(node, 119);
case 222:
- case 200:
+ return nodeHasAnyModifiersExcept(node, 116);
case 223:
- return true;
+ case 201:
case 224:
- return nodeHasAnyModifiersExcept(node, 74);
+ return true;
+ case 225:
+ return nodeHasAnyModifiersExcept(node, 75);
default:
ts.Debug.fail();
return false;
@@ -33430,10 +34747,10 @@ var ts;
}
function checkGrammarAsyncModifier(node, asyncModifier) {
switch (node.kind) {
- case 147:
- case 220:
- case 179:
+ case 148:
+ case 221:
case 180:
+ case 181:
if (!node.asteriskToken) {
return false;
}
@@ -33449,7 +34766,7 @@ var ts;
return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Trailing_comma_not_allowed);
}
}
- function checkGrammarTypeParameterList(node, typeParameters, file) {
+ function checkGrammarTypeParameterList(typeParameters, file) {
if (checkGrammarForDisallowedTrailingComma(typeParameters)) {
return true;
}
@@ -33491,11 +34808,11 @@ var ts;
}
function checkGrammarFunctionLikeDeclaration(node) {
var file = ts.getSourceFileOfNode(node);
- return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node.typeParameters, file) ||
+ return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) ||
checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file);
}
function checkGrammarArrowFunction(node, file) {
- if (node.kind === 180) {
+ if (node.kind === 181) {
var arrowFunction = node;
var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line;
var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line;
@@ -33530,7 +34847,7 @@ var ts;
if (!parameter.type) {
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation);
}
- if (parameter.type.kind !== 132 && parameter.type.kind !== 130) {
+ if (parameter.type.kind !== 133 && parameter.type.kind !== 131) {
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number);
}
if (!node.type) {
@@ -33557,7 +34874,7 @@ var ts;
var sourceFile = ts.getSourceFileOfNode(node);
for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
var arg = args_4[_i];
- if (arg.kind === 193) {
+ if (arg.kind === 194) {
return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
}
}
@@ -33583,7 +34900,7 @@ var ts;
if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && node.heritageClauses) {
for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) {
var heritageClause = _a[_i];
- if (heritageClause.token === 83) {
+ if (heritageClause.token === 84) {
if (seenExtendsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen);
}
@@ -33596,7 +34913,7 @@ var ts;
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 106);
+ ts.Debug.assert(heritageClause.token === 107);
if (seenImplementsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen);
}
@@ -33611,14 +34928,14 @@ var ts;
if (node.heritageClauses) {
for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) {
var heritageClause = _a[_i];
- if (heritageClause.token === 83) {
+ if (heritageClause.token === 84) {
if (seenExtendsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen);
}
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 106);
+ ts.Debug.assert(heritageClause.token === 107);
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause);
}
checkGrammarHeritageClause(heritageClause);
@@ -33627,19 +34944,19 @@ var ts;
return false;
}
function checkGrammarComputedPropertyName(node) {
- if (node.kind !== 140) {
+ if (node.kind !== 141) {
return false;
}
var computedPropertyName = node;
- if (computedPropertyName.expression.kind === 187 && computedPropertyName.expression.operatorToken.kind === 24) {
+ if (computedPropertyName.expression.kind === 188 && computedPropertyName.expression.operatorToken.kind === 25) {
return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name);
}
}
function checkGrammarForGenerator(node) {
if (node.asteriskToken) {
- ts.Debug.assert(node.kind === 220 ||
- node.kind === 179 ||
- node.kind === 147);
+ ts.Debug.assert(node.kind === 221 ||
+ node.kind === 180 ||
+ node.kind === 148);
if (ts.isInAmbientContext(node)) {
return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);
}
@@ -33651,7 +34968,7 @@ var ts;
}
}
}
- function checkGrammarForInvalidQuestionMark(node, questionToken, message) {
+ function checkGrammarForInvalidQuestionMark(questionToken, message) {
if (questionToken) {
return grammarErrorOnNode(questionToken, message);
}
@@ -33665,7 +34982,7 @@ var ts;
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var prop = _a[_i];
var name_24 = prop.name;
- if (name_24.kind === 140) {
+ if (name_24.kind === 141) {
checkGrammarComputedPropertyName(name_24);
}
if (prop.kind === 254 && !inDestructuring && prop.objectAssignmentInitializer) {
@@ -33674,26 +34991,26 @@ var ts;
if (prop.modifiers) {
for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) {
var mod = _c[_b];
- if (mod.kind !== 118 || prop.kind !== 147) {
+ if (mod.kind !== 119 || prop.kind !== 148) {
grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod));
}
}
}
var currentKind = void 0;
if (prop.kind === 253 || prop.kind === 254) {
- checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
+ checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
if (name_24.kind === 8) {
checkGrammarNumericLiteral(name_24);
}
currentKind = Property;
}
- else if (prop.kind === 147) {
+ else if (prop.kind === 148) {
currentKind = Property;
}
- else if (prop.kind === 149) {
+ else if (prop.kind === 150) {
currentKind = GetAccessor;
}
- else if (prop.kind === 150) {
+ else if (prop.kind === 151) {
currentKind = SetAccessor;
}
else {
@@ -33750,7 +35067,7 @@ var ts;
if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) {
return true;
}
- if (forInOrOfStatement.initializer.kind === 219) {
+ if (forInOrOfStatement.initializer.kind === 220) {
var variableList = forInOrOfStatement.initializer;
if (!checkGrammarVariableDeclarationList(variableList)) {
var declarations = variableList.declarations;
@@ -33758,20 +35075,20 @@ var ts;
return false;
}
if (declarations.length > 1) {
- var diagnostic = forInOrOfStatement.kind === 207
+ var diagnostic = forInOrOfStatement.kind === 208
? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement
: ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;
return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic);
}
var firstDeclaration = declarations[0];
if (firstDeclaration.initializer) {
- var diagnostic = forInOrOfStatement.kind === 207
+ var diagnostic = forInOrOfStatement.kind === 208
? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer
: ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;
return grammarErrorOnNode(firstDeclaration.name, diagnostic);
}
if (firstDeclaration.type) {
- var diagnostic = forInOrOfStatement.kind === 207
+ var diagnostic = forInOrOfStatement.kind === 208
? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation
: ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;
return grammarErrorOnNode(firstDeclaration, diagnostic);
@@ -33795,11 +35112,11 @@ var ts;
return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters);
}
else if (!doesAccessorHaveCorrectParameterCount(accessor)) {
- return grammarErrorOnNode(accessor.name, kind === 149 ?
+ return grammarErrorOnNode(accessor.name, kind === 150 ?
ts.Diagnostics.A_get_accessor_cannot_have_parameters :
ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter);
}
- else if (kind === 150) {
+ else if (kind === 151) {
if (accessor.type) {
return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);
}
@@ -33818,10 +35135,10 @@ var ts;
}
}
function doesAccessorHaveCorrectParameterCount(accessor) {
- return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 149 ? 0 : 1);
+ return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 150 ? 0 : 1);
}
function getAccessorThisParameter(accessor) {
- if (accessor.parameters.length === (accessor.kind === 149 ? 1 : 2)) {
+ if (accessor.parameters.length === (accessor.kind === 150 ? 1 : 2)) {
return ts.getThisParameter(accessor);
}
}
@@ -33836,8 +35153,8 @@ var ts;
checkGrammarForGenerator(node)) {
return true;
}
- if (node.parent.kind === 171) {
- if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) {
+ if (node.parent.kind === 172) {
+ if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) {
return true;
}
else if (node.body === undefined) {
@@ -33852,10 +35169,10 @@ var ts;
return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol);
}
}
- else if (node.parent.kind === 222) {
+ else if (node.parent.kind === 223) {
return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol);
}
- else if (node.parent.kind === 159) {
+ else if (node.parent.kind === 160) {
return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol);
}
}
@@ -33866,9 +35183,9 @@ var ts;
return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary);
}
switch (current.kind) {
- case 214:
+ case 215:
if (node.label && current.label.text === node.label.text) {
- var isMisplacedContinueLabel = node.kind === 209
+ var isMisplacedContinueLabel = node.kind === 210
&& !ts.isIterationStatement(current.statement, true);
if (isMisplacedContinueLabel) {
return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement);
@@ -33876,8 +35193,8 @@ var ts;
return false;
}
break;
- case 213:
- if (node.kind === 210 && !node.label) {
+ case 214:
+ if (node.kind === 211 && !node.label) {
return false;
}
break;
@@ -33890,13 +35207,13 @@ var ts;
current = current.parent;
}
if (node.label) {
- var message = node.kind === 210
+ var message = node.kind === 211
? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement
: ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
}
else {
- var message = node.kind === 210
+ var message = node.kind === 211
? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement
: ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
@@ -33908,7 +35225,7 @@ var ts;
if (node !== ts.lastOrUndefined(elements)) {
return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern);
}
- if (node.name.kind === 168 || node.name.kind === 167) {
+ if (node.name.kind === 169 || node.name.kind === 168) {
return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern);
}
if (node.initializer) {
@@ -33918,11 +35235,11 @@ var ts;
}
function isStringOrNumberLiteralExpression(expr) {
return expr.kind === 9 || expr.kind === 8 ||
- expr.kind === 185 && expr.operator === 36 &&
+ expr.kind === 186 && expr.operator === 37 &&
expr.operand.kind === 8;
}
function checkGrammarVariableDeclaration(node) {
- if (node.parent.parent.kind !== 207 && node.parent.parent.kind !== 208) {
+ if (node.parent.parent.kind !== 208 && node.parent.parent.kind !== 209) {
if (ts.isInAmbientContext(node)) {
if (node.initializer) {
if (ts.isConst(node) && !node.type) {
@@ -33953,8 +35270,8 @@ var ts;
return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name);
}
function checkGrammarNameInLetOrConstDeclarations(name) {
- if (name.kind === 69) {
- if (name.originalKeywordKind === 108) {
+ if (name.kind === 70) {
+ if (name.originalKeywordKind === 109) {
return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations);
}
}
@@ -33979,15 +35296,15 @@ var ts;
}
function allowLetAndConstDeclarations(parent) {
switch (parent.kind) {
- case 203:
case 204:
case 205:
- case 212:
case 206:
+ case 213:
case 207:
case 208:
+ case 209:
return false;
- case 214:
+ case 215:
return allowLetAndConstDeclarations(parent.parent);
}
return true;
@@ -34042,7 +35359,7 @@ var ts;
return true;
}
}
- else if (node.parent.kind === 222) {
+ else if (node.parent.kind === 223) {
if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) {
return true;
}
@@ -34050,7 +35367,7 @@ var ts;
return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer);
}
}
- else if (node.parent.kind === 159) {
+ else if (node.parent.kind === 160) {
if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) {
return true;
}
@@ -34063,13 +35380,13 @@ var ts;
}
}
function checkGrammarTopLevelElementForRequiredDeclareModifier(node) {
- if (node.kind === 222 ||
- node.kind === 223 ||
+ if (node.kind === 223 ||
+ node.kind === 224 ||
+ node.kind === 231 ||
node.kind === 230 ||
- node.kind === 229 ||
+ node.kind === 237 ||
node.kind === 236 ||
- node.kind === 235 ||
- node.kind === 228 ||
+ node.kind === 229 ||
ts.getModifierFlags(node) & (2 | 1 | 512)) {
return false;
}
@@ -34078,7 +35395,7 @@ var ts;
function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) {
for (var _i = 0, _a = file.statements; _i < _a.length; _i++) {
var decl = _a[_i];
- if (ts.isDeclaration(decl) || decl.kind === 200) {
+ if (ts.isDeclaration(decl) || decl.kind === 201) {
if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) {
return true;
}
@@ -34097,7 +35414,7 @@ var ts;
if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) {
return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
}
- if (node.parent.kind === 199 || node.parent.kind === 226 || node.parent.kind === 256) {
+ if (node.parent.kind === 200 || node.parent.kind === 227 || node.parent.kind === 256) {
var links_1 = getNodeLinks(node.parent);
if (!links_1.hasReportedStatementInAmbientContext) {
return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts);
@@ -34136,46 +35453,46 @@ var ts;
(function (ts) {
;
var nodeEdgeTraversalMap = ts.createMap((_a = {},
- _a[139] = [
+ _a[140] = [
{ name: "left", test: ts.isEntityName },
{ name: "right", test: ts.isIdentifier }
],
- _a[143] = [
+ _a[144] = [
{ name: "expression", test: ts.isLeftHandSideExpression }
],
- _a[177] = [
+ _a[178] = [
{ name: "type", test: ts.isTypeNode },
{ name: "expression", test: ts.isUnaryExpression }
],
- _a[195] = [
+ _a[196] = [
{ name: "expression", test: ts.isExpression },
{ name: "type", test: ts.isTypeNode }
],
- _a[196] = [
+ _a[197] = [
{ name: "expression", test: ts.isLeftHandSideExpression }
],
- _a[224] = [
+ _a[225] = [
{ name: "decorators", test: ts.isDecorator },
{ name: "modifiers", test: ts.isModifier },
{ name: "name", test: ts.isIdentifier },
{ name: "members", test: ts.isEnumMember }
],
- _a[225] = [
+ _a[226] = [
{ name: "decorators", test: ts.isDecorator },
{ name: "modifiers", test: ts.isModifier },
{ name: "name", test: ts.isModuleName },
{ name: "body", test: ts.isModuleBody }
],
- _a[226] = [
+ _a[227] = [
{ name: "statements", test: ts.isStatement }
],
- _a[229] = [
+ _a[230] = [
{ name: "decorators", test: ts.isDecorator },
{ name: "modifiers", test: ts.isModifier },
{ name: "name", test: ts.isIdentifier },
{ name: "moduleReference", test: ts.isModuleReference }
],
- _a[240] = [
+ _a[241] = [
{ name: "expression", test: ts.isExpression, optional: true }
],
_a[255] = [
@@ -34191,41 +35508,41 @@ var ts;
return initial;
}
var kind = node.kind;
- if ((kind > 0 && kind <= 138)) {
+ if ((kind > 0 && kind <= 139)) {
return initial;
}
- if ((kind >= 154 && kind <= 166)) {
+ if ((kind >= 155 && kind <= 167)) {
return initial;
}
var result = initial;
switch (node.kind) {
- case 198:
- case 201:
- case 193:
- case 217:
+ case 199:
+ case 202:
+ case 194:
+ case 218:
case 287:
break;
- case 140:
+ case 141:
result = reduceNode(node.expression, f, result);
break;
- case 142:
- result = ts.reduceLeft(node.decorators, f, result);
- result = ts.reduceLeft(node.modifiers, f, result);
- result = reduceNode(node.name, f, result);
- result = reduceNode(node.type, f, result);
- result = reduceNode(node.initializer, f, result);
- break;
case 143:
- result = reduceNode(node.expression, f, result);
- break;
- case 145:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
result = reduceNode(node.type, f, result);
result = reduceNode(node.initializer, f, result);
break;
- case 147:
+ case 144:
+ result = reduceNode(node.expression, f, result);
+ break;
+ case 146:
+ result = ts.reduceLeft(node.decorators, f, result);
+ result = ts.reduceLeft(node.modifiers, f, result);
+ result = reduceNode(node.name, f, result);
+ result = reduceNode(node.type, f, result);
+ result = reduceNode(node.initializer, f, result);
+ break;
+ case 148:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
@@ -34234,53 +35551,48 @@ var ts;
result = reduceNode(node.type, f, result);
result = reduceNode(node.body, f, result);
break;
- case 148:
- result = ts.reduceLeft(node.modifiers, f, result);
- result = ts.reduceLeft(node.parameters, f, result);
- result = reduceNode(node.body, f, result);
- break;
case 149:
- result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
- result = reduceNode(node.name, f, result);
result = ts.reduceLeft(node.parameters, f, result);
- result = reduceNode(node.type, f, result);
result = reduceNode(node.body, f, result);
break;
case 150:
+ result = ts.reduceLeft(node.decorators, f, result);
+ result = ts.reduceLeft(node.modifiers, f, result);
+ result = reduceNode(node.name, f, result);
+ result = ts.reduceLeft(node.parameters, f, result);
+ result = reduceNode(node.type, f, result);
+ result = reduceNode(node.body, f, result);
+ break;
+ case 151:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
result = ts.reduceLeft(node.parameters, f, result);
result = reduceNode(node.body, f, result);
break;
- case 167:
case 168:
+ case 169:
result = ts.reduceLeft(node.elements, f, result);
break;
- case 169:
+ case 170:
result = reduceNode(node.propertyName, f, result);
result = reduceNode(node.name, f, result);
result = reduceNode(node.initializer, f, result);
break;
- case 170:
+ case 171:
result = ts.reduceLeft(node.elements, f, result);
break;
- case 171:
- result = ts.reduceLeft(node.properties, f, result);
- break;
case 172:
- result = reduceNode(node.expression, f, result);
- result = reduceNode(node.name, f, result);
+ result = ts.reduceLeft(node.properties, f, result);
break;
case 173:
result = reduceNode(node.expression, f, result);
- result = reduceNode(node.argumentExpression, f, result);
+ result = reduceNode(node.name, f, result);
break;
case 174:
result = reduceNode(node.expression, f, result);
- result = ts.reduceLeft(node.typeArguments, f, result);
- result = ts.reduceLeft(node.arguments, f, result);
+ result = reduceNode(node.argumentExpression, f, result);
break;
case 175:
result = reduceNode(node.expression, f, result);
@@ -34288,10 +35600,15 @@ var ts;
result = ts.reduceLeft(node.arguments, f, result);
break;
case 176:
+ result = reduceNode(node.expression, f, result);
+ result = ts.reduceLeft(node.typeArguments, f, result);
+ result = ts.reduceLeft(node.arguments, f, result);
+ break;
+ case 177:
result = reduceNode(node.tag, f, result);
result = reduceNode(node.template, f, result);
break;
- case 179:
+ case 180:
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
result = ts.reduceLeft(node.typeParameters, f, result);
@@ -34299,126 +35616,126 @@ var ts;
result = reduceNode(node.type, f, result);
result = reduceNode(node.body, f, result);
break;
- case 180:
+ case 181:
result = ts.reduceLeft(node.modifiers, f, result);
result = ts.reduceLeft(node.typeParameters, f, result);
result = ts.reduceLeft(node.parameters, f, result);
result = reduceNode(node.type, f, result);
result = reduceNode(node.body, f, result);
break;
- case 178:
- case 181:
+ case 179:
case 182:
case 183:
case 184:
- case 190:
+ case 185:
case 191:
- case 196:
+ case 192:
+ case 197:
result = reduceNode(node.expression, f, result);
break;
- case 185:
case 186:
+ case 187:
result = reduceNode(node.operand, f, result);
break;
- case 187:
+ case 188:
result = reduceNode(node.left, f, result);
result = reduceNode(node.right, f, result);
break;
- case 188:
+ case 189:
result = reduceNode(node.condition, f, result);
result = reduceNode(node.whenTrue, f, result);
result = reduceNode(node.whenFalse, f, result);
break;
- case 189:
+ case 190:
result = reduceNode(node.head, f, result);
result = ts.reduceLeft(node.templateSpans, f, result);
break;
- case 192:
+ case 193:
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
result = ts.reduceLeft(node.typeParameters, f, result);
result = ts.reduceLeft(node.heritageClauses, f, result);
result = ts.reduceLeft(node.members, f, result);
break;
- case 194:
+ case 195:
result = reduceNode(node.expression, f, result);
result = ts.reduceLeft(node.typeArguments, f, result);
break;
- case 197:
+ case 198:
result = reduceNode(node.expression, f, result);
result = reduceNode(node.literal, f, result);
break;
- case 199:
+ case 200:
result = ts.reduceLeft(node.statements, f, result);
break;
- case 200:
+ case 201:
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.declarationList, f, result);
break;
- case 202:
+ case 203:
result = reduceNode(node.expression, f, result);
break;
- case 203:
+ case 204:
result = reduceNode(node.expression, f, result);
result = reduceNode(node.thenStatement, f, result);
result = reduceNode(node.elseStatement, f, result);
break;
- case 204:
- result = reduceNode(node.statement, f, result);
- result = reduceNode(node.expression, f, result);
- break;
case 205:
- case 212:
- result = reduceNode(node.expression, f, result);
result = reduceNode(node.statement, f, result);
+ result = reduceNode(node.expression, f, result);
break;
case 206:
+ case 213:
+ result = reduceNode(node.expression, f, result);
+ result = reduceNode(node.statement, f, result);
+ break;
+ case 207:
result = reduceNode(node.initializer, f, result);
result = reduceNode(node.condition, f, result);
result = reduceNode(node.incrementor, f, result);
result = reduceNode(node.statement, f, result);
break;
- case 207:
case 208:
+ case 209:
result = reduceNode(node.initializer, f, result);
result = reduceNode(node.expression, f, result);
result = reduceNode(node.statement, f, result);
break;
- case 211:
- case 215:
+ case 212:
+ case 216:
result = reduceNode(node.expression, f, result);
break;
- case 213:
+ case 214:
result = reduceNode(node.expression, f, result);
result = reduceNode(node.caseBlock, f, result);
break;
- case 214:
+ case 215:
result = reduceNode(node.label, f, result);
result = reduceNode(node.statement, f, result);
break;
- case 216:
+ case 217:
result = reduceNode(node.tryBlock, f, result);
result = reduceNode(node.catchClause, f, result);
result = reduceNode(node.finallyBlock, f, result);
break;
- case 218:
+ case 219:
result = reduceNode(node.name, f, result);
result = reduceNode(node.type, f, result);
result = reduceNode(node.initializer, f, result);
break;
- case 219:
- result = ts.reduceLeft(node.declarations, f, result);
- break;
case 220:
- result = ts.reduceLeft(node.decorators, f, result);
- result = ts.reduceLeft(node.modifiers, f, result);
- result = reduceNode(node.name, f, result);
- result = ts.reduceLeft(node.typeParameters, f, result);
- result = ts.reduceLeft(node.parameters, f, result);
- result = reduceNode(node.type, f, result);
- result = reduceNode(node.body, f, result);
+ result = ts.reduceLeft(node.declarations, f, result);
break;
case 221:
+ result = ts.reduceLeft(node.decorators, f, result);
+ result = ts.reduceLeft(node.modifiers, f, result);
+ result = reduceNode(node.name, f, result);
+ result = ts.reduceLeft(node.typeParameters, f, result);
+ result = ts.reduceLeft(node.parameters, f, result);
+ result = reduceNode(node.type, f, result);
+ result = reduceNode(node.body, f, result);
+ break;
+ case 222:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
@@ -34426,49 +35743,49 @@ var ts;
result = ts.reduceLeft(node.heritageClauses, f, result);
result = ts.reduceLeft(node.members, f, result);
break;
- case 227:
+ case 228:
result = ts.reduceLeft(node.clauses, f, result);
break;
- case 230:
+ case 231:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.importClause, f, result);
result = reduceNode(node.moduleSpecifier, f, result);
break;
- case 231:
+ case 232:
result = reduceNode(node.name, f, result);
result = reduceNode(node.namedBindings, f, result);
break;
- case 232:
- result = reduceNode(node.name, f, result);
- break;
case 233:
- case 237:
- result = ts.reduceLeft(node.elements, f, result);
+ result = reduceNode(node.name, f, result);
break;
case 234:
case 238:
+ result = ts.reduceLeft(node.elements, f, result);
+ break;
+ case 235:
+ case 239:
result = reduceNode(node.propertyName, f, result);
result = reduceNode(node.name, f, result);
break;
- case 235:
+ case 236:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.expression, f, result);
break;
- case 236:
+ case 237:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.exportClause, f, result);
result = reduceNode(node.moduleSpecifier, f, result);
break;
- case 241:
+ case 242:
result = reduceNode(node.openingElement, f, result);
result = ts.reduceLeft(node.children, f, result);
result = reduceNode(node.closingElement, f, result);
break;
- case 242:
case 243:
+ case 244:
result = reduceNode(node.tagName, f, result);
result = ts.reduceLeft(node.attributes, f, result);
break;
@@ -34611,153 +35928,153 @@ var ts;
return undefined;
}
var kind = node.kind;
- if ((kind > 0 && kind <= 138)) {
+ if ((kind > 0 && kind <= 139)) {
return node;
}
- if ((kind >= 154 && kind <= 166)) {
+ if ((kind >= 155 && kind <= 167)) {
return node;
}
switch (node.kind) {
- case 198:
- case 201:
- case 193:
- case 217:
- return node;
- case 140:
- return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression));
- case 142:
- return ts.updateParameterDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
- case 145:
- return ts.updateProperty(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
- case 147:
- return ts.updateMethod(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
- case 148:
- return ts.updateConstructor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
- case 149:
- return ts.updateGetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
- case 150:
- return ts.updateSetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
- case 167:
- return ts.updateObjectBindingPattern(node, visitNodes(node.elements, visitor, ts.isBindingElement));
- case 168:
- return ts.updateArrayBindingPattern(node, visitNodes(node.elements, visitor, ts.isArrayBindingElement));
- case 169:
- return ts.updateBindingElement(node, visitNode(node.propertyName, visitor, ts.isPropertyName, true), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression, true));
- case 170:
- return ts.updateArrayLiteral(node, visitNodes(node.elements, visitor, ts.isExpression));
- case 171:
- return ts.updateObjectLiteral(node, visitNodes(node.properties, visitor, ts.isObjectLiteralElementLike));
- case 172:
- return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier));
- case 173:
- return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression));
- case 174:
- return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression));
- case 175:
- return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression));
- case 176:
- return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral));
- case 178:
- return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression));
- case 179:
- return ts.updateFunctionExpression(node, visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
- case 180:
- return ts.updateArrowFunction(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isConciseBody, true), context.endLexicalEnvironment()));
- case 181:
- return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression));
- case 182:
- return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression));
- case 183:
- return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression));
- case 184:
- return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression));
- case 187:
- return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression));
- case 185:
- return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression));
- case 186:
- return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression));
- case 188:
- return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.whenFalse, visitor, ts.isExpression));
- case 189:
- return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), visitNodes(node.templateSpans, visitor, ts.isTemplateSpan));
- case 190:
- return ts.updateYield(node, visitNode(node.expression, visitor, ts.isExpression));
- case 191:
- return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression));
- case 192:
- return ts.updateClassExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement));
- case 194:
- return ts.updateExpressionWithTypeArguments(node, visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression));
- case 197:
- return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail));
case 199:
- return ts.updateBlock(node, visitNodes(node.statements, visitor, ts.isStatement));
- case 200:
- return ts.updateVariableStatement(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList));
case 202:
- return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression));
- case 203:
- return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, true, liftToBlock));
- case 204:
- return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.expression, visitor, ts.isExpression));
- case 205:
- return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 206:
- return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 207:
- return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 208:
- return ts.updateForOf(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 209:
- return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier, true));
- case 210:
- return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier, true));
- case 211:
- return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression, true));
- case 212:
- return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 213:
- return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock));
- case 214:
- return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 215:
- return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression));
- case 216:
- return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause, true), visitNode(node.finallyBlock, visitor, ts.isBlock, true));
+ case 194:
case 218:
- return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
+ return node;
+ case 141:
+ return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 143:
+ return ts.updateParameterDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
+ case 146:
+ return ts.updateProperty(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
+ case 148:
+ return ts.updateMethod(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 149:
+ return ts.updateConstructor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 150:
+ return ts.updateGetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 151:
+ return ts.updateSetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 168:
+ return ts.updateObjectBindingPattern(node, visitNodes(node.elements, visitor, ts.isBindingElement));
+ case 169:
+ return ts.updateArrayBindingPattern(node, visitNodes(node.elements, visitor, ts.isArrayBindingElement));
+ case 170:
+ return ts.updateBindingElement(node, visitNode(node.propertyName, visitor, ts.isPropertyName, true), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression, true));
+ case 171:
+ return ts.updateArrayLiteral(node, visitNodes(node.elements, visitor, ts.isExpression));
+ case 172:
+ return ts.updateObjectLiteral(node, visitNodes(node.properties, visitor, ts.isObjectLiteralElementLike));
+ case 173:
+ return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier));
+ case 174:
+ return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression));
+ case 175:
+ return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression));
+ case 176:
+ return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression));
+ case 177:
+ return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral));
+ case 179:
+ return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 180:
+ return ts.updateFunctionExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 181:
+ return ts.updateArrowFunction(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isConciseBody, true), context.endLexicalEnvironment()));
+ case 182:
+ return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 183:
+ return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 184:
+ return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 185:
+ return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 188:
+ return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression));
+ case 186:
+ return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression));
+ case 187:
+ return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression));
+ case 189:
+ return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.whenFalse, visitor, ts.isExpression));
+ case 190:
+ return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), visitNodes(node.templateSpans, visitor, ts.isTemplateSpan));
+ case 191:
+ return ts.updateYield(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 192:
+ return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 193:
+ return ts.updateClassExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement));
+ case 195:
+ return ts.updateExpressionWithTypeArguments(node, visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression));
+ case 198:
+ return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail));
+ case 200:
+ return ts.updateBlock(node, visitNodes(node.statements, visitor, ts.isStatement));
+ case 201:
+ return ts.updateVariableStatement(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList));
+ case 203:
+ return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 204:
+ return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, true, liftToBlock));
+ case 205:
+ return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.expression, visitor, ts.isExpression));
+ case 206:
+ return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 207:
+ return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 208:
+ return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 209:
+ return ts.updateForOf(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 210:
+ return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier, true));
+ case 211:
+ return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier, true));
+ case 212:
+ return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression, true));
+ case 213:
+ return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 214:
+ return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock));
+ case 215:
+ return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 216:
+ return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 217:
+ return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause, true), visitNode(node.finallyBlock, visitor, ts.isBlock, true));
case 219:
- return ts.updateVariableDeclarationList(node, visitNodes(node.declarations, visitor, ts.isVariableDeclaration));
+ return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
case 220:
- return ts.updateFunctionDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ return ts.updateVariableDeclarationList(node, visitNodes(node.declarations, visitor, ts.isVariableDeclaration));
case 221:
+ return ts.updateFunctionDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 222:
return ts.updateClassDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement));
- case 227:
+ case 228:
return ts.updateCaseBlock(node, visitNodes(node.clauses, visitor, ts.isCaseOrDefaultClause));
- case 230:
- return ts.updateImportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression));
case 231:
- return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier, true), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings, true));
+ return ts.updateImportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression));
case 232:
- return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier, true), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings, true));
case 233:
- return ts.updateNamedImports(node, visitNodes(node.elements, visitor, ts.isImportSpecifier));
+ return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier));
case 234:
- return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, true), visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateNamedImports(node, visitNodes(node.elements, visitor, ts.isImportSpecifier));
case 235:
- return ts.updateExportAssignment(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, true), visitNode(node.name, visitor, ts.isIdentifier));
case 236:
- return ts.updateExportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression, true));
+ return ts.updateExportAssignment(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression));
case 237:
- return ts.updateNamedExports(node, visitNodes(node.elements, visitor, ts.isExportSpecifier));
+ return ts.updateExportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression, true));
case 238:
+ return ts.updateNamedExports(node, visitNodes(node.elements, visitor, ts.isExportSpecifier));
+ case 239:
return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, true), visitNode(node.name, visitor, ts.isIdentifier));
- case 241:
- return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), visitNodes(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement));
case 242:
- return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike));
+ return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), visitNodes(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement));
case 243:
+ return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike));
+ case 244:
return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike));
case 245:
return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression));
@@ -34858,67 +36175,67 @@ var ts;
return transformFlags | aggregateTransformFlagsForNode(child);
}
function getTransformFlagsSubtreeExclusions(kind) {
- if (kind >= 154 && kind <= 166) {
+ if (kind >= 155 && kind <= 167) {
return -3;
}
switch (kind) {
- case 174:
case 175:
- case 170:
- return 537133909;
- case 225:
- return 546335573;
- case 142:
- return 538968917;
+ case 176:
+ case 171:
+ return 537922901;
+ case 226:
+ return 574729557;
+ case 143:
+ return 545262933;
+ case 181:
+ return 592227669;
case 180:
- return 550710101;
- case 179:
- case 220:
- return 550726485;
- case 219:
- return 538968917;
case 221:
- case 192:
- return 537590613;
- case 148:
- return 550593365;
- case 147:
+ return 592293205;
+ case 220:
+ return 545262933;
+ case 222:
+ case 193:
+ return 539749717;
case 149:
+ return 591760725;
+ case 148:
case 150:
- return 550593365;
- case 117:
- case 130:
- case 127:
- case 132:
- case 120:
- case 133:
- case 103:
- case 141:
- case 144:
- case 146:
case 151:
+ return 591760725;
+ case 118:
+ case 131:
+ case 128:
+ case 133:
+ case 121:
+ case 134:
+ case 104:
+ case 142:
+ case 145:
+ case 147:
case 152:
case 153:
- case 222:
+ case 154:
case 223:
+ case 224:
return -3;
- case 171:
- return 537430869;
+ case 172:
+ return 539110741;
default:
- return 536871765;
+ return 536874325;
}
}
var Debug;
(function (Debug) {
Debug.failNotOptional = Debug.shouldAssert(1)
? function (message) { return Debug.assert(false, message || "Node not optional."); }
- : function (message) { };
+ : function () { };
Debug.failBadSyntaxKind = Debug.shouldAssert(1)
? function (node, message) { return Debug.assert(false, message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " was unexpected."; }); }
- : function (node, message) { };
+ : function () { };
Debug.assertNode = Debug.shouldAssert(1)
? function (node, test, message) { return Debug.assert(test === undefined || test(node), message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }); }
- : function (node, test, message) { };
+ : function () { };
function getFunctionName(func) {
if (typeof func !== "function") {
return "";
@@ -34956,7 +36273,7 @@ var ts;
else if (ts.nodeIsSynthesized(node)) {
location = value;
}
- flattenDestructuring(context, node, value, location, emitAssignment, emitTempVariableAssignment, visitor);
+ flattenDestructuring(node, value, location, emitAssignment, emitTempVariableAssignment, visitor);
if (needsValue) {
expressions.push(value);
}
@@ -34976,9 +36293,9 @@ var ts;
}
}
ts.flattenDestructuringAssignment = flattenDestructuringAssignment;
- function flattenParameterDestructuring(context, node, value, visitor) {
+ function flattenParameterDestructuring(node, value, visitor) {
var declarations = [];
- flattenDestructuring(context, node, value, node, emitAssignment, emitTempVariableAssignment, visitor);
+ flattenDestructuring(node, value, node, emitAssignment, emitTempVariableAssignment, visitor);
return declarations;
function emitAssignment(name, value, location) {
var declaration = ts.createVariableDeclaration(name, undefined, value, location);
@@ -34993,10 +36310,10 @@ var ts;
}
}
ts.flattenParameterDestructuring = flattenParameterDestructuring;
- function flattenVariableDestructuring(context, node, value, visitor, recordTempVariable) {
+ function flattenVariableDestructuring(node, value, visitor, recordTempVariable) {
var declarations = [];
var pendingAssignments;
- flattenDestructuring(context, node, value, node, emitAssignment, emitTempVariableAssignment, visitor);
+ flattenDestructuring(node, value, node, emitAssignment, emitTempVariableAssignment, visitor);
return declarations;
function emitAssignment(name, value, location, original) {
if (pendingAssignments) {
@@ -35028,9 +36345,9 @@ var ts;
}
}
ts.flattenVariableDestructuring = flattenVariableDestructuring;
- function flattenVariableDestructuringToExpression(context, node, recordTempVariable, nameSubstitution, visitor) {
+ function flattenVariableDestructuringToExpression(node, recordTempVariable, nameSubstitution, visitor) {
var pendingAssignments = [];
- flattenDestructuring(context, node, undefined, node, emitAssignment, emitTempVariableAssignment, visitor);
+ flattenDestructuring(node, undefined, node, emitAssignment, emitTempVariableAssignment, visitor);
var expression = ts.inlineExpressions(pendingAssignments);
ts.aggregateTransformFlags(expression);
return expression;
@@ -35052,7 +36369,7 @@ var ts;
}
}
ts.flattenVariableDestructuringToExpression = flattenVariableDestructuringToExpression;
- function flattenDestructuring(context, root, value, location, emitAssignment, emitTempVariableAssignment, visitor) {
+ function flattenDestructuring(root, value, location, emitAssignment, emitTempVariableAssignment, visitor) {
if (value && visitor) {
value = ts.visitNode(value, visitor, ts.isExpression);
}
@@ -35073,7 +36390,7 @@ var ts;
}
target = bindingTarget.name;
}
- else if (ts.isBinaryExpression(bindingTarget) && bindingTarget.operatorToken.kind === 56) {
+ else if (ts.isBinaryExpression(bindingTarget) && bindingTarget.operatorToken.kind === 57) {
var initializer = visitor
? ts.visitNode(bindingTarget.right, visitor, ts.isExpression)
: bindingTarget.right;
@@ -35083,10 +36400,10 @@ var ts;
else {
target = bindingTarget;
}
- if (target.kind === 171) {
+ if (target.kind === 172) {
emitObjectLiteralAssignment(target, value, location);
}
- else if (target.kind === 170) {
+ else if (target.kind === 171) {
emitArrayLiteralAssignment(target, value, location);
}
else {
@@ -35118,8 +36435,8 @@ var ts;
}
for (var i = 0; i < numElements; i++) {
var e = elements[i];
- if (e.kind !== 193) {
- if (e.kind !== 191) {
+ if (e.kind !== 194) {
+ if (e.kind !== 192) {
emitDestructuringAssignment(e, ts.createElementAccess(value, ts.createLiteral(i)), e);
}
else if (i === numElements - 1) {
@@ -35148,7 +36465,7 @@ var ts;
if (ts.isOmittedExpression(element)) {
continue;
}
- else if (name.kind === 167) {
+ else if (name.kind === 168) {
var propName = element.propertyName || element.name;
emitBindingElement(element, createDestructuringPropertyAccess(value, propName));
}
@@ -35168,7 +36485,7 @@ var ts;
}
function createDefaultValueCheck(value, defaultValue, location) {
value = ensureIdentifier(value, true, location, emitTempVariableAssignment);
- return ts.createConditional(ts.createStrictEquality(value, ts.createVoidZero()), ts.createToken(53), defaultValue, ts.createToken(54), value);
+ return ts.createConditional(ts.createStrictEquality(value, ts.createVoidZero()), ts.createToken(54), defaultValue, ts.createToken(55), value);
}
function createDestructuringPropertyAccess(expression, propertyName) {
if (ts.isComputedPropertyName(propertyName)) {
@@ -35206,6 +36523,12 @@ var ts;
var ts;
(function (ts) {
var USE_NEW_TYPE_METADATA_FORMAT = false;
+ var TypeScriptSubstitutionFlags;
+ (function (TypeScriptSubstitutionFlags) {
+ TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["ClassAliases"] = 1] = "ClassAliases";
+ TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["NamespaceExports"] = 2] = "NamespaceExports";
+ TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["NonQualifiedEnumMembers"] = 8] = "NonQualifiedEnumMembers";
+ })(TypeScriptSubstitutionFlags || (TypeScriptSubstitutionFlags = {}));
function transformTypeScript(context) {
var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration;
var resolver = context.getEmitResolver();
@@ -35216,8 +36539,8 @@ var ts;
var previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(172);
context.enableSubstitution(173);
+ context.enableSubstitution(174);
var currentSourceFile;
var currentNamespace;
var currentNamespaceContainerName;
@@ -35227,7 +36550,6 @@ var ts;
var enabledSubstitutions;
var classAliases;
var applicableSubstitutions;
- var currentSuperContainer;
return transformSourceFile;
function transformSourceFile(node) {
if (ts.isDeclarationFile(node)) {
@@ -35261,15 +36583,32 @@ var ts;
}
return node;
}
+ function sourceElementVisitor(node) {
+ return saveStateAndInvoke(node, sourceElementVisitorWorker);
+ }
+ function sourceElementVisitorWorker(node) {
+ switch (node.kind) {
+ case 231:
+ return visitImportDeclaration(node);
+ case 230:
+ return visitImportEqualsDeclaration(node);
+ case 236:
+ return visitExportAssignment(node);
+ case 237:
+ return visitExportDeclaration(node);
+ default:
+ return visitorWorker(node);
+ }
+ }
function namespaceElementVisitor(node) {
return saveStateAndInvoke(node, namespaceElementVisitorWorker);
}
function namespaceElementVisitorWorker(node) {
- if (node.kind === 236 ||
- node.kind === 230 ||
+ if (node.kind === 237 ||
node.kind === 231 ||
- (node.kind === 229 &&
- node.moduleReference.kind === 240)) {
+ node.kind === 232 ||
+ (node.kind === 230 &&
+ node.moduleReference.kind === 241)) {
return undefined;
}
else if (node.transformFlags & 1 || ts.hasModifier(node, 1)) {
@@ -35285,15 +36624,15 @@ var ts;
}
function classElementVisitorWorker(node) {
switch (node.kind) {
- case 148:
- return undefined;
- case 145:
- case 153:
case 149:
+ return undefined;
+ case 146:
+ case 154:
case 150:
- case 147:
+ case 151:
+ case 148:
return visitorWorker(node);
- case 198:
+ case 199:
return node;
default:
ts.Debug.failBadSyntaxKind(node);
@@ -35305,84 +36644,87 @@ var ts;
return ts.createNotEmittedStatement(node);
}
switch (node.kind) {
- case 82:
- case 77:
+ case 83:
+ case 78:
return currentNamespace ? undefined : node;
- case 112:
- case 110:
+ case 113:
case 111:
- case 115:
- case 118:
- case 74:
- case 122:
- case 128:
- case 160:
+ case 112:
+ case 116:
+ case 75:
+ case 123:
+ case 129:
case 161:
- case 159:
- case 154:
- case 141:
- case 117:
- case 120:
- case 132:
- case 130:
- case 127:
- case 103:
- case 133:
- case 157:
- case 156:
- case 158:
- case 155:
case 162:
+ case 160:
+ case 155:
+ case 142:
+ case 118:
+ case 121:
+ case 133:
+ case 131:
+ case 128:
+ case 104:
+ case 134:
+ case 158:
+ case 157:
+ case 159:
+ case 156:
case 163:
case 164:
case 165:
case 166:
- case 153:
- case 143:
+ case 167:
+ case 154:
+ case 144:
+ case 224:
+ case 146:
+ case 149:
+ return visitConstructor(node);
case 223:
- case 145:
- case 148:
- return undefined;
- case 222:
return ts.createNotEmittedStatement(node);
- case 221:
+ case 222:
return visitClassDeclaration(node);
- case 192:
+ case 193:
return visitClassExpression(node);
case 251:
return visitHeritageClause(node);
- case 194:
- return visitExpressionWithTypeArguments(node);
- case 147:
- return visitMethodDeclaration(node);
- case 149:
- return visitGetAccessor(node);
- case 150:
- return visitSetAccessor(node);
- case 220:
- return visitFunctionDeclaration(node);
- case 179:
- return visitFunctionExpression(node);
- case 180:
- return visitArrowFunction(node);
- case 142:
- return visitParameter(node);
- case 178:
- return visitParenthesizedExpression(node);
- case 177:
case 195:
- return visitAssertionExpression(node);
+ return visitExpressionWithTypeArguments(node);
+ case 148:
+ return visitMethodDeclaration(node);
+ case 150:
+ return visitGetAccessor(node);
+ case 151:
+ return visitSetAccessor(node);
+ case 221:
+ return visitFunctionDeclaration(node);
+ case 180:
+ return visitFunctionExpression(node);
+ case 181:
+ return visitArrowFunction(node);
+ case 143:
+ return visitParameter(node);
+ case 179:
+ return visitParenthesizedExpression(node);
+ case 178:
case 196:
+ return visitAssertionExpression(node);
+ case 175:
+ return visitCallExpression(node);
+ case 176:
+ return visitNewExpression(node);
+ case 197:
return visitNonNullExpression(node);
- case 224:
- return visitEnumDeclaration(node);
- case 184:
- return visitAwaitExpression(node);
- case 200:
- return visitVariableStatement(node);
case 225:
+ return visitEnumDeclaration(node);
+ case 201:
+ return visitVariableStatement(node);
+ case 219:
+ return visitVariableDeclaration(node);
+ case 226:
return visitModuleDeclaration(node);
- case 229:
+ case 230:
return visitImportEqualsDeclaration(node);
default:
ts.Debug.failBadSyntaxKind(node);
@@ -35392,14 +36734,14 @@ var ts;
function onBeforeVisitNode(node) {
switch (node.kind) {
case 256:
+ case 228:
case 227:
- case 226:
- case 199:
+ case 200:
currentScope = node;
currentScopeFirstDeclarationsOfName = undefined;
break;
+ case 222:
case 221:
- case 220:
if (ts.hasModifier(node, 2)) {
break;
}
@@ -35424,14 +36766,14 @@ var ts;
externalHelpersModuleImport.flags &= ~8;
statements.push(externalHelpersModuleImport);
currentSourceFileExternalHelpersModuleName = externalHelpersModuleName;
- ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset));
+ ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset));
ts.addRange(statements, endLexicalEnvironment());
currentSourceFileExternalHelpersModuleName = undefined;
node = ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements));
node.externalHelpersModuleName = externalHelpersModuleName;
}
else {
- node = ts.visitEachChild(node, visitor, context);
+ node = ts.visitEachChild(node, sourceElementVisitor, context);
}
ts.setEmitFlags(node, 1 | ts.getEmitFlags(node));
return node;
@@ -35471,7 +36813,7 @@ var ts;
classAlias = addClassDeclarationHeadWithDecorators(statements, node, name, hasExtendsClause);
}
if (staticProperties.length) {
- addInitializedPropertyStatements(statements, node, staticProperties, getLocalName(node, true));
+ addInitializedPropertyStatements(statements, staticProperties, getLocalName(node, true));
}
addClassElementDecorationStatements(statements, node, false);
addClassElementDecorationStatements(statements, node, true);
@@ -35517,7 +36859,7 @@ var ts;
function visitClassExpression(node) {
var staticProperties = getInitializedProperties(node, true);
var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause);
- var members = transformClassMembers(node, heritageClauses !== undefined);
+ var members = transformClassMembers(node, ts.some(heritageClauses, function (c) { return c.token === 84; }));
var classExpression = ts.setOriginalNode(ts.createClassExpression(undefined, node.name, undefined, heritageClauses, members, node), node);
if (staticProperties.length > 0) {
var expressions = [];
@@ -35528,7 +36870,7 @@ var ts;
}
ts.setEmitFlags(classExpression, 524288 | ts.getEmitFlags(classExpression));
expressions.push(ts.startOnNewLine(ts.createAssignment(temp, classExpression)));
- ts.addRange(expressions, generateInitializedPropertyExpressions(node, staticProperties, temp));
+ ts.addRange(expressions, generateInitializedPropertyExpressions(staticProperties, temp));
expressions.push(ts.startOnNewLine(temp));
return ts.inlineExpressions(expressions);
}
@@ -35545,13 +36887,13 @@ var ts;
}
function transformConstructor(node, hasExtendsClause) {
var hasInstancePropertyWithInitializer = ts.forEach(node.members, isInstanceInitializedProperty);
- var hasParameterPropertyAssignments = node.transformFlags & 131072;
+ var hasParameterPropertyAssignments = node.transformFlags & 524288;
var constructor = ts.getFirstConstructorWithBody(node);
if (!hasInstancePropertyWithInitializer && !hasParameterPropertyAssignments) {
return ts.visitEachChild(constructor, visitor, context);
}
var parameters = transformConstructorParameters(constructor);
- var body = transformConstructorBody(node, constructor, hasExtendsClause, parameters);
+ var body = transformConstructorBody(node, constructor, hasExtendsClause);
return ts.startOnNewLine(ts.setOriginalNode(ts.createConstructor(undefined, undefined, parameters, body, constructor || node), constructor));
}
function transformConstructorParameters(constructor) {
@@ -35559,7 +36901,7 @@ var ts;
? ts.visitNodes(constructor.parameters, visitor, ts.isParameter)
: [];
}
- function transformConstructorBody(node, constructor, hasExtendsClause, parameters) {
+ function transformConstructorBody(node, constructor, hasExtendsClause) {
var statements = [];
var indexOfFirstStatement = 0;
startLexicalEnvironment();
@@ -35572,7 +36914,7 @@ var ts;
statements.push(ts.createStatement(ts.createCall(ts.createSuper(), undefined, [ts.createSpread(ts.createIdentifier("arguments"))])));
}
var properties = getInitializedProperties(node, false);
- addInitializedPropertyStatements(statements, node, properties, ts.createThis());
+ addInitializedPropertyStatements(statements, properties, ts.createThis());
if (constructor) {
ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement));
}
@@ -35587,7 +36929,7 @@ var ts;
return index;
}
var statement = statements[index];
- if (statement.kind === 202 && ts.isSuperCall(statement.expression)) {
+ if (statement.kind === 203 && ts.isSuperCall(statement.expression)) {
result.push(ts.visitNode(statement, visitor, ts.isStatement));
return index + 1;
}
@@ -35621,24 +36963,24 @@ var ts;
return isInitializedProperty(member, false);
}
function isInitializedProperty(member, isStatic) {
- return member.kind === 145
+ return member.kind === 146
&& isStatic === ts.hasModifier(member, 32)
&& member.initializer !== undefined;
}
- function addInitializedPropertyStatements(statements, node, properties, receiver) {
+ function addInitializedPropertyStatements(statements, properties, receiver) {
for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) {
var property = properties_7[_i];
- var statement = ts.createStatement(transformInitializedProperty(node, property, receiver));
+ var statement = ts.createStatement(transformInitializedProperty(property, receiver));
ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));
ts.setCommentRange(statement, property);
statements.push(statement);
}
}
- function generateInitializedPropertyExpressions(node, properties, receiver) {
+ function generateInitializedPropertyExpressions(properties, receiver) {
var expressions = [];
for (var _i = 0, properties_8 = properties; _i < properties_8.length; _i++) {
var property = properties_8[_i];
- var expression = transformInitializedProperty(node, property, receiver);
+ var expression = transformInitializedProperty(property, receiver);
expression.startsOnNewLine = true;
ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property));
ts.setCommentRange(expression, property);
@@ -35646,7 +36988,7 @@ var ts;
}
return expressions;
}
- function transformInitializedProperty(node, property, receiver) {
+ function transformInitializedProperty(property, receiver) {
var propertyName = visitPropertyNameOfClassElement(property);
var initializer = ts.visitNode(property.initializer, visitor, ts.isExpression);
var memberAccess = ts.createMemberAccessForPropertyName(receiver, propertyName, propertyName);
@@ -35694,12 +37036,12 @@ var ts;
}
function getAllDecoratorsOfClassElement(node, member) {
switch (member.kind) {
- case 149:
case 150:
+ case 151:
return getAllDecoratorsOfAccessors(node, member);
- case 147:
+ case 148:
return getAllDecoratorsOfMethod(member);
- case 145:
+ case 146:
return getAllDecoratorsOfProperty(member);
default:
return undefined;
@@ -35777,7 +37119,7 @@ var ts;
var prefix = getClassMemberPrefix(node, member);
var memberName = getExpressionForPropertyName(member, true);
var descriptor = languageVersion > 0
- ? member.kind === 145
+ ? member.kind === 146
? ts.createVoidZero()
: ts.createNull()
: undefined;
@@ -35865,43 +37207,43 @@ var ts;
}
function shouldAddTypeMetadata(node) {
var kind = node.kind;
- return kind === 147
- || kind === 149
+ return kind === 148
|| kind === 150
- || kind === 145;
+ || kind === 151
+ || kind === 146;
}
function shouldAddReturnTypeMetadata(node) {
- return node.kind === 147;
+ return node.kind === 148;
}
function shouldAddParamTypesMetadata(node) {
var kind = node.kind;
- return kind === 221
- || kind === 192
- || kind === 147
- || kind === 149
- || kind === 150;
+ return kind === 222
+ || kind === 193
+ || kind === 148
+ || kind === 150
+ || kind === 151;
}
function serializeTypeOfNode(node) {
switch (node.kind) {
- case 145:
- case 142:
- case 149:
- return serializeTypeNode(node.type);
+ case 146:
+ case 143:
case 150:
+ return serializeTypeNode(node.type);
+ case 151:
return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node));
- case 221:
- case 192:
- case 147:
+ case 222:
+ case 193:
+ case 148:
return ts.createIdentifier("Function");
default:
return ts.createVoidZero();
}
}
function getRestParameterElementType(node) {
- if (node && node.kind === 160) {
+ if (node && node.kind === 161) {
return node.elementType;
}
- else if (node && node.kind === 155) {
+ else if (node && node.kind === 156) {
return ts.singleOrUndefined(node.typeArguments);
}
else {
@@ -35947,52 +37289,52 @@ var ts;
return ts.createIdentifier("Object");
}
switch (node.kind) {
- case 103:
+ case 104:
return ts.createVoidZero();
- case 164:
+ case 165:
return serializeTypeNode(node.type);
- case 156:
case 157:
+ case 158:
return ts.createIdentifier("Function");
- case 160:
case 161:
+ case 162:
return ts.createIdentifier("Array");
- case 154:
- case 120:
+ case 155:
+ case 121:
return ts.createIdentifier("Boolean");
- case 132:
+ case 133:
return ts.createIdentifier("String");
- case 166:
+ case 167:
switch (node.literal.kind) {
case 9:
return ts.createIdentifier("String");
case 8:
return ts.createIdentifier("Number");
- case 99:
- case 84:
+ case 100:
+ case 85:
return ts.createIdentifier("Boolean");
default:
ts.Debug.failBadSyntaxKind(node.literal);
break;
}
break;
- case 130:
+ case 131:
return ts.createIdentifier("Number");
- case 133:
+ case 134:
return languageVersion < 2
? getGlobalSymbolNameWithFallback()
: ts.createIdentifier("Symbol");
- case 155:
+ case 156:
return serializeTypeReferenceNode(node);
+ case 164:
case 163:
- case 162:
{
var unionOrIntersection = node;
var serializedUnion = void 0;
for (var _i = 0, _a = unionOrIntersection.types; _i < _a.length; _i++) {
var typeNode = _a[_i];
var serializedIndividual = serializeTypeNode(typeNode);
- if (serializedIndividual.kind !== 69) {
+ if (serializedIndividual.kind !== 70) {
serializedUnion = undefined;
break;
}
@@ -36009,10 +37351,10 @@ var ts;
return serializedUnion;
}
}
- case 158:
case 159:
- case 117:
- case 165:
+ case 160:
+ case 118:
+ case 166:
break;
default:
ts.Debug.failBadSyntaxKind(node);
@@ -36053,7 +37395,7 @@ var ts;
}
function serializeEntityNameAsExpression(node, useFallback) {
switch (node.kind) {
- case 69:
+ case 70:
var name_27 = ts.getMutableClone(node);
name_27.flags &= ~8;
name_27.original = undefined;
@@ -36062,13 +37404,13 @@ var ts;
return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name_27), ts.createLiteral("undefined")), name_27);
}
return name_27;
- case 139:
+ case 140:
return serializeQualifiedNameAsExpression(node, useFallback);
}
}
function serializeQualifiedNameAsExpression(node, useFallback) {
var left;
- if (node.left.kind === 69) {
+ if (node.left.kind === 70) {
left = serializeEntityNameAsExpression(node.left, useFallback);
}
else if (useFallback) {
@@ -36081,7 +37423,7 @@ var ts;
return ts.createPropertyAccess(left, node.right);
}
function getGlobalSymbolNameWithFallback() {
- return ts.createConditional(ts.createStrictEquality(ts.createTypeOf(ts.createIdentifier("Symbol")), ts.createLiteral("function")), ts.createToken(53), ts.createIdentifier("Symbol"), ts.createToken(54), ts.createIdentifier("Object"));
+ return ts.createConditional(ts.createStrictEquality(ts.createTypeOf(ts.createIdentifier("Symbol")), ts.createLiteral("function")), ts.createToken(54), ts.createIdentifier("Symbol"), ts.createToken(55), ts.createIdentifier("Object"));
}
function getExpressionForPropertyName(member, generateNameForComputedPropertyName) {
var name = member.name;
@@ -36113,9 +37455,9 @@ var ts;
}
}
function visitHeritageClause(node) {
- if (node.token === 83) {
+ if (node.token === 84) {
var types = ts.visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments, 0, 1);
- return ts.createHeritageClause(83, types, node);
+ return ts.createHeritageClause(84, types, node);
}
return undefined;
}
@@ -36126,6 +37468,12 @@ var ts;
function shouldEmitFunctionLikeDeclaration(node) {
return !ts.nodeIsMissing(node.body);
}
+ function visitConstructor(node) {
+ if (!shouldEmitFunctionLikeDeclaration(node)) {
+ return undefined;
+ }
+ return ts.visitEachChild(node, visitor, context);
+ }
function visitMethodDeclaration(node) {
if (!shouldEmitFunctionLikeDeclaration(node)) {
return undefined;
@@ -36176,36 +37524,33 @@ var ts;
if (ts.nodeIsMissing(node.body)) {
return ts.createOmittedExpression();
}
- var func = ts.createFunctionExpression(node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node);
+ var func = ts.createFunctionExpression(ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node);
ts.setOriginalNode(func, node);
return func;
}
function visitArrowFunction(node) {
- var func = ts.createArrowFunction(undefined, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, node.equalsGreaterThanToken, transformConciseBody(node), node);
+ var func = ts.createArrowFunction(ts.visitNodes(node.modifiers, visitor, ts.isModifier), undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, node.equalsGreaterThanToken, transformConciseBody(node), node);
ts.setOriginalNode(func, node);
return func;
}
function transformFunctionBody(node) {
- if (ts.isAsyncFunctionLike(node)) {
- return transformAsyncFunctionBody(node);
- }
return transformFunctionBodyWorker(node.body);
}
function transformFunctionBodyWorker(body, start) {
if (start === void 0) { start = 0; }
var savedCurrentScope = currentScope;
+ var savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName;
currentScope = body;
+ currentScopeFirstDeclarationsOfName = ts.createMap();
startLexicalEnvironment();
var statements = ts.visitNodes(body.statements, visitor, ts.isStatement, start);
var visited = ts.updateBlock(body, statements);
var declarations = endLexicalEnvironment();
currentScope = savedCurrentScope;
+ currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName;
return ts.mergeFunctionBodyLexicalEnvironment(visited, declarations);
}
function transformConciseBody(node) {
- if (ts.isAsyncFunctionLike(node)) {
- return transformAsyncFunctionBody(node);
- }
return transformConciseBodyWorker(node.body, false);
}
function transformConciseBodyWorker(body, forceBlockFunctionBody) {
@@ -36227,42 +37572,6 @@ var ts;
}
}
}
- function getPromiseConstructor(type) {
- var typeName = ts.getEntityNameFromTypeNode(type);
- if (typeName && ts.isEntityName(typeName)) {
- var serializationKind = resolver.getTypeReferenceSerializationKind(typeName);
- if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue
- || serializationKind === ts.TypeReferenceSerializationKind.Unknown) {
- return typeName;
- }
- }
- return undefined;
- }
- function transformAsyncFunctionBody(node) {
- var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(node.type) : undefined;
- var isArrowFunction = node.kind === 180;
- var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0;
- if (!isArrowFunction) {
- var statements = [];
- var statementOffset = ts.addPrologueDirectives(statements, node.body.statements, false, visitor);
- statements.push(ts.createReturn(ts.createAwaiterHelper(currentSourceFileExternalHelpersModuleName, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset))));
- var block = ts.createBlock(statements, node.body, true);
- if (languageVersion >= 2) {
- if (resolver.getNodeCheckFlags(node) & 4096) {
- enableSubstitutionForAsyncMethodsWithSuper();
- ts.setEmitFlags(block, 8);
- }
- else if (resolver.getNodeCheckFlags(node) & 2048) {
- enableSubstitutionForAsyncMethodsWithSuper();
- ts.setEmitFlags(block, 4);
- }
- }
- return block;
- }
- else {
- return ts.createAwaiterHelper(currentSourceFileExternalHelpersModuleName, hasLexicalArguments, promiseConstructor, transformConciseBodyWorker(node.body, true));
- }
- }
function visitParameter(node) {
if (ts.parameterIsThisKeyword(node)) {
return undefined;
@@ -36289,14 +37598,14 @@ var ts;
function transformInitializedVariable(node) {
var name = node.name;
if (ts.isBindingPattern(name)) {
- return ts.flattenVariableDestructuringToExpression(context, node, hoistVariableDeclaration, getNamespaceMemberNameWithSourceMapsAndWithoutComments, visitor);
+ return ts.flattenVariableDestructuringToExpression(node, hoistVariableDeclaration, getNamespaceMemberNameWithSourceMapsAndWithoutComments, visitor);
}
else {
return ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression), node);
}
}
- function visitAwaitExpression(node) {
- return ts.setOriginalNode(ts.createYield(undefined, ts.visitNode(node.expression, visitor, ts.isExpression), node), node);
+ function visitVariableDeclaration(node) {
+ return ts.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName), undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
}
function visitParenthesizedExpression(node) {
var innerExpression = ts.skipOuterExpressions(node.expression, ~2);
@@ -36314,6 +37623,12 @@ var ts;
var expression = ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression);
return ts.createPartiallyEmittedExpression(expression, node);
}
+ function visitCallExpression(node) {
+ return ts.updateCall(node, ts.visitNode(node.expression, visitor, ts.isExpression), undefined, ts.visitNodes(node.arguments, visitor, ts.isExpression));
+ }
+ function visitNewExpression(node) {
+ return ts.updateNew(node, ts.visitNode(node.expression, visitor, ts.isExpression), undefined, ts.visitNodes(node.arguments, visitor, ts.isExpression));
+ }
function shouldEmitEnumDeclaration(node) {
return !ts.isConst(node)
|| compilerOptions.preserveConstEnums
@@ -36345,7 +37660,7 @@ var ts;
var parameterName = getNamespaceParameterName(node);
var containerName = getNamespaceContainerName(node);
var exportName = getExportName(node);
- var enumStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, transformEnumBody(node, containerName)), undefined, [ts.createLogicalOr(exportName, ts.createAssignment(exportName, ts.createObjectLiteral()))]), node);
+ var enumStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, transformEnumBody(node, containerName)), undefined, [ts.createLogicalOr(exportName, ts.createAssignment(exportName, ts.createObjectLiteral()))]), node);
ts.setOriginalNode(enumStatement, node);
ts.setEmitFlags(enumStatement, emitFlags);
statements.push(enumStatement);
@@ -36388,7 +37703,7 @@ var ts;
}
function isES6ExportedDeclaration(node) {
return isExternalModuleExport(node)
- && moduleKind === ts.ModuleKind.ES6;
+ && moduleKind === ts.ModuleKind.ES2015;
}
function recordEmittedDeclarationInScope(node) {
var name = node.symbol && node.symbol.name;
@@ -36420,7 +37735,7 @@ var ts;
ts.createVariableDeclaration(getDeclarationName(node, false, true))
]);
ts.setOriginalNode(statement, node);
- if (node.kind === 224) {
+ if (node.kind === 225) {
ts.setSourceMapRange(statement.declarationList, node);
}
else {
@@ -36453,7 +37768,7 @@ var ts;
var localName = getLocalName(node);
moduleArg = ts.createAssignment(localName, moduleArg);
}
- var moduleStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, transformModuleBody(node, containerName)), undefined, [moduleArg]), node);
+ var moduleStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, transformModuleBody(node, containerName)), undefined, [moduleArg]), node);
ts.setOriginalNode(moduleStatement, node);
ts.setEmitFlags(moduleStatement, emitFlags);
statements.push(moduleStatement);
@@ -36471,7 +37786,7 @@ var ts;
var statementsLocation;
var blockLocation;
var body = node.body;
- if (body.kind === 226) {
+ if (body.kind === 227) {
ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement));
statementsLocation = body.statements;
blockLocation = body;
@@ -36494,17 +37809,67 @@ var ts;
currentNamespace = savedCurrentNamespace;
currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName;
var block = ts.createBlock(ts.createNodeArray(statements, statementsLocation), blockLocation, true);
- if (body.kind !== 226) {
+ if (body.kind !== 227) {
ts.setEmitFlags(block, ts.getEmitFlags(block) | 49152);
}
return block;
}
function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) {
- if (moduleDeclaration.body.kind === 225) {
+ if (moduleDeclaration.body.kind === 226) {
var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body);
return recursiveInnerModule || moduleDeclaration.body;
}
}
+ function visitImportDeclaration(node) {
+ if (!node.importClause) {
+ return node;
+ }
+ var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause, true);
+ return importClause
+ ? ts.updateImportDeclaration(node, undefined, undefined, importClause, node.moduleSpecifier)
+ : undefined;
+ }
+ function visitImportClause(node) {
+ var name = resolver.isReferencedAliasDeclaration(node) ? node.name : undefined;
+ var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings, true);
+ return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings) : undefined;
+ }
+ function visitNamedImportBindings(node) {
+ if (node.kind === 233) {
+ return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
+ }
+ else {
+ var elements = ts.visitNodes(node.elements, visitImportSpecifier, ts.isImportSpecifier);
+ return ts.some(elements) ? ts.updateNamedImports(node, elements) : undefined;
+ }
+ }
+ function visitImportSpecifier(node) {
+ return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
+ }
+ function visitExportAssignment(node) {
+ return resolver.isValueAliasDeclaration(node)
+ ? ts.visitEachChild(node, visitor, context)
+ : undefined;
+ }
+ function visitExportDeclaration(node) {
+ if (!node.exportClause) {
+ return resolver.moduleExportsSomeValue(node.moduleSpecifier) ? node : undefined;
+ }
+ if (!resolver.isValueAliasDeclaration(node)) {
+ return undefined;
+ }
+ var exportClause = ts.visitNode(node.exportClause, visitNamedExports, ts.isNamedExports, true);
+ return exportClause
+ ? ts.updateExportDeclaration(node, undefined, undefined, exportClause, node.moduleSpecifier)
+ : undefined;
+ }
+ function visitNamedExports(node) {
+ var elements = ts.visitNodes(node.elements, visitExportSpecifier, ts.isExportSpecifier);
+ return ts.some(elements) ? ts.updateNamedExports(node, elements) : undefined;
+ }
+ function visitExportSpecifier(node) {
+ return resolver.isValueAliasDeclaration(node) ? node : undefined;
+ }
function shouldEmitImportEqualsDeclaration(node) {
return resolver.isReferencedAliasDeclaration(node)
|| (!ts.isExternalModule(currentSourceFile)
@@ -36512,7 +37877,9 @@ var ts;
}
function visitImportEqualsDeclaration(node) {
if (ts.isExternalModuleImportEqualsDeclaration(node)) {
- return ts.visitEachChild(node, visitor, context);
+ return resolver.isReferencedAliasDeclaration(node)
+ ? ts.visitEachChild(node, visitor, context)
+ : undefined;
}
if (!shouldEmitImportEqualsDeclaration(node)) {
return undefined;
@@ -36624,57 +37991,32 @@ var ts;
function enableSubstitutionForNonQualifiedEnumMembers() {
if ((enabledSubstitutions & 8) === 0) {
enabledSubstitutions |= 8;
- context.enableSubstitution(69);
- }
- }
- function enableSubstitutionForAsyncMethodsWithSuper() {
- if ((enabledSubstitutions & 4) === 0) {
- enabledSubstitutions |= 4;
- context.enableSubstitution(174);
- context.enableSubstitution(172);
- context.enableSubstitution(173);
- context.enableEmitNotification(221);
- context.enableEmitNotification(147);
- context.enableEmitNotification(149);
- context.enableEmitNotification(150);
- context.enableEmitNotification(148);
+ context.enableSubstitution(70);
}
}
function enableSubstitutionForClassAliases() {
if ((enabledSubstitutions & 1) === 0) {
enabledSubstitutions |= 1;
- context.enableSubstitution(69);
+ context.enableSubstitution(70);
classAliases = ts.createMap();
}
}
function enableSubstitutionForNamespaceExports() {
if ((enabledSubstitutions & 2) === 0) {
enabledSubstitutions |= 2;
- context.enableSubstitution(69);
+ context.enableSubstitution(70);
context.enableSubstitution(254);
- context.enableEmitNotification(225);
+ context.enableEmitNotification(226);
}
}
- function isSuperContainer(node) {
- var kind = node.kind;
- return kind === 221
- || kind === 148
- || kind === 147
- || kind === 149
- || kind === 150;
- }
function isTransformedModuleDeclaration(node) {
- return ts.getOriginalNode(node).kind === 225;
+ return ts.getOriginalNode(node).kind === 226;
}
function isTransformedEnumDeclaration(node) {
- return ts.getOriginalNode(node).kind === 224;
+ return ts.getOriginalNode(node).kind === 225;
}
function onEmitNode(emitContext, node, emitCallback) {
var savedApplicableSubstitutions = applicableSubstitutions;
- var savedCurrentSuperContainer = currentSuperContainer;
- if (enabledSubstitutions & 4 && isSuperContainer(node)) {
- currentSuperContainer = node;
- }
if (enabledSubstitutions & 2 && isTransformedModuleDeclaration(node)) {
applicableSubstitutions |= 2;
}
@@ -36683,7 +38025,6 @@ var ts;
}
previousOnEmitNode(emitContext, node, emitCallback);
applicableSubstitutions = savedApplicableSubstitutions;
- currentSuperContainer = savedCurrentSuperContainer;
}
function onSubstituteNode(emitContext, node) {
node = previousOnSubstituteNode(emitContext, node);
@@ -36711,17 +38052,12 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 69:
+ case 70:
return substituteExpressionIdentifier(node);
- case 172:
- return substitutePropertyAccessExpression(node);
case 173:
- return substituteElementAccessExpression(node);
+ return substitutePropertyAccessExpression(node);
case 174:
- if (enabledSubstitutions & 4) {
- return substituteCallExpression(node);
- }
- break;
+ return substituteElementAccessExpression(node);
}
return node;
}
@@ -36751,8 +38087,8 @@ var ts;
if (enabledSubstitutions & applicableSubstitutions && (ts.getEmitFlags(node) & 262144) === 0) {
var container = resolver.getReferencedExportContainer(node, false);
if (container) {
- var substitute = (applicableSubstitutions & 2 && container.kind === 225) ||
- (applicableSubstitutions & 8 && container.kind === 224);
+ var substitute = (applicableSubstitutions & 2 && container.kind === 226) ||
+ (applicableSubstitutions & 8 && container.kind === 225);
if (substitute) {
return ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node, node);
}
@@ -36760,37 +38096,10 @@ var ts;
}
return undefined;
}
- function substituteCallExpression(node) {
- var expression = node.expression;
- if (ts.isSuperProperty(expression)) {
- var flags = getSuperContainerAsyncMethodFlags();
- if (flags) {
- var argumentExpression = ts.isPropertyAccessExpression(expression)
- ? substitutePropertyAccessExpression(expression)
- : substituteElementAccessExpression(expression);
- return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [
- ts.createThis()
- ].concat(node.arguments));
- }
- }
- return node;
- }
function substitutePropertyAccessExpression(node) {
- if (enabledSubstitutions & 4 && node.expression.kind === 95) {
- var flags = getSuperContainerAsyncMethodFlags();
- if (flags) {
- return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), flags, node);
- }
- }
return substituteConstantValue(node);
}
function substituteElementAccessExpression(node) {
- if (enabledSubstitutions & 4 && node.expression.kind === 95) {
- var flags = getSuperContainerAsyncMethodFlags();
- if (flags) {
- return createSuperAccessInAsyncMethod(node.argumentExpression, flags, node);
- }
- }
return substituteConstantValue(node);
}
function substituteConstantValue(node) {
@@ -36818,1524 +38127,10 @@ var ts;
? resolver.getConstantValue(node)
: undefined;
}
- function createSuperAccessInAsyncMethod(argumentExpression, flags, location) {
- if (flags & 4096) {
- return ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), "value", location);
- }
- else {
- return ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression], location);
- }
- }
- function getSuperContainerAsyncMethodFlags() {
- return currentSuperContainer !== undefined
- && resolver.getNodeCheckFlags(currentSuperContainer) & (2048 | 4096);
- }
}
ts.transformTypeScript = transformTypeScript;
})(ts || (ts = {}));
var ts;
-(function (ts) {
- function transformES6Module(context) {
- var compilerOptions = context.getCompilerOptions();
- var resolver = context.getEmitResolver();
- var currentSourceFile;
- return transformSourceFile;
- function transformSourceFile(node) {
- if (ts.isDeclarationFile(node)) {
- return node;
- }
- if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
- currentSourceFile = node;
- return ts.visitEachChild(node, visitor, context);
- }
- return node;
- }
- function visitor(node) {
- switch (node.kind) {
- case 230:
- return visitImportDeclaration(node);
- case 229:
- return visitImportEqualsDeclaration(node);
- case 231:
- return visitImportClause(node);
- case 233:
- case 232:
- return visitNamedBindings(node);
- case 234:
- return visitImportSpecifier(node);
- case 235:
- return visitExportAssignment(node);
- case 236:
- return visitExportDeclaration(node);
- case 237:
- return visitNamedExports(node);
- case 238:
- return visitExportSpecifier(node);
- }
- return node;
- }
- function visitExportAssignment(node) {
- if (node.isExportEquals) {
- return undefined;
- }
- var original = ts.getOriginalNode(node);
- return ts.nodeIsSynthesized(original) || resolver.isValueAliasDeclaration(original) ? node : undefined;
- }
- function visitExportDeclaration(node) {
- if (!node.exportClause) {
- return resolver.moduleExportsSomeValue(node.moduleSpecifier) ? node : undefined;
- }
- if (!resolver.isValueAliasDeclaration(node)) {
- return undefined;
- }
- var newExportClause = ts.visitNode(node.exportClause, visitor, ts.isNamedExports, true);
- if (node.exportClause === newExportClause) {
- return node;
- }
- return newExportClause
- ? ts.createExportDeclaration(undefined, undefined, newExportClause, node.moduleSpecifier)
- : undefined;
- }
- function visitNamedExports(node) {
- var newExports = ts.visitNodes(node.elements, visitor, ts.isExportSpecifier);
- if (node.elements === newExports) {
- return node;
- }
- return newExports.length ? ts.createNamedExports(newExports) : undefined;
- }
- function visitExportSpecifier(node) {
- return resolver.isValueAliasDeclaration(node) ? node : undefined;
- }
- function visitImportEqualsDeclaration(node) {
- return !ts.isExternalModuleImportEqualsDeclaration(node) || resolver.isReferencedAliasDeclaration(node) ? node : undefined;
- }
- function visitImportDeclaration(node) {
- if (node.importClause) {
- var newImportClause = ts.visitNode(node.importClause, visitor, ts.isImportClause);
- if (!newImportClause.name && !newImportClause.namedBindings) {
- return undefined;
- }
- else if (newImportClause !== node.importClause) {
- return ts.createImportDeclaration(undefined, undefined, newImportClause, node.moduleSpecifier);
- }
- }
- return node;
- }
- function visitImportClause(node) {
- var newDefaultImport = node.name;
- if (!resolver.isReferencedAliasDeclaration(node)) {
- newDefaultImport = undefined;
- }
- var newNamedBindings = ts.visitNode(node.namedBindings, visitor, ts.isNamedImportBindings, true);
- return newDefaultImport !== node.name || newNamedBindings !== node.namedBindings
- ? ts.createImportClause(newDefaultImport, newNamedBindings)
- : node;
- }
- function visitNamedBindings(node) {
- if (node.kind === 232) {
- return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
- }
- else {
- var newNamedImportElements = ts.visitNodes(node.elements, visitor, ts.isImportSpecifier);
- if (!newNamedImportElements || newNamedImportElements.length == 0) {
- return undefined;
- }
- if (newNamedImportElements === node.elements) {
- return node;
- }
- return ts.createNamedImports(newNamedImportElements);
- }
- }
- function visitImportSpecifier(node) {
- return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
- }
- }
- ts.transformES6Module = transformES6Module;
-})(ts || (ts = {}));
-var ts;
-(function (ts) {
- function transformSystemModule(context) {
- var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration, hoistFunctionDeclaration = context.hoistFunctionDeclaration;
- var compilerOptions = context.getCompilerOptions();
- var resolver = context.getEmitResolver();
- var host = context.getEmitHost();
- var languageVersion = ts.getEmitScriptTarget(compilerOptions);
- var previousOnSubstituteNode = context.onSubstituteNode;
- var previousOnEmitNode = context.onEmitNode;
- context.onSubstituteNode = onSubstituteNode;
- context.onEmitNode = onEmitNode;
- context.enableSubstitution(69);
- context.enableSubstitution(187);
- context.enableSubstitution(185);
- context.enableSubstitution(186);
- context.enableEmitNotification(256);
- var exportFunctionForFileMap = [];
- var currentSourceFile;
- var externalImports;
- var exportSpecifiers;
- var exportEquals;
- var hasExportStarsToExportValues;
- var exportFunctionForFile;
- var contextObjectForFile;
- var exportedLocalNames;
- var exportedFunctionDeclarations;
- var enclosingBlockScopedContainer;
- var currentParent;
- var currentNode;
- return transformSourceFile;
- function transformSourceFile(node) {
- if (ts.isDeclarationFile(node)) {
- return node;
- }
- if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
- currentSourceFile = node;
- currentNode = node;
- var updated = transformSystemModuleWorker(node);
- ts.aggregateTransformFlags(updated);
- currentSourceFile = undefined;
- externalImports = undefined;
- exportSpecifiers = undefined;
- exportEquals = undefined;
- hasExportStarsToExportValues = false;
- exportFunctionForFile = undefined;
- contextObjectForFile = undefined;
- exportedLocalNames = undefined;
- exportedFunctionDeclarations = undefined;
- return updated;
- }
- return node;
- }
- function transformSystemModuleWorker(node) {
- ts.Debug.assert(!exportFunctionForFile);
- (_a = ts.collectExternalModuleInfo(node, resolver), externalImports = _a.externalImports, exportSpecifiers = _a.exportSpecifiers, exportEquals = _a.exportEquals, hasExportStarsToExportValues = _a.hasExportStarsToExportValues, _a);
- exportFunctionForFile = ts.createUniqueName("exports");
- contextObjectForFile = ts.createUniqueName("context");
- exportFunctionForFileMap[ts.getOriginalNodeId(node)] = exportFunctionForFile;
- var dependencyGroups = collectDependencyGroups(externalImports);
- var statements = [];
- addSystemModuleBody(statements, node, dependencyGroups);
- var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions);
- var dependencies = ts.createArrayLiteral(ts.map(dependencyGroups, getNameOfDependencyGroup));
- var body = ts.createFunctionExpression(undefined, undefined, undefined, [
- ts.createParameter(exportFunctionForFile),
- ts.createParameter(contextObjectForFile)
- ], undefined, ts.setEmitFlags(ts.createBlock(statements, undefined, true), 1));
- return updateSourceFile(node, [
- ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("System"), "register"), undefined, moduleName
- ? [moduleName, dependencies, body]
- : [dependencies, body]))
- ], ~1 & ts.getEmitFlags(node));
- var _a;
- }
- function addSystemModuleBody(statements, node, dependencyGroups) {
- startLexicalEnvironment();
- var statementOffset = ts.addPrologueDirectives(statements, node.statements, !compilerOptions.noImplicitUseStrict, visitSourceElement);
- statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
- ts.createVariableDeclaration("__moduleName", undefined, ts.createLogicalAnd(contextObjectForFile, ts.createPropertyAccess(contextObjectForFile, "id")))
- ])));
- var executeStatements = ts.visitNodes(node.statements, visitSourceElement, ts.isStatement, statementOffset);
- ts.addRange(statements, endLexicalEnvironment());
- ts.addRange(statements, exportedFunctionDeclarations);
- var exportStarFunction = addExportStarIfNeeded(statements);
- statements.push(ts.createReturn(ts.setMultiLine(ts.createObjectLiteral([
- ts.createPropertyAssignment("setters", generateSetters(exportStarFunction, dependencyGroups)),
- ts.createPropertyAssignment("execute", ts.createFunctionExpression(undefined, undefined, undefined, [], undefined, ts.createBlock(executeStatements, undefined, true)))
- ]), true)));
- }
- function addExportStarIfNeeded(statements) {
- if (!hasExportStarsToExportValues) {
- return;
- }
- if (!exportedLocalNames && ts.isEmpty(exportSpecifiers)) {
- var hasExportDeclarationWithExportClause = false;
- for (var _i = 0, externalImports_1 = externalImports; _i < externalImports_1.length; _i++) {
- var externalImport = externalImports_1[_i];
- if (externalImport.kind === 236 && externalImport.exportClause) {
- hasExportDeclarationWithExportClause = true;
- break;
- }
- }
- if (!hasExportDeclarationWithExportClause) {
- return addExportStarFunction(statements, undefined);
- }
- }
- var exportedNames = [];
- if (exportedLocalNames) {
- for (var _a = 0, exportedLocalNames_1 = exportedLocalNames; _a < exportedLocalNames_1.length; _a++) {
- var exportedLocalName = exportedLocalNames_1[_a];
- exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(exportedLocalName.text), ts.createLiteral(true)));
- }
- }
- for (var _b = 0, externalImports_2 = externalImports; _b < externalImports_2.length; _b++) {
- var externalImport = externalImports_2[_b];
- if (externalImport.kind !== 236) {
- continue;
- }
- var exportDecl = externalImport;
- if (!exportDecl.exportClause) {
- continue;
- }
- for (var _c = 0, _d = exportDecl.exportClause.elements; _c < _d.length; _c++) {
- var element = _d[_c];
- exportedNames.push(ts.createPropertyAssignment(ts.createLiteral((element.name || element.propertyName).text), ts.createLiteral(true)));
- }
- }
- var exportedNamesStorageRef = ts.createUniqueName("exportedNames");
- statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
- ts.createVariableDeclaration(exportedNamesStorageRef, undefined, ts.createObjectLiteral(exportedNames, undefined, true))
- ])));
- return addExportStarFunction(statements, exportedNamesStorageRef);
- }
- function generateSetters(exportStarFunction, dependencyGroups) {
- var setters = [];
- for (var _i = 0, dependencyGroups_1 = dependencyGroups; _i < dependencyGroups_1.length; _i++) {
- var group = dependencyGroups_1[_i];
- var localName = ts.forEach(group.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); });
- var parameterName = localName ? ts.getGeneratedNameForNode(localName) : ts.createUniqueName("");
- var statements = [];
- for (var _a = 0, _b = group.externalImports; _a < _b.length; _a++) {
- var entry = _b[_a];
- var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile);
- switch (entry.kind) {
- case 230:
- if (!entry.importClause) {
- break;
- }
- case 229:
- ts.Debug.assert(importVariableName !== undefined);
- statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName)));
- break;
- case 236:
- ts.Debug.assert(importVariableName !== undefined);
- if (entry.exportClause) {
- var properties = [];
- for (var _c = 0, _d = entry.exportClause.elements; _c < _d.length; _c++) {
- var e = _d[_c];
- properties.push(ts.createPropertyAssignment(ts.createLiteral(e.name.text), ts.createElementAccess(parameterName, ts.createLiteral((e.propertyName || e.name).text))));
- }
- statements.push(ts.createStatement(ts.createCall(exportFunctionForFile, undefined, [ts.createObjectLiteral(properties, undefined, true)])));
- }
- else {
- statements.push(ts.createStatement(ts.createCall(exportStarFunction, undefined, [parameterName])));
- }
- break;
- }
- }
- setters.push(ts.createFunctionExpression(undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, ts.createBlock(statements, undefined, true)));
- }
- return ts.createArrayLiteral(setters, undefined, true);
- }
- function visitSourceElement(node) {
- switch (node.kind) {
- case 230:
- return visitImportDeclaration(node);
- case 229:
- return visitImportEqualsDeclaration(node);
- case 236:
- return visitExportDeclaration(node);
- case 235:
- return visitExportAssignment(node);
- default:
- return visitNestedNode(node);
- }
- }
- function visitNestedNode(node) {
- var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;
- var savedCurrentParent = currentParent;
- var savedCurrentNode = currentNode;
- var currentGrandparent = currentParent;
- currentParent = currentNode;
- currentNode = node;
- if (currentParent && ts.isBlockScope(currentParent, currentGrandparent)) {
- enclosingBlockScopedContainer = currentParent;
- }
- var result = visitNestedNodeWorker(node);
- enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;
- currentParent = savedCurrentParent;
- currentNode = savedCurrentNode;
- return result;
- }
- function visitNestedNodeWorker(node) {
- switch (node.kind) {
- case 200:
- return visitVariableStatement(node);
- case 220:
- return visitFunctionDeclaration(node);
- case 221:
- return visitClassDeclaration(node);
- case 206:
- return visitForStatement(node);
- case 207:
- return visitForInStatement(node);
- case 208:
- return visitForOfStatement(node);
- case 204:
- return visitDoStatement(node);
- case 205:
- return visitWhileStatement(node);
- case 214:
- return visitLabeledStatement(node);
- case 212:
- return visitWithStatement(node);
- case 213:
- return visitSwitchStatement(node);
- case 227:
- return visitCaseBlock(node);
- case 249:
- return visitCaseClause(node);
- case 250:
- return visitDefaultClause(node);
- case 216:
- return visitTryStatement(node);
- case 252:
- return visitCatchClause(node);
- case 199:
- return visitBlock(node);
- case 202:
- return visitExpressionStatement(node);
- default:
- return node;
- }
- }
- function visitImportDeclaration(node) {
- if (node.importClause && ts.contains(externalImports, node)) {
- hoistVariableDeclaration(ts.getLocalNameForExternalImport(node, currentSourceFile));
- }
- return undefined;
- }
- function visitImportEqualsDeclaration(node) {
- if (ts.contains(externalImports, node)) {
- hoistVariableDeclaration(ts.getLocalNameForExternalImport(node, currentSourceFile));
- }
- return undefined;
- }
- function visitExportDeclaration(node) {
- if (!node.moduleSpecifier) {
- var statements = [];
- ts.addRange(statements, ts.map(node.exportClause.elements, visitExportSpecifier));
- return statements;
- }
- return undefined;
- }
- function visitExportSpecifier(specifier) {
- if (resolver.getReferencedValueDeclaration(specifier.propertyName || specifier.name)
- || resolver.isValueAliasDeclaration(specifier)) {
- recordExportName(specifier.name);
- return createExportStatement(specifier.name, specifier.propertyName || specifier.name);
- }
- return undefined;
- }
- function visitExportAssignment(node) {
- if (!node.isExportEquals) {
- if (ts.nodeIsSynthesized(node) || resolver.isValueAliasDeclaration(node)) {
- return createExportStatement(ts.createLiteral("default"), node.expression);
- }
- }
- return undefined;
- }
- function visitVariableStatement(node) {
- var shouldHoist = ((ts.getCombinedNodeFlags(ts.getOriginalNode(node.declarationList)) & 3) == 0) ||
- enclosingBlockScopedContainer.kind === 256;
- if (!shouldHoist) {
- return node;
- }
- var isExported = ts.hasModifier(node, 1);
- var expressions = [];
- for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
- var variable = _a[_i];
- var visited = transformVariable(variable, isExported);
- if (visited) {
- expressions.push(visited);
- }
- }
- if (expressions.length) {
- return ts.createStatement(ts.inlineExpressions(expressions), node);
- }
- return undefined;
- }
- function transformVariable(node, isExported) {
- hoistBindingElement(node, isExported);
- if (!node.initializer) {
- return;
- }
- var name = node.name;
- if (ts.isIdentifier(name)) {
- return ts.createAssignment(name, node.initializer);
- }
- else {
- return ts.flattenVariableDestructuringToExpression(context, node, hoistVariableDeclaration);
- }
- }
- function visitFunctionDeclaration(node) {
- if (ts.hasModifier(node, 1)) {
- var name_31 = node.name || ts.getGeneratedNameForNode(node);
- var newNode = ts.createFunctionDeclaration(undefined, undefined, node.asteriskToken, name_31, undefined, node.parameters, undefined, node.body, node);
- recordExportedFunctionDeclaration(node);
- if (!ts.hasModifier(node, 512)) {
- recordExportName(name_31);
- }
- ts.setOriginalNode(newNode, node);
- node = newNode;
- }
- hoistFunctionDeclaration(node);
- return undefined;
- }
- function visitExpressionStatement(node) {
- var originalNode = ts.getOriginalNode(node);
- if ((originalNode.kind === 225 || originalNode.kind === 224) && ts.hasModifier(originalNode, 1)) {
- var name_32 = getDeclarationName(originalNode);
- if (originalNode.kind === 224) {
- hoistVariableDeclaration(name_32);
- }
- return [
- node,
- createExportStatement(name_32, name_32)
- ];
- }
- return node;
- }
- function visitClassDeclaration(node) {
- var name = getDeclarationName(node);
- hoistVariableDeclaration(name);
- var statements = [];
- statements.push(ts.createStatement(ts.createAssignment(name, ts.createClassExpression(undefined, node.name, undefined, node.heritageClauses, node.members, node)), node));
- if (ts.hasModifier(node, 1)) {
- if (!ts.hasModifier(node, 512)) {
- recordExportName(name);
- }
- statements.push(createDeclarationExport(node));
- }
- return statements;
- }
- function shouldHoistLoopInitializer(node) {
- return ts.isVariableDeclarationList(node) && (ts.getCombinedNodeFlags(node) & 3) === 0;
- }
- function visitForStatement(node) {
- var initializer = node.initializer;
- if (shouldHoistLoopInitializer(initializer)) {
- var expressions = [];
- for (var _i = 0, _a = initializer.declarations; _i < _a.length; _i++) {
- var variable = _a[_i];
- var visited = transformVariable(variable, false);
- if (visited) {
- expressions.push(visited);
- }
- }
- ;
- return ts.createFor(expressions.length
- ? ts.inlineExpressions(expressions)
- : ts.createSynthesizedNode(193), node.condition, node.incrementor, ts.visitNode(node.statement, visitNestedNode, ts.isStatement), node);
- }
- else {
- return ts.visitEachChild(node, visitNestedNode, context);
- }
- }
- function transformForBinding(node) {
- var firstDeclaration = ts.firstOrUndefined(node.declarations);
- hoistBindingElement(firstDeclaration, false);
- var name = firstDeclaration.name;
- return ts.isIdentifier(name)
- ? name
- : ts.flattenVariableDestructuringToExpression(context, firstDeclaration, hoistVariableDeclaration);
- }
- function visitForInStatement(node) {
- var initializer = node.initializer;
- if (shouldHoistLoopInitializer(initializer)) {
- var updated = ts.getMutableClone(node);
- updated.initializer = transformForBinding(initializer);
- updated.statement = ts.visitNode(node.statement, visitNestedNode, ts.isStatement, false, ts.liftToBlock);
- return updated;
- }
- else {
- return ts.visitEachChild(node, visitNestedNode, context);
- }
- }
- function visitForOfStatement(node) {
- var initializer = node.initializer;
- if (shouldHoistLoopInitializer(initializer)) {
- var updated = ts.getMutableClone(node);
- updated.initializer = transformForBinding(initializer);
- updated.statement = ts.visitNode(node.statement, visitNestedNode, ts.isStatement, false, ts.liftToBlock);
- return updated;
- }
- else {
- return ts.visitEachChild(node, visitNestedNode, context);
- }
- }
- function visitDoStatement(node) {
- var statement = ts.visitNode(node.statement, visitNestedNode, ts.isStatement, false, ts.liftToBlock);
- if (statement !== node.statement) {
- var updated = ts.getMutableClone(node);
- updated.statement = statement;
- return updated;
- }
- return node;
- }
- function visitWhileStatement(node) {
- var statement = ts.visitNode(node.statement, visitNestedNode, ts.isStatement, false, ts.liftToBlock);
- if (statement !== node.statement) {
- var updated = ts.getMutableClone(node);
- updated.statement = statement;
- return updated;
- }
- return node;
- }
- function visitLabeledStatement(node) {
- var statement = ts.visitNode(node.statement, visitNestedNode, ts.isStatement, false, ts.liftToBlock);
- if (statement !== node.statement) {
- var updated = ts.getMutableClone(node);
- updated.statement = statement;
- return updated;
- }
- return node;
- }
- function visitWithStatement(node) {
- var statement = ts.visitNode(node.statement, visitNestedNode, ts.isStatement, false, ts.liftToBlock);
- if (statement !== node.statement) {
- var updated = ts.getMutableClone(node);
- updated.statement = statement;
- return updated;
- }
- return node;
- }
- function visitSwitchStatement(node) {
- var caseBlock = ts.visitNode(node.caseBlock, visitNestedNode, ts.isCaseBlock);
- if (caseBlock !== node.caseBlock) {
- var updated = ts.getMutableClone(node);
- updated.caseBlock = caseBlock;
- return updated;
- }
- return node;
- }
- function visitCaseBlock(node) {
- var clauses = ts.visitNodes(node.clauses, visitNestedNode, ts.isCaseOrDefaultClause);
- if (clauses !== node.clauses) {
- var updated = ts.getMutableClone(node);
- updated.clauses = clauses;
- return updated;
- }
- return node;
- }
- function visitCaseClause(node) {
- var statements = ts.visitNodes(node.statements, visitNestedNode, ts.isStatement);
- if (statements !== node.statements) {
- var updated = ts.getMutableClone(node);
- updated.statements = statements;
- return updated;
- }
- return node;
- }
- function visitDefaultClause(node) {
- return ts.visitEachChild(node, visitNestedNode, context);
- }
- function visitTryStatement(node) {
- return ts.visitEachChild(node, visitNestedNode, context);
- }
- function visitCatchClause(node) {
- var block = ts.visitNode(node.block, visitNestedNode, ts.isBlock);
- if (block !== node.block) {
- var updated = ts.getMutableClone(node);
- updated.block = block;
- return updated;
- }
- return node;
- }
- function visitBlock(node) {
- return ts.visitEachChild(node, visitNestedNode, context);
- }
- function onEmitNode(emitContext, node, emitCallback) {
- if (node.kind === 256) {
- exportFunctionForFile = exportFunctionForFileMap[ts.getOriginalNodeId(node)];
- previousOnEmitNode(emitContext, node, emitCallback);
- exportFunctionForFile = undefined;
- }
- else {
- previousOnEmitNode(emitContext, node, emitCallback);
- }
- }
- function onSubstituteNode(emitContext, node) {
- node = previousOnSubstituteNode(emitContext, node);
- if (emitContext === 1) {
- return substituteExpression(node);
- }
- return node;
- }
- function substituteExpression(node) {
- switch (node.kind) {
- case 69:
- return substituteExpressionIdentifier(node);
- case 187:
- return substituteBinaryExpression(node);
- case 185:
- case 186:
- return substituteUnaryExpression(node);
- }
- return node;
- }
- function substituteExpressionIdentifier(node) {
- var importDeclaration = resolver.getReferencedImportDeclaration(node);
- if (importDeclaration) {
- var importBinding = createImportBinding(importDeclaration);
- if (importBinding) {
- return importBinding;
- }
- }
- return node;
- }
- function substituteBinaryExpression(node) {
- if (ts.isAssignmentOperator(node.operatorToken.kind)) {
- return substituteAssignmentExpression(node);
- }
- return node;
- }
- function substituteAssignmentExpression(node) {
- ts.setEmitFlags(node, 128);
- var left = node.left;
- switch (left.kind) {
- case 69:
- var exportDeclaration = resolver.getReferencedExportContainer(left);
- if (exportDeclaration) {
- return createExportExpression(left, node);
- }
- break;
- case 171:
- case 170:
- if (hasExportedReferenceInDestructuringPattern(left)) {
- return substituteDestructuring(node);
- }
- break;
- }
- return node;
- }
- function isExportedBinding(name) {
- var container = resolver.getReferencedExportContainer(name);
- return container && container.kind === 256;
- }
- function hasExportedReferenceInDestructuringPattern(node) {
- switch (node.kind) {
- case 69:
- return isExportedBinding(node);
- case 171:
- for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
- var property = _a[_i];
- if (hasExportedReferenceInObjectDestructuringElement(property)) {
- return true;
- }
- }
- break;
- case 170:
- for (var _b = 0, _c = node.elements; _b < _c.length; _b++) {
- var element = _c[_b];
- if (hasExportedReferenceInArrayDestructuringElement(element)) {
- return true;
- }
- }
- break;
- }
- return false;
- }
- function hasExportedReferenceInObjectDestructuringElement(node) {
- if (ts.isShorthandPropertyAssignment(node)) {
- return isExportedBinding(node.name);
- }
- else if (ts.isPropertyAssignment(node)) {
- return hasExportedReferenceInDestructuringElement(node.initializer);
- }
- else {
- return false;
- }
- }
- function hasExportedReferenceInArrayDestructuringElement(node) {
- if (ts.isSpreadElementExpression(node)) {
- var expression = node.expression;
- return ts.isIdentifier(expression) && isExportedBinding(expression);
- }
- else {
- return hasExportedReferenceInDestructuringElement(node);
- }
- }
- function hasExportedReferenceInDestructuringElement(node) {
- if (ts.isBinaryExpression(node)) {
- var left = node.left;
- return node.operatorToken.kind === 56
- && isDestructuringPattern(left)
- && hasExportedReferenceInDestructuringPattern(left);
- }
- else if (ts.isIdentifier(node)) {
- return isExportedBinding(node);
- }
- else if (ts.isSpreadElementExpression(node)) {
- var expression = node.expression;
- return ts.isIdentifier(expression) && isExportedBinding(expression);
- }
- else if (isDestructuringPattern(node)) {
- return hasExportedReferenceInDestructuringPattern(node);
- }
- else {
- return false;
- }
- }
- function isDestructuringPattern(node) {
- var kind = node.kind;
- return kind === 69
- || kind === 171
- || kind === 170;
- }
- function substituteDestructuring(node) {
- return ts.flattenDestructuringAssignment(context, node, true, hoistVariableDeclaration);
- }
- function substituteUnaryExpression(node) {
- var operand = node.operand;
- var operator = node.operator;
- var substitute = ts.isIdentifier(operand) &&
- (node.kind === 186 ||
- (node.kind === 185 && (operator === 41 || operator === 42)));
- if (substitute) {
- var exportDeclaration = resolver.getReferencedExportContainer(operand);
- if (exportDeclaration) {
- var expr = ts.createPrefix(node.operator, operand, node);
- ts.setEmitFlags(expr, 128);
- var call = createExportExpression(operand, expr);
- if (node.kind === 185) {
- return call;
- }
- else {
- return operator === 41
- ? ts.createSubtract(call, ts.createLiteral(1))
- : ts.createAdd(call, ts.createLiteral(1));
- }
- }
- }
- return node;
- }
- function getDeclarationName(node) {
- return node.name ? ts.getSynthesizedClone(node.name) : ts.getGeneratedNameForNode(node);
- }
- function addExportStarFunction(statements, localNames) {
- var exportStarFunction = ts.createUniqueName("exportStar");
- var m = ts.createIdentifier("m");
- var n = ts.createIdentifier("n");
- var exports = ts.createIdentifier("exports");
- var condition = ts.createStrictInequality(n, ts.createLiteral("default"));
- if (localNames) {
- condition = ts.createLogicalAnd(condition, ts.createLogicalNot(ts.createHasOwnProperty(localNames, n)));
- }
- statements.push(ts.createFunctionDeclaration(undefined, undefined, undefined, exportStarFunction, undefined, [ts.createParameter(m)], undefined, ts.createBlock([
- ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
- ts.createVariableDeclaration(exports, undefined, ts.createObjectLiteral([]))
- ])),
- ts.createForIn(ts.createVariableDeclarationList([
- ts.createVariableDeclaration(n, undefined)
- ]), m, ts.createBlock([
- ts.setEmitFlags(ts.createIf(condition, ts.createStatement(ts.createAssignment(ts.createElementAccess(exports, n), ts.createElementAccess(m, n)))), 32)
- ])),
- ts.createStatement(ts.createCall(exportFunctionForFile, undefined, [exports]))
- ], undefined, true)));
- return exportStarFunction;
- }
- function createExportExpression(name, value) {
- var exportName = ts.isIdentifier(name) ? ts.createLiteral(name.text) : name;
- return ts.createCall(exportFunctionForFile, undefined, [exportName, value]);
- }
- function createExportStatement(name, value) {
- return ts.createStatement(createExportExpression(name, value));
- }
- function createDeclarationExport(node) {
- var declarationName = getDeclarationName(node);
- var exportName = ts.hasModifier(node, 512) ? ts.createLiteral("default") : declarationName;
- return createExportStatement(exportName, declarationName);
- }
- function createImportBinding(importDeclaration) {
- var importAlias;
- var name;
- if (ts.isImportClause(importDeclaration)) {
- importAlias = ts.getGeneratedNameForNode(importDeclaration.parent);
- name = ts.createIdentifier("default");
- }
- else if (ts.isImportSpecifier(importDeclaration)) {
- importAlias = ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent);
- name = importDeclaration.propertyName || importDeclaration.name;
- }
- else {
- return undefined;
- }
- if (name.originalKeywordKind && languageVersion === 0) {
- return ts.createElementAccess(importAlias, ts.createLiteral(name.text));
- }
- else {
- return ts.createPropertyAccess(importAlias, ts.getSynthesizedClone(name));
- }
- }
- function collectDependencyGroups(externalImports) {
- var groupIndices = ts.createMap();
- var dependencyGroups = [];
- for (var i = 0; i < externalImports.length; i++) {
- var externalImport = externalImports[i];
- var externalModuleName = ts.getExternalModuleNameLiteral(externalImport, currentSourceFile, host, resolver, compilerOptions);
- var text = externalModuleName.text;
- if (ts.hasProperty(groupIndices, text)) {
- var groupIndex = groupIndices[text];
- dependencyGroups[groupIndex].externalImports.push(externalImport);
- continue;
- }
- else {
- groupIndices[text] = dependencyGroups.length;
- dependencyGroups.push({
- name: externalModuleName,
- externalImports: [externalImport]
- });
- }
- }
- return dependencyGroups;
- }
- function getNameOfDependencyGroup(dependencyGroup) {
- return dependencyGroup.name;
- }
- function recordExportName(name) {
- if (!exportedLocalNames) {
- exportedLocalNames = [];
- }
- exportedLocalNames.push(name);
- }
- function recordExportedFunctionDeclaration(node) {
- if (!exportedFunctionDeclarations) {
- exportedFunctionDeclarations = [];
- }
- exportedFunctionDeclarations.push(createDeclarationExport(node));
- }
- function hoistBindingElement(node, isExported) {
- if (ts.isOmittedExpression(node)) {
- return;
- }
- var name = node.name;
- if (ts.isIdentifier(name)) {
- hoistVariableDeclaration(ts.getSynthesizedClone(name));
- if (isExported) {
- recordExportName(name);
- }
- }
- else if (ts.isBindingPattern(name)) {
- ts.forEach(name.elements, isExported ? hoistExportedBindingElement : hoistNonExportedBindingElement);
- }
- }
- function hoistExportedBindingElement(node) {
- hoistBindingElement(node, true);
- }
- function hoistNonExportedBindingElement(node) {
- hoistBindingElement(node, false);
- }
- function updateSourceFile(node, statements, nodeEmitFlags) {
- var updated = ts.getMutableClone(node);
- updated.statements = ts.createNodeArray(statements, node.statements);
- ts.setEmitFlags(updated, nodeEmitFlags);
- return updated;
- }
- }
- ts.transformSystemModule = transformSystemModule;
-})(ts || (ts = {}));
-var ts;
-(function (ts) {
- function transformModule(context) {
- var transformModuleDelegates = ts.createMap((_a = {},
- _a[ts.ModuleKind.None] = transformCommonJSModule,
- _a[ts.ModuleKind.CommonJS] = transformCommonJSModule,
- _a[ts.ModuleKind.AMD] = transformAMDModule,
- _a[ts.ModuleKind.UMD] = transformUMDModule,
- _a));
- var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration;
- var compilerOptions = context.getCompilerOptions();
- var resolver = context.getEmitResolver();
- var host = context.getEmitHost();
- var languageVersion = ts.getEmitScriptTarget(compilerOptions);
- var moduleKind = ts.getEmitModuleKind(compilerOptions);
- var previousOnSubstituteNode = context.onSubstituteNode;
- var previousOnEmitNode = context.onEmitNode;
- context.onSubstituteNode = onSubstituteNode;
- context.onEmitNode = onEmitNode;
- context.enableSubstitution(69);
- context.enableSubstitution(187);
- context.enableSubstitution(185);
- context.enableSubstitution(186);
- context.enableSubstitution(254);
- context.enableEmitNotification(256);
- var currentSourceFile;
- var externalImports;
- var exportSpecifiers;
- var exportEquals;
- var bindingNameExportSpecifiersMap;
- var bindingNameExportSpecifiersForFileMap = ts.createMap();
- var hasExportStarsToExportValues;
- return transformSourceFile;
- function transformSourceFile(node) {
- if (ts.isDeclarationFile(node)) {
- return node;
- }
- if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
- currentSourceFile = node;
- (_a = ts.collectExternalModuleInfo(node, resolver), externalImports = _a.externalImports, exportSpecifiers = _a.exportSpecifiers, exportEquals = _a.exportEquals, hasExportStarsToExportValues = _a.hasExportStarsToExportValues, _a);
- var transformModule_1 = transformModuleDelegates[moduleKind] || transformModuleDelegates[ts.ModuleKind.None];
- var updated = transformModule_1(node);
- ts.aggregateTransformFlags(updated);
- currentSourceFile = undefined;
- externalImports = undefined;
- exportSpecifiers = undefined;
- exportEquals = undefined;
- hasExportStarsToExportValues = false;
- return updated;
- }
- return node;
- var _a;
- }
- function transformCommonJSModule(node) {
- startLexicalEnvironment();
- var statements = [];
- var statementOffset = ts.addPrologueDirectives(statements, node.statements, !compilerOptions.noImplicitUseStrict, visitor);
- ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset));
- ts.addRange(statements, endLexicalEnvironment());
- addExportEqualsIfNeeded(statements, false);
- var updated = updateSourceFile(node, statements);
- if (hasExportStarsToExportValues) {
- ts.setEmitFlags(updated, 2 | ts.getEmitFlags(node));
- }
- return updated;
- }
- function transformAMDModule(node) {
- var define = ts.createIdentifier("define");
- var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions);
- return transformAsynchronousModule(node, define, moduleName, true);
- }
- function transformUMDModule(node) {
- var define = ts.createIdentifier("define");
- ts.setEmitFlags(define, 16);
- return transformAsynchronousModule(node, define, undefined, false);
- }
- function transformAsynchronousModule(node, define, moduleName, includeNonAmdDependencies) {
- var _a = collectAsynchronousDependencies(node, includeNonAmdDependencies), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames;
- return updateSourceFile(node, [
- ts.createStatement(ts.createCall(define, undefined, (moduleName ? [moduleName] : []).concat([
- ts.createArrayLiteral([
- ts.createLiteral("require"),
- ts.createLiteral("exports")
- ].concat(aliasedModuleNames, unaliasedModuleNames)),
- ts.createFunctionExpression(undefined, undefined, undefined, [
- ts.createParameter("require"),
- ts.createParameter("exports")
- ].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node))
- ])))
- ]);
- }
- function transformAsynchronousModuleBody(node) {
- startLexicalEnvironment();
- var statements = [];
- var statementOffset = ts.addPrologueDirectives(statements, node.statements, !compilerOptions.noImplicitUseStrict, visitor);
- ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset));
- ts.addRange(statements, endLexicalEnvironment());
- addExportEqualsIfNeeded(statements, true);
- var body = ts.createBlock(statements, undefined, true);
- if (hasExportStarsToExportValues) {
- ts.setEmitFlags(body, 2);
- }
- return body;
- }
- function addExportEqualsIfNeeded(statements, emitAsReturn) {
- if (exportEquals && resolver.isValueAliasDeclaration(exportEquals)) {
- if (emitAsReturn) {
- var statement = ts.createReturn(exportEquals.expression, exportEquals);
- ts.setEmitFlags(statement, 12288 | 49152);
- statements.push(statement);
- }
- else {
- var statement = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), exportEquals.expression), exportEquals);
- ts.setEmitFlags(statement, 49152);
- statements.push(statement);
- }
- }
- }
- function visitor(node) {
- switch (node.kind) {
- case 230:
- return visitImportDeclaration(node);
- case 229:
- return visitImportEqualsDeclaration(node);
- case 236:
- return visitExportDeclaration(node);
- case 235:
- return visitExportAssignment(node);
- case 200:
- return visitVariableStatement(node);
- case 220:
- return visitFunctionDeclaration(node);
- case 221:
- return visitClassDeclaration(node);
- case 202:
- return visitExpressionStatement(node);
- default:
- return node;
- }
- }
- function visitImportDeclaration(node) {
- if (!ts.contains(externalImports, node)) {
- return undefined;
- }
- var statements = [];
- var namespaceDeclaration = ts.getNamespaceDeclarationNode(node);
- if (moduleKind !== ts.ModuleKind.AMD) {
- if (!node.importClause) {
- statements.push(ts.createStatement(createRequireCall(node), node));
- }
- else {
- var variables = [];
- if (namespaceDeclaration && !ts.isDefaultImport(node)) {
- variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, createRequireCall(node)));
- }
- else {
- variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), undefined, createRequireCall(node)));
- if (namespaceDeclaration && ts.isDefaultImport(node)) {
- variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node)));
- }
- }
- statements.push(ts.createVariableStatement(undefined, ts.createConstDeclarationList(variables), node));
- }
- }
- else if (namespaceDeclaration && ts.isDefaultImport(node)) {
- statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
- ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node), node)
- ])));
- }
- addExportImportAssignments(statements, node);
- return ts.singleOrMany(statements);
- }
- function visitImportEqualsDeclaration(node) {
- if (!ts.contains(externalImports, node)) {
- return undefined;
- }
- ts.setEmitFlags(node.name, 128);
- var statements = [];
- if (moduleKind !== ts.ModuleKind.AMD) {
- if (ts.hasModifier(node, 1)) {
- statements.push(ts.createStatement(createExportAssignment(node.name, createRequireCall(node)), node));
- }
- else {
- statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
- ts.createVariableDeclaration(ts.getSynthesizedClone(node.name), undefined, createRequireCall(node))
- ], undefined, languageVersion >= 2 ? 2 : 0), node));
- }
- }
- else {
- if (ts.hasModifier(node, 1)) {
- statements.push(ts.createStatement(createExportAssignment(node.name, node.name), node));
- }
- }
- addExportImportAssignments(statements, node);
- return statements;
- }
- function visitExportDeclaration(node) {
- if (!ts.contains(externalImports, node)) {
- return undefined;
- }
- var generatedName = ts.getGeneratedNameForNode(node);
- if (node.exportClause) {
- var statements = [];
- if (moduleKind !== ts.ModuleKind.AMD) {
- statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
- ts.createVariableDeclaration(generatedName, undefined, createRequireCall(node))
- ]), node));
- }
- for (var _i = 0, _a = node.exportClause.elements; _i < _a.length; _i++) {
- var specifier = _a[_i];
- if (resolver.isValueAliasDeclaration(specifier)) {
- var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name);
- statements.push(ts.createStatement(createExportAssignment(specifier.name, exportedValue), specifier));
- }
- }
- return ts.singleOrMany(statements);
- }
- else if (resolver.moduleExportsSomeValue(node.moduleSpecifier)) {
- return ts.createStatement(ts.createCall(ts.createIdentifier("__export"), undefined, [
- moduleKind !== ts.ModuleKind.AMD
- ? createRequireCall(node)
- : generatedName
- ]), node);
- }
- }
- function visitExportAssignment(node) {
- if (!node.isExportEquals) {
- if (ts.nodeIsSynthesized(node) || resolver.isValueAliasDeclaration(node)) {
- var statements = [];
- addExportDefault(statements, node.expression, node);
- return statements;
- }
- }
- return undefined;
- }
- function addExportDefault(statements, expression, location) {
- tryAddExportDefaultCompat(statements);
- statements.push(ts.createStatement(createExportAssignment(ts.createIdentifier("default"), expression), location));
- }
- function tryAddExportDefaultCompat(statements) {
- var original = ts.getOriginalNode(currentSourceFile);
- ts.Debug.assert(original.kind === 256);
- if (!original.symbol.exports["___esModule"]) {
- if (languageVersion === 0) {
- statements.push(ts.createStatement(createExportAssignment(ts.createIdentifier("__esModule"), ts.createLiteral(true))));
- }
- else {
- statements.push(ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [
- ts.createIdentifier("exports"),
- ts.createLiteral("__esModule"),
- ts.createObjectLiteral([
- ts.createPropertyAssignment("value", ts.createLiteral(true))
- ])
- ])));
- }
- }
- }
- function addExportImportAssignments(statements, node) {
- if (ts.isImportEqualsDeclaration(node)) {
- addExportMemberAssignments(statements, node.name);
- }
- else {
- var names = ts.reduceEachChild(node, collectExportMembers, []);
- for (var _i = 0, names_1 = names; _i < names_1.length; _i++) {
- var name_33 = names_1[_i];
- addExportMemberAssignments(statements, name_33);
- }
- }
- }
- function collectExportMembers(names, node) {
- if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node) && ts.isDeclaration(node)) {
- var name_34 = node.name;
- if (ts.isIdentifier(name_34)) {
- names.push(name_34);
- }
- }
- return ts.reduceEachChild(node, collectExportMembers, names);
- }
- function addExportMemberAssignments(statements, name) {
- if (!exportEquals && exportSpecifiers && ts.hasProperty(exportSpecifiers, name.text)) {
- for (var _i = 0, _a = exportSpecifiers[name.text]; _i < _a.length; _i++) {
- var specifier = _a[_i];
- statements.push(ts.startOnNewLine(ts.createStatement(createExportAssignment(specifier.name, name), specifier.name)));
- }
- }
- }
- function addExportMemberAssignment(statements, node) {
- if (ts.hasModifier(node, 512)) {
- addExportDefault(statements, getDeclarationName(node), node);
- }
- else {
- statements.push(createExportStatement(node.name, ts.setEmitFlags(ts.getSynthesizedClone(node.name), 262144), node));
- }
- }
- function visitVariableStatement(node) {
- var originalKind = ts.getOriginalNode(node).kind;
- if (originalKind === 225 ||
- originalKind === 224 ||
- originalKind === 221) {
- if (!ts.hasModifier(node, 1)) {
- return node;
- }
- return ts.setOriginalNode(ts.createVariableStatement(undefined, node.declarationList), node);
- }
- var resultStatements = [];
- if (ts.hasModifier(node, 1)) {
- var variables = ts.getInitializedVariables(node.declarationList);
- if (variables.length > 0) {
- var inlineAssignments = ts.createStatement(ts.inlineExpressions(ts.map(variables, transformInitializedVariable)), node);
- resultStatements.push(inlineAssignments);
- }
- }
- else {
- resultStatements.push(node);
- }
- for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
- var decl = _a[_i];
- addExportMemberAssignmentsForBindingName(resultStatements, decl.name);
- }
- return resultStatements;
- }
- function addExportMemberAssignmentsForBindingName(resultStatements, name) {
- if (ts.isBindingPattern(name)) {
- for (var _i = 0, _a = name.elements; _i < _a.length; _i++) {
- var element = _a[_i];
- if (!ts.isOmittedExpression(element)) {
- addExportMemberAssignmentsForBindingName(resultStatements, element.name);
- }
- }
- }
- else {
- if (!exportEquals && exportSpecifiers && ts.hasProperty(exportSpecifiers, name.text)) {
- var sourceFileId = ts.getOriginalNodeId(currentSourceFile);
- if (!bindingNameExportSpecifiersForFileMap[sourceFileId]) {
- bindingNameExportSpecifiersForFileMap[sourceFileId] = ts.createMap();
- }
- bindingNameExportSpecifiersForFileMap[sourceFileId][name.text] = exportSpecifiers[name.text];
- addExportMemberAssignments(resultStatements, name);
- }
- }
- }
- function transformInitializedVariable(node) {
- var name = node.name;
- if (ts.isBindingPattern(name)) {
- return ts.flattenVariableDestructuringToExpression(context, node, hoistVariableDeclaration, getModuleMemberName, visitor);
- }
- else {
- return ts.createAssignment(getModuleMemberName(name), ts.visitNode(node.initializer, visitor, ts.isExpression));
- }
- }
- function visitFunctionDeclaration(node) {
- var statements = [];
- var name = node.name || ts.getGeneratedNameForNode(node);
- if (ts.hasModifier(node, 1)) {
- statements.push(ts.setOriginalNode(ts.createFunctionDeclaration(undefined, undefined, node.asteriskToken, name, undefined, node.parameters, undefined, node.body, node), node));
- addExportMemberAssignment(statements, node);
- }
- else {
- statements.push(node);
- }
- if (node.name) {
- addExportMemberAssignments(statements, node.name);
- }
- return ts.singleOrMany(statements);
- }
- function visitClassDeclaration(node) {
- var statements = [];
- var name = node.name || ts.getGeneratedNameForNode(node);
- if (ts.hasModifier(node, 1)) {
- statements.push(ts.setOriginalNode(ts.createClassDeclaration(undefined, undefined, name, undefined, node.heritageClauses, node.members, node), node));
- addExportMemberAssignment(statements, node);
- }
- else {
- statements.push(node);
- }
- if (node.name && !(node.decorators && node.decorators.length)) {
- addExportMemberAssignments(statements, node.name);
- }
- return ts.singleOrMany(statements);
- }
- function visitExpressionStatement(node) {
- var original = ts.getOriginalNode(node);
- var origKind = original.kind;
- if (origKind === 224 || origKind === 225) {
- return visitExpressionStatementForEnumOrNamespaceDeclaration(node, original);
- }
- else if (origKind === 221) {
- var classDecl = original;
- if (classDecl.name) {
- var statements = [node];
- addExportMemberAssignments(statements, classDecl.name);
- return statements;
- }
- }
- return node;
- }
- function visitExpressionStatementForEnumOrNamespaceDeclaration(node, original) {
- var statements = [node];
- if (ts.hasModifier(original, 1) &&
- original.kind === 224 &&
- ts.isFirstDeclarationOfKind(original, 224)) {
- addVarForExportedEnumOrNamespaceDeclaration(statements, original);
- }
- addExportMemberAssignments(statements, original.name);
- return statements;
- }
- function addVarForExportedEnumOrNamespaceDeclaration(statements, node) {
- var transformedStatement = ts.createVariableStatement(undefined, [ts.createVariableDeclaration(getDeclarationName(node), undefined, ts.createPropertyAccess(ts.createIdentifier("exports"), getDeclarationName(node)))], node);
- ts.setEmitFlags(transformedStatement, 49152);
- statements.push(transformedStatement);
- }
- function getDeclarationName(node) {
- return node.name ? ts.getSynthesizedClone(node.name) : ts.getGeneratedNameForNode(node);
- }
- function onEmitNode(emitContext, node, emitCallback) {
- if (node.kind === 256) {
- bindingNameExportSpecifiersMap = bindingNameExportSpecifiersForFileMap[ts.getOriginalNodeId(node)];
- previousOnEmitNode(emitContext, node, emitCallback);
- bindingNameExportSpecifiersMap = undefined;
- }
- else {
- previousOnEmitNode(emitContext, node, emitCallback);
- }
- }
- function onSubstituteNode(emitContext, node) {
- node = previousOnSubstituteNode(emitContext, node);
- if (emitContext === 1) {
- return substituteExpression(node);
- }
- else if (ts.isShorthandPropertyAssignment(node)) {
- return substituteShorthandPropertyAssignment(node);
- }
- return node;
- }
- function substituteShorthandPropertyAssignment(node) {
- var name = node.name;
- var exportedOrImportedName = substituteExpressionIdentifier(name);
- if (exportedOrImportedName !== name) {
- if (node.objectAssignmentInitializer) {
- var initializer = ts.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer);
- return ts.createPropertyAssignment(name, initializer, node);
- }
- return ts.createPropertyAssignment(name, exportedOrImportedName, node);
- }
- return node;
- }
- function substituteExpression(node) {
- switch (node.kind) {
- case 69:
- return substituteExpressionIdentifier(node);
- case 187:
- return substituteBinaryExpression(node);
- case 186:
- case 185:
- return substituteUnaryExpression(node);
- }
- return node;
- }
- function substituteExpressionIdentifier(node) {
- return trySubstituteExportedName(node)
- || trySubstituteImportedName(node)
- || node;
- }
- function substituteBinaryExpression(node) {
- var left = node.left;
- if (ts.isIdentifier(left) && ts.isAssignmentOperator(node.operatorToken.kind)) {
- if (bindingNameExportSpecifiersMap && ts.hasProperty(bindingNameExportSpecifiersMap, left.text)) {
- ts.setEmitFlags(node, 128);
- var nestedExportAssignment = void 0;
- for (var _i = 0, _a = bindingNameExportSpecifiersMap[left.text]; _i < _a.length; _i++) {
- var specifier = _a[_i];
- nestedExportAssignment = nestedExportAssignment ?
- createExportAssignment(specifier.name, nestedExportAssignment) :
- createExportAssignment(specifier.name, node);
- }
- return nestedExportAssignment;
- }
- }
- return node;
- }
- function substituteUnaryExpression(node) {
- var operator = node.operator;
- var operand = node.operand;
- if (ts.isIdentifier(operand) && bindingNameExportSpecifiersForFileMap) {
- if (bindingNameExportSpecifiersMap && ts.hasProperty(bindingNameExportSpecifiersMap, operand.text)) {
- ts.setEmitFlags(node, 128);
- var transformedUnaryExpression = void 0;
- if (node.kind === 186) {
- transformedUnaryExpression = ts.createBinary(operand, ts.createToken(operator === 41 ? 57 : 58), ts.createLiteral(1), node);
- ts.setEmitFlags(transformedUnaryExpression, 128);
- }
- var nestedExportAssignment = void 0;
- for (var _i = 0, _a = bindingNameExportSpecifiersMap[operand.text]; _i < _a.length; _i++) {
- var specifier = _a[_i];
- nestedExportAssignment = nestedExportAssignment ?
- createExportAssignment(specifier.name, nestedExportAssignment) :
- createExportAssignment(specifier.name, transformedUnaryExpression || node);
- }
- return nestedExportAssignment;
- }
- }
- return node;
- }
- function trySubstituteExportedName(node) {
- var emitFlags = ts.getEmitFlags(node);
- if ((emitFlags & 262144) === 0) {
- var container = resolver.getReferencedExportContainer(node, (emitFlags & 131072) !== 0);
- if (container) {
- if (container.kind === 256) {
- return ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node), node);
- }
- }
- }
- return undefined;
- }
- function trySubstituteImportedName(node) {
- if ((ts.getEmitFlags(node) & 262144) === 0) {
- var declaration = resolver.getReferencedImportDeclaration(node);
- if (declaration) {
- if (ts.isImportClause(declaration)) {
- if (languageVersion >= 1) {
- return ts.createPropertyAccess(ts.getGeneratedNameForNode(declaration.parent), ts.createIdentifier("default"), node);
- }
- else {
- return ts.createElementAccess(ts.getGeneratedNameForNode(declaration.parent), ts.createLiteral("default"), node);
- }
- }
- else if (ts.isImportSpecifier(declaration)) {
- var name_35 = declaration.propertyName || declaration.name;
- if (name_35.originalKeywordKind === 77 && languageVersion <= 0) {
- return ts.createElementAccess(ts.getGeneratedNameForNode(declaration.parent.parent.parent), ts.createLiteral(name_35.text), node);
- }
- else {
- return ts.createPropertyAccess(ts.getGeneratedNameForNode(declaration.parent.parent.parent), ts.getSynthesizedClone(name_35), node);
- }
- }
- }
- }
- return undefined;
- }
- function getModuleMemberName(name) {
- return ts.createPropertyAccess(ts.createIdentifier("exports"), name, name);
- }
- function createRequireCall(importNode) {
- var moduleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions);
- var args = [];
- if (ts.isDefined(moduleName)) {
- args.push(moduleName);
- }
- return ts.createCall(ts.createIdentifier("require"), undefined, args);
- }
- function createExportStatement(name, value, location) {
- var statement = ts.createStatement(createExportAssignment(name, value));
- statement.startsOnNewLine = true;
- if (location) {
- ts.setSourceMapRange(statement, location);
- }
- return statement;
- }
- function createExportAssignment(name, value) {
- return ts.createAssignment(name.originalKeywordKind === 77 && languageVersion === 0
- ? ts.createElementAccess(ts.createIdentifier("exports"), ts.createLiteral(name.text))
- : ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value);
- }
- function collectAsynchronousDependencies(node, includeNonAmdDependencies) {
- var aliasedModuleNames = [];
- var unaliasedModuleNames = [];
- var importAliasNames = [];
- for (var _i = 0, _a = node.amdDependencies; _i < _a.length; _i++) {
- var amdDependency = _a[_i];
- if (amdDependency.name) {
- aliasedModuleNames.push(ts.createLiteral(amdDependency.path));
- importAliasNames.push(ts.createParameter(amdDependency.name));
- }
- else {
- unaliasedModuleNames.push(ts.createLiteral(amdDependency.path));
- }
- }
- for (var _b = 0, externalImports_3 = externalImports; _b < externalImports_3.length; _b++) {
- var importNode = externalImports_3[_b];
- var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions);
- var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile);
- if (includeNonAmdDependencies && importAliasName) {
- ts.setEmitFlags(importAliasName, 128);
- aliasedModuleNames.push(externalModuleName);
- importAliasNames.push(ts.createParameter(importAliasName));
- }
- else {
- unaliasedModuleNames.push(externalModuleName);
- }
- }
- return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames };
- }
- function updateSourceFile(node, statements) {
- var updated = ts.getMutableClone(node);
- updated.statements = ts.createNodeArray(statements, node.statements);
- return updated;
- }
- var _a;
- }
- ts.transformModule = transformModule;
-})(ts || (ts = {}));
-var ts;
(function (ts) {
var entities = createEntitiesMap();
function transformJsx(context) {
@@ -38364,9 +38159,9 @@ var ts;
}
function visitorWorker(node) {
switch (node.kind) {
- case 241:
- return visitJsxElement(node, false);
case 242:
+ return visitJsxElement(node, false);
+ case 243:
return visitJsxSelfClosingElement(node, false);
case 248:
return visitJsxExpression(node);
@@ -38377,13 +38172,13 @@ var ts;
}
function transformJsxChildToExpression(node) {
switch (node.kind) {
- case 244:
+ case 10:
return visitJsxText(node);
case 248:
return visitJsxExpression(node);
- case 241:
- return visitJsxElement(node, true);
case 242:
+ return visitJsxElement(node, true);
+ case 243:
return visitJsxSelfClosingElement(node, true);
default:
ts.Debug.failBadSyntaxKind(node);
@@ -38500,16 +38295,16 @@ var ts;
return decoded === text ? undefined : decoded;
}
function getTagName(node) {
- if (node.kind === 241) {
+ if (node.kind === 242) {
return getTagName(node.openingElement);
}
else {
- var name_36 = node.tagName;
- if (ts.isIdentifier(name_36) && ts.isIntrinsicJsxName(name_36.text)) {
- return ts.createLiteral(name_36.text);
+ var name_31 = node.tagName;
+ if (ts.isIdentifier(name_31) && ts.isIntrinsicJsxName(name_31.text)) {
+ return ts.createLiteral(name_31.text);
}
else {
- return ts.createExpressionFromEntityName(name_36);
+ return ts.createExpressionFromEntityName(name_31);
}
}
}
@@ -38787,13 +38582,30 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
- function transformES7(context) {
- var hoistVariableDeclaration = context.hoistVariableDeclaration;
+ function transformES2017(context) {
+ var ES2017SubstitutionFlags;
+ (function (ES2017SubstitutionFlags) {
+ ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper";
+ })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {}));
+ var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment;
+ var resolver = context.getEmitResolver();
+ var compilerOptions = context.getCompilerOptions();
+ var languageVersion = ts.getEmitScriptTarget(compilerOptions);
+ var currentSourceFileExternalHelpersModuleName;
+ var enabledSubstitutions;
+ var applicableSubstitutions;
+ var currentSuperContainer;
+ var previousOnEmitNode = context.onEmitNode;
+ var previousOnSubstituteNode = context.onSubstituteNode;
+ context.onEmitNode = onEmitNode;
+ context.onSubstituteNode = onSubstituteNode;
+ var currentScope;
return transformSourceFile;
function transformSourceFile(node) {
if (ts.isDeclarationFile(node)) {
return node;
}
+ currentSourceFileExternalHelpersModuleName = node.externalHelpersModuleName;
return ts.visitEachChild(node, visitor, context);
}
function visitor(node) {
@@ -38803,13 +38615,265 @@ var ts;
else if (node.transformFlags & 32) {
return ts.visitEachChild(node, visitor, context);
}
+ return node;
+ }
+ function visitorWorker(node) {
+ switch (node.kind) {
+ case 119:
+ return undefined;
+ case 185:
+ return visitAwaitExpression(node);
+ case 148:
+ return visitMethodDeclaration(node);
+ case 221:
+ return visitFunctionDeclaration(node);
+ case 180:
+ return visitFunctionExpression(node);
+ case 181:
+ return visitArrowFunction(node);
+ default:
+ ts.Debug.failBadSyntaxKind(node);
+ return node;
+ }
+ }
+ function visitAwaitExpression(node) {
+ return ts.setOriginalNode(ts.createYield(undefined, ts.visitNode(node.expression, visitor, ts.isExpression), node), node);
+ }
+ function visitMethodDeclaration(node) {
+ if (!ts.isAsyncFunctionLike(node)) {
+ return node;
+ }
+ var method = ts.createMethod(undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node);
+ ts.setCommentRange(method, node);
+ ts.setSourceMapRange(method, ts.moveRangePastDecorators(node));
+ ts.setOriginalNode(method, node);
+ return method;
+ }
+ function visitFunctionDeclaration(node) {
+ if (!ts.isAsyncFunctionLike(node)) {
+ return node;
+ }
+ var func = ts.createFunctionDeclaration(undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node);
+ ts.setOriginalNode(func, node);
+ return func;
+ }
+ function visitFunctionExpression(node) {
+ if (!ts.isAsyncFunctionLike(node)) {
+ return node;
+ }
+ if (ts.nodeIsMissing(node.body)) {
+ return ts.createOmittedExpression();
+ }
+ var func = ts.createFunctionExpression(undefined, node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node);
+ ts.setOriginalNode(func, node);
+ return func;
+ }
+ function visitArrowFunction(node) {
+ if (!ts.isAsyncFunctionLike(node)) {
+ return node;
+ }
+ var func = ts.createArrowFunction(ts.visitNodes(node.modifiers, visitor, ts.isModifier), undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, node.equalsGreaterThanToken, transformConciseBody(node), node);
+ ts.setOriginalNode(func, node);
+ return func;
+ }
+ function transformFunctionBody(node) {
+ return transformAsyncFunctionBody(node);
+ }
+ function transformConciseBody(node) {
+ return transformAsyncFunctionBody(node);
+ }
+ function transformFunctionBodyWorker(body, start) {
+ if (start === void 0) { start = 0; }
+ var savedCurrentScope = currentScope;
+ currentScope = body;
+ startLexicalEnvironment();
+ var statements = ts.visitNodes(body.statements, visitor, ts.isStatement, start);
+ var visited = ts.updateBlock(body, statements);
+ var declarations = endLexicalEnvironment();
+ currentScope = savedCurrentScope;
+ return ts.mergeFunctionBodyLexicalEnvironment(visited, declarations);
+ }
+ function transformAsyncFunctionBody(node) {
+ var nodeType = node.original ? node.original.type : node.type;
+ var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : undefined;
+ var isArrowFunction = node.kind === 181;
+ var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0;
+ if (!isArrowFunction) {
+ var statements = [];
+ var statementOffset = ts.addPrologueDirectives(statements, node.body.statements, false, visitor);
+ statements.push(ts.createReturn(ts.createAwaiterHelper(currentSourceFileExternalHelpersModuleName, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset))));
+ var block = ts.createBlock(statements, node.body, true);
+ if (languageVersion >= 2) {
+ if (resolver.getNodeCheckFlags(node) & 4096) {
+ enableSubstitutionForAsyncMethodsWithSuper();
+ ts.setEmitFlags(block, 8);
+ }
+ else if (resolver.getNodeCheckFlags(node) & 2048) {
+ enableSubstitutionForAsyncMethodsWithSuper();
+ ts.setEmitFlags(block, 4);
+ }
+ }
+ return block;
+ }
+ else {
+ return ts.createAwaiterHelper(currentSourceFileExternalHelpersModuleName, hasLexicalArguments, promiseConstructor, transformConciseBodyWorker(node.body, true));
+ }
+ }
+ function transformConciseBodyWorker(body, forceBlockFunctionBody) {
+ if (ts.isBlock(body)) {
+ return transformFunctionBodyWorker(body);
+ }
+ else {
+ startLexicalEnvironment();
+ var visited = ts.visitNode(body, visitor, ts.isConciseBody);
+ var declarations = endLexicalEnvironment();
+ var merged = ts.mergeFunctionBodyLexicalEnvironment(visited, declarations);
+ if (forceBlockFunctionBody && !ts.isBlock(merged)) {
+ return ts.createBlock([
+ ts.createReturn(merged)
+ ]);
+ }
+ else {
+ return merged;
+ }
+ }
+ }
+ function getPromiseConstructor(type) {
+ var typeName = ts.getEntityNameFromTypeNode(type);
+ if (typeName && ts.isEntityName(typeName)) {
+ var serializationKind = resolver.getTypeReferenceSerializationKind(typeName);
+ if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue
+ || serializationKind === ts.TypeReferenceSerializationKind.Unknown) {
+ return typeName;
+ }
+ }
+ return undefined;
+ }
+ function enableSubstitutionForAsyncMethodsWithSuper() {
+ if ((enabledSubstitutions & 1) === 0) {
+ enabledSubstitutions |= 1;
+ context.enableSubstitution(175);
+ context.enableSubstitution(173);
+ context.enableSubstitution(174);
+ context.enableEmitNotification(222);
+ context.enableEmitNotification(148);
+ context.enableEmitNotification(150);
+ context.enableEmitNotification(151);
+ context.enableEmitNotification(149);
+ }
+ }
+ function substituteExpression(node) {
+ switch (node.kind) {
+ case 173:
+ return substitutePropertyAccessExpression(node);
+ case 174:
+ return substituteElementAccessExpression(node);
+ case 175:
+ if (enabledSubstitutions & 1) {
+ return substituteCallExpression(node);
+ }
+ break;
+ }
+ return node;
+ }
+ function substitutePropertyAccessExpression(node) {
+ if (enabledSubstitutions & 1 && node.expression.kind === 96) {
+ var flags = getSuperContainerAsyncMethodFlags();
+ if (flags) {
+ return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), flags, node);
+ }
+ }
+ return node;
+ }
+ function substituteElementAccessExpression(node) {
+ if (enabledSubstitutions & 1 && node.expression.kind === 96) {
+ var flags = getSuperContainerAsyncMethodFlags();
+ if (flags) {
+ return createSuperAccessInAsyncMethod(node.argumentExpression, flags, node);
+ }
+ }
+ return node;
+ }
+ function substituteCallExpression(node) {
+ var expression = node.expression;
+ if (ts.isSuperProperty(expression)) {
+ var flags = getSuperContainerAsyncMethodFlags();
+ if (flags) {
+ var argumentExpression = ts.isPropertyAccessExpression(expression)
+ ? substitutePropertyAccessExpression(expression)
+ : substituteElementAccessExpression(expression);
+ return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [
+ ts.createThis()
+ ].concat(node.arguments));
+ }
+ }
+ return node;
+ }
+ function isSuperContainer(node) {
+ var kind = node.kind;
+ return kind === 222
+ || kind === 149
+ || kind === 148
+ || kind === 150
+ || kind === 151;
+ }
+ function onEmitNode(emitContext, node, emitCallback) {
+ var savedApplicableSubstitutions = applicableSubstitutions;
+ var savedCurrentSuperContainer = currentSuperContainer;
+ if (enabledSubstitutions & 1 && isSuperContainer(node)) {
+ currentSuperContainer = node;
+ }
+ previousOnEmitNode(emitContext, node, emitCallback);
+ applicableSubstitutions = savedApplicableSubstitutions;
+ currentSuperContainer = savedCurrentSuperContainer;
+ }
+ function onSubstituteNode(emitContext, node) {
+ node = previousOnSubstituteNode(emitContext, node);
+ if (emitContext === 1) {
+ return substituteExpression(node);
+ }
+ return node;
+ }
+ function createSuperAccessInAsyncMethod(argumentExpression, flags, location) {
+ if (flags & 4096) {
+ return ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), "value", location);
+ }
+ else {
+ return ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression], location);
+ }
+ }
+ function getSuperContainerAsyncMethodFlags() {
+ return currentSuperContainer !== undefined
+ && resolver.getNodeCheckFlags(currentSuperContainer) & (2048 | 4096);
+ }
+ }
+ ts.transformES2017 = transformES2017;
+})(ts || (ts = {}));
+var ts;
+(function (ts) {
+ function transformES2016(context) {
+ var hoistVariableDeclaration = context.hoistVariableDeclaration;
+ return transformSourceFile;
+ function transformSourceFile(node) {
+ if (ts.isDeclarationFile(node)) {
+ return node;
+ }
+ return ts.visitEachChild(node, visitor, context);
+ }
+ function visitor(node) {
+ if (node.transformFlags & 64) {
+ return visitorWorker(node);
+ }
+ else if (node.transformFlags & 128) {
+ return ts.visitEachChild(node, visitor, context);
+ }
else {
return node;
}
}
function visitorWorker(node) {
switch (node.kind) {
- case 187:
+ case 188:
return visitBinaryExpression(node);
default:
ts.Debug.failBadSyntaxKind(node);
@@ -38819,7 +38883,7 @@ var ts;
function visitBinaryExpression(node) {
var left = ts.visitNode(node.left, visitor, ts.isExpression);
var right = ts.visitNode(node.right, visitor, ts.isExpression);
- if (node.operatorToken.kind === 60) {
+ if (node.operatorToken.kind === 61) {
var target = void 0;
var value = void 0;
if (ts.isElementAccessExpression(left)) {
@@ -38839,7 +38903,7 @@ var ts;
}
return ts.createAssignment(target, ts.createMathPow(value, right, node), node);
}
- else if (node.operatorToken.kind === 38) {
+ else if (node.operatorToken.kind === 39) {
return ts.createMathPow(left, right, node);
}
else {
@@ -38848,10 +38912,1644 @@ var ts;
}
}
}
- ts.transformES7 = transformES7;
+ ts.transformES2016 = transformES2016;
})(ts || (ts = {}));
var ts;
(function (ts) {
+ var ES2015SubstitutionFlags;
+ (function (ES2015SubstitutionFlags) {
+ ES2015SubstitutionFlags[ES2015SubstitutionFlags["CapturedThis"] = 1] = "CapturedThis";
+ ES2015SubstitutionFlags[ES2015SubstitutionFlags["BlockScopedBindings"] = 2] = "BlockScopedBindings";
+ })(ES2015SubstitutionFlags || (ES2015SubstitutionFlags = {}));
+ var CopyDirection;
+ (function (CopyDirection) {
+ CopyDirection[CopyDirection["ToOriginal"] = 0] = "ToOriginal";
+ CopyDirection[CopyDirection["ToOutParameter"] = 1] = "ToOutParameter";
+ })(CopyDirection || (CopyDirection = {}));
+ var Jump;
+ (function (Jump) {
+ Jump[Jump["Break"] = 2] = "Break";
+ Jump[Jump["Continue"] = 4] = "Continue";
+ Jump[Jump["Return"] = 8] = "Return";
+ })(Jump || (Jump = {}));
+ var SuperCaptureResult;
+ (function (SuperCaptureResult) {
+ SuperCaptureResult[SuperCaptureResult["NoReplacement"] = 0] = "NoReplacement";
+ SuperCaptureResult[SuperCaptureResult["ReplaceSuperCapture"] = 1] = "ReplaceSuperCapture";
+ SuperCaptureResult[SuperCaptureResult["ReplaceWithReturn"] = 2] = "ReplaceWithReturn";
+ })(SuperCaptureResult || (SuperCaptureResult = {}));
+ function transformES2015(context) {
+ var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration;
+ var resolver = context.getEmitResolver();
+ var previousOnSubstituteNode = context.onSubstituteNode;
+ var previousOnEmitNode = context.onEmitNode;
+ context.onEmitNode = onEmitNode;
+ context.onSubstituteNode = onSubstituteNode;
+ var currentSourceFile;
+ var currentText;
+ var currentParent;
+ var currentNode;
+ var enclosingVariableStatement;
+ var enclosingBlockScopeContainer;
+ var enclosingBlockScopeContainerParent;
+ var enclosingFunction;
+ var enclosingNonArrowFunction;
+ var enclosingNonAsyncFunctionBody;
+ var convertedLoopState;
+ var enabledSubstitutions;
+ return transformSourceFile;
+ function transformSourceFile(node) {
+ if (ts.isDeclarationFile(node)) {
+ return node;
+ }
+ currentSourceFile = node;
+ currentText = node.text;
+ return ts.visitNode(node, visitor, ts.isSourceFile);
+ }
+ function visitor(node) {
+ return saveStateAndInvoke(node, dispatcher);
+ }
+ function dispatcher(node) {
+ return convertedLoopState
+ ? visitorForConvertedLoopWorker(node)
+ : visitorWorker(node);
+ }
+ function saveStateAndInvoke(node, f) {
+ var savedEnclosingFunction = enclosingFunction;
+ var savedEnclosingNonArrowFunction = enclosingNonArrowFunction;
+ var savedEnclosingNonAsyncFunctionBody = enclosingNonAsyncFunctionBody;
+ var savedEnclosingBlockScopeContainer = enclosingBlockScopeContainer;
+ var savedEnclosingBlockScopeContainerParent = enclosingBlockScopeContainerParent;
+ var savedEnclosingVariableStatement = enclosingVariableStatement;
+ var savedCurrentParent = currentParent;
+ var savedCurrentNode = currentNode;
+ var savedConvertedLoopState = convertedLoopState;
+ if (ts.nodeStartsNewLexicalEnvironment(node)) {
+ convertedLoopState = undefined;
+ }
+ onBeforeVisitNode(node);
+ var visited = f(node);
+ convertedLoopState = savedConvertedLoopState;
+ enclosingFunction = savedEnclosingFunction;
+ enclosingNonArrowFunction = savedEnclosingNonArrowFunction;
+ enclosingNonAsyncFunctionBody = savedEnclosingNonAsyncFunctionBody;
+ enclosingBlockScopeContainer = savedEnclosingBlockScopeContainer;
+ enclosingBlockScopeContainerParent = savedEnclosingBlockScopeContainerParent;
+ enclosingVariableStatement = savedEnclosingVariableStatement;
+ currentParent = savedCurrentParent;
+ currentNode = savedCurrentNode;
+ return visited;
+ }
+ function shouldCheckNode(node) {
+ return (node.transformFlags & 256) !== 0 ||
+ node.kind === 215 ||
+ (ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node));
+ }
+ function visitorWorker(node) {
+ if (shouldCheckNode(node)) {
+ return visitJavaScript(node);
+ }
+ else if (node.transformFlags & 512) {
+ return ts.visitEachChild(node, visitor, context);
+ }
+ else {
+ return node;
+ }
+ }
+ function visitorForConvertedLoopWorker(node) {
+ var result;
+ if (shouldCheckNode(node)) {
+ result = visitJavaScript(node);
+ }
+ else {
+ result = visitNodesInConvertedLoop(node);
+ }
+ return result;
+ }
+ function visitNodesInConvertedLoop(node) {
+ switch (node.kind) {
+ case 212:
+ return visitReturnStatement(node);
+ case 201:
+ return visitVariableStatement(node);
+ case 214:
+ return visitSwitchStatement(node);
+ case 211:
+ case 210:
+ return visitBreakOrContinueStatement(node);
+ case 98:
+ return visitThisKeyword(node);
+ case 70:
+ return visitIdentifier(node);
+ default:
+ return ts.visitEachChild(node, visitor, context);
+ }
+ }
+ function visitJavaScript(node) {
+ switch (node.kind) {
+ case 83:
+ return node;
+ case 222:
+ return visitClassDeclaration(node);
+ case 193:
+ return visitClassExpression(node);
+ case 143:
+ return visitParameter(node);
+ case 221:
+ return visitFunctionDeclaration(node);
+ case 181:
+ return visitArrowFunction(node);
+ case 180:
+ return visitFunctionExpression(node);
+ case 219:
+ return visitVariableDeclaration(node);
+ case 70:
+ return visitIdentifier(node);
+ case 220:
+ return visitVariableDeclarationList(node);
+ case 215:
+ return visitLabeledStatement(node);
+ case 205:
+ return visitDoStatement(node);
+ case 206:
+ return visitWhileStatement(node);
+ case 207:
+ return visitForStatement(node);
+ case 208:
+ return visitForInStatement(node);
+ case 209:
+ return visitForOfStatement(node);
+ case 203:
+ return visitExpressionStatement(node);
+ case 172:
+ return visitObjectLiteralExpression(node);
+ case 254:
+ return visitShorthandPropertyAssignment(node);
+ case 171:
+ return visitArrayLiteralExpression(node);
+ case 175:
+ return visitCallExpression(node);
+ case 176:
+ return visitNewExpression(node);
+ case 179:
+ return visitParenthesizedExpression(node, true);
+ case 188:
+ return visitBinaryExpression(node, true);
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ return visitTemplateLiteral(node);
+ case 177:
+ return visitTaggedTemplateExpression(node);
+ case 190:
+ return visitTemplateExpression(node);
+ case 191:
+ return visitYieldExpression(node);
+ case 96:
+ return visitSuperKeyword();
+ case 191:
+ return ts.visitEachChild(node, visitor, context);
+ case 148:
+ return visitMethodDeclaration(node);
+ case 256:
+ return visitSourceFileNode(node);
+ case 201:
+ return visitVariableStatement(node);
+ default:
+ ts.Debug.failBadSyntaxKind(node);
+ return ts.visitEachChild(node, visitor, context);
+ }
+ }
+ function onBeforeVisitNode(node) {
+ if (currentNode) {
+ if (ts.isBlockScope(currentNode, currentParent)) {
+ enclosingBlockScopeContainer = currentNode;
+ enclosingBlockScopeContainerParent = currentParent;
+ }
+ if (ts.isFunctionLike(currentNode)) {
+ enclosingFunction = currentNode;
+ if (currentNode.kind !== 181) {
+ enclosingNonArrowFunction = currentNode;
+ if (!(ts.getEmitFlags(currentNode) & 2097152)) {
+ enclosingNonAsyncFunctionBody = currentNode;
+ }
+ }
+ }
+ switch (currentNode.kind) {
+ case 201:
+ enclosingVariableStatement = currentNode;
+ break;
+ case 220:
+ case 219:
+ case 170:
+ case 168:
+ case 169:
+ break;
+ default:
+ enclosingVariableStatement = undefined;
+ }
+ }
+ currentParent = currentNode;
+ currentNode = node;
+ }
+ function visitSwitchStatement(node) {
+ ts.Debug.assert(convertedLoopState !== undefined);
+ var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps;
+ convertedLoopState.allowedNonLabeledJumps |= 2;
+ var result = ts.visitEachChild(node, visitor, context);
+ convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps;
+ return result;
+ }
+ function visitReturnStatement(node) {
+ ts.Debug.assert(convertedLoopState !== undefined);
+ convertedLoopState.nonLocalJumps |= 8;
+ return ts.createReturn(ts.createObjectLiteral([
+ ts.createPropertyAssignment(ts.createIdentifier("value"), node.expression
+ ? ts.visitNode(node.expression, visitor, ts.isExpression)
+ : ts.createVoidZero())
+ ]));
+ }
+ function visitThisKeyword(node) {
+ ts.Debug.assert(convertedLoopState !== undefined);
+ if (enclosingFunction && enclosingFunction.kind === 181) {
+ convertedLoopState.containsLexicalThis = true;
+ return node;
+ }
+ return convertedLoopState.thisName || (convertedLoopState.thisName = ts.createUniqueName("this"));
+ }
+ function visitIdentifier(node) {
+ if (!convertedLoopState) {
+ return node;
+ }
+ if (ts.isGeneratedIdentifier(node)) {
+ return node;
+ }
+ if (node.text !== "arguments" && !resolver.isArgumentsLocalBinding(node)) {
+ return node;
+ }
+ return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = ts.createUniqueName("arguments"));
+ }
+ function visitBreakOrContinueStatement(node) {
+ if (convertedLoopState) {
+ var jump = node.kind === 211 ? 2 : 4;
+ var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) ||
+ (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump));
+ if (!canUseBreakOrContinue) {
+ var labelMarker = void 0;
+ if (!node.label) {
+ if (node.kind === 211) {
+ convertedLoopState.nonLocalJumps |= 2;
+ labelMarker = "break";
+ }
+ else {
+ convertedLoopState.nonLocalJumps |= 4;
+ labelMarker = "continue";
+ }
+ }
+ else {
+ if (node.kind === 211) {
+ labelMarker = "break-" + node.label.text;
+ setLabeledJump(convertedLoopState, true, node.label.text, labelMarker);
+ }
+ else {
+ labelMarker = "continue-" + node.label.text;
+ setLabeledJump(convertedLoopState, false, node.label.text, labelMarker);
+ }
+ }
+ var returnExpression = ts.createLiteral(labelMarker);
+ if (convertedLoopState.loopOutParameters.length) {
+ var outParams = convertedLoopState.loopOutParameters;
+ var expr = void 0;
+ for (var i = 0; i < outParams.length; i++) {
+ var copyExpr = copyOutParameter(outParams[i], 1);
+ if (i === 0) {
+ expr = copyExpr;
+ }
+ else {
+ expr = ts.createBinary(expr, 25, copyExpr);
+ }
+ }
+ returnExpression = ts.createBinary(expr, 25, returnExpression);
+ }
+ return ts.createReturn(returnExpression);
+ }
+ }
+ return ts.visitEachChild(node, visitor, context);
+ }
+ function visitClassDeclaration(node) {
+ var modifierFlags = ts.getModifierFlags(node);
+ var isExported = modifierFlags & 1;
+ var isDefault = modifierFlags & 512;
+ var modifiers = isExported && !isDefault
+ ? ts.filter(node.modifiers, isExportModifier)
+ : undefined;
+ var statement = ts.createVariableStatement(modifiers, ts.createVariableDeclarationList([
+ ts.createVariableDeclaration(getDeclarationName(node, true), undefined, transformClassLikeDeclarationToExpression(node))
+ ]), node);
+ ts.setOriginalNode(statement, node);
+ ts.startOnNewLine(statement);
+ if (isExported && isDefault) {
+ var statements = [statement];
+ statements.push(ts.createExportAssignment(undefined, undefined, false, getDeclarationName(node, false)));
+ return statements;
+ }
+ return statement;
+ }
+ function isExportModifier(node) {
+ return node.kind === 83;
+ }
+ function visitClassExpression(node) {
+ return transformClassLikeDeclarationToExpression(node);
+ }
+ function transformClassLikeDeclarationToExpression(node) {
+ if (node.name) {
+ enableSubstitutionsForBlockScopedBindings();
+ }
+ var extendsClauseElement = ts.getClassExtendsHeritageClauseElement(node);
+ var classFunction = ts.createFunctionExpression(undefined, undefined, undefined, undefined, extendsClauseElement ? [ts.createParameter("_super")] : [], undefined, transformClassBody(node, extendsClauseElement));
+ if (ts.getEmitFlags(node) & 524288) {
+ ts.setEmitFlags(classFunction, 524288);
+ }
+ var inner = ts.createPartiallyEmittedExpression(classFunction);
+ inner.end = node.end;
+ ts.setEmitFlags(inner, 49152);
+ var outer = ts.createPartiallyEmittedExpression(inner);
+ outer.end = ts.skipTrivia(currentText, node.pos);
+ ts.setEmitFlags(outer, 49152);
+ return ts.createParen(ts.createCall(outer, undefined, extendsClauseElement
+ ? [ts.visitNode(extendsClauseElement.expression, visitor, ts.isExpression)]
+ : []));
+ }
+ function transformClassBody(node, extendsClauseElement) {
+ var statements = [];
+ startLexicalEnvironment();
+ addExtendsHelperIfNeeded(statements, node, extendsClauseElement);
+ addConstructor(statements, node, extendsClauseElement);
+ addClassMembers(statements, node);
+ var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 17);
+ var localName = getLocalName(node);
+ var outer = ts.createPartiallyEmittedExpression(localName);
+ outer.end = closingBraceLocation.end;
+ ts.setEmitFlags(outer, 49152);
+ var statement = ts.createReturn(outer);
+ statement.pos = closingBraceLocation.pos;
+ ts.setEmitFlags(statement, 49152 | 12288);
+ statements.push(statement);
+ ts.addRange(statements, endLexicalEnvironment());
+ var block = ts.createBlock(ts.createNodeArray(statements, node.members), undefined, true);
+ ts.setEmitFlags(block, 49152);
+ return block;
+ }
+ function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) {
+ if (extendsClauseElement) {
+ statements.push(ts.createStatement(ts.createExtendsHelper(currentSourceFile.externalHelpersModuleName, getDeclarationName(node)), extendsClauseElement));
+ }
+ }
+ function addConstructor(statements, node, extendsClauseElement) {
+ var constructor = ts.getFirstConstructorWithBody(node);
+ var hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== undefined);
+ var constructorFunction = ts.createFunctionDeclaration(undefined, undefined, undefined, getDeclarationName(node), undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper), constructor || node);
+ if (extendsClauseElement) {
+ ts.setEmitFlags(constructorFunction, 256);
+ }
+ statements.push(constructorFunction);
+ }
+ function transformConstructorParameters(constructor, hasSynthesizedSuper) {
+ if (constructor && !hasSynthesizedSuper) {
+ return ts.visitNodes(constructor.parameters, visitor, ts.isParameter);
+ }
+ return [];
+ }
+ function transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper) {
+ var statements = [];
+ startLexicalEnvironment();
+ var statementOffset = -1;
+ if (hasSynthesizedSuper) {
+ statementOffset = 1;
+ }
+ else if (constructor) {
+ statementOffset = ts.addPrologueDirectives(statements, constructor.body.statements, false, visitor);
+ }
+ if (constructor) {
+ addDefaultValueAssignmentsIfNeeded(statements, constructor);
+ addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper);
+ ts.Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!");
+ }
+ var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, hasSynthesizedSuper, statementOffset);
+ if (superCaptureStatus === 1 || superCaptureStatus === 2) {
+ statementOffset++;
+ }
+ if (constructor) {
+ var body = saveStateAndInvoke(constructor, function (constructor) { return ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, statementOffset); });
+ ts.addRange(statements, body);
+ }
+ if (extendsClauseElement
+ && superCaptureStatus !== 2
+ && !(constructor && isSufficientlyCoveredByReturnStatements(constructor.body))) {
+ statements.push(ts.createReturn(ts.createIdentifier("_this")));
+ }
+ ts.addRange(statements, endLexicalEnvironment());
+ var block = ts.createBlock(ts.createNodeArray(statements, constructor ? constructor.body.statements : node.members), constructor ? constructor.body : node, true);
+ if (!constructor) {
+ ts.setEmitFlags(block, 49152);
+ }
+ return block;
+ }
+ function isSufficientlyCoveredByReturnStatements(statement) {
+ if (statement.kind === 212) {
+ return true;
+ }
+ else if (statement.kind === 204) {
+ var ifStatement = statement;
+ if (ifStatement.elseStatement) {
+ return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) &&
+ isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement);
+ }
+ }
+ else if (statement.kind === 200) {
+ var lastStatement = ts.lastOrUndefined(statement.statements);
+ if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, ctor, hasExtendsClause, hasSynthesizedSuper, statementOffset) {
+ if (!hasExtendsClause) {
+ if (ctor) {
+ addCaptureThisForNodeIfNeeded(statements, ctor);
+ }
+ return 0;
+ }
+ if (!ctor) {
+ statements.push(ts.createReturn(createDefaultSuperCallOrThis()));
+ return 2;
+ }
+ if (hasSynthesizedSuper) {
+ captureThisForNode(statements, ctor, createDefaultSuperCallOrThis());
+ enableSubstitutionsForCapturedThis();
+ return 1;
+ }
+ var firstStatement;
+ var superCallExpression;
+ var ctorStatements = ctor.body.statements;
+ if (statementOffset < ctorStatements.length) {
+ firstStatement = ctorStatements[statementOffset];
+ if (firstStatement.kind === 203 && ts.isSuperCall(firstStatement.expression)) {
+ var superCall = firstStatement.expression;
+ superCallExpression = ts.setOriginalNode(saveStateAndInvoke(superCall, visitImmediateSuperCallInBody), superCall);
+ }
+ }
+ if (superCallExpression && statementOffset === ctorStatements.length - 1) {
+ statements.push(ts.createReturn(superCallExpression));
+ return 2;
+ }
+ captureThisForNode(statements, ctor, superCallExpression, firstStatement);
+ if (superCallExpression) {
+ return 1;
+ }
+ return 0;
+ }
+ function createDefaultSuperCallOrThis() {
+ var actualThis = ts.createThis();
+ ts.setEmitFlags(actualThis, 128);
+ var superCall = ts.createFunctionApply(ts.createIdentifier("_super"), actualThis, ts.createIdentifier("arguments"));
+ return ts.createLogicalOr(superCall, actualThis);
+ }
+ function visitParameter(node) {
+ if (node.dotDotDotToken) {
+ return undefined;
+ }
+ else if (ts.isBindingPattern(node.name)) {
+ return ts.setOriginalNode(ts.createParameter(ts.getGeneratedNameForNode(node), undefined, node), node);
+ }
+ else if (node.initializer) {
+ return ts.setOriginalNode(ts.createParameter(node.name, undefined, node), node);
+ }
+ else {
+ return node;
+ }
+ }
+ function shouldAddDefaultValueAssignments(node) {
+ return (node.transformFlags & 262144) !== 0;
+ }
+ function addDefaultValueAssignmentsIfNeeded(statements, node) {
+ if (!shouldAddDefaultValueAssignments(node)) {
+ return;
+ }
+ for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
+ var parameter = _a[_i];
+ var name_32 = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken;
+ if (dotDotDotToken) {
+ continue;
+ }
+ if (ts.isBindingPattern(name_32)) {
+ addDefaultValueAssignmentForBindingPattern(statements, parameter, name_32, initializer);
+ }
+ else if (initializer) {
+ addDefaultValueAssignmentForInitializer(statements, parameter, name_32, initializer);
+ }
+ }
+ }
+ function addDefaultValueAssignmentForBindingPattern(statements, parameter, name, initializer) {
+ var temp = ts.getGeneratedNameForNode(parameter);
+ if (name.elements.length > 0) {
+ statements.push(ts.setEmitFlags(ts.createVariableStatement(undefined, ts.createVariableDeclarationList(ts.flattenParameterDestructuring(parameter, temp, visitor))), 8388608));
+ }
+ else if (initializer) {
+ statements.push(ts.setEmitFlags(ts.createStatement(ts.createAssignment(temp, ts.visitNode(initializer, visitor, ts.isExpression))), 8388608));
+ }
+ }
+ function addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer) {
+ initializer = ts.visitNode(initializer, visitor, ts.isExpression);
+ var statement = ts.createIf(ts.createStrictEquality(ts.getSynthesizedClone(name), ts.createVoidZero()), ts.setEmitFlags(ts.createBlock([
+ ts.createStatement(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 1536), ts.setEmitFlags(initializer, 1536 | ts.getEmitFlags(initializer)), parameter))
+ ], parameter), 32 | 1024 | 12288), undefined, parameter);
+ statement.startsOnNewLine = true;
+ ts.setEmitFlags(statement, 12288 | 1024 | 8388608);
+ statements.push(statement);
+ }
+ function shouldAddRestParameter(node, inConstructorWithSynthesizedSuper) {
+ return node && node.dotDotDotToken && node.name.kind === 70 && !inConstructorWithSynthesizedSuper;
+ }
+ function addRestParameterIfNeeded(statements, node, inConstructorWithSynthesizedSuper) {
+ var parameter = ts.lastOrUndefined(node.parameters);
+ if (!shouldAddRestParameter(parameter, inConstructorWithSynthesizedSuper)) {
+ return;
+ }
+ var declarationName = ts.getMutableClone(parameter.name);
+ ts.setEmitFlags(declarationName, 1536);
+ var expressionName = ts.getSynthesizedClone(parameter.name);
+ var restIndex = node.parameters.length - 1;
+ var temp = ts.createLoopVariable();
+ statements.push(ts.setEmitFlags(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
+ ts.createVariableDeclaration(declarationName, undefined, ts.createArrayLiteral([]))
+ ]), parameter), 8388608));
+ var forStatement = ts.createFor(ts.createVariableDeclarationList([
+ ts.createVariableDeclaration(temp, undefined, ts.createLiteral(restIndex))
+ ], parameter), ts.createLessThan(temp, ts.createPropertyAccess(ts.createIdentifier("arguments"), "length"), parameter), ts.createPostfixIncrement(temp, parameter), ts.createBlock([
+ ts.startOnNewLine(ts.createStatement(ts.createAssignment(ts.createElementAccess(expressionName, ts.createSubtract(temp, ts.createLiteral(restIndex))), ts.createElementAccess(ts.createIdentifier("arguments"), temp)), parameter))
+ ]));
+ ts.setEmitFlags(forStatement, 8388608);
+ ts.startOnNewLine(forStatement);
+ statements.push(forStatement);
+ }
+ function addCaptureThisForNodeIfNeeded(statements, node) {
+ if (node.transformFlags & 65536 && node.kind !== 181) {
+ captureThisForNode(statements, node, ts.createThis());
+ }
+ }
+ function captureThisForNode(statements, node, initializer, originalStatement) {
+ enableSubstitutionsForCapturedThis();
+ var captureThisStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
+ ts.createVariableDeclaration("_this", undefined, initializer)
+ ]), originalStatement);
+ ts.setEmitFlags(captureThisStatement, 49152 | 8388608);
+ ts.setSourceMapRange(captureThisStatement, node);
+ statements.push(captureThisStatement);
+ }
+ function addClassMembers(statements, node) {
+ for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
+ var member = _a[_i];
+ switch (member.kind) {
+ case 199:
+ statements.push(transformSemicolonClassElementToStatement(member));
+ break;
+ case 148:
+ statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member));
+ break;
+ case 150:
+ case 151:
+ var accessors = ts.getAllAccessorDeclarations(node.members, member);
+ if (member === accessors.firstAccessor) {
+ statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors));
+ }
+ break;
+ case 149:
+ break;
+ default:
+ ts.Debug.failBadSyntaxKind(node);
+ break;
+ }
+ }
+ }
+ function transformSemicolonClassElementToStatement(member) {
+ return ts.createEmptyStatement(member);
+ }
+ function transformClassMethodDeclarationToStatement(receiver, member) {
+ var commentRange = ts.getCommentRange(member);
+ var sourceMapRange = ts.getSourceMapRange(member);
+ var func = transformFunctionLikeToExpression(member, member, undefined);
+ ts.setEmitFlags(func, 49152);
+ ts.setSourceMapRange(func, sourceMapRange);
+ var statement = ts.createStatement(ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(member.name, visitor, ts.isPropertyName), member.name), func), member);
+ ts.setOriginalNode(statement, member);
+ ts.setCommentRange(statement, commentRange);
+ ts.setEmitFlags(statement, 1536);
+ return statement;
+ }
+ function transformAccessorsToStatement(receiver, accessors) {
+ var statement = ts.createStatement(transformAccessorsToExpression(receiver, accessors, false), ts.getSourceMapRange(accessors.firstAccessor));
+ ts.setEmitFlags(statement, 49152);
+ return statement;
+ }
+ function transformAccessorsToExpression(receiver, _a, startsOnNewLine) {
+ var firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor;
+ var target = ts.getMutableClone(receiver);
+ ts.setEmitFlags(target, 49152 | 1024);
+ ts.setSourceMapRange(target, firstAccessor.name);
+ var propertyName = ts.createExpressionForPropertyName(ts.visitNode(firstAccessor.name, visitor, ts.isPropertyName));
+ ts.setEmitFlags(propertyName, 49152 | 512);
+ ts.setSourceMapRange(propertyName, firstAccessor.name);
+ var properties = [];
+ if (getAccessor) {
+ var getterFunction = transformFunctionLikeToExpression(getAccessor, undefined, undefined);
+ ts.setSourceMapRange(getterFunction, ts.getSourceMapRange(getAccessor));
+ ts.setEmitFlags(getterFunction, 16384);
+ var getter = ts.createPropertyAssignment("get", getterFunction);
+ ts.setCommentRange(getter, ts.getCommentRange(getAccessor));
+ properties.push(getter);
+ }
+ if (setAccessor) {
+ var setterFunction = transformFunctionLikeToExpression(setAccessor, undefined, undefined);
+ ts.setSourceMapRange(setterFunction, ts.getSourceMapRange(setAccessor));
+ ts.setEmitFlags(setterFunction, 16384);
+ var setter = ts.createPropertyAssignment("set", setterFunction);
+ ts.setCommentRange(setter, ts.getCommentRange(setAccessor));
+ properties.push(setter);
+ }
+ properties.push(ts.createPropertyAssignment("enumerable", ts.createLiteral(true)), ts.createPropertyAssignment("configurable", ts.createLiteral(true)));
+ var call = ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [
+ target,
+ propertyName,
+ ts.createObjectLiteral(properties, undefined, true)
+ ]);
+ if (startsOnNewLine) {
+ call.startsOnNewLine = true;
+ }
+ return call;
+ }
+ function visitArrowFunction(node) {
+ if (node.transformFlags & 32768) {
+ enableSubstitutionsForCapturedThis();
+ }
+ var func = transformFunctionLikeToExpression(node, node, undefined);
+ ts.setEmitFlags(func, 256);
+ return func;
+ }
+ function visitFunctionExpression(node) {
+ return transformFunctionLikeToExpression(node, node, node.name);
+ }
+ function visitFunctionDeclaration(node) {
+ return ts.setOriginalNode(ts.createFunctionDeclaration(undefined, node.modifiers, node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node), node);
+ }
+ function transformFunctionLikeToExpression(node, location, name) {
+ var savedContainingNonArrowFunction = enclosingNonArrowFunction;
+ if (node.kind !== 181) {
+ enclosingNonArrowFunction = node;
+ }
+ var expression = ts.setOriginalNode(ts.createFunctionExpression(undefined, node.asteriskToken, name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, saveStateAndInvoke(node, transformFunctionBody), location), node);
+ enclosingNonArrowFunction = savedContainingNonArrowFunction;
+ return expression;
+ }
+ function transformFunctionBody(node) {
+ var multiLine = false;
+ var singleLine = false;
+ var statementsLocation;
+ var closeBraceLocation;
+ var statements = [];
+ var body = node.body;
+ var statementOffset;
+ startLexicalEnvironment();
+ if (ts.isBlock(body)) {
+ statementOffset = ts.addPrologueDirectives(statements, body.statements, false, visitor);
+ }
+ addCaptureThisForNodeIfNeeded(statements, node);
+ addDefaultValueAssignmentsIfNeeded(statements, node);
+ addRestParameterIfNeeded(statements, node, false);
+ if (!multiLine && statements.length > 0) {
+ multiLine = true;
+ }
+ if (ts.isBlock(body)) {
+ statementsLocation = body.statements;
+ ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, statementOffset));
+ if (!multiLine && body.multiLine) {
+ multiLine = true;
+ }
+ }
+ else {
+ ts.Debug.assert(node.kind === 181);
+ statementsLocation = ts.moveRangeEnd(body, -1);
+ var equalsGreaterThanToken = node.equalsGreaterThanToken;
+ if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) {
+ if (ts.rangeEndIsOnSameLineAsRangeStart(equalsGreaterThanToken, body, currentSourceFile)) {
+ singleLine = true;
+ }
+ else {
+ multiLine = true;
+ }
+ }
+ var expression = ts.visitNode(body, visitor, ts.isExpression);
+ var returnStatement = ts.createReturn(expression, body);
+ ts.setEmitFlags(returnStatement, 12288 | 1024 | 32768);
+ statements.push(returnStatement);
+ closeBraceLocation = body;
+ }
+ var lexicalEnvironment = endLexicalEnvironment();
+ ts.addRange(statements, lexicalEnvironment);
+ if (!multiLine && lexicalEnvironment && lexicalEnvironment.length) {
+ multiLine = true;
+ }
+ var block = ts.createBlock(ts.createNodeArray(statements, statementsLocation), node.body, multiLine);
+ if (!multiLine && singleLine) {
+ ts.setEmitFlags(block, 32);
+ }
+ if (closeBraceLocation) {
+ ts.setTokenSourceMapRange(block, 17, closeBraceLocation);
+ }
+ ts.setOriginalNode(block, node.body);
+ return block;
+ }
+ function visitExpressionStatement(node) {
+ switch (node.expression.kind) {
+ case 179:
+ return ts.updateStatement(node, visitParenthesizedExpression(node.expression, false));
+ case 188:
+ return ts.updateStatement(node, visitBinaryExpression(node.expression, false));
+ }
+ return ts.visitEachChild(node, visitor, context);
+ }
+ function visitParenthesizedExpression(node, needsDestructuringValue) {
+ if (needsDestructuringValue) {
+ switch (node.expression.kind) {
+ case 179:
+ return ts.createParen(visitParenthesizedExpression(node.expression, true), node);
+ case 188:
+ return ts.createParen(visitBinaryExpression(node.expression, true), node);
+ }
+ }
+ return ts.visitEachChild(node, visitor, context);
+ }
+ function visitBinaryExpression(node, needsDestructuringValue) {
+ ts.Debug.assert(ts.isDestructuringAssignment(node));
+ return ts.flattenDestructuringAssignment(context, node, needsDestructuringValue, hoistVariableDeclaration, visitor);
+ }
+ function visitVariableStatement(node) {
+ if (convertedLoopState && (ts.getCombinedNodeFlags(node.declarationList) & 3) == 0) {
+ var assignments = void 0;
+ for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
+ var decl = _a[_i];
+ hoistVariableDeclarationDeclaredInConvertedLoop(convertedLoopState, decl);
+ if (decl.initializer) {
+ var assignment = void 0;
+ if (ts.isBindingPattern(decl.name)) {
+ assignment = ts.flattenVariableDestructuringToExpression(decl, hoistVariableDeclaration, undefined, visitor);
+ }
+ else {
+ assignment = ts.createBinary(decl.name, 57, ts.visitNode(decl.initializer, visitor, ts.isExpression));
+ }
+ (assignments || (assignments = [])).push(assignment);
+ }
+ }
+ if (assignments) {
+ return ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 25, acc); }), node);
+ }
+ else {
+ return undefined;
+ }
+ }
+ return ts.visitEachChild(node, visitor, context);
+ }
+ function visitVariableDeclarationList(node) {
+ if (node.flags & 3) {
+ enableSubstitutionsForBlockScopedBindings();
+ }
+ var declarations = ts.flatten(ts.map(node.declarations, node.flags & 1
+ ? visitVariableDeclarationInLetDeclarationList
+ : visitVariableDeclaration));
+ var declarationList = ts.createVariableDeclarationList(declarations, node);
+ ts.setOriginalNode(declarationList, node);
+ ts.setCommentRange(declarationList, node);
+ if (node.transformFlags & 8388608
+ && (ts.isBindingPattern(node.declarations[0].name)
+ || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) {
+ var firstDeclaration = ts.firstOrUndefined(declarations);
+ var lastDeclaration = ts.lastOrUndefined(declarations);
+ ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end));
+ }
+ return declarationList;
+ }
+ function shouldEmitExplicitInitializerForLetDeclaration(node) {
+ var flags = resolver.getNodeCheckFlags(node);
+ var isCapturedInFunction = flags & 131072;
+ var isDeclaredInLoop = flags & 262144;
+ var emittedAsTopLevel = ts.isBlockScopedContainerTopLevel(enclosingBlockScopeContainer)
+ || (isCapturedInFunction
+ && isDeclaredInLoop
+ && ts.isBlock(enclosingBlockScopeContainer)
+ && ts.isIterationStatement(enclosingBlockScopeContainerParent, false));
+ var emitExplicitInitializer = !emittedAsTopLevel
+ && enclosingBlockScopeContainer.kind !== 208
+ && enclosingBlockScopeContainer.kind !== 209
+ && (!resolver.isDeclarationWithCollidingName(node)
+ || (isDeclaredInLoop
+ && !isCapturedInFunction
+ && !ts.isIterationStatement(enclosingBlockScopeContainer, false)));
+ return emitExplicitInitializer;
+ }
+ function visitVariableDeclarationInLetDeclarationList(node) {
+ var name = node.name;
+ if (ts.isBindingPattern(name)) {
+ return visitVariableDeclaration(node);
+ }
+ if (!node.initializer && shouldEmitExplicitInitializerForLetDeclaration(node)) {
+ var clone_5 = ts.getMutableClone(node);
+ clone_5.initializer = ts.createVoidZero();
+ return clone_5;
+ }
+ return ts.visitEachChild(node, visitor, context);
+ }
+ function visitVariableDeclaration(node) {
+ if (ts.isBindingPattern(node.name)) {
+ var recordTempVariablesInLine = !enclosingVariableStatement
+ || !ts.hasModifier(enclosingVariableStatement, 1);
+ return ts.flattenVariableDestructuring(node, undefined, visitor, recordTempVariablesInLine ? undefined : hoistVariableDeclaration);
+ }
+ return ts.visitEachChild(node, visitor, context);
+ }
+ function visitLabeledStatement(node) {
+ if (convertedLoopState) {
+ if (!convertedLoopState.labels) {
+ convertedLoopState.labels = ts.createMap();
+ }
+ convertedLoopState.labels[node.label.text] = node.label.text;
+ }
+ var result;
+ if (ts.isIterationStatement(node.statement, false) && shouldConvertIterationStatementBody(node.statement)) {
+ result = ts.visitNodes(ts.createNodeArray([node.statement]), visitor, ts.isStatement);
+ }
+ else {
+ result = ts.visitEachChild(node, visitor, context);
+ }
+ if (convertedLoopState) {
+ convertedLoopState.labels[node.label.text] = undefined;
+ }
+ return result;
+ }
+ function visitDoStatement(node) {
+ return convertIterationStatementBodyIfNecessary(node);
+ }
+ function visitWhileStatement(node) {
+ return convertIterationStatementBodyIfNecessary(node);
+ }
+ function visitForStatement(node) {
+ return convertIterationStatementBodyIfNecessary(node);
+ }
+ function visitForInStatement(node) {
+ return convertIterationStatementBodyIfNecessary(node);
+ }
+ function visitForOfStatement(node) {
+ return convertIterationStatementBodyIfNecessary(node, convertForOfToFor);
+ }
+ function convertForOfToFor(node, convertedLoopBodyStatements) {
+ var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
+ var initializer = node.initializer;
+ var statements = [];
+ var counter = ts.createLoopVariable();
+ var rhsReference = expression.kind === 70
+ ? ts.createUniqueName(expression.text)
+ : ts.createTempVariable(undefined);
+ if (ts.isVariableDeclarationList(initializer)) {
+ if (initializer.flags & 3) {
+ enableSubstitutionsForBlockScopedBindings();
+ }
+ var firstOriginalDeclaration = ts.firstOrUndefined(initializer.declarations);
+ if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) {
+ var declarations = ts.flattenVariableDestructuring(firstOriginalDeclaration, ts.createElementAccess(rhsReference, counter), visitor);
+ var declarationList = ts.createVariableDeclarationList(declarations, initializer);
+ ts.setOriginalNode(declarationList, initializer);
+ var firstDeclaration = declarations[0];
+ var lastDeclaration = ts.lastOrUndefined(declarations);
+ ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end));
+ statements.push(ts.createVariableStatement(undefined, declarationList));
+ }
+ else {
+ statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
+ ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(undefined), undefined, ts.createElementAccess(rhsReference, counter))
+ ], ts.moveRangePos(initializer, -1)), ts.moveRangeEnd(initializer, -1)));
+ }
+ }
+ else {
+ var assignment = ts.createAssignment(initializer, ts.createElementAccess(rhsReference, counter));
+ if (ts.isDestructuringAssignment(assignment)) {
+ statements.push(ts.createStatement(ts.flattenDestructuringAssignment(context, assignment, false, hoistVariableDeclaration, visitor)));
+ }
+ else {
+ assignment.end = initializer.end;
+ statements.push(ts.createStatement(assignment, ts.moveRangeEnd(initializer, -1)));
+ }
+ }
+ var bodyLocation;
+ var statementsLocation;
+ if (convertedLoopBodyStatements) {
+ ts.addRange(statements, convertedLoopBodyStatements);
+ }
+ else {
+ var statement = ts.visitNode(node.statement, visitor, ts.isStatement);
+ if (ts.isBlock(statement)) {
+ ts.addRange(statements, statement.statements);
+ bodyLocation = statement;
+ statementsLocation = statement.statements;
+ }
+ else {
+ statements.push(statement);
+ }
+ }
+ ts.setEmitFlags(expression, 1536 | ts.getEmitFlags(expression));
+ var body = ts.createBlock(ts.createNodeArray(statements, statementsLocation), bodyLocation);
+ ts.setEmitFlags(body, 1536 | 12288);
+ var forStatement = ts.createFor(ts.createVariableDeclarationList([
+ ts.createVariableDeclaration(counter, undefined, ts.createLiteral(0), ts.moveRangePos(node.expression, -1)),
+ ts.createVariableDeclaration(rhsReference, undefined, expression, node.expression)
+ ], node.expression), ts.createLessThan(counter, ts.createPropertyAccess(rhsReference, "length"), node.expression), ts.createPostfixIncrement(counter, node.expression), body, node);
+ ts.setEmitFlags(forStatement, 8192);
+ return forStatement;
+ }
+ function visitObjectLiteralExpression(node) {
+ var properties = node.properties;
+ var numProperties = properties.length;
+ var numInitialProperties = numProperties;
+ for (var i = 0; i < numProperties; i++) {
+ var property = properties[i];
+ if (property.transformFlags & 16777216
+ || property.name.kind === 141) {
+ numInitialProperties = i;
+ break;
+ }
+ }
+ ts.Debug.assert(numInitialProperties !== numProperties);
+ var temp = ts.createTempVariable(hoistVariableDeclaration);
+ var expressions = [];
+ var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), undefined, node.multiLine), 524288));
+ if (node.multiLine) {
+ assignment.startsOnNewLine = true;
+ }
+ expressions.push(assignment);
+ addObjectLiteralMembers(expressions, node, temp, numInitialProperties);
+ expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp);
+ return ts.inlineExpressions(expressions);
+ }
+ function shouldConvertIterationStatementBody(node) {
+ return (resolver.getNodeCheckFlags(node) & 65536) !== 0;
+ }
+ function hoistVariableDeclarationDeclaredInConvertedLoop(state, node) {
+ if (!state.hoistedLocalVariables) {
+ state.hoistedLocalVariables = [];
+ }
+ visit(node.name);
+ function visit(node) {
+ if (node.kind === 70) {
+ state.hoistedLocalVariables.push(node);
+ }
+ else {
+ for (var _i = 0, _a = node.elements; _i < _a.length; _i++) {
+ var element = _a[_i];
+ if (!ts.isOmittedExpression(element)) {
+ visit(element.name);
+ }
+ }
+ }
+ }
+ }
+ function convertIterationStatementBodyIfNecessary(node, convert) {
+ if (!shouldConvertIterationStatementBody(node)) {
+ var saveAllowedNonLabeledJumps = void 0;
+ if (convertedLoopState) {
+ saveAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps;
+ convertedLoopState.allowedNonLabeledJumps = 2 | 4;
+ }
+ var result = convert ? convert(node, undefined) : ts.visitEachChild(node, visitor, context);
+ if (convertedLoopState) {
+ convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps;
+ }
+ return result;
+ }
+ var functionName = ts.createUniqueName("_loop");
+ var loopInitializer;
+ switch (node.kind) {
+ case 207:
+ case 208:
+ case 209:
+ var initializer = node.initializer;
+ if (initializer && initializer.kind === 220) {
+ loopInitializer = initializer;
+ }
+ break;
+ }
+ var loopParameters = [];
+ var loopOutParameters = [];
+ if (loopInitializer && (ts.getCombinedNodeFlags(loopInitializer) & 3)) {
+ for (var _i = 0, _a = loopInitializer.declarations; _i < _a.length; _i++) {
+ var decl = _a[_i];
+ processLoopVariableDeclaration(decl, loopParameters, loopOutParameters);
+ }
+ }
+ var outerConvertedLoopState = convertedLoopState;
+ convertedLoopState = { loopOutParameters: loopOutParameters };
+ if (outerConvertedLoopState) {
+ if (outerConvertedLoopState.argumentsName) {
+ convertedLoopState.argumentsName = outerConvertedLoopState.argumentsName;
+ }
+ if (outerConvertedLoopState.thisName) {
+ convertedLoopState.thisName = outerConvertedLoopState.thisName;
+ }
+ if (outerConvertedLoopState.hoistedLocalVariables) {
+ convertedLoopState.hoistedLocalVariables = outerConvertedLoopState.hoistedLocalVariables;
+ }
+ }
+ var loopBody = ts.visitNode(node.statement, visitor, ts.isStatement);
+ var currentState = convertedLoopState;
+ convertedLoopState = outerConvertedLoopState;
+ if (loopOutParameters.length) {
+ var statements_3 = ts.isBlock(loopBody) ? loopBody.statements.slice() : [loopBody];
+ copyOutParameters(loopOutParameters, 1, statements_3);
+ loopBody = ts.createBlock(statements_3, undefined, true);
+ }
+ if (!ts.isBlock(loopBody)) {
+ loopBody = ts.createBlock([loopBody], undefined, true);
+ }
+ var isAsyncBlockContainingAwait = enclosingNonArrowFunction
+ && (ts.getEmitFlags(enclosingNonArrowFunction) & 2097152) !== 0
+ && (node.statement.transformFlags & 16777216) !== 0;
+ var loopBodyFlags = 0;
+ if (currentState.containsLexicalThis) {
+ loopBodyFlags |= 256;
+ }
+ if (isAsyncBlockContainingAwait) {
+ loopBodyFlags |= 2097152;
+ }
+ var convertedLoopVariable = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
+ ts.createVariableDeclaration(functionName, undefined, ts.setEmitFlags(ts.createFunctionExpression(undefined, isAsyncBlockContainingAwait ? ts.createToken(38) : undefined, undefined, undefined, loopParameters, undefined, loopBody), loopBodyFlags))
+ ]));
+ var statements = [convertedLoopVariable];
+ var extraVariableDeclarations;
+ if (currentState.argumentsName) {
+ if (outerConvertedLoopState) {
+ outerConvertedLoopState.argumentsName = currentState.argumentsName;
+ }
+ else {
+ (extraVariableDeclarations || (extraVariableDeclarations = [])).push(ts.createVariableDeclaration(currentState.argumentsName, undefined, ts.createIdentifier("arguments")));
+ }
+ }
+ if (currentState.thisName) {
+ if (outerConvertedLoopState) {
+ outerConvertedLoopState.thisName = currentState.thisName;
+ }
+ else {
+ (extraVariableDeclarations || (extraVariableDeclarations = [])).push(ts.createVariableDeclaration(currentState.thisName, undefined, ts.createIdentifier("this")));
+ }
+ }
+ if (currentState.hoistedLocalVariables) {
+ if (outerConvertedLoopState) {
+ outerConvertedLoopState.hoistedLocalVariables = currentState.hoistedLocalVariables;
+ }
+ else {
+ if (!extraVariableDeclarations) {
+ extraVariableDeclarations = [];
+ }
+ for (var _b = 0, _c = currentState.hoistedLocalVariables; _b < _c.length; _b++) {
+ var identifier = _c[_b];
+ extraVariableDeclarations.push(ts.createVariableDeclaration(identifier));
+ }
+ }
+ }
+ if (loopOutParameters.length) {
+ if (!extraVariableDeclarations) {
+ extraVariableDeclarations = [];
+ }
+ for (var _d = 0, loopOutParameters_1 = loopOutParameters; _d < loopOutParameters_1.length; _d++) {
+ var outParam = loopOutParameters_1[_d];
+ extraVariableDeclarations.push(ts.createVariableDeclaration(outParam.outParamName));
+ }
+ }
+ if (extraVariableDeclarations) {
+ statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList(extraVariableDeclarations)));
+ }
+ var convertedLoopBodyStatements = generateCallToConvertedLoop(functionName, loopParameters, currentState, isAsyncBlockContainingAwait);
+ var loop;
+ if (convert) {
+ loop = convert(node, convertedLoopBodyStatements);
+ }
+ else {
+ loop = ts.getMutableClone(node);
+ loop.statement = undefined;
+ loop = ts.visitEachChild(loop, visitor, context);
+ loop.statement = ts.createBlock(convertedLoopBodyStatements, undefined, true);
+ loop.transformFlags = 0;
+ ts.aggregateTransformFlags(loop);
+ }
+ statements.push(currentParent.kind === 215
+ ? ts.createLabel(currentParent.label, loop)
+ : loop);
+ return statements;
+ }
+ function copyOutParameter(outParam, copyDirection) {
+ var source = copyDirection === 0 ? outParam.outParamName : outParam.originalName;
+ var target = copyDirection === 0 ? outParam.originalName : outParam.outParamName;
+ return ts.createBinary(target, 57, source);
+ }
+ function copyOutParameters(outParams, copyDirection, statements) {
+ for (var _i = 0, outParams_1 = outParams; _i < outParams_1.length; _i++) {
+ var outParam = outParams_1[_i];
+ statements.push(ts.createStatement(copyOutParameter(outParam, copyDirection)));
+ }
+ }
+ function generateCallToConvertedLoop(loopFunctionExpressionName, parameters, state, isAsyncBlockContainingAwait) {
+ var outerConvertedLoopState = convertedLoopState;
+ var statements = [];
+ var isSimpleLoop = !(state.nonLocalJumps & ~4) &&
+ !state.labeledNonLocalBreaks &&
+ !state.labeledNonLocalContinues;
+ var call = ts.createCall(loopFunctionExpressionName, undefined, ts.map(parameters, function (p) { return p.name; }));
+ var callResult = isAsyncBlockContainingAwait ? ts.createYield(ts.createToken(38), call) : call;
+ if (isSimpleLoop) {
+ statements.push(ts.createStatement(callResult));
+ copyOutParameters(state.loopOutParameters, 0, statements);
+ }
+ else {
+ var loopResultName = ts.createUniqueName("state");
+ var stateVariable = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ts.createVariableDeclaration(loopResultName, undefined, callResult)]));
+ statements.push(stateVariable);
+ copyOutParameters(state.loopOutParameters, 0, statements);
+ if (state.nonLocalJumps & 8) {
+ var returnStatement = void 0;
+ if (outerConvertedLoopState) {
+ outerConvertedLoopState.nonLocalJumps |= 8;
+ returnStatement = ts.createReturn(loopResultName);
+ }
+ else {
+ returnStatement = ts.createReturn(ts.createPropertyAccess(loopResultName, "value"));
+ }
+ statements.push(ts.createIf(ts.createBinary(ts.createTypeOf(loopResultName), 33, ts.createLiteral("object")), returnStatement));
+ }
+ if (state.nonLocalJumps & 2) {
+ statements.push(ts.createIf(ts.createBinary(loopResultName, 33, ts.createLiteral("break")), ts.createBreak()));
+ }
+ if (state.labeledNonLocalBreaks || state.labeledNonLocalContinues) {
+ var caseClauses = [];
+ processLabeledJumps(state.labeledNonLocalBreaks, true, loopResultName, outerConvertedLoopState, caseClauses);
+ processLabeledJumps(state.labeledNonLocalContinues, false, loopResultName, outerConvertedLoopState, caseClauses);
+ statements.push(ts.createSwitch(loopResultName, ts.createCaseBlock(caseClauses)));
+ }
+ }
+ return statements;
+ }
+ function setLabeledJump(state, isBreak, labelText, labelMarker) {
+ if (isBreak) {
+ if (!state.labeledNonLocalBreaks) {
+ state.labeledNonLocalBreaks = ts.createMap();
+ }
+ state.labeledNonLocalBreaks[labelText] = labelMarker;
+ }
+ else {
+ if (!state.labeledNonLocalContinues) {
+ state.labeledNonLocalContinues = ts.createMap();
+ }
+ state.labeledNonLocalContinues[labelText] = labelMarker;
+ }
+ }
+ function processLabeledJumps(table, isBreak, loopResultName, outerLoop, caseClauses) {
+ if (!table) {
+ return;
+ }
+ for (var labelText in table) {
+ var labelMarker = table[labelText];
+ var statements = [];
+ if (!outerLoop || (outerLoop.labels && outerLoop.labels[labelText])) {
+ var label = ts.createIdentifier(labelText);
+ statements.push(isBreak ? ts.createBreak(label) : ts.createContinue(label));
+ }
+ else {
+ setLabeledJump(outerLoop, isBreak, labelText, labelMarker);
+ statements.push(ts.createReturn(loopResultName));
+ }
+ caseClauses.push(ts.createCaseClause(ts.createLiteral(labelMarker), statements));
+ }
+ }
+ function processLoopVariableDeclaration(decl, loopParameters, loopOutParameters) {
+ var name = decl.name;
+ if (ts.isBindingPattern(name)) {
+ for (var _i = 0, _a = name.elements; _i < _a.length; _i++) {
+ var element = _a[_i];
+ if (!ts.isOmittedExpression(element)) {
+ processLoopVariableDeclaration(element, loopParameters, loopOutParameters);
+ }
+ }
+ }
+ else {
+ loopParameters.push(ts.createParameter(name));
+ if (resolver.getNodeCheckFlags(decl) & 2097152) {
+ var outParamName = ts.createUniqueName("out_" + name.text);
+ loopOutParameters.push({ originalName: name, outParamName: outParamName });
+ }
+ }
+ }
+ function addObjectLiteralMembers(expressions, node, receiver, start) {
+ var properties = node.properties;
+ var numProperties = properties.length;
+ for (var i = start; i < numProperties; i++) {
+ var property = properties[i];
+ switch (property.kind) {
+ case 150:
+ case 151:
+ var accessors = ts.getAllAccessorDeclarations(node.properties, property);
+ if (property === accessors.firstAccessor) {
+ expressions.push(transformAccessorsToExpression(receiver, accessors, node.multiLine));
+ }
+ break;
+ case 253:
+ expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine));
+ break;
+ case 254:
+ expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine));
+ break;
+ case 148:
+ expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node.multiLine));
+ break;
+ default:
+ ts.Debug.failBadSyntaxKind(node);
+ break;
+ }
+ }
+ }
+ function transformPropertyAssignmentToExpression(property, receiver, startsOnNewLine) {
+ var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression), property);
+ if (startsOnNewLine) {
+ expression.startsOnNewLine = true;
+ }
+ return expression;
+ }
+ function transformShorthandPropertyAssignmentToExpression(property, receiver, startsOnNewLine) {
+ var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name), property);
+ if (startsOnNewLine) {
+ expression.startsOnNewLine = true;
+ }
+ return expression;
+ }
+ function transformObjectLiteralMethodDeclarationToExpression(method, receiver, startsOnNewLine) {
+ var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, method, undefined), method);
+ if (startsOnNewLine) {
+ expression.startsOnNewLine = true;
+ }
+ return expression;
+ }
+ function visitMethodDeclaration(node) {
+ ts.Debug.assert(!ts.isComputedPropertyName(node.name));
+ var functionExpression = transformFunctionLikeToExpression(node, ts.moveRangePos(node, -1), undefined);
+ ts.setEmitFlags(functionExpression, 16384 | ts.getEmitFlags(functionExpression));
+ return ts.createPropertyAssignment(node.name, functionExpression, node);
+ }
+ function visitShorthandPropertyAssignment(node) {
+ return ts.createPropertyAssignment(node.name, ts.getSynthesizedClone(node.name), node);
+ }
+ function visitYieldExpression(node) {
+ return ts.visitEachChild(node, visitor, context);
+ }
+ function visitArrayLiteralExpression(node) {
+ return transformAndSpreadElements(node.elements, true, node.multiLine, node.elements.hasTrailingComma);
+ }
+ function visitCallExpression(node) {
+ return visitCallExpressionWithPotentialCapturedThisAssignment(node, true);
+ }
+ function visitImmediateSuperCallInBody(node) {
+ return visitCallExpressionWithPotentialCapturedThisAssignment(node, false);
+ }
+ function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) {
+ var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
+ if (node.expression.kind === 96) {
+ ts.setEmitFlags(thisArg, 128);
+ }
+ var resultingCall;
+ if (node.transformFlags & 1048576) {
+ resultingCall = ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, false, false, false));
+ }
+ else {
+ resultingCall = ts.createFunctionCall(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), node);
+ }
+ if (node.expression.kind === 96) {
+ var actualThis = ts.createThis();
+ ts.setEmitFlags(actualThis, 128);
+ var initializer = ts.createLogicalOr(resultingCall, actualThis);
+ return assignToCapturedThis
+ ? ts.createAssignment(ts.createIdentifier("_this"), initializer)
+ : initializer;
+ }
+ return resultingCall;
+ }
+ function visitNewExpression(node) {
+ ts.Debug.assert((node.transformFlags & 1048576) !== 0);
+ var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
+ return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), false, false, false)), undefined, []);
+ }
+ function transformAndSpreadElements(elements, needsUniqueCopy, multiLine, hasTrailingComma) {
+ var numElements = elements.length;
+ var segments = ts.flatten(ts.spanMap(elements, partitionSpreadElement, function (partition, visitPartition, _start, end) {
+ return visitPartition(partition, multiLine, hasTrailingComma && end === numElements);
+ }));
+ if (segments.length === 1) {
+ var firstElement = elements[0];
+ return needsUniqueCopy && ts.isSpreadElementExpression(firstElement) && firstElement.expression.kind !== 171
+ ? ts.createArraySlice(segments[0])
+ : segments[0];
+ }
+ return ts.createArrayConcat(segments.shift(), segments);
+ }
+ function partitionSpreadElement(node) {
+ return ts.isSpreadElementExpression(node)
+ ? visitSpanOfSpreadElements
+ : visitSpanOfNonSpreadElements;
+ }
+ function visitSpanOfSpreadElements(chunk) {
+ return ts.map(chunk, visitExpressionOfSpreadElement);
+ }
+ function visitSpanOfNonSpreadElements(chunk, multiLine, hasTrailingComma) {
+ return ts.createArrayLiteral(ts.visitNodes(ts.createNodeArray(chunk, undefined, hasTrailingComma), visitor, ts.isExpression), undefined, multiLine);
+ }
+ function visitExpressionOfSpreadElement(node) {
+ return ts.visitNode(node.expression, visitor, ts.isExpression);
+ }
+ function visitTemplateLiteral(node) {
+ return ts.createLiteral(node.text, node);
+ }
+ function visitTaggedTemplateExpression(node) {
+ var tag = ts.visitNode(node.tag, visitor, ts.isExpression);
+ var temp = ts.createTempVariable(hoistVariableDeclaration);
+ var templateArguments = [temp];
+ var cookedStrings = [];
+ var rawStrings = [];
+ var template = node.template;
+ if (ts.isNoSubstitutionTemplateLiteral(template)) {
+ cookedStrings.push(ts.createLiteral(template.text));
+ rawStrings.push(getRawLiteral(template));
+ }
+ else {
+ cookedStrings.push(ts.createLiteral(template.head.text));
+ rawStrings.push(getRawLiteral(template.head));
+ for (var _i = 0, _a = template.templateSpans; _i < _a.length; _i++) {
+ var templateSpan = _a[_i];
+ cookedStrings.push(ts.createLiteral(templateSpan.literal.text));
+ rawStrings.push(getRawLiteral(templateSpan.literal));
+ templateArguments.push(ts.visitNode(templateSpan.expression, visitor, ts.isExpression));
+ }
+ }
+ return ts.createParen(ts.inlineExpressions([
+ ts.createAssignment(temp, ts.createArrayLiteral(cookedStrings)),
+ ts.createAssignment(ts.createPropertyAccess(temp, "raw"), ts.createArrayLiteral(rawStrings)),
+ ts.createCall(tag, undefined, templateArguments)
+ ]));
+ }
+ function getRawLiteral(node) {
+ var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node);
+ var isLast = node.kind === 12 || node.kind === 15;
+ text = text.substring(1, text.length - (isLast ? 1 : 2));
+ text = text.replace(/\r\n?/g, "\n");
+ return ts.createLiteral(text, node);
+ }
+ function visitTemplateExpression(node) {
+ var expressions = [];
+ addTemplateHead(expressions, node);
+ addTemplateSpans(expressions, node);
+ var expression = ts.reduceLeft(expressions, ts.createAdd);
+ if (ts.nodeIsSynthesized(expression)) {
+ ts.setTextRange(expression, node);
+ }
+ return expression;
+ }
+ function shouldAddTemplateHead(node) {
+ ts.Debug.assert(node.templateSpans.length !== 0);
+ return node.head.text.length !== 0 || node.templateSpans[0].literal.text.length === 0;
+ }
+ function addTemplateHead(expressions, node) {
+ if (!shouldAddTemplateHead(node)) {
+ return;
+ }
+ expressions.push(ts.createLiteral(node.head.text));
+ }
+ function addTemplateSpans(expressions, node) {
+ for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) {
+ var span_6 = _a[_i];
+ expressions.push(ts.visitNode(span_6.expression, visitor, ts.isExpression));
+ if (span_6.literal.text.length !== 0) {
+ expressions.push(ts.createLiteral(span_6.literal.text));
+ }
+ }
+ }
+ function visitSuperKeyword() {
+ return enclosingNonAsyncFunctionBody
+ && ts.isClassElement(enclosingNonAsyncFunctionBody)
+ && !ts.hasModifier(enclosingNonAsyncFunctionBody, 32)
+ && currentParent.kind !== 175
+ ? ts.createPropertyAccess(ts.createIdentifier("_super"), "prototype")
+ : ts.createIdentifier("_super");
+ }
+ function visitSourceFileNode(node) {
+ var _a = ts.span(node.statements, ts.isPrologueDirective), prologue = _a[0], remaining = _a[1];
+ var statements = [];
+ startLexicalEnvironment();
+ ts.addRange(statements, prologue);
+ addCaptureThisForNodeIfNeeded(statements, node);
+ ts.addRange(statements, ts.visitNodes(ts.createNodeArray(remaining), visitor, ts.isStatement));
+ ts.addRange(statements, endLexicalEnvironment());
+ var clone = ts.getMutableClone(node);
+ clone.statements = ts.createNodeArray(statements, node.statements);
+ return clone;
+ }
+ function onEmitNode(emitContext, node, emitCallback) {
+ var savedEnclosingFunction = enclosingFunction;
+ if (enabledSubstitutions & 1 && ts.isFunctionLike(node)) {
+ enclosingFunction = node;
+ }
+ previousOnEmitNode(emitContext, node, emitCallback);
+ enclosingFunction = savedEnclosingFunction;
+ }
+ function enableSubstitutionsForBlockScopedBindings() {
+ if ((enabledSubstitutions & 2) === 0) {
+ enabledSubstitutions |= 2;
+ context.enableSubstitution(70);
+ }
+ }
+ function enableSubstitutionsForCapturedThis() {
+ if ((enabledSubstitutions & 1) === 0) {
+ enabledSubstitutions |= 1;
+ context.enableSubstitution(98);
+ context.enableEmitNotification(149);
+ context.enableEmitNotification(148);
+ context.enableEmitNotification(150);
+ context.enableEmitNotification(151);
+ context.enableEmitNotification(181);
+ context.enableEmitNotification(180);
+ context.enableEmitNotification(221);
+ }
+ }
+ function onSubstituteNode(emitContext, node) {
+ node = previousOnSubstituteNode(emitContext, node);
+ if (emitContext === 1) {
+ return substituteExpression(node);
+ }
+ if (ts.isIdentifier(node)) {
+ return substituteIdentifier(node);
+ }
+ return node;
+ }
+ function substituteIdentifier(node) {
+ if (enabledSubstitutions & 2) {
+ var original = ts.getParseTreeNode(node, ts.isIdentifier);
+ if (original && isNameOfDeclarationWithCollidingName(original)) {
+ return ts.getGeneratedNameForNode(original);
+ }
+ }
+ return node;
+ }
+ function isNameOfDeclarationWithCollidingName(node) {
+ var parent = node.parent;
+ switch (parent.kind) {
+ case 170:
+ case 222:
+ case 225:
+ case 219:
+ return parent.name === node
+ && resolver.isDeclarationWithCollidingName(parent);
+ }
+ return false;
+ }
+ function substituteExpression(node) {
+ switch (node.kind) {
+ case 70:
+ return substituteExpressionIdentifier(node);
+ case 98:
+ return substituteThisKeyword(node);
+ }
+ return node;
+ }
+ function substituteExpressionIdentifier(node) {
+ if (enabledSubstitutions & 2) {
+ var declaration = resolver.getReferencedDeclarationWithCollidingName(node);
+ if (declaration) {
+ return ts.getGeneratedNameForNode(declaration.name);
+ }
+ }
+ return node;
+ }
+ function substituteThisKeyword(node) {
+ if (enabledSubstitutions & 1
+ && enclosingFunction
+ && ts.getEmitFlags(enclosingFunction) & 256) {
+ return ts.createIdentifier("_this", node);
+ }
+ return node;
+ }
+ function getLocalName(node, allowComments, allowSourceMaps) {
+ return getDeclarationName(node, allowComments, allowSourceMaps, 262144);
+ }
+ function getDeclarationName(node, allowComments, allowSourceMaps, emitFlags) {
+ if (node.name && !ts.isGeneratedIdentifier(node.name)) {
+ var name_33 = ts.getMutableClone(node.name);
+ emitFlags |= ts.getEmitFlags(node.name);
+ if (!allowSourceMaps) {
+ emitFlags |= 1536;
+ }
+ if (!allowComments) {
+ emitFlags |= 49152;
+ }
+ if (emitFlags) {
+ ts.setEmitFlags(name_33, emitFlags);
+ }
+ return name_33;
+ }
+ return ts.getGeneratedNameForNode(node);
+ }
+ function getClassMemberPrefix(node, member) {
+ var expression = getLocalName(node);
+ return ts.hasModifier(member, 32) ? expression : ts.createPropertyAccess(expression, "prototype");
+ }
+ function hasSynthesizedDefaultSuperCall(constructor, hasExtendsClause) {
+ if (!constructor || !hasExtendsClause) {
+ return false;
+ }
+ var parameter = ts.singleOrUndefined(constructor.parameters);
+ if (!parameter || !ts.nodeIsSynthesized(parameter) || !parameter.dotDotDotToken) {
+ return false;
+ }
+ var statement = ts.firstOrUndefined(constructor.body.statements);
+ if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 203) {
+ return false;
+ }
+ var statementExpression = statement.expression;
+ if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 175) {
+ return false;
+ }
+ var callTarget = statementExpression.expression;
+ if (!ts.nodeIsSynthesized(callTarget) || callTarget.kind !== 96) {
+ return false;
+ }
+ var callArgument = ts.singleOrUndefined(statementExpression.arguments);
+ if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 192) {
+ return false;
+ }
+ var expression = callArgument.expression;
+ return ts.isIdentifier(expression) && expression === parameter.name;
+ }
+ }
+ ts.transformES2015 = transformES2015;
+})(ts || (ts = {}));
+var ts;
+(function (ts) {
+ var OpCode;
+ (function (OpCode) {
+ OpCode[OpCode["Nop"] = 0] = "Nop";
+ OpCode[OpCode["Statement"] = 1] = "Statement";
+ OpCode[OpCode["Assign"] = 2] = "Assign";
+ OpCode[OpCode["Break"] = 3] = "Break";
+ OpCode[OpCode["BreakWhenTrue"] = 4] = "BreakWhenTrue";
+ OpCode[OpCode["BreakWhenFalse"] = 5] = "BreakWhenFalse";
+ OpCode[OpCode["Yield"] = 6] = "Yield";
+ OpCode[OpCode["YieldStar"] = 7] = "YieldStar";
+ OpCode[OpCode["Return"] = 8] = "Return";
+ OpCode[OpCode["Throw"] = 9] = "Throw";
+ OpCode[OpCode["Endfinally"] = 10] = "Endfinally";
+ })(OpCode || (OpCode = {}));
+ var BlockAction;
+ (function (BlockAction) {
+ BlockAction[BlockAction["Open"] = 0] = "Open";
+ BlockAction[BlockAction["Close"] = 1] = "Close";
+ })(BlockAction || (BlockAction = {}));
+ var CodeBlockKind;
+ (function (CodeBlockKind) {
+ CodeBlockKind[CodeBlockKind["Exception"] = 0] = "Exception";
+ CodeBlockKind[CodeBlockKind["With"] = 1] = "With";
+ CodeBlockKind[CodeBlockKind["Switch"] = 2] = "Switch";
+ CodeBlockKind[CodeBlockKind["Loop"] = 3] = "Loop";
+ CodeBlockKind[CodeBlockKind["Labeled"] = 4] = "Labeled";
+ })(CodeBlockKind || (CodeBlockKind = {}));
+ var ExceptionBlockState;
+ (function (ExceptionBlockState) {
+ ExceptionBlockState[ExceptionBlockState["Try"] = 0] = "Try";
+ ExceptionBlockState[ExceptionBlockState["Catch"] = 1] = "Catch";
+ ExceptionBlockState[ExceptionBlockState["Finally"] = 2] = "Finally";
+ ExceptionBlockState[ExceptionBlockState["Done"] = 3] = "Done";
+ })(ExceptionBlockState || (ExceptionBlockState = {}));
+ var Instruction;
+ (function (Instruction) {
+ Instruction[Instruction["Next"] = 0] = "Next";
+ Instruction[Instruction["Throw"] = 1] = "Throw";
+ Instruction[Instruction["Return"] = 2] = "Return";
+ Instruction[Instruction["Break"] = 3] = "Break";
+ Instruction[Instruction["Yield"] = 4] = "Yield";
+ Instruction[Instruction["YieldStar"] = 5] = "YieldStar";
+ Instruction[Instruction["Catch"] = 6] = "Catch";
+ Instruction[Instruction["Endfinally"] = 7] = "Endfinally";
+ })(Instruction || (Instruction = {}));
var instructionNames = ts.createMap((_a = {},
_a[2] = "return",
_a[3] = "break",
@@ -38897,7 +40595,7 @@ var ts;
if (ts.isDeclarationFile(node)) {
return node;
}
- if (node.transformFlags & 1024) {
+ if (node.transformFlags & 4096) {
currentSourceFile = node;
node = ts.visitEachChild(node, visitor, context);
currentSourceFile = undefined;
@@ -38912,10 +40610,10 @@ var ts;
else if (inGeneratorFunctionBody) {
return visitJavaScriptInGeneratorFunctionBody(node);
}
- else if (transformFlags & 512) {
+ else if (transformFlags & 2048) {
return visitGenerator(node);
}
- else if (transformFlags & 1024) {
+ else if (transformFlags & 4096) {
return ts.visitEachChild(node, visitor, context);
}
else {
@@ -38924,13 +40622,13 @@ var ts;
}
function visitJavaScriptInStatementContainingYield(node) {
switch (node.kind) {
- case 204:
- return visitDoStatement(node);
case 205:
+ return visitDoStatement(node);
+ case 206:
return visitWhileStatement(node);
- case 213:
- return visitSwitchStatement(node);
case 214:
+ return visitSwitchStatement(node);
+ case 215:
return visitLabeledStatement(node);
default:
return visitJavaScriptInGeneratorFunctionBody(node);
@@ -38938,30 +40636,30 @@ var ts;
}
function visitJavaScriptInGeneratorFunctionBody(node) {
switch (node.kind) {
- case 220:
+ case 221:
return visitFunctionDeclaration(node);
- case 179:
+ case 180:
return visitFunctionExpression(node);
- case 149:
case 150:
+ case 151:
return visitAccessorDeclaration(node);
- case 200:
+ case 201:
return visitVariableStatement(node);
- case 206:
- return visitForStatement(node);
case 207:
+ return visitForStatement(node);
+ case 208:
return visitForInStatement(node);
- case 210:
- return visitBreakStatement(node);
- case 209:
- return visitContinueStatement(node);
case 211:
+ return visitBreakStatement(node);
+ case 210:
+ return visitContinueStatement(node);
+ case 212:
return visitReturnStatement(node);
default:
- if (node.transformFlags & 4194304) {
+ if (node.transformFlags & 16777216) {
return visitJavaScriptContainingYield(node);
}
- else if (node.transformFlags & (1024 | 8388608)) {
+ else if (node.transformFlags & (4096 | 33554432)) {
return ts.visitEachChild(node, visitor, context);
}
else {
@@ -38971,21 +40669,21 @@ var ts;
}
function visitJavaScriptContainingYield(node) {
switch (node.kind) {
- case 187:
- return visitBinaryExpression(node);
case 188:
+ return visitBinaryExpression(node);
+ case 189:
return visitConditionalExpression(node);
- case 190:
+ case 191:
return visitYieldExpression(node);
- case 170:
- return visitArrayLiteralExpression(node);
case 171:
+ return visitArrayLiteralExpression(node);
+ case 172:
return visitObjectLiteralExpression(node);
- case 173:
- return visitElementAccessExpression(node);
case 174:
- return visitCallExpression(node);
+ return visitElementAccessExpression(node);
case 175:
+ return visitCallExpression(node);
+ case 176:
return visitNewExpression(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -38993,9 +40691,9 @@ var ts;
}
function visitGenerator(node) {
switch (node.kind) {
- case 220:
+ case 221:
return visitFunctionDeclaration(node);
- case 179:
+ case 180:
return visitFunctionExpression(node);
default:
ts.Debug.failBadSyntaxKind(node);
@@ -39025,7 +40723,7 @@ var ts;
}
function visitFunctionExpression(node) {
if (node.asteriskToken && ts.getEmitFlags(node) & 2097152) {
- node = ts.setOriginalNode(ts.createFunctionExpression(undefined, node.name, undefined, node.parameters, undefined, transformGeneratorFunctionBody(node.body), node), node);
+ node = ts.setOriginalNode(ts.createFunctionExpression(undefined, undefined, node.name, undefined, node.parameters, undefined, transformGeneratorFunctionBody(node.body), node), node);
}
else {
var savedInGeneratorFunctionBody = inGeneratorFunctionBody;
@@ -39098,7 +40796,7 @@ var ts;
return ts.createBlock(statements, body, body.multiLine);
}
function visitVariableStatement(node) {
- if (node.transformFlags & 4194304) {
+ if (node.transformFlags & 16777216) {
transformAndEmitVariableDeclarationList(node.declarationList);
return undefined;
}
@@ -39128,23 +40826,23 @@ var ts;
}
}
function isCompoundAssignment(kind) {
- return kind >= 57
- && kind <= 68;
+ return kind >= 58
+ && kind <= 69;
}
function getOperatorForCompoundAssignment(kind) {
switch (kind) {
- case 57: return 35;
case 58: return 36;
case 59: return 37;
case 60: return 38;
case 61: return 39;
case 62: return 40;
- case 63: return 43;
+ case 63: return 41;
case 64: return 44;
case 65: return 45;
case 66: return 46;
case 67: return 47;
case 68: return 48;
+ case 69: return 49;
}
}
function visitRightAssociativeBinaryExpression(node) {
@@ -39152,10 +40850,10 @@ var ts;
if (containsYield(right)) {
var target = void 0;
switch (left.kind) {
- case 172:
+ case 173:
target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name);
break;
- case 173:
+ case 174:
target = ts.updateElementAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression)));
break;
default:
@@ -39164,7 +40862,7 @@ var ts;
}
var operator = node.operatorToken.kind;
if (isCompoundAssignment(operator)) {
- return ts.createBinary(target, 56, ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression), node), node);
+ return ts.createBinary(target, 57, ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression), node), node);
}
else {
return ts.updateBinary(node, target, ts.visitNode(right, visitor, ts.isExpression));
@@ -39177,13 +40875,13 @@ var ts;
if (ts.isLogicalOperator(node.operatorToken.kind)) {
return visitLogicalBinaryExpression(node);
}
- else if (node.operatorToken.kind === 24) {
+ else if (node.operatorToken.kind === 25) {
return visitCommaExpression(node);
}
- var clone_5 = ts.getMutableClone(node);
- clone_5.left = cacheExpression(ts.visitNode(node.left, visitor, ts.isExpression));
- clone_5.right = ts.visitNode(node.right, visitor, ts.isExpression);
- return clone_5;
+ var clone_6 = ts.getMutableClone(node);
+ clone_6.left = cacheExpression(ts.visitNode(node.left, visitor, ts.isExpression));
+ clone_6.right = ts.visitNode(node.right, visitor, ts.isExpression);
+ return clone_6;
}
return ts.visitEachChild(node, visitor, context);
}
@@ -39191,7 +40889,7 @@ var ts;
var resultLabel = defineLabel();
var resultLocal = declareLocal();
emitAssignment(resultLocal, ts.visitNode(node.left, visitor, ts.isExpression), node.left);
- if (node.operatorToken.kind === 51) {
+ if (node.operatorToken.kind === 52) {
emitBreakWhenFalse(resultLabel, resultLocal, node.left);
}
else {
@@ -39207,7 +40905,7 @@ var ts;
visit(node.right);
return ts.inlineExpressions(pendingExpressions);
function visit(node) {
- if (ts.isBinaryExpression(node) && node.operatorToken.kind === 24) {
+ if (ts.isBinaryExpression(node) && node.operatorToken.kind === 25) {
visit(node.left);
visit(node.right);
}
@@ -39250,7 +40948,7 @@ var ts;
function visitArrayLiteralExpression(node) {
return visitElements(node.elements, node.multiLine);
}
- function visitElements(elements, multiLine) {
+ function visitElements(elements, _multiLine) {
var numInitialElements = countInitialNodesWithoutYield(elements);
var temp = declareLocal();
var hasAssignedTemp = false;
@@ -39301,24 +40999,24 @@ var ts;
}
function visitElementAccessExpression(node) {
if (containsYield(node.argumentExpression)) {
- var clone_6 = ts.getMutableClone(node);
- clone_6.expression = cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression));
- clone_6.argumentExpression = ts.visitNode(node.argumentExpression, visitor, ts.isExpression);
- return clone_6;
+ var clone_7 = ts.getMutableClone(node);
+ clone_7.expression = cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression));
+ clone_7.argumentExpression = ts.visitNode(node.argumentExpression, visitor, ts.isExpression);
+ return clone_7;
}
return ts.visitEachChild(node, visitor, context);
}
function visitCallExpression(node) {
if (ts.forEach(node.arguments, containsYield)) {
var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion, true), target = _a.target, thisArg = _a.thisArg;
- return ts.setOriginalNode(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isLeftHandSideExpression)), thisArg, visitElements(node.arguments, false), node), node);
+ return ts.setOriginalNode(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isLeftHandSideExpression)), thisArg, visitElements(node.arguments), node), node);
}
return ts.visitEachChild(node, visitor, context);
}
function visitNewExpression(node) {
if (ts.forEach(node.arguments, containsYield)) {
var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
- return ts.setOriginalNode(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, false)), undefined, [], node), node);
+ return ts.setOriginalNode(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments)), undefined, [], node), node);
}
return ts.visitEachChild(node, visitor, context);
}
@@ -39347,35 +41045,35 @@ var ts;
}
function transformAndEmitStatementWorker(node) {
switch (node.kind) {
- case 199:
+ case 200:
return transformAndEmitBlock(node);
- case 202:
- return transformAndEmitExpressionStatement(node);
case 203:
- return transformAndEmitIfStatement(node);
+ return transformAndEmitExpressionStatement(node);
case 204:
- return transformAndEmitDoStatement(node);
+ return transformAndEmitIfStatement(node);
case 205:
- return transformAndEmitWhileStatement(node);
+ return transformAndEmitDoStatement(node);
case 206:
- return transformAndEmitForStatement(node);
+ return transformAndEmitWhileStatement(node);
case 207:
+ return transformAndEmitForStatement(node);
+ case 208:
return transformAndEmitForInStatement(node);
- case 209:
- return transformAndEmitContinueStatement(node);
case 210:
- return transformAndEmitBreakStatement(node);
+ return transformAndEmitContinueStatement(node);
case 211:
- return transformAndEmitReturnStatement(node);
+ return transformAndEmitBreakStatement(node);
case 212:
- return transformAndEmitWithStatement(node);
+ return transformAndEmitReturnStatement(node);
case 213:
- return transformAndEmitSwitchStatement(node);
+ return transformAndEmitWithStatement(node);
case 214:
- return transformAndEmitLabeledStatement(node);
+ return transformAndEmitSwitchStatement(node);
case 215:
- return transformAndEmitThrowStatement(node);
+ return transformAndEmitLabeledStatement(node);
case 216:
+ return transformAndEmitThrowStatement(node);
+ case 217:
return transformAndEmitTryStatement(node);
default:
return emitStatement(ts.visitNode(node, visitor, ts.isStatement, true));
@@ -39760,7 +41458,7 @@ var ts;
}
}
function containsYield(node) {
- return node && (node.transformFlags & 4194304) !== 0;
+ return node && (node.transformFlags & 16777216) !== 0;
}
function countInitialNodesWithoutYield(nodes) {
var numNodes = nodes.length;
@@ -39790,12 +41488,12 @@ var ts;
if (ts.isIdentifier(original) && original.parent) {
var declaration = resolver.getReferencedValueDeclaration(original);
if (declaration) {
- var name_37 = ts.getProperty(renamedCatchVariableDeclarations, String(ts.getOriginalNodeId(declaration)));
- if (name_37) {
- var clone_7 = ts.getMutableClone(name_37);
- ts.setSourceMapRange(clone_7, node);
- ts.setCommentRange(clone_7, node);
- return clone_7;
+ var name_34 = ts.getProperty(renamedCatchVariableDeclarations, String(ts.getOriginalNodeId(declaration)));
+ if (name_34) {
+ var clone_8 = ts.getMutableClone(name_34);
+ ts.setSourceMapRange(clone_8, node);
+ ts.setCommentRange(clone_8, node);
+ return clone_8;
}
}
}
@@ -39901,7 +41599,7 @@ var ts;
if (!renamedCatchVariables) {
renamedCatchVariables = ts.createMap();
renamedCatchVariableDeclarations = ts.createMap();
- context.enableSubstitution(69);
+ context.enableSubstitution(70);
}
renamedCatchVariables[text] = true;
renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name;
@@ -40100,7 +41798,7 @@ var ts;
}
return expression;
}
- return ts.createNode(193);
+ return ts.createNode(194);
}
function createInstruction(instruction) {
var literal = ts.createLiteral(instruction);
@@ -40188,7 +41886,7 @@ var ts;
var buildResult = buildStatements();
return ts.createCall(ts.createHelperName(currentSourceFile.externalHelpersModuleName, "__generator"), undefined, [
ts.createThis(),
- ts.setEmitFlags(ts.createFunctionExpression(undefined, undefined, undefined, [ts.createParameter(state)], undefined, ts.createBlock(buildResult, undefined, buildResult.length > 0)), 4194304)
+ ts.setEmitFlags(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(state)], undefined, ts.createBlock(buildResult, undefined, buildResult.length > 0)), 4194304)
]);
}
function buildStatements() {
@@ -40456,1456 +42154,468 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
- function transformES6(context) {
+ function transformES5(context) {
+ var previousOnSubstituteNode = context.onSubstituteNode;
+ context.onSubstituteNode = onSubstituteNode;
+ context.enableSubstitution(173);
+ context.enableSubstitution(253);
+ return transformSourceFile;
+ function transformSourceFile(node) {
+ return node;
+ }
+ function onSubstituteNode(emitContext, node) {
+ node = previousOnSubstituteNode(emitContext, node);
+ if (ts.isPropertyAccessExpression(node)) {
+ return substitutePropertyAccessExpression(node);
+ }
+ else if (ts.isPropertyAssignment(node)) {
+ return substitutePropertyAssignment(node);
+ }
+ return node;
+ }
+ function substitutePropertyAccessExpression(node) {
+ var literalName = trySubstituteReservedName(node.name);
+ if (literalName) {
+ return ts.createElementAccess(node.expression, literalName, node);
+ }
+ return node;
+ }
+ function substitutePropertyAssignment(node) {
+ var literalName = ts.isIdentifier(node.name) && trySubstituteReservedName(node.name);
+ if (literalName) {
+ return ts.updatePropertyAssignment(node, literalName, node.initializer);
+ }
+ return node;
+ }
+ function trySubstituteReservedName(name) {
+ var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(name.text) : undefined);
+ if (token >= 71 && token <= 106) {
+ return ts.createLiteral(name, name);
+ }
+ return undefined;
+ }
+ }
+ ts.transformES5 = transformES5;
+})(ts || (ts = {}));
+var ts;
+(function (ts) {
+ function transformModule(context) {
+ var transformModuleDelegates = ts.createMap((_a = {},
+ _a[ts.ModuleKind.None] = transformCommonJSModule,
+ _a[ts.ModuleKind.CommonJS] = transformCommonJSModule,
+ _a[ts.ModuleKind.AMD] = transformAMDModule,
+ _a[ts.ModuleKind.UMD] = transformUMDModule,
+ _a));
var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration;
+ var compilerOptions = context.getCompilerOptions();
var resolver = context.getEmitResolver();
+ var host = context.getEmitHost();
+ var languageVersion = ts.getEmitScriptTarget(compilerOptions);
+ var moduleKind = ts.getEmitModuleKind(compilerOptions);
var previousOnSubstituteNode = context.onSubstituteNode;
var previousOnEmitNode = context.onEmitNode;
- context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
+ context.onEmitNode = onEmitNode;
+ context.enableSubstitution(70);
+ context.enableSubstitution(188);
+ context.enableSubstitution(186);
+ context.enableSubstitution(187);
+ context.enableSubstitution(254);
+ context.enableEmitNotification(256);
var currentSourceFile;
- var currentText;
- var currentParent;
- var currentNode;
- var enclosingVariableStatement;
- var enclosingBlockScopeContainer;
- var enclosingBlockScopeContainerParent;
- var enclosingFunction;
- var enclosingNonArrowFunction;
- var enclosingNonAsyncFunctionBody;
- var convertedLoopState;
- var enabledSubstitutions;
+ var externalImports;
+ var exportSpecifiers;
+ var exportEquals;
+ var bindingNameExportSpecifiersMap;
+ var bindingNameExportSpecifiersForFileMap = ts.createMap();
+ var hasExportStarsToExportValues;
return transformSourceFile;
function transformSourceFile(node) {
if (ts.isDeclarationFile(node)) {
return node;
}
- currentSourceFile = node;
- currentText = node.text;
- return ts.visitNode(node, visitor, ts.isSourceFile);
- }
- function visitor(node) {
- return saveStateAndInvoke(node, dispatcher);
- }
- function dispatcher(node) {
- return convertedLoopState
- ? visitorForConvertedLoopWorker(node)
- : visitorWorker(node);
- }
- function saveStateAndInvoke(node, f) {
- var savedEnclosingFunction = enclosingFunction;
- var savedEnclosingNonArrowFunction = enclosingNonArrowFunction;
- var savedEnclosingNonAsyncFunctionBody = enclosingNonAsyncFunctionBody;
- var savedEnclosingBlockScopeContainer = enclosingBlockScopeContainer;
- var savedEnclosingBlockScopeContainerParent = enclosingBlockScopeContainerParent;
- var savedEnclosingVariableStatement = enclosingVariableStatement;
- var savedCurrentParent = currentParent;
- var savedCurrentNode = currentNode;
- var savedConvertedLoopState = convertedLoopState;
- if (ts.nodeStartsNewLexicalEnvironment(node)) {
- convertedLoopState = undefined;
+ if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
+ currentSourceFile = node;
+ (_a = ts.collectExternalModuleInfo(node), externalImports = _a.externalImports, exportSpecifiers = _a.exportSpecifiers, exportEquals = _a.exportEquals, hasExportStarsToExportValues = _a.hasExportStarsToExportValues, _a);
+ var transformModule_1 = transformModuleDelegates[moduleKind] || transformModuleDelegates[ts.ModuleKind.None];
+ var updated = transformModule_1(node);
+ ts.aggregateTransformFlags(updated);
+ currentSourceFile = undefined;
+ externalImports = undefined;
+ exportSpecifiers = undefined;
+ exportEquals = undefined;
+ hasExportStarsToExportValues = false;
+ return updated;
}
- onBeforeVisitNode(node);
- var visited = f(node);
- convertedLoopState = savedConvertedLoopState;
- enclosingFunction = savedEnclosingFunction;
- enclosingNonArrowFunction = savedEnclosingNonArrowFunction;
- enclosingNonAsyncFunctionBody = savedEnclosingNonAsyncFunctionBody;
- enclosingBlockScopeContainer = savedEnclosingBlockScopeContainer;
- enclosingBlockScopeContainerParent = savedEnclosingBlockScopeContainerParent;
- enclosingVariableStatement = savedEnclosingVariableStatement;
- currentParent = savedCurrentParent;
- currentNode = savedCurrentNode;
- return visited;
+ return node;
+ var _a;
}
- function shouldCheckNode(node) {
- return (node.transformFlags & 64) !== 0 ||
- node.kind === 214 ||
- (ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node));
- }
- function visitorWorker(node) {
- if (shouldCheckNode(node)) {
- return visitJavaScript(node);
- }
- else if (node.transformFlags & 128) {
- return ts.visitEachChild(node, visitor, context);
- }
- else {
- return node;
- }
- }
- function visitorForConvertedLoopWorker(node) {
- var result;
- if (shouldCheckNode(node)) {
- result = visitJavaScript(node);
- }
- else {
- result = visitNodesInConvertedLoop(node);
- }
- return result;
- }
- function visitNodesInConvertedLoop(node) {
- switch (node.kind) {
- case 211:
- return visitReturnStatement(node);
- case 200:
- return visitVariableStatement(node);
- case 213:
- return visitSwitchStatement(node);
- case 210:
- case 209:
- return visitBreakOrContinueStatement(node);
- case 97:
- return visitThisKeyword(node);
- case 69:
- return visitIdentifier(node);
- default:
- return ts.visitEachChild(node, visitor, context);
- }
- }
- function visitJavaScript(node) {
- switch (node.kind) {
- case 82:
- return node;
- case 221:
- return visitClassDeclaration(node);
- case 192:
- return visitClassExpression(node);
- case 142:
- return visitParameter(node);
- case 220:
- return visitFunctionDeclaration(node);
- case 180:
- return visitArrowFunction(node);
- case 179:
- return visitFunctionExpression(node);
- case 218:
- return visitVariableDeclaration(node);
- case 69:
- return visitIdentifier(node);
- case 219:
- return visitVariableDeclarationList(node);
- case 214:
- return visitLabeledStatement(node);
- case 204:
- return visitDoStatement(node);
- case 205:
- return visitWhileStatement(node);
- case 206:
- return visitForStatement(node);
- case 207:
- return visitForInStatement(node);
- case 208:
- return visitForOfStatement(node);
- case 202:
- return visitExpressionStatement(node);
- case 171:
- return visitObjectLiteralExpression(node);
- case 254:
- return visitShorthandPropertyAssignment(node);
- case 170:
- return visitArrayLiteralExpression(node);
- case 174:
- return visitCallExpression(node);
- case 175:
- return visitNewExpression(node);
- case 178:
- return visitParenthesizedExpression(node, true);
- case 187:
- return visitBinaryExpression(node, true);
- case 11:
- case 12:
- case 13:
- case 14:
- return visitTemplateLiteral(node);
- case 176:
- return visitTaggedTemplateExpression(node);
- case 189:
- return visitTemplateExpression(node);
- case 190:
- return visitYieldExpression(node);
- case 95:
- return visitSuperKeyword(node);
- case 190:
- return ts.visitEachChild(node, visitor, context);
- case 147:
- return visitMethodDeclaration(node);
- case 256:
- return visitSourceFileNode(node);
- case 200:
- return visitVariableStatement(node);
- default:
- ts.Debug.failBadSyntaxKind(node);
- return ts.visitEachChild(node, visitor, context);
- }
- }
- function onBeforeVisitNode(node) {
- if (currentNode) {
- if (ts.isBlockScope(currentNode, currentParent)) {
- enclosingBlockScopeContainer = currentNode;
- enclosingBlockScopeContainerParent = currentParent;
- }
- if (ts.isFunctionLike(currentNode)) {
- enclosingFunction = currentNode;
- if (currentNode.kind !== 180) {
- enclosingNonArrowFunction = currentNode;
- if (!(ts.getEmitFlags(currentNode) & 2097152)) {
- enclosingNonAsyncFunctionBody = currentNode;
- }
- }
- }
- switch (currentNode.kind) {
- case 200:
- enclosingVariableStatement = currentNode;
- break;
- case 219:
- case 218:
- case 169:
- case 167:
- case 168:
- break;
- default:
- enclosingVariableStatement = undefined;
- }
- }
- currentParent = currentNode;
- currentNode = node;
- }
- function visitSwitchStatement(node) {
- ts.Debug.assert(convertedLoopState !== undefined);
- var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps;
- convertedLoopState.allowedNonLabeledJumps |= 2;
- var result = ts.visitEachChild(node, visitor, context);
- convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps;
- return result;
- }
- function visitReturnStatement(node) {
- ts.Debug.assert(convertedLoopState !== undefined);
- convertedLoopState.nonLocalJumps |= 8;
- return ts.createReturn(ts.createObjectLiteral([
- ts.createPropertyAssignment(ts.createIdentifier("value"), node.expression
- ? ts.visitNode(node.expression, visitor, ts.isExpression)
- : ts.createVoidZero())
- ]));
- }
- function visitThisKeyword(node) {
- ts.Debug.assert(convertedLoopState !== undefined);
- if (enclosingFunction && enclosingFunction.kind === 180) {
- convertedLoopState.containsLexicalThis = true;
- return node;
- }
- return convertedLoopState.thisName || (convertedLoopState.thisName = ts.createUniqueName("this"));
- }
- function visitIdentifier(node) {
- if (!convertedLoopState) {
- return node;
- }
- if (ts.isGeneratedIdentifier(node)) {
- return node;
- }
- if (node.text !== "arguments" && !resolver.isArgumentsLocalBinding(node)) {
- return node;
- }
- return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = ts.createUniqueName("arguments"));
- }
- function visitBreakOrContinueStatement(node) {
- if (convertedLoopState) {
- var jump = node.kind === 210 ? 2 : 4;
- var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) ||
- (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump));
- if (!canUseBreakOrContinue) {
- var labelMarker = void 0;
- if (!node.label) {
- if (node.kind === 210) {
- convertedLoopState.nonLocalJumps |= 2;
- labelMarker = "break";
- }
- else {
- convertedLoopState.nonLocalJumps |= 4;
- labelMarker = "continue";
- }
- }
- else {
- if (node.kind === 210) {
- labelMarker = "break-" + node.label.text;
- setLabeledJump(convertedLoopState, true, node.label.text, labelMarker);
- }
- else {
- labelMarker = "continue-" + node.label.text;
- setLabeledJump(convertedLoopState, false, node.label.text, labelMarker);
- }
- }
- var returnExpression = ts.createLiteral(labelMarker);
- if (convertedLoopState.loopOutParameters.length) {
- var outParams = convertedLoopState.loopOutParameters;
- var expr = void 0;
- for (var i = 0; i < outParams.length; i++) {
- var copyExpr = copyOutParameter(outParams[i], 1);
- if (i === 0) {
- expr = copyExpr;
- }
- else {
- expr = ts.createBinary(expr, 24, copyExpr);
- }
- }
- returnExpression = ts.createBinary(expr, 24, returnExpression);
- }
- return ts.createReturn(returnExpression);
- }
- }
- return ts.visitEachChild(node, visitor, context);
- }
- function visitClassDeclaration(node) {
- var modifierFlags = ts.getModifierFlags(node);
- var isExported = modifierFlags & 1;
- var isDefault = modifierFlags & 512;
- var modifiers = isExported && !isDefault
- ? ts.filter(node.modifiers, isExportModifier)
- : undefined;
- var statement = ts.createVariableStatement(modifiers, ts.createVariableDeclarationList([
- ts.createVariableDeclaration(getDeclarationName(node, true), undefined, transformClassLikeDeclarationToExpression(node))
- ]), node);
- ts.setOriginalNode(statement, node);
- ts.startOnNewLine(statement);
- if (isExported && isDefault) {
- var statements = [statement];
- statements.push(ts.createExportAssignment(undefined, undefined, false, getDeclarationName(node, false)));
- return statements;
- }
- return statement;
- }
- function isExportModifier(node) {
- return node.kind === 82;
- }
- function visitClassExpression(node) {
- return transformClassLikeDeclarationToExpression(node);
- }
- function transformClassLikeDeclarationToExpression(node) {
- if (node.name) {
- enableSubstitutionsForBlockScopedBindings();
- }
- var extendsClauseElement = ts.getClassExtendsHeritageClauseElement(node);
- var classFunction = ts.createFunctionExpression(undefined, undefined, undefined, extendsClauseElement ? [ts.createParameter("_super")] : [], undefined, transformClassBody(node, extendsClauseElement));
- if (ts.getEmitFlags(node) & 524288) {
- ts.setEmitFlags(classFunction, 524288);
- }
- var inner = ts.createPartiallyEmittedExpression(classFunction);
- inner.end = node.end;
- ts.setEmitFlags(inner, 49152);
- var outer = ts.createPartiallyEmittedExpression(inner);
- outer.end = ts.skipTrivia(currentText, node.pos);
- ts.setEmitFlags(outer, 49152);
- return ts.createParen(ts.createCall(outer, undefined, extendsClauseElement
- ? [ts.visitNode(extendsClauseElement.expression, visitor, ts.isExpression)]
- : []));
- }
- function transformClassBody(node, extendsClauseElement) {
- var statements = [];
+ function transformCommonJSModule(node) {
startLexicalEnvironment();
- addExtendsHelperIfNeeded(statements, node, extendsClauseElement);
- addConstructor(statements, node, extendsClauseElement);
- addClassMembers(statements, node);
- var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 16);
- var localName = getLocalName(node);
- var outer = ts.createPartiallyEmittedExpression(localName);
- outer.end = closingBraceLocation.end;
- ts.setEmitFlags(outer, 49152);
- var statement = ts.createReturn(outer);
- statement.pos = closingBraceLocation.pos;
- ts.setEmitFlags(statement, 49152 | 12288);
- statements.push(statement);
- ts.addRange(statements, endLexicalEnvironment());
- var block = ts.createBlock(ts.createNodeArray(statements, node.members), undefined, true);
- ts.setEmitFlags(block, 49152);
- return block;
- }
- function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) {
- if (extendsClauseElement) {
- statements.push(ts.createStatement(ts.createExtendsHelper(currentSourceFile.externalHelpersModuleName, getDeclarationName(node)), extendsClauseElement));
- }
- }
- function addConstructor(statements, node, extendsClauseElement) {
- var constructor = ts.getFirstConstructorWithBody(node);
- var hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== undefined);
- var constructorFunction = ts.createFunctionDeclaration(undefined, undefined, undefined, getDeclarationName(node), undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper), constructor || node);
- if (extendsClauseElement) {
- ts.setEmitFlags(constructorFunction, 256);
- }
- statements.push(constructorFunction);
- }
- function transformConstructorParameters(constructor, hasSynthesizedSuper) {
- if (constructor && !hasSynthesizedSuper) {
- return ts.visitNodes(constructor.parameters, visitor, ts.isParameter);
- }
- return [];
- }
- function transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper) {
var statements = [];
- startLexicalEnvironment();
- var statementOffset = -1;
- if (hasSynthesizedSuper) {
- statementOffset = 1;
- }
- else if (constructor) {
- statementOffset = ts.addPrologueDirectives(statements, constructor.body.statements, false, visitor);
- }
- if (constructor) {
- addDefaultValueAssignmentsIfNeeded(statements, constructor);
- addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper);
- ts.Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!");
- }
- var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, hasSynthesizedSuper, statementOffset);
- if (superCaptureStatus === 1 || superCaptureStatus === 2) {
- statementOffset++;
- }
- if (constructor) {
- var body = saveStateAndInvoke(constructor, function (constructor) { return ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, statementOffset); });
- ts.addRange(statements, body);
- }
- if (extendsClauseElement
- && superCaptureStatus !== 2
- && !(constructor && isSufficientlyCoveredByReturnStatements(constructor.body))) {
- statements.push(ts.createReturn(ts.createIdentifier("_this")));
- }
+ var statementOffset = ts.addPrologueDirectives(statements, node.statements, !compilerOptions.noImplicitUseStrict, visitor);
+ ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset));
ts.addRange(statements, endLexicalEnvironment());
- var block = ts.createBlock(ts.createNodeArray(statements, constructor ? constructor.body.statements : node.members), constructor ? constructor.body : node, true);
- if (!constructor) {
- ts.setEmitFlags(block, 49152);
+ addExportEqualsIfNeeded(statements, false);
+ var updated = updateSourceFile(node, statements);
+ if (hasExportStarsToExportValues) {
+ ts.setEmitFlags(updated, 2 | ts.getEmitFlags(node));
}
- return block;
+ return updated;
}
- function isSufficientlyCoveredByReturnStatements(statement) {
- if (statement.kind === 211) {
- return true;
- }
- else if (statement.kind === 203) {
- var ifStatement = statement;
- if (ifStatement.elseStatement) {
- return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) &&
- isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement);
- }
- }
- else if (statement.kind === 199) {
- var lastStatement = ts.lastOrUndefined(statement.statements);
- if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) {
- return true;
- }
- }
- return false;
+ function transformAMDModule(node) {
+ var define = ts.createIdentifier("define");
+ var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions);
+ return transformAsynchronousModule(node, define, moduleName, true);
}
- function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, ctor, hasExtendsClause, hasSynthesizedSuper, statementOffset) {
- if (!hasExtendsClause) {
- if (ctor) {
- addCaptureThisForNodeIfNeeded(statements, ctor);
- }
- return 0;
- }
- if (!ctor) {
- statements.push(ts.createReturn(createDefaultSuperCallOrThis()));
- return 2;
- }
- if (hasSynthesizedSuper) {
- captureThisForNode(statements, ctor, createDefaultSuperCallOrThis());
- enableSubstitutionsForCapturedThis();
- return 1;
- }
- var firstStatement;
- var superCallExpression;
- var ctorStatements = ctor.body.statements;
- if (statementOffset < ctorStatements.length) {
- firstStatement = ctorStatements[statementOffset];
- if (firstStatement.kind === 202 && ts.isSuperCall(firstStatement.expression)) {
- var superCall = firstStatement.expression;
- superCallExpression = ts.setOriginalNode(saveStateAndInvoke(superCall, visitImmediateSuperCallInBody), superCall);
- }
- }
- if (superCallExpression && statementOffset === ctorStatements.length - 1) {
- statements.push(ts.createReturn(superCallExpression));
- return 2;
- }
- captureThisForNode(statements, ctor, superCallExpression, firstStatement);
- if (superCallExpression) {
- return 1;
- }
- return 0;
+ function transformUMDModule(node) {
+ var define = ts.createIdentifier("define");
+ ts.setEmitFlags(define, 16);
+ return transformAsynchronousModule(node, define, undefined, false);
}
- function createDefaultSuperCallOrThis() {
- var actualThis = ts.createThis();
- ts.setEmitFlags(actualThis, 128);
- var superCall = ts.createFunctionApply(ts.createIdentifier("_super"), actualThis, ts.createIdentifier("arguments"));
- return ts.createLogicalOr(superCall, actualThis);
- }
- function visitParameter(node) {
- if (node.dotDotDotToken) {
- return undefined;
- }
- else if (ts.isBindingPattern(node.name)) {
- return ts.setOriginalNode(ts.createParameter(ts.getGeneratedNameForNode(node), undefined, node), node);
- }
- else if (node.initializer) {
- return ts.setOriginalNode(ts.createParameter(node.name, undefined, node), node);
- }
- else {
- return node;
- }
- }
- function shouldAddDefaultValueAssignments(node) {
- return (node.transformFlags & 65536) !== 0;
- }
- function addDefaultValueAssignmentsIfNeeded(statements, node) {
- if (!shouldAddDefaultValueAssignments(node)) {
- return;
- }
- for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
- var parameter = _a[_i];
- var name_38 = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken;
- if (dotDotDotToken) {
- continue;
- }
- if (ts.isBindingPattern(name_38)) {
- addDefaultValueAssignmentForBindingPattern(statements, parameter, name_38, initializer);
- }
- else if (initializer) {
- addDefaultValueAssignmentForInitializer(statements, parameter, name_38, initializer);
- }
- }
- }
- function addDefaultValueAssignmentForBindingPattern(statements, parameter, name, initializer) {
- var temp = ts.getGeneratedNameForNode(parameter);
- if (name.elements.length > 0) {
- statements.push(ts.setEmitFlags(ts.createVariableStatement(undefined, ts.createVariableDeclarationList(ts.flattenParameterDestructuring(context, parameter, temp, visitor))), 8388608));
- }
- else if (initializer) {
- statements.push(ts.setEmitFlags(ts.createStatement(ts.createAssignment(temp, ts.visitNode(initializer, visitor, ts.isExpression))), 8388608));
- }
- }
- function addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer) {
- initializer = ts.visitNode(initializer, visitor, ts.isExpression);
- var statement = ts.createIf(ts.createStrictEquality(ts.getSynthesizedClone(name), ts.createVoidZero()), ts.setEmitFlags(ts.createBlock([
- ts.createStatement(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 1536), ts.setEmitFlags(initializer, 1536 | ts.getEmitFlags(initializer)), parameter))
- ], parameter), 32 | 1024 | 12288), undefined, parameter);
- statement.startsOnNewLine = true;
- ts.setEmitFlags(statement, 12288 | 1024 | 8388608);
- statements.push(statement);
- }
- function shouldAddRestParameter(node, inConstructorWithSynthesizedSuper) {
- return node && node.dotDotDotToken && node.name.kind === 69 && !inConstructorWithSynthesizedSuper;
- }
- function addRestParameterIfNeeded(statements, node, inConstructorWithSynthesizedSuper) {
- var parameter = ts.lastOrUndefined(node.parameters);
- if (!shouldAddRestParameter(parameter, inConstructorWithSynthesizedSuper)) {
- return;
- }
- var declarationName = ts.getMutableClone(parameter.name);
- ts.setEmitFlags(declarationName, 1536);
- var expressionName = ts.getSynthesizedClone(parameter.name);
- var restIndex = node.parameters.length - 1;
- var temp = ts.createLoopVariable();
- statements.push(ts.setEmitFlags(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
- ts.createVariableDeclaration(declarationName, undefined, ts.createArrayLiteral([]))
- ]), parameter), 8388608));
- var forStatement = ts.createFor(ts.createVariableDeclarationList([
- ts.createVariableDeclaration(temp, undefined, ts.createLiteral(restIndex))
- ], parameter), ts.createLessThan(temp, ts.createPropertyAccess(ts.createIdentifier("arguments"), "length"), parameter), ts.createPostfixIncrement(temp, parameter), ts.createBlock([
- ts.startOnNewLine(ts.createStatement(ts.createAssignment(ts.createElementAccess(expressionName, ts.createSubtract(temp, ts.createLiteral(restIndex))), ts.createElementAccess(ts.createIdentifier("arguments"), temp)), parameter))
- ]));
- ts.setEmitFlags(forStatement, 8388608);
- ts.startOnNewLine(forStatement);
- statements.push(forStatement);
- }
- function addCaptureThisForNodeIfNeeded(statements, node) {
- if (node.transformFlags & 16384 && node.kind !== 180) {
- captureThisForNode(statements, node, ts.createThis());
- }
- }
- function captureThisForNode(statements, node, initializer, originalStatement) {
- enableSubstitutionsForCapturedThis();
- var captureThisStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
- ts.createVariableDeclaration("_this", undefined, initializer)
- ]), originalStatement);
- ts.setEmitFlags(captureThisStatement, 49152 | 8388608);
- ts.setSourceMapRange(captureThisStatement, node);
- statements.push(captureThisStatement);
- }
- function addClassMembers(statements, node) {
- for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
- var member = _a[_i];
- switch (member.kind) {
- case 198:
- statements.push(transformSemicolonClassElementToStatement(member));
- break;
- case 147:
- statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member));
- break;
- case 149:
- case 150:
- var accessors = ts.getAllAccessorDeclarations(node.members, member);
- if (member === accessors.firstAccessor) {
- statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors));
- }
- break;
- case 148:
- break;
- default:
- ts.Debug.failBadSyntaxKind(node);
- break;
- }
- }
- }
- function transformSemicolonClassElementToStatement(member) {
- return ts.createEmptyStatement(member);
- }
- function transformClassMethodDeclarationToStatement(receiver, member) {
- var commentRange = ts.getCommentRange(member);
- var sourceMapRange = ts.getSourceMapRange(member);
- var func = transformFunctionLikeToExpression(member, member, undefined);
- ts.setEmitFlags(func, 49152);
- ts.setSourceMapRange(func, sourceMapRange);
- var statement = ts.createStatement(ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(member.name, visitor, ts.isPropertyName), member.name), func), member);
- ts.setOriginalNode(statement, member);
- ts.setCommentRange(statement, commentRange);
- ts.setEmitFlags(statement, 1536);
- return statement;
- }
- function transformAccessorsToStatement(receiver, accessors) {
- var statement = ts.createStatement(transformAccessorsToExpression(receiver, accessors, false), ts.getSourceMapRange(accessors.firstAccessor));
- ts.setEmitFlags(statement, 49152);
- return statement;
- }
- function transformAccessorsToExpression(receiver, _a, startsOnNewLine) {
- var firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor;
- var target = ts.getMutableClone(receiver);
- ts.setEmitFlags(target, 49152 | 1024);
- ts.setSourceMapRange(target, firstAccessor.name);
- var propertyName = ts.createExpressionForPropertyName(ts.visitNode(firstAccessor.name, visitor, ts.isPropertyName));
- ts.setEmitFlags(propertyName, 49152 | 512);
- ts.setSourceMapRange(propertyName, firstAccessor.name);
- var properties = [];
- if (getAccessor) {
- var getterFunction = transformFunctionLikeToExpression(getAccessor, undefined, undefined);
- ts.setSourceMapRange(getterFunction, ts.getSourceMapRange(getAccessor));
- var getter = ts.createPropertyAssignment("get", getterFunction);
- ts.setCommentRange(getter, ts.getCommentRange(getAccessor));
- properties.push(getter);
- }
- if (setAccessor) {
- var setterFunction = transformFunctionLikeToExpression(setAccessor, undefined, undefined);
- ts.setSourceMapRange(setterFunction, ts.getSourceMapRange(setAccessor));
- var setter = ts.createPropertyAssignment("set", setterFunction);
- ts.setCommentRange(setter, ts.getCommentRange(setAccessor));
- properties.push(setter);
- }
- properties.push(ts.createPropertyAssignment("enumerable", ts.createLiteral(true)), ts.createPropertyAssignment("configurable", ts.createLiteral(true)));
- var call = ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [
- target,
- propertyName,
- ts.createObjectLiteral(properties, undefined, true)
+ function transformAsynchronousModule(node, define, moduleName, includeNonAmdDependencies) {
+ var _a = collectAsynchronousDependencies(node, includeNonAmdDependencies), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames;
+ return updateSourceFile(node, [
+ ts.createStatement(ts.createCall(define, undefined, (moduleName ? [moduleName] : []).concat([
+ ts.createArrayLiteral([
+ ts.createLiteral("require"),
+ ts.createLiteral("exports")
+ ].concat(aliasedModuleNames, unaliasedModuleNames)),
+ ts.createFunctionExpression(undefined, undefined, undefined, undefined, [
+ ts.createParameter("require"),
+ ts.createParameter("exports")
+ ].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node))
+ ])))
]);
- if (startsOnNewLine) {
- call.startsOnNewLine = true;
- }
- return call;
}
- function visitArrowFunction(node) {
- if (node.transformFlags & 8192) {
- enableSubstitutionsForCapturedThis();
- }
- var func = transformFunctionLikeToExpression(node, node, undefined);
- ts.setEmitFlags(func, 256);
- return func;
- }
- function visitFunctionExpression(node) {
- return transformFunctionLikeToExpression(node, node, node.name);
- }
- function visitFunctionDeclaration(node) {
- return ts.setOriginalNode(ts.createFunctionDeclaration(undefined, node.modifiers, node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node), node);
- }
- function transformFunctionLikeToExpression(node, location, name) {
- var savedContainingNonArrowFunction = enclosingNonArrowFunction;
- if (node.kind !== 180) {
- enclosingNonArrowFunction = node;
- }
- var expression = ts.setOriginalNode(ts.createFunctionExpression(node.asteriskToken, name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, saveStateAndInvoke(node, transformFunctionBody), location), node);
- enclosingNonArrowFunction = savedContainingNonArrowFunction;
- return expression;
- }
- function transformFunctionBody(node) {
- var multiLine = false;
- var singleLine = false;
- var statementsLocation;
- var closeBraceLocation;
- var statements = [];
- var body = node.body;
- var statementOffset;
+ function transformAsynchronousModuleBody(node) {
startLexicalEnvironment();
- if (ts.isBlock(body)) {
- statementOffset = ts.addPrologueDirectives(statements, body.statements, false, visitor);
- }
- addCaptureThisForNodeIfNeeded(statements, node);
- addDefaultValueAssignmentsIfNeeded(statements, node);
- addRestParameterIfNeeded(statements, node, false);
- if (!multiLine && statements.length > 0) {
- multiLine = true;
- }
- if (ts.isBlock(body)) {
- statementsLocation = body.statements;
- ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, statementOffset));
- if (!multiLine && body.multiLine) {
- multiLine = true;
- }
- }
- else {
- ts.Debug.assert(node.kind === 180);
- statementsLocation = ts.moveRangeEnd(body, -1);
- var equalsGreaterThanToken = node.equalsGreaterThanToken;
- if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) {
- if (ts.rangeEndIsOnSameLineAsRangeStart(equalsGreaterThanToken, body, currentSourceFile)) {
- singleLine = true;
- }
- else {
- multiLine = true;
- }
- }
- var expression = ts.visitNode(body, visitor, ts.isExpression);
- var returnStatement = ts.createReturn(expression, body);
- ts.setEmitFlags(returnStatement, 12288 | 1024 | 32768);
- statements.push(returnStatement);
- closeBraceLocation = body;
- }
- var lexicalEnvironment = endLexicalEnvironment();
- ts.addRange(statements, lexicalEnvironment);
- if (!multiLine && lexicalEnvironment && lexicalEnvironment.length) {
- multiLine = true;
- }
- var block = ts.createBlock(ts.createNodeArray(statements, statementsLocation), node.body, multiLine);
- if (!multiLine && singleLine) {
- ts.setEmitFlags(block, 32);
- }
- if (closeBraceLocation) {
- ts.setTokenSourceMapRange(block, 16, closeBraceLocation);
- }
- ts.setOriginalNode(block, node.body);
- return block;
- }
- function visitExpressionStatement(node) {
- switch (node.expression.kind) {
- case 178:
- return ts.updateStatement(node, visitParenthesizedExpression(node.expression, false));
- case 187:
- return ts.updateStatement(node, visitBinaryExpression(node.expression, false));
- }
- return ts.visitEachChild(node, visitor, context);
- }
- function visitParenthesizedExpression(node, needsDestructuringValue) {
- if (needsDestructuringValue) {
- switch (node.expression.kind) {
- case 178:
- return ts.createParen(visitParenthesizedExpression(node.expression, true), node);
- case 187:
- return ts.createParen(visitBinaryExpression(node.expression, true), node);
- }
- }
- return ts.visitEachChild(node, visitor, context);
- }
- function visitBinaryExpression(node, needsDestructuringValue) {
- ts.Debug.assert(ts.isDestructuringAssignment(node));
- return ts.flattenDestructuringAssignment(context, node, needsDestructuringValue, hoistVariableDeclaration, visitor);
- }
- function visitVariableStatement(node) {
- if (convertedLoopState && (ts.getCombinedNodeFlags(node.declarationList) & 3) == 0) {
- var assignments = void 0;
- for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
- var decl = _a[_i];
- hoistVariableDeclarationDeclaredInConvertedLoop(convertedLoopState, decl);
- if (decl.initializer) {
- var assignment = void 0;
- if (ts.isBindingPattern(decl.name)) {
- assignment = ts.flattenVariableDestructuringToExpression(context, decl, hoistVariableDeclaration, undefined, visitor);
- }
- else {
- assignment = ts.createBinary(decl.name, 56, ts.visitNode(decl.initializer, visitor, ts.isExpression));
- }
- (assignments || (assignments = [])).push(assignment);
- }
- }
- if (assignments) {
- return ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 24, acc); }), node);
- }
- else {
- return undefined;
- }
- }
- return ts.visitEachChild(node, visitor, context);
- }
- function visitVariableDeclarationList(node) {
- if (node.flags & 3) {
- enableSubstitutionsForBlockScopedBindings();
- }
- var declarations = ts.flatten(ts.map(node.declarations, node.flags & 1
- ? visitVariableDeclarationInLetDeclarationList
- : visitVariableDeclaration));
- var declarationList = ts.createVariableDeclarationList(declarations, node);
- ts.setOriginalNode(declarationList, node);
- ts.setCommentRange(declarationList, node);
- if (node.transformFlags & 2097152
- && (ts.isBindingPattern(node.declarations[0].name)
- || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) {
- var firstDeclaration = ts.firstOrUndefined(declarations);
- var lastDeclaration = ts.lastOrUndefined(declarations);
- ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end));
- }
- return declarationList;
- }
- function shouldEmitExplicitInitializerForLetDeclaration(node) {
- var flags = resolver.getNodeCheckFlags(node);
- var isCapturedInFunction = flags & 131072;
- var isDeclaredInLoop = flags & 262144;
- var emittedAsTopLevel = ts.isBlockScopedContainerTopLevel(enclosingBlockScopeContainer)
- || (isCapturedInFunction
- && isDeclaredInLoop
- && ts.isBlock(enclosingBlockScopeContainer)
- && ts.isIterationStatement(enclosingBlockScopeContainerParent, false));
- var emitExplicitInitializer = !emittedAsTopLevel
- && enclosingBlockScopeContainer.kind !== 207
- && enclosingBlockScopeContainer.kind !== 208
- && (!resolver.isDeclarationWithCollidingName(node)
- || (isDeclaredInLoop
- && !isCapturedInFunction
- && !ts.isIterationStatement(enclosingBlockScopeContainer, false)));
- return emitExplicitInitializer;
- }
- function visitVariableDeclarationInLetDeclarationList(node) {
- var name = node.name;
- if (ts.isBindingPattern(name)) {
- return visitVariableDeclaration(node);
- }
- if (!node.initializer && shouldEmitExplicitInitializerForLetDeclaration(node)) {
- var clone_8 = ts.getMutableClone(node);
- clone_8.initializer = ts.createVoidZero();
- return clone_8;
- }
- return ts.visitEachChild(node, visitor, context);
- }
- function visitVariableDeclaration(node) {
- if (ts.isBindingPattern(node.name)) {
- var recordTempVariablesInLine = !enclosingVariableStatement
- || !ts.hasModifier(enclosingVariableStatement, 1);
- return ts.flattenVariableDestructuring(context, node, undefined, visitor, recordTempVariablesInLine ? undefined : hoistVariableDeclaration);
- }
- return ts.visitEachChild(node, visitor, context);
- }
- function visitLabeledStatement(node) {
- if (convertedLoopState) {
- if (!convertedLoopState.labels) {
- convertedLoopState.labels = ts.createMap();
- }
- convertedLoopState.labels[node.label.text] = node.label.text;
- }
- var result;
- if (ts.isIterationStatement(node.statement, false) && shouldConvertIterationStatementBody(node.statement)) {
- result = ts.visitNodes(ts.createNodeArray([node.statement]), visitor, ts.isStatement);
- }
- else {
- result = ts.visitEachChild(node, visitor, context);
- }
- if (convertedLoopState) {
- convertedLoopState.labels[node.label.text] = undefined;
- }
- return result;
- }
- function visitDoStatement(node) {
- return convertIterationStatementBodyIfNecessary(node);
- }
- function visitWhileStatement(node) {
- return convertIterationStatementBodyIfNecessary(node);
- }
- function visitForStatement(node) {
- return convertIterationStatementBodyIfNecessary(node);
- }
- function visitForInStatement(node) {
- return convertIterationStatementBodyIfNecessary(node);
- }
- function visitForOfStatement(node) {
- return convertIterationStatementBodyIfNecessary(node, convertForOfToFor);
- }
- function convertForOfToFor(node, convertedLoopBodyStatements) {
- var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
- var initializer = node.initializer;
var statements = [];
- var counter = ts.createLoopVariable();
- var rhsReference = expression.kind === 69
- ? ts.createUniqueName(expression.text)
- : ts.createTempVariable(undefined);
- if (ts.isVariableDeclarationList(initializer)) {
- if (initializer.flags & 3) {
- enableSubstitutionsForBlockScopedBindings();
- }
- var firstOriginalDeclaration = ts.firstOrUndefined(initializer.declarations);
- if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) {
- var declarations = ts.flattenVariableDestructuring(context, firstOriginalDeclaration, ts.createElementAccess(rhsReference, counter), visitor);
- var declarationList = ts.createVariableDeclarationList(declarations, initializer);
- ts.setOriginalNode(declarationList, initializer);
- var firstDeclaration = declarations[0];
- var lastDeclaration = ts.lastOrUndefined(declarations);
- ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end));
- statements.push(ts.createVariableStatement(undefined, declarationList));
- }
- else {
- statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
- ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(undefined), undefined, ts.createElementAccess(rhsReference, counter))
- ], ts.moveRangePos(initializer, -1)), ts.moveRangeEnd(initializer, -1)));
- }
+ var statementOffset = ts.addPrologueDirectives(statements, node.statements, !compilerOptions.noImplicitUseStrict, visitor);
+ ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset));
+ ts.addRange(statements, endLexicalEnvironment());
+ addExportEqualsIfNeeded(statements, true);
+ var body = ts.createBlock(statements, undefined, true);
+ if (hasExportStarsToExportValues) {
+ ts.setEmitFlags(body, 2);
}
- else {
- var assignment = ts.createAssignment(initializer, ts.createElementAccess(rhsReference, counter));
- if (ts.isDestructuringAssignment(assignment)) {
- statements.push(ts.createStatement(ts.flattenDestructuringAssignment(context, assignment, false, hoistVariableDeclaration, visitor)));
- }
- else {
- assignment.end = initializer.end;
- statements.push(ts.createStatement(assignment, ts.moveRangeEnd(initializer, -1)));
- }
- }
- var bodyLocation;
- var statementsLocation;
- if (convertedLoopBodyStatements) {
- ts.addRange(statements, convertedLoopBodyStatements);
- }
- else {
- var statement = ts.visitNode(node.statement, visitor, ts.isStatement);
- if (ts.isBlock(statement)) {
- ts.addRange(statements, statement.statements);
- bodyLocation = statement;
- statementsLocation = statement.statements;
+ return body;
+ }
+ function addExportEqualsIfNeeded(statements, emitAsReturn) {
+ if (exportEquals) {
+ if (emitAsReturn) {
+ var statement = ts.createReturn(exportEquals.expression, exportEquals);
+ ts.setEmitFlags(statement, 12288 | 49152);
+ statements.push(statement);
}
else {
+ var statement = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), exportEquals.expression), exportEquals);
+ ts.setEmitFlags(statement, 49152);
statements.push(statement);
}
}
- ts.setEmitFlags(expression, 1536 | ts.getEmitFlags(expression));
- var body = ts.createBlock(ts.createNodeArray(statements, statementsLocation), bodyLocation);
- ts.setEmitFlags(body, 1536 | 12288);
- var forStatement = ts.createFor(ts.createVariableDeclarationList([
- ts.createVariableDeclaration(counter, undefined, ts.createLiteral(0), ts.moveRangePos(node.expression, -1)),
- ts.createVariableDeclaration(rhsReference, undefined, expression, node.expression)
- ], node.expression), ts.createLessThan(counter, ts.createPropertyAccess(rhsReference, "length"), node.expression), ts.createPostfixIncrement(counter, node.expression), body, node);
- ts.setEmitFlags(forStatement, 8192);
- return forStatement;
}
- function visitObjectLiteralExpression(node) {
- var properties = node.properties;
- var numProperties = properties.length;
- var numInitialProperties = numProperties;
- for (var i = 0; i < numProperties; i++) {
- var property = properties[i];
- if (property.transformFlags & 4194304
- || property.name.kind === 140) {
- numInitialProperties = i;
- break;
- }
- }
- ts.Debug.assert(numInitialProperties !== numProperties);
- var temp = ts.createTempVariable(hoistVariableDeclaration);
- var expressions = [];
- var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), undefined, node.multiLine), 524288));
- if (node.multiLine) {
- assignment.startsOnNewLine = true;
- }
- expressions.push(assignment);
- addObjectLiteralMembers(expressions, node, temp, numInitialProperties);
- expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp);
- return ts.inlineExpressions(expressions);
- }
- function shouldConvertIterationStatementBody(node) {
- return (resolver.getNodeCheckFlags(node) & 65536) !== 0;
- }
- function hoistVariableDeclarationDeclaredInConvertedLoop(state, node) {
- if (!state.hoistedLocalVariables) {
- state.hoistedLocalVariables = [];
- }
- visit(node.name);
- function visit(node) {
- if (node.kind === 69) {
- state.hoistedLocalVariables.push(node);
- }
- else {
- for (var _i = 0, _a = node.elements; _i < _a.length; _i++) {
- var element = _a[_i];
- if (!ts.isOmittedExpression(element)) {
- visit(element.name);
- }
- }
- }
- }
- }
- function convertIterationStatementBodyIfNecessary(node, convert) {
- if (!shouldConvertIterationStatementBody(node)) {
- var saveAllowedNonLabeledJumps = void 0;
- if (convertedLoopState) {
- saveAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps;
- convertedLoopState.allowedNonLabeledJumps = 2 | 4;
- }
- var result = convert ? convert(node, undefined) : ts.visitEachChild(node, visitor, context);
- if (convertedLoopState) {
- convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps;
- }
- return result;
- }
- var functionName = ts.createUniqueName("_loop");
- var loopInitializer;
+ function visitor(node) {
switch (node.kind) {
- case 206:
- case 207:
- case 208:
- var initializer = node.initializer;
- if (initializer && initializer.kind === 219) {
- loopInitializer = initializer;
- }
- break;
- }
- var loopParameters = [];
- var loopOutParameters = [];
- if (loopInitializer && (ts.getCombinedNodeFlags(loopInitializer) & 3)) {
- for (var _i = 0, _a = loopInitializer.declarations; _i < _a.length; _i++) {
- var decl = _a[_i];
- processLoopVariableDeclaration(decl, loopParameters, loopOutParameters);
- }
- }
- var outerConvertedLoopState = convertedLoopState;
- convertedLoopState = { loopOutParameters: loopOutParameters };
- if (outerConvertedLoopState) {
- if (outerConvertedLoopState.argumentsName) {
- convertedLoopState.argumentsName = outerConvertedLoopState.argumentsName;
- }
- if (outerConvertedLoopState.thisName) {
- convertedLoopState.thisName = outerConvertedLoopState.thisName;
- }
- if (outerConvertedLoopState.hoistedLocalVariables) {
- convertedLoopState.hoistedLocalVariables = outerConvertedLoopState.hoistedLocalVariables;
- }
- }
- var loopBody = ts.visitNode(node.statement, visitor, ts.isStatement);
- var currentState = convertedLoopState;
- convertedLoopState = outerConvertedLoopState;
- if (loopOutParameters.length) {
- var statements_3 = ts.isBlock(loopBody) ? loopBody.statements.slice() : [loopBody];
- copyOutParameters(loopOutParameters, 1, statements_3);
- loopBody = ts.createBlock(statements_3, undefined, true);
- }
- if (!ts.isBlock(loopBody)) {
- loopBody = ts.createBlock([loopBody], undefined, true);
- }
- var isAsyncBlockContainingAwait = enclosingNonArrowFunction
- && (ts.getEmitFlags(enclosingNonArrowFunction) & 2097152) !== 0
- && (node.statement.transformFlags & 4194304) !== 0;
- var loopBodyFlags = 0;
- if (currentState.containsLexicalThis) {
- loopBodyFlags |= 256;
- }
- if (isAsyncBlockContainingAwait) {
- loopBodyFlags |= 2097152;
- }
- var convertedLoopVariable = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
- ts.createVariableDeclaration(functionName, undefined, ts.setEmitFlags(ts.createFunctionExpression(isAsyncBlockContainingAwait ? ts.createToken(37) : undefined, undefined, undefined, loopParameters, undefined, loopBody), loopBodyFlags))
- ]));
- var statements = [convertedLoopVariable];
- var extraVariableDeclarations;
- if (currentState.argumentsName) {
- if (outerConvertedLoopState) {
- outerConvertedLoopState.argumentsName = currentState.argumentsName;
- }
- else {
- (extraVariableDeclarations || (extraVariableDeclarations = [])).push(ts.createVariableDeclaration(currentState.argumentsName, undefined, ts.createIdentifier("arguments")));
- }
- }
- if (currentState.thisName) {
- if (outerConvertedLoopState) {
- outerConvertedLoopState.thisName = currentState.thisName;
- }
- else {
- (extraVariableDeclarations || (extraVariableDeclarations = [])).push(ts.createVariableDeclaration(currentState.thisName, undefined, ts.createIdentifier("this")));
- }
- }
- if (currentState.hoistedLocalVariables) {
- if (outerConvertedLoopState) {
- outerConvertedLoopState.hoistedLocalVariables = currentState.hoistedLocalVariables;
- }
- else {
- if (!extraVariableDeclarations) {
- extraVariableDeclarations = [];
- }
- for (var _b = 0, _c = currentState.hoistedLocalVariables; _b < _c.length; _b++) {
- var identifier = _c[_b];
- extraVariableDeclarations.push(ts.createVariableDeclaration(identifier));
- }
- }
- }
- if (loopOutParameters.length) {
- if (!extraVariableDeclarations) {
- extraVariableDeclarations = [];
- }
- for (var _d = 0, loopOutParameters_1 = loopOutParameters; _d < loopOutParameters_1.length; _d++) {
- var outParam = loopOutParameters_1[_d];
- extraVariableDeclarations.push(ts.createVariableDeclaration(outParam.outParamName));
- }
- }
- if (extraVariableDeclarations) {
- statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList(extraVariableDeclarations)));
- }
- var convertedLoopBodyStatements = generateCallToConvertedLoop(functionName, loopParameters, currentState, isAsyncBlockContainingAwait);
- var loop;
- if (convert) {
- loop = convert(node, convertedLoopBodyStatements);
- }
- else {
- loop = ts.getMutableClone(node);
- loop.statement = undefined;
- loop = ts.visitEachChild(loop, visitor, context);
- loop.statement = ts.createBlock(convertedLoopBodyStatements, undefined, true);
- loop.transformFlags = 0;
- ts.aggregateTransformFlags(loop);
- }
- statements.push(currentParent.kind === 214
- ? ts.createLabel(currentParent.label, loop)
- : loop);
- return statements;
- }
- function copyOutParameter(outParam, copyDirection) {
- var source = copyDirection === 0 ? outParam.outParamName : outParam.originalName;
- var target = copyDirection === 0 ? outParam.originalName : outParam.outParamName;
- return ts.createBinary(target, 56, source);
- }
- function copyOutParameters(outParams, copyDirection, statements) {
- for (var _i = 0, outParams_1 = outParams; _i < outParams_1.length; _i++) {
- var outParam = outParams_1[_i];
- statements.push(ts.createStatement(copyOutParameter(outParam, copyDirection)));
+ case 231:
+ return visitImportDeclaration(node);
+ case 230:
+ return visitImportEqualsDeclaration(node);
+ case 237:
+ return visitExportDeclaration(node);
+ case 236:
+ return visitExportAssignment(node);
+ case 201:
+ return visitVariableStatement(node);
+ case 221:
+ return visitFunctionDeclaration(node);
+ case 222:
+ return visitClassDeclaration(node);
+ case 203:
+ return visitExpressionStatement(node);
+ default:
+ return node;
}
}
- function generateCallToConvertedLoop(loopFunctionExpressionName, parameters, state, isAsyncBlockContainingAwait) {
- var outerConvertedLoopState = convertedLoopState;
+ function visitImportDeclaration(node) {
+ if (!ts.contains(externalImports, node)) {
+ return undefined;
+ }
var statements = [];
- var isSimpleLoop = !(state.nonLocalJumps & ~4) &&
- !state.labeledNonLocalBreaks &&
- !state.labeledNonLocalContinues;
- var call = ts.createCall(loopFunctionExpressionName, undefined, ts.map(parameters, function (p) { return p.name; }));
- var callResult = isAsyncBlockContainingAwait ? ts.createYield(ts.createToken(37), call) : call;
- if (isSimpleLoop) {
- statements.push(ts.createStatement(callResult));
- copyOutParameters(state.loopOutParameters, 0, statements);
- }
- else {
- var loopResultName = ts.createUniqueName("state");
- var stateVariable = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ts.createVariableDeclaration(loopResultName, undefined, callResult)]));
- statements.push(stateVariable);
- copyOutParameters(state.loopOutParameters, 0, statements);
- if (state.nonLocalJumps & 8) {
- var returnStatement = void 0;
- if (outerConvertedLoopState) {
- outerConvertedLoopState.nonLocalJumps |= 8;
- returnStatement = ts.createReturn(loopResultName);
+ var namespaceDeclaration = ts.getNamespaceDeclarationNode(node);
+ if (moduleKind !== ts.ModuleKind.AMD) {
+ if (!node.importClause) {
+ statements.push(ts.createStatement(createRequireCall(node), node));
+ }
+ else {
+ var variables = [];
+ if (namespaceDeclaration && !ts.isDefaultImport(node)) {
+ variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, createRequireCall(node)));
}
else {
- returnStatement = ts.createReturn(ts.createPropertyAccess(loopResultName, "value"));
+ variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), undefined, createRequireCall(node)));
+ if (namespaceDeclaration && ts.isDefaultImport(node)) {
+ variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node)));
+ }
}
- statements.push(ts.createIf(ts.createBinary(ts.createTypeOf(loopResultName), 32, ts.createLiteral("object")), returnStatement));
- }
- if (state.nonLocalJumps & 2) {
- statements.push(ts.createIf(ts.createBinary(loopResultName, 32, ts.createLiteral("break")), ts.createBreak()));
- }
- if (state.labeledNonLocalBreaks || state.labeledNonLocalContinues) {
- var caseClauses = [];
- processLabeledJumps(state.labeledNonLocalBreaks, true, loopResultName, outerConvertedLoopState, caseClauses);
- processLabeledJumps(state.labeledNonLocalContinues, false, loopResultName, outerConvertedLoopState, caseClauses);
- statements.push(ts.createSwitch(loopResultName, ts.createCaseBlock(caseClauses)));
+ statements.push(ts.createVariableStatement(undefined, ts.createConstDeclarationList(variables), node));
}
}
- return statements;
+ else if (namespaceDeclaration && ts.isDefaultImport(node)) {
+ statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
+ ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node), node)
+ ])));
+ }
+ addExportImportAssignments(statements, node);
+ return ts.singleOrMany(statements);
}
- function setLabeledJump(state, isBreak, labelText, labelMarker) {
- if (isBreak) {
- if (!state.labeledNonLocalBreaks) {
- state.labeledNonLocalBreaks = ts.createMap();
- }
- state.labeledNonLocalBreaks[labelText] = labelMarker;
+ function visitImportEqualsDeclaration(node) {
+ if (!ts.contains(externalImports, node)) {
+ return undefined;
}
- else {
- if (!state.labeledNonLocalContinues) {
- state.labeledNonLocalContinues = ts.createMap();
- }
- state.labeledNonLocalContinues[labelText] = labelMarker;
- }
- }
- function processLabeledJumps(table, isBreak, loopResultName, outerLoop, caseClauses) {
- if (!table) {
- return;
- }
- for (var labelText in table) {
- var labelMarker = table[labelText];
- var statements = [];
- if (!outerLoop || (outerLoop.labels && outerLoop.labels[labelText])) {
- var label = ts.createIdentifier(labelText);
- statements.push(isBreak ? ts.createBreak(label) : ts.createContinue(label));
+ ts.setEmitFlags(node.name, 128);
+ var statements = [];
+ if (moduleKind !== ts.ModuleKind.AMD) {
+ if (ts.hasModifier(node, 1)) {
+ statements.push(ts.createStatement(createExportAssignment(node.name, createRequireCall(node)), node));
}
else {
- setLabeledJump(outerLoop, isBreak, labelText, labelMarker);
- statements.push(ts.createReturn(loopResultName));
+ statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
+ ts.createVariableDeclaration(ts.getSynthesizedClone(node.name), undefined, createRequireCall(node))
+ ], undefined, languageVersion >= 2 ? 2 : 0), node));
}
- caseClauses.push(ts.createCaseClause(ts.createLiteral(labelMarker), statements));
+ }
+ else {
+ if (ts.hasModifier(node, 1)) {
+ statements.push(ts.createStatement(createExportAssignment(node.name, node.name), node));
+ }
+ }
+ addExportImportAssignments(statements, node);
+ return statements;
+ }
+ function visitExportDeclaration(node) {
+ if (!ts.contains(externalImports, node)) {
+ return undefined;
+ }
+ var generatedName = ts.getGeneratedNameForNode(node);
+ if (node.exportClause) {
+ var statements = [];
+ if (moduleKind !== ts.ModuleKind.AMD) {
+ statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
+ ts.createVariableDeclaration(generatedName, undefined, createRequireCall(node))
+ ]), node));
+ }
+ for (var _i = 0, _a = node.exportClause.elements; _i < _a.length; _i++) {
+ var specifier = _a[_i];
+ var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name);
+ statements.push(ts.createStatement(createExportAssignment(specifier.name, exportedValue), specifier));
+ }
+ return ts.singleOrMany(statements);
+ }
+ else {
+ return ts.createStatement(ts.createCall(ts.createIdentifier("__export"), undefined, [
+ moduleKind !== ts.ModuleKind.AMD
+ ? createRequireCall(node)
+ : generatedName
+ ]), node);
}
}
- function processLoopVariableDeclaration(decl, loopParameters, loopOutParameters) {
- var name = decl.name;
+ function visitExportAssignment(node) {
+ if (node.isExportEquals) {
+ return undefined;
+ }
+ var statements = [];
+ addExportDefault(statements, node.expression, node);
+ return statements;
+ }
+ function addExportDefault(statements, expression, location) {
+ tryAddExportDefaultCompat(statements);
+ statements.push(ts.createStatement(createExportAssignment(ts.createIdentifier("default"), expression), location));
+ }
+ function tryAddExportDefaultCompat(statements) {
+ var original = ts.getOriginalNode(currentSourceFile);
+ ts.Debug.assert(original.kind === 256);
+ if (!original.symbol.exports["___esModule"]) {
+ if (languageVersion === 0) {
+ statements.push(ts.createStatement(createExportAssignment(ts.createIdentifier("__esModule"), ts.createLiteral(true))));
+ }
+ else {
+ statements.push(ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [
+ ts.createIdentifier("exports"),
+ ts.createLiteral("__esModule"),
+ ts.createObjectLiteral([
+ ts.createPropertyAssignment("value", ts.createLiteral(true))
+ ])
+ ])));
+ }
+ }
+ }
+ function addExportImportAssignments(statements, node) {
+ if (ts.isImportEqualsDeclaration(node)) {
+ addExportMemberAssignments(statements, node.name);
+ }
+ else {
+ var names = ts.reduceEachChild(node, collectExportMembers, []);
+ for (var _i = 0, names_1 = names; _i < names_1.length; _i++) {
+ var name_35 = names_1[_i];
+ addExportMemberAssignments(statements, name_35);
+ }
+ }
+ }
+ function collectExportMembers(names, node) {
+ if (ts.isAliasSymbolDeclaration(node) && ts.isDeclaration(node)) {
+ var name_36 = node.name;
+ if (ts.isIdentifier(name_36)) {
+ names.push(name_36);
+ }
+ }
+ return ts.reduceEachChild(node, collectExportMembers, names);
+ }
+ function addExportMemberAssignments(statements, name) {
+ if (!exportEquals && exportSpecifiers && ts.hasProperty(exportSpecifiers, name.text)) {
+ for (var _i = 0, _a = exportSpecifiers[name.text]; _i < _a.length; _i++) {
+ var specifier = _a[_i];
+ statements.push(ts.startOnNewLine(ts.createStatement(createExportAssignment(specifier.name, name), specifier.name)));
+ }
+ }
+ }
+ function addExportMemberAssignment(statements, node) {
+ if (ts.hasModifier(node, 512)) {
+ addExportDefault(statements, getDeclarationName(node), node);
+ }
+ else {
+ statements.push(createExportStatement(node.name, ts.setEmitFlags(ts.getSynthesizedClone(node.name), 262144), node));
+ }
+ }
+ function visitVariableStatement(node) {
+ var originalKind = ts.getOriginalNode(node).kind;
+ if (originalKind === 226 ||
+ originalKind === 225 ||
+ originalKind === 222) {
+ if (!ts.hasModifier(node, 1)) {
+ return node;
+ }
+ return ts.setOriginalNode(ts.createVariableStatement(undefined, node.declarationList), node);
+ }
+ var resultStatements = [];
+ if (ts.hasModifier(node, 1)) {
+ var variables = ts.getInitializedVariables(node.declarationList);
+ if (variables.length > 0) {
+ var inlineAssignments = ts.createStatement(ts.inlineExpressions(ts.map(variables, transformInitializedVariable)), node);
+ resultStatements.push(inlineAssignments);
+ }
+ }
+ else {
+ resultStatements.push(node);
+ }
+ for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
+ var decl = _a[_i];
+ addExportMemberAssignmentsForBindingName(resultStatements, decl.name);
+ }
+ return resultStatements;
+ }
+ function addExportMemberAssignmentsForBindingName(resultStatements, name) {
if (ts.isBindingPattern(name)) {
for (var _i = 0, _a = name.elements; _i < _a.length; _i++) {
var element = _a[_i];
if (!ts.isOmittedExpression(element)) {
- processLoopVariableDeclaration(element, loopParameters, loopOutParameters);
+ addExportMemberAssignmentsForBindingName(resultStatements, element.name);
}
}
}
else {
- loopParameters.push(ts.createParameter(name));
- if (resolver.getNodeCheckFlags(decl) & 2097152) {
- var outParamName = ts.createUniqueName("out_" + name.text);
- loopOutParameters.push({ originalName: name, outParamName: outParamName });
+ if (!exportEquals && exportSpecifiers && ts.hasProperty(exportSpecifiers, name.text)) {
+ var sourceFileId = ts.getOriginalNodeId(currentSourceFile);
+ if (!bindingNameExportSpecifiersForFileMap[sourceFileId]) {
+ bindingNameExportSpecifiersForFileMap[sourceFileId] = ts.createMap();
+ }
+ bindingNameExportSpecifiersForFileMap[sourceFileId][name.text] = exportSpecifiers[name.text];
+ addExportMemberAssignments(resultStatements, name);
}
}
}
- function addObjectLiteralMembers(expressions, node, receiver, start) {
- var properties = node.properties;
- var numProperties = properties.length;
- for (var i = start; i < numProperties; i++) {
- var property = properties[i];
- switch (property.kind) {
- case 149:
- case 150:
- var accessors = ts.getAllAccessorDeclarations(node.properties, property);
- if (property === accessors.firstAccessor) {
- expressions.push(transformAccessorsToExpression(receiver, accessors, node.multiLine));
- }
- break;
- case 253:
- expressions.push(transformPropertyAssignmentToExpression(node, property, receiver, node.multiLine));
- break;
- case 254:
- expressions.push(transformShorthandPropertyAssignmentToExpression(node, property, receiver, node.multiLine));
- break;
- case 147:
- expressions.push(transformObjectLiteralMethodDeclarationToExpression(node, property, receiver, node.multiLine));
- break;
- default:
- ts.Debug.failBadSyntaxKind(node);
- break;
- }
- }
- }
- function transformPropertyAssignmentToExpression(node, property, receiver, startsOnNewLine) {
- var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression), property);
- if (startsOnNewLine) {
- expression.startsOnNewLine = true;
- }
- return expression;
- }
- function transformShorthandPropertyAssignmentToExpression(node, property, receiver, startsOnNewLine) {
- var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name), property);
- if (startsOnNewLine) {
- expression.startsOnNewLine = true;
- }
- return expression;
- }
- function transformObjectLiteralMethodDeclarationToExpression(node, method, receiver, startsOnNewLine) {
- var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, method, undefined), method);
- if (startsOnNewLine) {
- expression.startsOnNewLine = true;
- }
- return expression;
- }
- function visitMethodDeclaration(node) {
- ts.Debug.assert(!ts.isComputedPropertyName(node.name));
- var functionExpression = transformFunctionLikeToExpression(node, ts.moveRangePos(node, -1), undefined);
- ts.setEmitFlags(functionExpression, 16384 | ts.getEmitFlags(functionExpression));
- return ts.createPropertyAssignment(node.name, functionExpression, node);
- }
- function visitShorthandPropertyAssignment(node) {
- return ts.createPropertyAssignment(node.name, ts.getSynthesizedClone(node.name), node);
- }
- function visitYieldExpression(node) {
- return ts.visitEachChild(node, visitor, context);
- }
- function visitArrayLiteralExpression(node) {
- return transformAndSpreadElements(node.elements, true, node.multiLine, node.elements.hasTrailingComma);
- }
- function visitCallExpression(node) {
- return visitCallExpressionWithPotentialCapturedThisAssignment(node, true);
- }
- function visitImmediateSuperCallInBody(node) {
- return visitCallExpressionWithPotentialCapturedThisAssignment(node, false);
- }
- function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) {
- var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
- if (node.expression.kind === 95) {
- ts.setEmitFlags(thisArg, 128);
- }
- var resultingCall;
- if (node.transformFlags & 262144) {
- resultingCall = ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, false, false, false));
+ function transformInitializedVariable(node) {
+ var name = node.name;
+ if (ts.isBindingPattern(name)) {
+ return ts.flattenVariableDestructuringToExpression(node, hoistVariableDeclaration, getModuleMemberName, visitor);
}
else {
- resultingCall = ts.createFunctionCall(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), node);
- }
- if (node.expression.kind === 95) {
- var actualThis = ts.createThis();
- ts.setEmitFlags(actualThis, 128);
- var initializer = ts.createLogicalOr(resultingCall, actualThis);
- return assignToCapturedThis
- ? ts.createAssignment(ts.createIdentifier("_this"), initializer)
- : initializer;
- }
- return resultingCall;
- }
- function visitNewExpression(node) {
- ts.Debug.assert((node.transformFlags & 262144) !== 0);
- var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
- return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), false, false, false)), undefined, []);
- }
- function transformAndSpreadElements(elements, needsUniqueCopy, multiLine, hasTrailingComma) {
- var numElements = elements.length;
- var segments = ts.flatten(ts.spanMap(elements, partitionSpreadElement, function (partition, visitPartition, start, end) {
- return visitPartition(partition, multiLine, hasTrailingComma && end === numElements);
- }));
- if (segments.length === 1) {
- var firstElement = elements[0];
- return needsUniqueCopy && ts.isSpreadElementExpression(firstElement) && firstElement.expression.kind !== 170
- ? ts.createArraySlice(segments[0])
- : segments[0];
- }
- return ts.createArrayConcat(segments.shift(), segments);
- }
- function partitionSpreadElement(node) {
- return ts.isSpreadElementExpression(node)
- ? visitSpanOfSpreadElements
- : visitSpanOfNonSpreadElements;
- }
- function visitSpanOfSpreadElements(chunk, multiLine, hasTrailingComma) {
- return ts.map(chunk, visitExpressionOfSpreadElement);
- }
- function visitSpanOfNonSpreadElements(chunk, multiLine, hasTrailingComma) {
- return ts.createArrayLiteral(ts.visitNodes(ts.createNodeArray(chunk, undefined, hasTrailingComma), visitor, ts.isExpression), undefined, multiLine);
- }
- function visitExpressionOfSpreadElement(node) {
- return ts.visitNode(node.expression, visitor, ts.isExpression);
- }
- function visitTemplateLiteral(node) {
- return ts.createLiteral(node.text, node);
- }
- function visitTaggedTemplateExpression(node) {
- var tag = ts.visitNode(node.tag, visitor, ts.isExpression);
- var temp = ts.createTempVariable(hoistVariableDeclaration);
- var templateArguments = [temp];
- var cookedStrings = [];
- var rawStrings = [];
- var template = node.template;
- if (ts.isNoSubstitutionTemplateLiteral(template)) {
- cookedStrings.push(ts.createLiteral(template.text));
- rawStrings.push(getRawLiteral(template));
- }
- else {
- cookedStrings.push(ts.createLiteral(template.head.text));
- rawStrings.push(getRawLiteral(template.head));
- for (var _i = 0, _a = template.templateSpans; _i < _a.length; _i++) {
- var templateSpan = _a[_i];
- cookedStrings.push(ts.createLiteral(templateSpan.literal.text));
- rawStrings.push(getRawLiteral(templateSpan.literal));
- templateArguments.push(ts.visitNode(templateSpan.expression, visitor, ts.isExpression));
- }
- }
- return ts.createParen(ts.inlineExpressions([
- ts.createAssignment(temp, ts.createArrayLiteral(cookedStrings)),
- ts.createAssignment(ts.createPropertyAccess(temp, "raw"), ts.createArrayLiteral(rawStrings)),
- ts.createCall(tag, undefined, templateArguments)
- ]));
- }
- function getRawLiteral(node) {
- var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node);
- var isLast = node.kind === 11 || node.kind === 14;
- text = text.substring(1, text.length - (isLast ? 1 : 2));
- text = text.replace(/\r\n?/g, "\n");
- return ts.createLiteral(text, node);
- }
- function visitTemplateExpression(node) {
- var expressions = [];
- addTemplateHead(expressions, node);
- addTemplateSpans(expressions, node);
- var expression = ts.reduceLeft(expressions, ts.createAdd);
- if (ts.nodeIsSynthesized(expression)) {
- ts.setTextRange(expression, node);
- }
- return expression;
- }
- function shouldAddTemplateHead(node) {
- ts.Debug.assert(node.templateSpans.length !== 0);
- return node.head.text.length !== 0 || node.templateSpans[0].literal.text.length === 0;
- }
- function addTemplateHead(expressions, node) {
- if (!shouldAddTemplateHead(node)) {
- return;
- }
- expressions.push(ts.createLiteral(node.head.text));
- }
- function addTemplateSpans(expressions, node) {
- for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) {
- var span_6 = _a[_i];
- expressions.push(ts.visitNode(span_6.expression, visitor, ts.isExpression));
- if (span_6.literal.text.length !== 0) {
- expressions.push(ts.createLiteral(span_6.literal.text));
- }
+ return ts.createAssignment(getModuleMemberName(name), ts.visitNode(node.initializer, visitor, ts.isExpression));
}
}
- function visitSuperKeyword(node) {
- return enclosingNonAsyncFunctionBody
- && ts.isClassElement(enclosingNonAsyncFunctionBody)
- && !ts.hasModifier(enclosingNonAsyncFunctionBody, 32)
- && currentParent.kind !== 174
- ? ts.createPropertyAccess(ts.createIdentifier("_super"), "prototype")
- : ts.createIdentifier("_super");
- }
- function visitSourceFileNode(node) {
- var _a = ts.span(node.statements, ts.isPrologueDirective), prologue = _a[0], remaining = _a[1];
+ function visitFunctionDeclaration(node) {
var statements = [];
- startLexicalEnvironment();
- ts.addRange(statements, prologue);
- addCaptureThisForNodeIfNeeded(statements, node);
- ts.addRange(statements, ts.visitNodes(ts.createNodeArray(remaining), visitor, ts.isStatement));
- ts.addRange(statements, endLexicalEnvironment());
- var clone = ts.getMutableClone(node);
- clone.statements = ts.createNodeArray(statements, node.statements);
- return clone;
+ var name = node.name || ts.getGeneratedNameForNode(node);
+ if (ts.hasModifier(node, 1)) {
+ var isAsync = ts.hasModifier(node, 256);
+ statements.push(ts.setOriginalNode(ts.createFunctionDeclaration(undefined, isAsync ? [ts.createNode(119)] : undefined, node.asteriskToken, name, undefined, node.parameters, undefined, node.body, node), node));
+ addExportMemberAssignment(statements, node);
+ }
+ else {
+ statements.push(node);
+ }
+ if (node.name) {
+ addExportMemberAssignments(statements, node.name);
+ }
+ return ts.singleOrMany(statements);
+ }
+ function visitClassDeclaration(node) {
+ var statements = [];
+ var name = node.name || ts.getGeneratedNameForNode(node);
+ if (ts.hasModifier(node, 1)) {
+ statements.push(ts.setOriginalNode(ts.createClassDeclaration(undefined, undefined, name, undefined, node.heritageClauses, node.members, node), node));
+ addExportMemberAssignment(statements, node);
+ }
+ else {
+ statements.push(node);
+ }
+ if (node.name && !(node.decorators && node.decorators.length)) {
+ addExportMemberAssignments(statements, node.name);
+ }
+ return ts.singleOrMany(statements);
+ }
+ function visitExpressionStatement(node) {
+ var original = ts.getOriginalNode(node);
+ var origKind = original.kind;
+ if (origKind === 225 || origKind === 226) {
+ return visitExpressionStatementForEnumOrNamespaceDeclaration(node, original);
+ }
+ else if (origKind === 222) {
+ var classDecl = original;
+ if (classDecl.name) {
+ var statements = [node];
+ addExportMemberAssignments(statements, classDecl.name);
+ return statements;
+ }
+ }
+ return node;
+ }
+ function visitExpressionStatementForEnumOrNamespaceDeclaration(node, original) {
+ var statements = [node];
+ if (ts.hasModifier(original, 1) &&
+ original.kind === 225 &&
+ ts.isFirstDeclarationOfKind(original, 225)) {
+ addVarForExportedEnumOrNamespaceDeclaration(statements, original);
+ }
+ addExportMemberAssignments(statements, original.name);
+ return statements;
+ }
+ function addVarForExportedEnumOrNamespaceDeclaration(statements, node) {
+ var transformedStatement = ts.createVariableStatement(undefined, [ts.createVariableDeclaration(getDeclarationName(node), undefined, ts.createPropertyAccess(ts.createIdentifier("exports"), getDeclarationName(node)))], node);
+ ts.setEmitFlags(transformedStatement, 49152);
+ statements.push(transformedStatement);
+ }
+ function getDeclarationName(node) {
+ return node.name ? ts.getSynthesizedClone(node.name) : ts.getGeneratedNameForNode(node);
}
function onEmitNode(emitContext, node, emitCallback) {
- var savedEnclosingFunction = enclosingFunction;
- if (enabledSubstitutions & 1 && ts.isFunctionLike(node)) {
- enclosingFunction = node;
+ if (node.kind === 256) {
+ bindingNameExportSpecifiersMap = bindingNameExportSpecifiersForFileMap[ts.getOriginalNodeId(node)];
+ previousOnEmitNode(emitContext, node, emitCallback);
+ bindingNameExportSpecifiersMap = undefined;
}
- previousOnEmitNode(emitContext, node, emitCallback);
- enclosingFunction = savedEnclosingFunction;
- }
- function enableSubstitutionsForBlockScopedBindings() {
- if ((enabledSubstitutions & 2) === 0) {
- enabledSubstitutions |= 2;
- context.enableSubstitution(69);
- }
- }
- function enableSubstitutionsForCapturedThis() {
- if ((enabledSubstitutions & 1) === 0) {
- enabledSubstitutions |= 1;
- context.enableSubstitution(97);
- context.enableEmitNotification(148);
- context.enableEmitNotification(147);
- context.enableEmitNotification(149);
- context.enableEmitNotification(150);
- context.enableEmitNotification(180);
- context.enableEmitNotification(179);
- context.enableEmitNotification(220);
+ else {
+ previousOnEmitNode(emitContext, node, emitCallback);
}
}
function onSubstituteNode(emitContext, node) {
@@ -41913,122 +42623,981 @@ var ts;
if (emitContext === 1) {
return substituteExpression(node);
}
- if (ts.isIdentifier(node)) {
- return substituteIdentifier(node);
+ else if (ts.isShorthandPropertyAssignment(node)) {
+ return substituteShorthandPropertyAssignment(node);
}
return node;
}
- function substituteIdentifier(node) {
- if (enabledSubstitutions & 2) {
- var original = ts.getParseTreeNode(node, ts.isIdentifier);
- if (original && isNameOfDeclarationWithCollidingName(original)) {
- return ts.getGeneratedNameForNode(original);
+ function substituteShorthandPropertyAssignment(node) {
+ var name = node.name;
+ var exportedOrImportedName = substituteExpressionIdentifier(name);
+ if (exportedOrImportedName !== name) {
+ if (node.objectAssignmentInitializer) {
+ var initializer = ts.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer);
+ return ts.createPropertyAssignment(name, initializer, node);
}
+ return ts.createPropertyAssignment(name, exportedOrImportedName, node);
}
return node;
}
- function isNameOfDeclarationWithCollidingName(node) {
- var parent = node.parent;
- switch (parent.kind) {
- case 169:
- case 221:
- case 224:
- case 218:
- return parent.name === node
- && resolver.isDeclarationWithCollidingName(parent);
- }
- return false;
- }
function substituteExpression(node) {
switch (node.kind) {
- case 69:
+ case 70:
return substituteExpressionIdentifier(node);
- case 97:
- return substituteThisKeyword(node);
+ case 188:
+ return substituteBinaryExpression(node);
+ case 187:
+ case 186:
+ return substituteUnaryExpression(node);
}
return node;
}
function substituteExpressionIdentifier(node) {
- if (enabledSubstitutions & 2) {
- var declaration = resolver.getReferencedDeclarationWithCollidingName(node);
+ return trySubstituteExportedName(node)
+ || trySubstituteImportedName(node)
+ || node;
+ }
+ function substituteBinaryExpression(node) {
+ var left = node.left;
+ if (ts.isIdentifier(left) && ts.isAssignmentOperator(node.operatorToken.kind)) {
+ if (bindingNameExportSpecifiersMap && ts.hasProperty(bindingNameExportSpecifiersMap, left.text)) {
+ ts.setEmitFlags(node, 128);
+ var nestedExportAssignment = void 0;
+ for (var _i = 0, _a = bindingNameExportSpecifiersMap[left.text]; _i < _a.length; _i++) {
+ var specifier = _a[_i];
+ nestedExportAssignment = nestedExportAssignment ?
+ createExportAssignment(specifier.name, nestedExportAssignment) :
+ createExportAssignment(specifier.name, node);
+ }
+ return nestedExportAssignment;
+ }
+ }
+ return node;
+ }
+ function substituteUnaryExpression(node) {
+ var operator = node.operator;
+ var operand = node.operand;
+ if (ts.isIdentifier(operand) && bindingNameExportSpecifiersForFileMap) {
+ if (bindingNameExportSpecifiersMap && ts.hasProperty(bindingNameExportSpecifiersMap, operand.text)) {
+ ts.setEmitFlags(node, 128);
+ var transformedUnaryExpression = void 0;
+ if (node.kind === 187) {
+ transformedUnaryExpression = ts.createBinary(operand, ts.createToken(operator === 42 ? 58 : 59), ts.createLiteral(1), node);
+ ts.setEmitFlags(transformedUnaryExpression, 128);
+ }
+ var nestedExportAssignment = void 0;
+ for (var _i = 0, _a = bindingNameExportSpecifiersMap[operand.text]; _i < _a.length; _i++) {
+ var specifier = _a[_i];
+ nestedExportAssignment = nestedExportAssignment ?
+ createExportAssignment(specifier.name, nestedExportAssignment) :
+ createExportAssignment(specifier.name, transformedUnaryExpression || node);
+ }
+ return nestedExportAssignment;
+ }
+ }
+ return node;
+ }
+ function trySubstituteExportedName(node) {
+ var emitFlags = ts.getEmitFlags(node);
+ if ((emitFlags & 262144) === 0) {
+ var container = resolver.getReferencedExportContainer(node, (emitFlags & 131072) !== 0);
+ if (container) {
+ if (container.kind === 256) {
+ return ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node), node);
+ }
+ }
+ }
+ return undefined;
+ }
+ function trySubstituteImportedName(node) {
+ if ((ts.getEmitFlags(node) & 262144) === 0) {
+ var declaration = resolver.getReferencedImportDeclaration(node);
if (declaration) {
- return ts.getGeneratedNameForNode(declaration.name);
+ if (ts.isImportClause(declaration)) {
+ return ts.createPropertyAccess(ts.getGeneratedNameForNode(declaration.parent), ts.createIdentifier("default"), node);
+ }
+ else if (ts.isImportSpecifier(declaration)) {
+ var name_37 = declaration.propertyName || declaration.name;
+ return ts.createPropertyAccess(ts.getGeneratedNameForNode(declaration.parent.parent.parent), ts.getSynthesizedClone(name_37), node);
+ }
+ }
+ }
+ return undefined;
+ }
+ function getModuleMemberName(name) {
+ return ts.createPropertyAccess(ts.createIdentifier("exports"), name, name);
+ }
+ function createRequireCall(importNode) {
+ var moduleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions);
+ var args = [];
+ if (ts.isDefined(moduleName)) {
+ args.push(moduleName);
+ }
+ return ts.createCall(ts.createIdentifier("require"), undefined, args);
+ }
+ function createExportStatement(name, value, location) {
+ var statement = ts.createStatement(createExportAssignment(name, value));
+ statement.startsOnNewLine = true;
+ if (location) {
+ ts.setSourceMapRange(statement, location);
+ }
+ return statement;
+ }
+ function createExportAssignment(name, value) {
+ return ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value);
+ }
+ function collectAsynchronousDependencies(node, includeNonAmdDependencies) {
+ var aliasedModuleNames = [];
+ var unaliasedModuleNames = [];
+ var importAliasNames = [];
+ for (var _i = 0, _a = node.amdDependencies; _i < _a.length; _i++) {
+ var amdDependency = _a[_i];
+ if (amdDependency.name) {
+ aliasedModuleNames.push(ts.createLiteral(amdDependency.path));
+ importAliasNames.push(ts.createParameter(amdDependency.name));
+ }
+ else {
+ unaliasedModuleNames.push(ts.createLiteral(amdDependency.path));
+ }
+ }
+ for (var _b = 0, externalImports_1 = externalImports; _b < externalImports_1.length; _b++) {
+ var importNode = externalImports_1[_b];
+ var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions);
+ var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile);
+ if (includeNonAmdDependencies && importAliasName) {
+ ts.setEmitFlags(importAliasName, 128);
+ aliasedModuleNames.push(externalModuleName);
+ importAliasNames.push(ts.createParameter(importAliasName));
+ }
+ else {
+ unaliasedModuleNames.push(externalModuleName);
+ }
+ }
+ return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames };
+ }
+ function updateSourceFile(node, statements) {
+ var updated = ts.getMutableClone(node);
+ updated.statements = ts.createNodeArray(statements, node.statements);
+ return updated;
+ }
+ var _a;
+ }
+ ts.transformModule = transformModule;
+})(ts || (ts = {}));
+var ts;
+(function (ts) {
+ function transformSystemModule(context) {
+ var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration, hoistFunctionDeclaration = context.hoistFunctionDeclaration;
+ var compilerOptions = context.getCompilerOptions();
+ var resolver = context.getEmitResolver();
+ var host = context.getEmitHost();
+ var previousOnSubstituteNode = context.onSubstituteNode;
+ var previousOnEmitNode = context.onEmitNode;
+ context.onSubstituteNode = onSubstituteNode;
+ context.onEmitNode = onEmitNode;
+ context.enableSubstitution(70);
+ context.enableSubstitution(188);
+ context.enableSubstitution(186);
+ context.enableSubstitution(187);
+ context.enableEmitNotification(256);
+ var exportFunctionForFileMap = [];
+ var currentSourceFile;
+ var externalImports;
+ var exportSpecifiers;
+ var exportEquals;
+ var hasExportStarsToExportValues;
+ var exportFunctionForFile;
+ var contextObjectForFile;
+ var exportedLocalNames;
+ var exportedFunctionDeclarations;
+ var enclosingBlockScopedContainer;
+ var currentParent;
+ var currentNode;
+ return transformSourceFile;
+ function transformSourceFile(node) {
+ if (ts.isDeclarationFile(node)) {
+ return node;
+ }
+ if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
+ currentSourceFile = node;
+ currentNode = node;
+ var updated = transformSystemModuleWorker(node);
+ ts.aggregateTransformFlags(updated);
+ currentSourceFile = undefined;
+ externalImports = undefined;
+ exportSpecifiers = undefined;
+ exportEquals = undefined;
+ hasExportStarsToExportValues = false;
+ exportFunctionForFile = undefined;
+ contextObjectForFile = undefined;
+ exportedLocalNames = undefined;
+ exportedFunctionDeclarations = undefined;
+ return updated;
+ }
+ return node;
+ }
+ function transformSystemModuleWorker(node) {
+ ts.Debug.assert(!exportFunctionForFile);
+ (_a = ts.collectExternalModuleInfo(node), externalImports = _a.externalImports, exportSpecifiers = _a.exportSpecifiers, exportEquals = _a.exportEquals, hasExportStarsToExportValues = _a.hasExportStarsToExportValues, _a);
+ exportFunctionForFile = ts.createUniqueName("exports");
+ contextObjectForFile = ts.createUniqueName("context");
+ exportFunctionForFileMap[ts.getOriginalNodeId(node)] = exportFunctionForFile;
+ var dependencyGroups = collectDependencyGroups(externalImports);
+ var statements = [];
+ addSystemModuleBody(statements, node, dependencyGroups);
+ var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions);
+ var dependencies = ts.createArrayLiteral(ts.map(dependencyGroups, getNameOfDependencyGroup));
+ var body = ts.createFunctionExpression(undefined, undefined, undefined, undefined, [
+ ts.createParameter(exportFunctionForFile),
+ ts.createParameter(contextObjectForFile)
+ ], undefined, ts.setEmitFlags(ts.createBlock(statements, undefined, true), 1));
+ return updateSourceFile(node, [
+ ts.createStatement(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("System"), "register"), undefined, moduleName
+ ? [moduleName, dependencies, body]
+ : [dependencies, body]))
+ ], ~1 & ts.getEmitFlags(node));
+ var _a;
+ }
+ function addSystemModuleBody(statements, node, dependencyGroups) {
+ startLexicalEnvironment();
+ var statementOffset = ts.addPrologueDirectives(statements, node.statements, !compilerOptions.noImplicitUseStrict, visitSourceElement);
+ statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
+ ts.createVariableDeclaration("__moduleName", undefined, ts.createLogicalAnd(contextObjectForFile, ts.createPropertyAccess(contextObjectForFile, "id")))
+ ])));
+ var executeStatements = ts.visitNodes(node.statements, visitSourceElement, ts.isStatement, statementOffset);
+ ts.addRange(statements, endLexicalEnvironment());
+ ts.addRange(statements, exportedFunctionDeclarations);
+ var exportStarFunction = addExportStarIfNeeded(statements);
+ statements.push(ts.createReturn(ts.setMultiLine(ts.createObjectLiteral([
+ ts.createPropertyAssignment("setters", generateSetters(exportStarFunction, dependencyGroups)),
+ ts.createPropertyAssignment("execute", ts.createFunctionExpression(undefined, undefined, undefined, undefined, [], undefined, ts.createBlock(executeStatements, undefined, true)))
+ ]), true)));
+ }
+ function addExportStarIfNeeded(statements) {
+ if (!hasExportStarsToExportValues) {
+ return;
+ }
+ if (!exportedLocalNames && ts.isEmpty(exportSpecifiers)) {
+ var hasExportDeclarationWithExportClause = false;
+ for (var _i = 0, externalImports_2 = externalImports; _i < externalImports_2.length; _i++) {
+ var externalImport = externalImports_2[_i];
+ if (externalImport.kind === 237 && externalImport.exportClause) {
+ hasExportDeclarationWithExportClause = true;
+ break;
+ }
+ }
+ if (!hasExportDeclarationWithExportClause) {
+ return addExportStarFunction(statements, undefined);
+ }
+ }
+ var exportedNames = [];
+ if (exportedLocalNames) {
+ for (var _a = 0, exportedLocalNames_1 = exportedLocalNames; _a < exportedLocalNames_1.length; _a++) {
+ var exportedLocalName = exportedLocalNames_1[_a];
+ exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(exportedLocalName.text), ts.createLiteral(true)));
+ }
+ }
+ for (var _b = 0, externalImports_3 = externalImports; _b < externalImports_3.length; _b++) {
+ var externalImport = externalImports_3[_b];
+ if (externalImport.kind !== 237) {
+ continue;
+ }
+ var exportDecl = externalImport;
+ if (!exportDecl.exportClause) {
+ continue;
+ }
+ for (var _c = 0, _d = exportDecl.exportClause.elements; _c < _d.length; _c++) {
+ var element = _d[_c];
+ exportedNames.push(ts.createPropertyAssignment(ts.createLiteral((element.name || element.propertyName).text), ts.createLiteral(true)));
+ }
+ }
+ var exportedNamesStorageRef = ts.createUniqueName("exportedNames");
+ statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
+ ts.createVariableDeclaration(exportedNamesStorageRef, undefined, ts.createObjectLiteral(exportedNames, undefined, true))
+ ])));
+ return addExportStarFunction(statements, exportedNamesStorageRef);
+ }
+ function generateSetters(exportStarFunction, dependencyGroups) {
+ var setters = [];
+ for (var _i = 0, dependencyGroups_1 = dependencyGroups; _i < dependencyGroups_1.length; _i++) {
+ var group = dependencyGroups_1[_i];
+ var localName = ts.forEach(group.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); });
+ var parameterName = localName ? ts.getGeneratedNameForNode(localName) : ts.createUniqueName("");
+ var statements = [];
+ for (var _a = 0, _b = group.externalImports; _a < _b.length; _a++) {
+ var entry = _b[_a];
+ var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile);
+ switch (entry.kind) {
+ case 231:
+ if (!entry.importClause) {
+ break;
+ }
+ case 230:
+ ts.Debug.assert(importVariableName !== undefined);
+ statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName)));
+ break;
+ case 237:
+ ts.Debug.assert(importVariableName !== undefined);
+ if (entry.exportClause) {
+ var properties = [];
+ for (var _c = 0, _d = entry.exportClause.elements; _c < _d.length; _c++) {
+ var e = _d[_c];
+ properties.push(ts.createPropertyAssignment(ts.createLiteral(e.name.text), ts.createElementAccess(parameterName, ts.createLiteral((e.propertyName || e.name).text))));
+ }
+ statements.push(ts.createStatement(ts.createCall(exportFunctionForFile, undefined, [ts.createObjectLiteral(properties, undefined, true)])));
+ }
+ else {
+ statements.push(ts.createStatement(ts.createCall(exportStarFunction, undefined, [parameterName])));
+ }
+ break;
+ }
+ }
+ setters.push(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, ts.createBlock(statements, undefined, true)));
+ }
+ return ts.createArrayLiteral(setters, undefined, true);
+ }
+ function visitSourceElement(node) {
+ switch (node.kind) {
+ case 231:
+ return visitImportDeclaration(node);
+ case 230:
+ return visitImportEqualsDeclaration(node);
+ case 237:
+ return visitExportDeclaration(node);
+ case 236:
+ return visitExportAssignment(node);
+ default:
+ return visitNestedNode(node);
+ }
+ }
+ function visitNestedNode(node) {
+ var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;
+ var savedCurrentParent = currentParent;
+ var savedCurrentNode = currentNode;
+ var currentGrandparent = currentParent;
+ currentParent = currentNode;
+ currentNode = node;
+ if (currentParent && ts.isBlockScope(currentParent, currentGrandparent)) {
+ enclosingBlockScopedContainer = currentParent;
+ }
+ var result = visitNestedNodeWorker(node);
+ enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;
+ currentParent = savedCurrentParent;
+ currentNode = savedCurrentNode;
+ return result;
+ }
+ function visitNestedNodeWorker(node) {
+ switch (node.kind) {
+ case 201:
+ return visitVariableStatement(node);
+ case 221:
+ return visitFunctionDeclaration(node);
+ case 222:
+ return visitClassDeclaration(node);
+ case 207:
+ return visitForStatement(node);
+ case 208:
+ return visitForInStatement(node);
+ case 209:
+ return visitForOfStatement(node);
+ case 205:
+ return visitDoStatement(node);
+ case 206:
+ return visitWhileStatement(node);
+ case 215:
+ return visitLabeledStatement(node);
+ case 213:
+ return visitWithStatement(node);
+ case 214:
+ return visitSwitchStatement(node);
+ case 228:
+ return visitCaseBlock(node);
+ case 249:
+ return visitCaseClause(node);
+ case 250:
+ return visitDefaultClause(node);
+ case 217:
+ return visitTryStatement(node);
+ case 252:
+ return visitCatchClause(node);
+ case 200:
+ return visitBlock(node);
+ case 203:
+ return visitExpressionStatement(node);
+ default:
+ return node;
+ }
+ }
+ function visitImportDeclaration(node) {
+ if (node.importClause && ts.contains(externalImports, node)) {
+ hoistVariableDeclaration(ts.getLocalNameForExternalImport(node, currentSourceFile));
+ }
+ return undefined;
+ }
+ function visitImportEqualsDeclaration(node) {
+ if (ts.contains(externalImports, node)) {
+ hoistVariableDeclaration(ts.getLocalNameForExternalImport(node, currentSourceFile));
+ }
+ return undefined;
+ }
+ function visitExportDeclaration(node) {
+ if (!node.moduleSpecifier) {
+ var statements = [];
+ ts.addRange(statements, ts.map(node.exportClause.elements, visitExportSpecifier));
+ return statements;
+ }
+ return undefined;
+ }
+ function visitExportSpecifier(specifier) {
+ recordExportName(specifier.name);
+ return createExportStatement(specifier.name, specifier.propertyName || specifier.name);
+ }
+ function visitExportAssignment(node) {
+ if (node.isExportEquals) {
+ return undefined;
+ }
+ return createExportStatement(ts.createLiteral("default"), node.expression);
+ }
+ function visitVariableStatement(node) {
+ var shouldHoist = ((ts.getCombinedNodeFlags(ts.getOriginalNode(node.declarationList)) & 3) == 0) ||
+ enclosingBlockScopedContainer.kind === 256;
+ if (!shouldHoist) {
+ return node;
+ }
+ var isExported = ts.hasModifier(node, 1);
+ var expressions = [];
+ for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
+ var variable = _a[_i];
+ var visited = transformVariable(variable, isExported);
+ if (visited) {
+ expressions.push(visited);
+ }
+ }
+ if (expressions.length) {
+ return ts.createStatement(ts.inlineExpressions(expressions), node);
+ }
+ return undefined;
+ }
+ function transformVariable(node, isExported) {
+ hoistBindingElement(node, isExported);
+ if (!node.initializer) {
+ return;
+ }
+ var name = node.name;
+ if (ts.isIdentifier(name)) {
+ return ts.createAssignment(name, node.initializer);
+ }
+ else {
+ return ts.flattenVariableDestructuringToExpression(node, hoistVariableDeclaration);
+ }
+ }
+ function visitFunctionDeclaration(node) {
+ if (ts.hasModifier(node, 1)) {
+ var name_38 = node.name || ts.getGeneratedNameForNode(node);
+ var isAsync = ts.hasModifier(node, 256);
+ var newNode = ts.createFunctionDeclaration(undefined, isAsync ? [ts.createNode(119)] : undefined, node.asteriskToken, name_38, undefined, node.parameters, undefined, node.body, node);
+ recordExportedFunctionDeclaration(node);
+ if (!ts.hasModifier(node, 512)) {
+ recordExportName(name_38);
+ }
+ ts.setOriginalNode(newNode, node);
+ node = newNode;
+ }
+ hoistFunctionDeclaration(node);
+ return undefined;
+ }
+ function visitExpressionStatement(node) {
+ var originalNode = ts.getOriginalNode(node);
+ if ((originalNode.kind === 226 || originalNode.kind === 225) && ts.hasModifier(originalNode, 1)) {
+ var name_39 = getDeclarationName(originalNode);
+ if (originalNode.kind === 225) {
+ hoistVariableDeclaration(name_39);
+ }
+ return [
+ node,
+ createExportStatement(name_39, name_39)
+ ];
+ }
+ return node;
+ }
+ function visitClassDeclaration(node) {
+ var name = getDeclarationName(node);
+ hoistVariableDeclaration(name);
+ var statements = [];
+ statements.push(ts.createStatement(ts.createAssignment(name, ts.createClassExpression(undefined, node.name, undefined, node.heritageClauses, node.members, node)), node));
+ if (ts.hasModifier(node, 1)) {
+ if (!ts.hasModifier(node, 512)) {
+ recordExportName(name);
+ }
+ statements.push(createDeclarationExport(node));
+ }
+ return statements;
+ }
+ function shouldHoistLoopInitializer(node) {
+ return ts.isVariableDeclarationList(node) && (ts.getCombinedNodeFlags(node) & 3) === 0;
+ }
+ function visitForStatement(node) {
+ var initializer = node.initializer;
+ if (shouldHoistLoopInitializer(initializer)) {
+ var expressions = [];
+ for (var _i = 0, _a = initializer.declarations; _i < _a.length; _i++) {
+ var variable = _a[_i];
+ var visited = transformVariable(variable, false);
+ if (visited) {
+ expressions.push(visited);
+ }
+ }
+ ;
+ return ts.createFor(expressions.length
+ ? ts.inlineExpressions(expressions)
+ : ts.createSynthesizedNode(194), node.condition, node.incrementor, ts.visitNode(node.statement, visitNestedNode, ts.isStatement), node);
+ }
+ else {
+ return ts.visitEachChild(node, visitNestedNode, context);
+ }
+ }
+ function transformForBinding(node) {
+ var firstDeclaration = ts.firstOrUndefined(node.declarations);
+ hoistBindingElement(firstDeclaration, false);
+ var name = firstDeclaration.name;
+ return ts.isIdentifier(name)
+ ? name
+ : ts.flattenVariableDestructuringToExpression(firstDeclaration, hoistVariableDeclaration);
+ }
+ function visitForInStatement(node) {
+ var initializer = node.initializer;
+ if (shouldHoistLoopInitializer(initializer)) {
+ var updated = ts.getMutableClone(node);
+ updated.initializer = transformForBinding(initializer);
+ updated.statement = ts.visitNode(node.statement, visitNestedNode, ts.isStatement, false, ts.liftToBlock);
+ return updated;
+ }
+ else {
+ return ts.visitEachChild(node, visitNestedNode, context);
+ }
+ }
+ function visitForOfStatement(node) {
+ var initializer = node.initializer;
+ if (shouldHoistLoopInitializer(initializer)) {
+ var updated = ts.getMutableClone(node);
+ updated.initializer = transformForBinding(initializer);
+ updated.statement = ts.visitNode(node.statement, visitNestedNode, ts.isStatement, false, ts.liftToBlock);
+ return updated;
+ }
+ else {
+ return ts.visitEachChild(node, visitNestedNode, context);
+ }
+ }
+ function visitDoStatement(node) {
+ var statement = ts.visitNode(node.statement, visitNestedNode, ts.isStatement, false, ts.liftToBlock);
+ if (statement !== node.statement) {
+ var updated = ts.getMutableClone(node);
+ updated.statement = statement;
+ return updated;
+ }
+ return node;
+ }
+ function visitWhileStatement(node) {
+ var statement = ts.visitNode(node.statement, visitNestedNode, ts.isStatement, false, ts.liftToBlock);
+ if (statement !== node.statement) {
+ var updated = ts.getMutableClone(node);
+ updated.statement = statement;
+ return updated;
+ }
+ return node;
+ }
+ function visitLabeledStatement(node) {
+ var statement = ts.visitNode(node.statement, visitNestedNode, ts.isStatement, false, ts.liftToBlock);
+ if (statement !== node.statement) {
+ var updated = ts.getMutableClone(node);
+ updated.statement = statement;
+ return updated;
+ }
+ return node;
+ }
+ function visitWithStatement(node) {
+ var statement = ts.visitNode(node.statement, visitNestedNode, ts.isStatement, false, ts.liftToBlock);
+ if (statement !== node.statement) {
+ var updated = ts.getMutableClone(node);
+ updated.statement = statement;
+ return updated;
+ }
+ return node;
+ }
+ function visitSwitchStatement(node) {
+ var caseBlock = ts.visitNode(node.caseBlock, visitNestedNode, ts.isCaseBlock);
+ if (caseBlock !== node.caseBlock) {
+ var updated = ts.getMutableClone(node);
+ updated.caseBlock = caseBlock;
+ return updated;
+ }
+ return node;
+ }
+ function visitCaseBlock(node) {
+ var clauses = ts.visitNodes(node.clauses, visitNestedNode, ts.isCaseOrDefaultClause);
+ if (clauses !== node.clauses) {
+ var updated = ts.getMutableClone(node);
+ updated.clauses = clauses;
+ return updated;
+ }
+ return node;
+ }
+ function visitCaseClause(node) {
+ var statements = ts.visitNodes(node.statements, visitNestedNode, ts.isStatement);
+ if (statements !== node.statements) {
+ var updated = ts.getMutableClone(node);
+ updated.statements = statements;
+ return updated;
+ }
+ return node;
+ }
+ function visitDefaultClause(node) {
+ return ts.visitEachChild(node, visitNestedNode, context);
+ }
+ function visitTryStatement(node) {
+ return ts.visitEachChild(node, visitNestedNode, context);
+ }
+ function visitCatchClause(node) {
+ var block = ts.visitNode(node.block, visitNestedNode, ts.isBlock);
+ if (block !== node.block) {
+ var updated = ts.getMutableClone(node);
+ updated.block = block;
+ return updated;
+ }
+ return node;
+ }
+ function visitBlock(node) {
+ return ts.visitEachChild(node, visitNestedNode, context);
+ }
+ function onEmitNode(emitContext, node, emitCallback) {
+ if (node.kind === 256) {
+ exportFunctionForFile = exportFunctionForFileMap[ts.getOriginalNodeId(node)];
+ previousOnEmitNode(emitContext, node, emitCallback);
+ exportFunctionForFile = undefined;
+ }
+ else {
+ previousOnEmitNode(emitContext, node, emitCallback);
+ }
+ }
+ function onSubstituteNode(emitContext, node) {
+ node = previousOnSubstituteNode(emitContext, node);
+ if (emitContext === 1) {
+ return substituteExpression(node);
+ }
+ return node;
+ }
+ function substituteExpression(node) {
+ switch (node.kind) {
+ case 70:
+ return substituteExpressionIdentifier(node);
+ case 188:
+ return substituteBinaryExpression(node);
+ case 186:
+ case 187:
+ return substituteUnaryExpression(node);
+ }
+ return node;
+ }
+ function substituteExpressionIdentifier(node) {
+ var importDeclaration = resolver.getReferencedImportDeclaration(node);
+ if (importDeclaration) {
+ var importBinding = createImportBinding(importDeclaration);
+ if (importBinding) {
+ return importBinding;
}
}
return node;
}
- function substituteThisKeyword(node) {
- if (enabledSubstitutions & 1
- && enclosingFunction
- && ts.getEmitFlags(enclosingFunction) & 256) {
- return ts.createIdentifier("_this", node);
+ function substituteBinaryExpression(node) {
+ if (ts.isAssignmentOperator(node.operatorToken.kind)) {
+ return substituteAssignmentExpression(node);
}
return node;
}
- function getLocalName(node, allowComments, allowSourceMaps) {
- return getDeclarationName(node, allowComments, allowSourceMaps, 262144);
+ function substituteAssignmentExpression(node) {
+ ts.setEmitFlags(node, 128);
+ var left = node.left;
+ switch (left.kind) {
+ case 70:
+ var exportDeclaration = resolver.getReferencedExportContainer(left);
+ if (exportDeclaration) {
+ return createExportExpression(left, node);
+ }
+ break;
+ case 172:
+ case 171:
+ if (hasExportedReferenceInDestructuringPattern(left)) {
+ return substituteDestructuring(node);
+ }
+ break;
+ }
+ return node;
}
- function getDeclarationName(node, allowComments, allowSourceMaps, emitFlags) {
- if (node.name && !ts.isGeneratedIdentifier(node.name)) {
- var name_39 = ts.getMutableClone(node.name);
- emitFlags |= ts.getEmitFlags(node.name);
- if (!allowSourceMaps) {
- emitFlags |= 1536;
- }
- if (!allowComments) {
- emitFlags |= 49152;
- }
- if (emitFlags) {
- ts.setEmitFlags(name_39, emitFlags);
- }
- return name_39;
- }
- return ts.getGeneratedNameForNode(node);
+ function isExportedBinding(name) {
+ var container = resolver.getReferencedExportContainer(name);
+ return container && container.kind === 256;
}
- function getClassMemberPrefix(node, member) {
- var expression = getLocalName(node);
- return ts.hasModifier(member, 32) ? expression : ts.createPropertyAccess(expression, "prototype");
+ function hasExportedReferenceInDestructuringPattern(node) {
+ switch (node.kind) {
+ case 70:
+ return isExportedBinding(node);
+ case 172:
+ for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
+ var property = _a[_i];
+ if (hasExportedReferenceInObjectDestructuringElement(property)) {
+ return true;
+ }
+ }
+ break;
+ case 171:
+ for (var _b = 0, _c = node.elements; _b < _c.length; _b++) {
+ var element = _c[_b];
+ if (hasExportedReferenceInArrayDestructuringElement(element)) {
+ return true;
+ }
+ }
+ break;
+ }
+ return false;
}
- function hasSynthesizedDefaultSuperCall(constructor, hasExtendsClause) {
- if (!constructor || !hasExtendsClause) {
+ function hasExportedReferenceInObjectDestructuringElement(node) {
+ if (ts.isShorthandPropertyAssignment(node)) {
+ return isExportedBinding(node.name);
+ }
+ else if (ts.isPropertyAssignment(node)) {
+ return hasExportedReferenceInDestructuringElement(node.initializer);
+ }
+ else {
return false;
}
- var parameter = ts.singleOrUndefined(constructor.parameters);
- if (!parameter || !ts.nodeIsSynthesized(parameter) || !parameter.dotDotDotToken) {
+ }
+ function hasExportedReferenceInArrayDestructuringElement(node) {
+ if (ts.isSpreadElementExpression(node)) {
+ var expression = node.expression;
+ return ts.isIdentifier(expression) && isExportedBinding(expression);
+ }
+ else {
+ return hasExportedReferenceInDestructuringElement(node);
+ }
+ }
+ function hasExportedReferenceInDestructuringElement(node) {
+ if (ts.isBinaryExpression(node)) {
+ var left = node.left;
+ return node.operatorToken.kind === 57
+ && isDestructuringPattern(left)
+ && hasExportedReferenceInDestructuringPattern(left);
+ }
+ else if (ts.isIdentifier(node)) {
+ return isExportedBinding(node);
+ }
+ else if (ts.isSpreadElementExpression(node)) {
+ var expression = node.expression;
+ return ts.isIdentifier(expression) && isExportedBinding(expression);
+ }
+ else if (isDestructuringPattern(node)) {
+ return hasExportedReferenceInDestructuringPattern(node);
+ }
+ else {
return false;
}
- var statement = ts.firstOrUndefined(constructor.body.statements);
- if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 202) {
- return false;
+ }
+ function isDestructuringPattern(node) {
+ var kind = node.kind;
+ return kind === 70
+ || kind === 172
+ || kind === 171;
+ }
+ function substituteDestructuring(node) {
+ return ts.flattenDestructuringAssignment(context, node, true, hoistVariableDeclaration);
+ }
+ function substituteUnaryExpression(node) {
+ var operand = node.operand;
+ var operator = node.operator;
+ var substitute = ts.isIdentifier(operand) &&
+ (node.kind === 187 ||
+ (node.kind === 186 && (operator === 42 || operator === 43)));
+ if (substitute) {
+ var exportDeclaration = resolver.getReferencedExportContainer(operand);
+ if (exportDeclaration) {
+ var expr = ts.createPrefix(node.operator, operand, node);
+ ts.setEmitFlags(expr, 128);
+ var call = createExportExpression(operand, expr);
+ if (node.kind === 186) {
+ return call;
+ }
+ else {
+ return operator === 42
+ ? ts.createSubtract(call, ts.createLiteral(1))
+ : ts.createAdd(call, ts.createLiteral(1));
+ }
+ }
}
- var statementExpression = statement.expression;
- if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 174) {
- return false;
+ return node;
+ }
+ function getDeclarationName(node) {
+ return node.name ? ts.getSynthesizedClone(node.name) : ts.getGeneratedNameForNode(node);
+ }
+ function addExportStarFunction(statements, localNames) {
+ var exportStarFunction = ts.createUniqueName("exportStar");
+ var m = ts.createIdentifier("m");
+ var n = ts.createIdentifier("n");
+ var exports = ts.createIdentifier("exports");
+ var condition = ts.createStrictInequality(n, ts.createLiteral("default"));
+ if (localNames) {
+ condition = ts.createLogicalAnd(condition, ts.createLogicalNot(ts.createHasOwnProperty(localNames, n)));
}
- var callTarget = statementExpression.expression;
- if (!ts.nodeIsSynthesized(callTarget) || callTarget.kind !== 95) {
- return false;
+ statements.push(ts.createFunctionDeclaration(undefined, undefined, undefined, exportStarFunction, undefined, [ts.createParameter(m)], undefined, ts.createBlock([
+ ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
+ ts.createVariableDeclaration(exports, undefined, ts.createObjectLiteral([]))
+ ])),
+ ts.createForIn(ts.createVariableDeclarationList([
+ ts.createVariableDeclaration(n, undefined)
+ ]), m, ts.createBlock([
+ ts.setEmitFlags(ts.createIf(condition, ts.createStatement(ts.createAssignment(ts.createElementAccess(exports, n), ts.createElementAccess(m, n)))), 32)
+ ])),
+ ts.createStatement(ts.createCall(exportFunctionForFile, undefined, [exports]))
+ ], undefined, true)));
+ return exportStarFunction;
+ }
+ function createExportExpression(name, value) {
+ var exportName = ts.isIdentifier(name) ? ts.createLiteral(name.text) : name;
+ return ts.createCall(exportFunctionForFile, undefined, [exportName, value]);
+ }
+ function createExportStatement(name, value) {
+ return ts.createStatement(createExportExpression(name, value));
+ }
+ function createDeclarationExport(node) {
+ var declarationName = getDeclarationName(node);
+ var exportName = ts.hasModifier(node, 512) ? ts.createLiteral("default") : declarationName;
+ return createExportStatement(exportName, declarationName);
+ }
+ function createImportBinding(importDeclaration) {
+ var importAlias;
+ var name;
+ if (ts.isImportClause(importDeclaration)) {
+ importAlias = ts.getGeneratedNameForNode(importDeclaration.parent);
+ name = ts.createIdentifier("default");
}
- var callArgument = ts.singleOrUndefined(statementExpression.arguments);
- if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 191) {
- return false;
+ else if (ts.isImportSpecifier(importDeclaration)) {
+ importAlias = ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent);
+ name = importDeclaration.propertyName || importDeclaration.name;
}
- var expression = callArgument.expression;
- return ts.isIdentifier(expression) && expression === parameter.name;
+ else {
+ return undefined;
+ }
+ return ts.createPropertyAccess(importAlias, ts.getSynthesizedClone(name));
+ }
+ function collectDependencyGroups(externalImports) {
+ var groupIndices = ts.createMap();
+ var dependencyGroups = [];
+ for (var i = 0; i < externalImports.length; i++) {
+ var externalImport = externalImports[i];
+ var externalModuleName = ts.getExternalModuleNameLiteral(externalImport, currentSourceFile, host, resolver, compilerOptions);
+ var text = externalModuleName.text;
+ if (ts.hasProperty(groupIndices, text)) {
+ var groupIndex = groupIndices[text];
+ dependencyGroups[groupIndex].externalImports.push(externalImport);
+ continue;
+ }
+ else {
+ groupIndices[text] = dependencyGroups.length;
+ dependencyGroups.push({
+ name: externalModuleName,
+ externalImports: [externalImport]
+ });
+ }
+ }
+ return dependencyGroups;
+ }
+ function getNameOfDependencyGroup(dependencyGroup) {
+ return dependencyGroup.name;
+ }
+ function recordExportName(name) {
+ if (!exportedLocalNames) {
+ exportedLocalNames = [];
+ }
+ exportedLocalNames.push(name);
+ }
+ function recordExportedFunctionDeclaration(node) {
+ if (!exportedFunctionDeclarations) {
+ exportedFunctionDeclarations = [];
+ }
+ exportedFunctionDeclarations.push(createDeclarationExport(node));
+ }
+ function hoistBindingElement(node, isExported) {
+ if (ts.isOmittedExpression(node)) {
+ return;
+ }
+ var name = node.name;
+ if (ts.isIdentifier(name)) {
+ hoistVariableDeclaration(ts.getSynthesizedClone(name));
+ if (isExported) {
+ recordExportName(name);
+ }
+ }
+ else if (ts.isBindingPattern(name)) {
+ ts.forEach(name.elements, isExported ? hoistExportedBindingElement : hoistNonExportedBindingElement);
+ }
+ }
+ function hoistExportedBindingElement(node) {
+ hoistBindingElement(node, true);
+ }
+ function hoistNonExportedBindingElement(node) {
+ hoistBindingElement(node, false);
+ }
+ function updateSourceFile(node, statements, nodeEmitFlags) {
+ var updated = ts.getMutableClone(node);
+ updated.statements = ts.createNodeArray(statements, node.statements);
+ ts.setEmitFlags(updated, nodeEmitFlags);
+ return updated;
}
}
- ts.transformES6 = transformES6;
+ ts.transformSystemModule = transformSystemModule;
+})(ts || (ts = {}));
+var ts;
+(function (ts) {
+ function transformES2015Module(context) {
+ var compilerOptions = context.getCompilerOptions();
+ return transformSourceFile;
+ function transformSourceFile(node) {
+ if (ts.isDeclarationFile(node)) {
+ return node;
+ }
+ if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
+ return ts.visitEachChild(node, visitor, context);
+ }
+ return node;
+ }
+ function visitor(node) {
+ switch (node.kind) {
+ case 230:
+ return undefined;
+ case 236:
+ return visitExportAssignment(node);
+ }
+ return node;
+ }
+ function visitExportAssignment(node) {
+ return node.isExportEquals ? undefined : node;
+ }
+ }
+ ts.transformES2015Module = transformES2015Module;
})(ts || (ts = {}));
var ts;
(function (ts) {
var moduleTransformerMap = ts.createMap((_a = {},
- _a[ts.ModuleKind.ES6] = ts.transformES6Module,
+ _a[ts.ModuleKind.ES2015] = ts.transformES2015Module,
_a[ts.ModuleKind.System] = ts.transformSystemModule,
_a[ts.ModuleKind.AMD] = ts.transformModule,
_a[ts.ModuleKind.CommonJS] = ts.transformModule,
_a[ts.ModuleKind.UMD] = ts.transformModule,
_a[ts.ModuleKind.None] = ts.transformModule,
_a));
+ var SyntaxKindFeatureFlags;
+ (function (SyntaxKindFeatureFlags) {
+ SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["Substitution"] = 1] = "Substitution";
+ SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["EmitNotifications"] = 2] = "EmitNotifications";
+ })(SyntaxKindFeatureFlags || (SyntaxKindFeatureFlags = {}));
function getTransformers(compilerOptions) {
var jsx = compilerOptions.jsx;
var languageVersion = ts.getEmitScriptTarget(compilerOptions);
@@ -42039,11 +43608,19 @@ var ts;
if (jsx === 2) {
transformers.push(ts.transformJsx);
}
- transformers.push(ts.transformES7);
+ if (languageVersion < 4) {
+ transformers.push(ts.transformES2017);
+ }
+ if (languageVersion < 3) {
+ transformers.push(ts.transformES2016);
+ }
if (languageVersion < 2) {
- transformers.push(ts.transformES6);
+ transformers.push(ts.transformES2015);
transformers.push(ts.transformGenerators);
}
+ if (languageVersion < 1) {
+ transformers.push(ts.transformES5);
+ }
return transformers;
}
ts.getTransformers = getTransformers;
@@ -42063,7 +43640,7 @@ var ts;
hoistFunctionDeclaration: hoistFunctionDeclaration,
startLexicalEnvironment: startLexicalEnvironment,
endLexicalEnvironment: endLexicalEnvironment,
- onSubstituteNode: function (emitContext, node) { return node; },
+ onSubstituteNode: function (_emitContext, node) { return node; },
enableSubstitution: enableSubstitution,
isSubstitutionEnabled: isSubstitutionEnabled,
onEmitNode: function (node, emitContext, emitCallback) { return emitCallback(node, emitContext); },
@@ -42203,7 +43780,7 @@ var ts;
emitNodeWithSourceMap: emitNodeWithSourceMap,
emitTokenWithSourceMap: emitTokenWithSourceMap,
getText: getText,
- getSourceMappingURL: getSourceMappingURL
+ getSourceMappingURL: getSourceMappingURL,
};
function initialize(filePath, sourceMapFilePath, sourceFiles, isBundledEmit) {
if (disabled) {
@@ -42406,7 +43983,7 @@ var ts;
sources: sourceMapData.sourceMapSources,
names: sourceMapData.sourceMapNames,
mappings: sourceMapData.sourceMapMappings,
- sourcesContent: sourceMapData.sourceMapSourcesContent
+ sourcesContent: sourceMapData.sourceMapSourcesContent,
});
}
function getSourceMappingURL() {
@@ -42470,7 +44047,7 @@ var ts;
setSourceFile: setSourceFile,
emitNodeWithComments: emitNodeWithComments,
emitBodyWithDetachedComments: emitBodyWithDetachedComments,
- emitTrailingCommentsOfPosition: emitTrailingCommentsOfPosition
+ emitTrailingCommentsOfPosition: emitTrailingCommentsOfPosition,
};
function emitNodeWithComments(emitContext, node, emitCallback) {
if (disabled) {
@@ -42508,7 +44085,7 @@ var ts;
}
if (!skipTrailingComments) {
containerEnd = end;
- if (node.kind === 219) {
+ if (node.kind === 220) {
declarationListContainerEnd = end;
}
}
@@ -42584,7 +44161,7 @@ var ts;
emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos);
}
}
- function emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) {
+ function emitLeadingComment(commentPos, commentEnd, _kind, hasTrailingNewLine, rangePos) {
if (!hasWrittenComment) {
ts.emitNewLineBeforeLeadingCommentOfPosition(currentLineMap, writer, rangePos, commentPos);
hasWrittenComment = true;
@@ -42602,7 +44179,7 @@ var ts;
function emitTrailingComments(pos) {
forEachTrailingCommentToEmit(pos, emitTrailingComment);
}
- function emitTrailingComment(commentPos, commentEnd, kind, hasTrailingNewLine) {
+ function emitTrailingComment(commentPos, commentEnd, _kind, hasTrailingNewLine) {
if (!writer.isAtStartOfLine()) {
writer.write(" ");
}
@@ -42625,7 +44202,7 @@ var ts;
ts.performance.measure("commentTime", "beforeEmitTrailingCommentsOfPosition");
}
}
- function emitTrailingCommentOfPosition(commentPos, commentEnd, kind, hasTrailingNewLine) {
+ function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) {
emitPos(commentPos);
ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine);
emitPos(commentEnd);
@@ -42736,7 +44313,7 @@ var ts;
var isCurrentFileExternalModule;
var reportedDeclarationError = false;
var errorNameNode;
- var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments;
+ var emitJsDocComments = compilerOptions.removeComments ? function () { } : writeJsDocComments;
var emit = compilerOptions.stripInternal ? stripInternal : emitNode;
var noDeclare;
var moduleElementDeclarationEmitInfo = [];
@@ -42780,7 +44357,7 @@ var ts;
var oldWriter = writer;
ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) {
if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) {
- ts.Debug.assert(aliasEmitInfo.node.kind === 230);
+ ts.Debug.assert(aliasEmitInfo.node.kind === 231);
createAndSetNewTextWriterWithSymbolWriter();
ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit));
for (var i = 0; i < aliasEmitInfo.indent; i++) {
@@ -42811,7 +44388,7 @@ var ts;
reportedDeclarationError: reportedDeclarationError,
moduleElementDeclarationEmitInfo: allSourcesModuleElementDeclarationEmitInfo,
synchronousDeclarationOutput: writer.getText(),
- referencesOutput: referencesOutput
+ referencesOutput: referencesOutput,
};
function hasInternalAnnotation(range) {
var comment = currentText.substring(range.pos, range.end);
@@ -42851,10 +44428,10 @@ var ts;
var oldWriter = writer;
ts.forEach(nodes, function (declaration) {
var nodeToCheck;
- if (declaration.kind === 218) {
+ if (declaration.kind === 219) {
nodeToCheck = declaration.parent.parent;
}
- else if (declaration.kind === 233 || declaration.kind === 234 || declaration.kind === 231) {
+ else if (declaration.kind === 234 || declaration.kind === 235 || declaration.kind === 232) {
ts.Debug.fail("We should be getting ImportDeclaration instead to write");
}
else {
@@ -42865,7 +44442,7 @@ var ts;
moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; });
}
if (moduleElementEmitInfo) {
- if (moduleElementEmitInfo.node.kind === 230) {
+ if (moduleElementEmitInfo.node.kind === 231) {
moduleElementEmitInfo.isVisible = true;
}
else {
@@ -42873,12 +44450,12 @@ var ts;
for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) {
increaseIndent();
}
- if (nodeToCheck.kind === 225) {
+ if (nodeToCheck.kind === 226) {
ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined);
asynchronousSubModuleDeclarationEmitInfo = [];
}
writeModuleElement(nodeToCheck);
- if (nodeToCheck.kind === 225) {
+ if (nodeToCheck.kind === 226) {
moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo;
asynchronousSubModuleDeclarationEmitInfo = undefined;
}
@@ -42990,67 +44567,67 @@ var ts;
}
function emitType(type) {
switch (type.kind) {
- case 117:
- case 132:
- case 130:
- case 120:
+ case 118:
case 133:
- case 103:
- case 135:
- case 93:
- case 127:
- case 165:
+ case 131:
+ case 121:
+ case 134:
+ case 104:
+ case 136:
+ case 94:
+ case 128:
case 166:
+ case 167:
return writeTextOfNode(currentText, type);
- case 194:
+ case 195:
return emitExpressionWithTypeArguments(type);
- case 155:
- return emitTypeReference(type);
- case 158:
- return emitTypeQuery(type);
- case 160:
- return emitArrayType(type);
- case 161:
- return emitTupleType(type);
- case 162:
- return emitUnionType(type);
- case 163:
- return emitIntersectionType(type);
- case 164:
- return emitParenType(type);
case 156:
- case 157:
- return emitSignatureDeclarationWithJsDocComments(type);
+ return emitTypeReference(type);
case 159:
+ return emitTypeQuery(type);
+ case 161:
+ return emitArrayType(type);
+ case 162:
+ return emitTupleType(type);
+ case 163:
+ return emitUnionType(type);
+ case 164:
+ return emitIntersectionType(type);
+ case 165:
+ return emitParenType(type);
+ case 157:
+ case 158:
+ return emitSignatureDeclarationWithJsDocComments(type);
+ case 160:
return emitTypeLiteral(type);
- case 69:
+ case 70:
return emitEntityName(type);
- case 139:
+ case 140:
return emitEntityName(type);
- case 154:
+ case 155:
return emitTypePredicate(type);
}
function writeEntityName(entityName) {
- if (entityName.kind === 69) {
+ if (entityName.kind === 70) {
writeTextOfNode(currentText, entityName);
}
else {
- var left = entityName.kind === 139 ? entityName.left : entityName.expression;
- var right = entityName.kind === 139 ? entityName.right : entityName.name;
+ var left = entityName.kind === 140 ? entityName.left : entityName.expression;
+ var right = entityName.kind === 140 ? entityName.right : entityName.name;
writeEntityName(left);
write(".");
writeTextOfNode(currentText, right);
}
}
function emitEntityName(entityName) {
- var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 229 ? entityName.parent : enclosingDeclaration);
+ var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 230 ? entityName.parent : enclosingDeclaration);
handleSymbolAccessibilityError(visibilityResult);
recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName));
writeEntityName(entityName);
}
function emitExpressionWithTypeArguments(node) {
if (ts.isEntityNameExpression(node.expression)) {
- ts.Debug.assert(node.expression.kind === 69 || node.expression.kind === 172);
+ ts.Debug.assert(node.expression.kind === 70 || node.expression.kind === 173);
emitEntityName(node.expression);
if (node.typeArguments) {
write("<");
@@ -43131,7 +44708,7 @@ var ts;
}
}
function emitExportAssignment(node) {
- if (node.expression.kind === 69) {
+ if (node.expression.kind === 70) {
write(node.isExportEquals ? "export = " : "export default ");
writeTextOfNode(currentText, node.expression);
}
@@ -43152,11 +44729,11 @@ var ts;
}
write(";");
writeLine();
- if (node.expression.kind === 69) {
+ if (node.expression.kind === 70) {
var nodes = resolver.collectLinkedAliases(node.expression);
writeAsynchronousModuleElements(nodes);
}
- function getDefaultExportAccessibilityDiagnostic(diagnostic) {
+ function getDefaultExportAccessibilityDiagnostic() {
return {
diagnosticMessage: ts.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0,
errorNode: node
@@ -43170,7 +44747,7 @@ var ts;
if (isModuleElementVisible) {
writeModuleElement(node);
}
- else if (node.kind === 229 ||
+ else if (node.kind === 230 ||
(node.parent.kind === 256 && isCurrentFileExternalModule)) {
var isVisible = void 0;
if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 256) {
@@ -43182,7 +44759,7 @@ var ts;
});
}
else {
- if (node.kind === 230) {
+ if (node.kind === 231) {
var importDeclaration = node;
if (importDeclaration.importClause) {
isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) ||
@@ -43200,23 +44777,23 @@ var ts;
}
function writeModuleElement(node) {
switch (node.kind) {
- case 220:
- return writeFunctionDeclaration(node);
- case 200:
- return writeVariableStatement(node);
- case 222:
- return writeInterfaceDeclaration(node);
case 221:
- return writeClassDeclaration(node);
+ return writeFunctionDeclaration(node);
+ case 201:
+ return writeVariableStatement(node);
case 223:
- return writeTypeAliasDeclaration(node);
+ return writeInterfaceDeclaration(node);
+ case 222:
+ return writeClassDeclaration(node);
case 224:
- return writeEnumDeclaration(node);
+ return writeTypeAliasDeclaration(node);
case 225:
+ return writeEnumDeclaration(node);
+ case 226:
return writeModuleDeclaration(node);
- case 229:
- return writeImportEqualsDeclaration(node);
case 230:
+ return writeImportEqualsDeclaration(node);
+ case 231:
return writeImportDeclaration(node);
default:
ts.Debug.fail("Unknown symbol kind");
@@ -43231,7 +44808,7 @@ var ts;
if (modifiers & 512) {
write("default ");
}
- else if (node.kind !== 222 && !noDeclare) {
+ else if (node.kind !== 223 && !noDeclare) {
write("declare ");
}
}
@@ -43271,7 +44848,7 @@ var ts;
write(");");
}
writer.writeLine();
- function getImportEntityNameVisibilityError(symbolAccessibilityResult) {
+ function getImportEntityNameVisibilityError() {
return {
diagnosticMessage: ts.Diagnostics.Import_declaration_0_is_using_private_name_1,
errorNode: node,
@@ -43281,7 +44858,7 @@ var ts;
}
function isVisibleNamedBinding(namedBindings) {
if (namedBindings) {
- if (namedBindings.kind === 232) {
+ if (namedBindings.kind === 233) {
return resolver.isDeclarationVisible(namedBindings);
}
else {
@@ -43304,7 +44881,7 @@ var ts;
if (currentWriterPos !== writer.getTextPos()) {
write(", ");
}
- if (node.importClause.namedBindings.kind === 232) {
+ if (node.importClause.namedBindings.kind === 233) {
write("* as ");
writeTextOfNode(currentText, node.importClause.namedBindings.name);
}
@@ -43321,13 +44898,13 @@ var ts;
writer.writeLine();
}
function emitExternalModuleSpecifier(parent) {
- resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 225;
+ resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 226;
var moduleSpecifier;
- if (parent.kind === 229) {
+ if (parent.kind === 230) {
var node = parent;
moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node);
}
- else if (parent.kind === 225) {
+ else if (parent.kind === 226) {
moduleSpecifier = parent.name;
}
else {
@@ -43395,7 +44972,7 @@ var ts;
writeTextOfNode(currentText, node.name);
}
}
- while (node.body && node.body.kind !== 226) {
+ while (node.body && node.body.kind !== 227) {
node = node.body;
write(".");
writeTextOfNode(currentText, node.name);
@@ -43429,7 +45006,7 @@ var ts;
write(";");
writeLine();
enclosingDeclaration = prevEnclosingDeclaration;
- function getTypeAliasDeclarationVisibilityError(symbolAccessibilityResult) {
+ function getTypeAliasDeclarationVisibilityError() {
return {
diagnosticMessage: ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1,
errorNode: node.type,
@@ -43465,7 +45042,7 @@ var ts;
writeLine();
}
function isPrivateMethodTypeParameter(node) {
- return node.parent.kind === 147 && ts.hasModifier(node.parent, 8);
+ return node.parent.kind === 148 && ts.hasModifier(node.parent, 8);
}
function emitTypeParameters(typeParameters) {
function emitTypeParameter(node) {
@@ -43475,49 +45052,49 @@ var ts;
writeTextOfNode(currentText, node.name);
if (node.constraint && !isPrivateMethodTypeParameter(node)) {
write(" extends ");
- if (node.parent.kind === 156 ||
- node.parent.kind === 157 ||
- (node.parent.parent && node.parent.parent.kind === 159)) {
- ts.Debug.assert(node.parent.kind === 147 ||
- node.parent.kind === 146 ||
- node.parent.kind === 156 ||
+ if (node.parent.kind === 157 ||
+ node.parent.kind === 158 ||
+ (node.parent.parent && node.parent.parent.kind === 160)) {
+ ts.Debug.assert(node.parent.kind === 148 ||
+ node.parent.kind === 147 ||
node.parent.kind === 157 ||
- node.parent.kind === 151 ||
- node.parent.kind === 152);
+ node.parent.kind === 158 ||
+ node.parent.kind === 152 ||
+ node.parent.kind === 153);
emitType(node.constraint);
}
else {
emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.constraint, getTypeParameterConstraintVisibilityError);
}
}
- function getTypeParameterConstraintVisibilityError(symbolAccessibilityResult) {
+ function getTypeParameterConstraintVisibilityError() {
var diagnosticMessage;
switch (node.parent.kind) {
- case 221:
+ case 222:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;
break;
- case 222:
+ case 223:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;
break;
- case 152:
+ case 153:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
- case 151:
+ case 152:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
+ case 148:
case 147:
- case 146:
if (ts.hasModifier(node.parent, 32)) {
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
}
- else if (node.parent.parent.kind === 221) {
+ else if (node.parent.parent.kind === 222) {
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1;
}
else {
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
break;
- case 220:
+ case 221:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
break;
default:
@@ -43545,16 +45122,16 @@ var ts;
if (ts.isEntityNameExpression(node.expression)) {
emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError);
}
- else if (!isImplementsList && node.expression.kind === 93) {
+ else if (!isImplementsList && node.expression.kind === 94) {
write("null");
}
else {
writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError;
resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 | 1024, writer);
}
- function getHeritageClauseVisibilityError(symbolAccessibilityResult) {
+ function getHeritageClauseVisibilityError() {
var diagnosticMessage;
- if (node.parent.parent.kind === 221) {
+ if (node.parent.parent.kind === 222) {
diagnosticMessage = isImplementsList ?
ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 :
ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1;
@@ -43634,17 +45211,17 @@ var ts;
writeLine();
}
function emitVariableDeclaration(node) {
- if (node.kind !== 218 || resolver.isDeclarationVisible(node)) {
+ if (node.kind !== 219 || resolver.isDeclarationVisible(node)) {
if (ts.isBindingPattern(node.name)) {
emitBindingPattern(node.name);
}
else {
writeTextOfNode(currentText, node.name);
- if ((node.kind === 145 || node.kind === 144 ||
- (node.kind === 142 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) {
+ if ((node.kind === 146 || node.kind === 145 ||
+ (node.kind === 143 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) {
write("?");
}
- if ((node.kind === 145 || node.kind === 144) && node.parent.kind === 159) {
+ if ((node.kind === 146 || node.kind === 145) && node.parent.kind === 160) {
emitTypeOfVariableDeclarationFromTypeLiteral(node);
}
else if (resolver.isLiteralConstDeclaration(node)) {
@@ -43657,14 +45234,14 @@ var ts;
}
}
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
- if (node.kind === 218) {
+ if (node.kind === 219) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
}
- else if (node.kind === 145 || node.kind === 144) {
+ else if (node.kind === 146 || node.kind === 145) {
if (ts.hasModifier(node, 32)) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -43672,7 +45249,7 @@ var ts;
ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
}
- else if (node.parent.kind === 221) {
+ else if (node.parent.kind === 222) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -43698,7 +45275,7 @@ var ts;
var elements = [];
for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) {
var element = _a[_i];
- if (element.kind !== 193) {
+ if (element.kind !== 194) {
elements.push(element);
}
}
@@ -43764,7 +45341,7 @@ var ts;
accessorWithTypeAnnotation = node;
var type = getTypeAnnotationFromAccessor(node);
if (!type) {
- var anotherAccessor = node.kind === 149 ? accessors.setAccessor : accessors.getAccessor;
+ var anotherAccessor = node.kind === 150 ? accessors.setAccessor : accessors.getAccessor;
type = getTypeAnnotationFromAccessor(anotherAccessor);
if (type) {
accessorWithTypeAnnotation = anotherAccessor;
@@ -43777,7 +45354,7 @@ var ts;
}
function getTypeAnnotationFromAccessor(accessor) {
if (accessor) {
- return accessor.kind === 149
+ return accessor.kind === 150
? accessor.type
: accessor.parameters.length > 0
? accessor.parameters[0].type
@@ -43786,7 +45363,7 @@ var ts;
}
function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) {
var diagnosticMessage;
- if (accessorWithTypeAnnotation.kind === 150) {
+ if (accessorWithTypeAnnotation.kind === 151) {
if (ts.hasModifier(accessorWithTypeAnnotation.parent, 32)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 :
@@ -43832,17 +45409,17 @@ var ts;
}
if (!resolver.isImplementationOfOverload(node)) {
emitJsDocComments(node);
- if (node.kind === 220) {
+ if (node.kind === 221) {
emitModuleElementDeclarationFlags(node);
}
- else if (node.kind === 147 || node.kind === 148) {
+ else if (node.kind === 148 || node.kind === 149) {
emitClassMemberDeclarationFlags(ts.getModifierFlags(node));
}
- if (node.kind === 220) {
+ if (node.kind === 221) {
write("function ");
writeTextOfNode(currentText, node.name);
}
- else if (node.kind === 148) {
+ else if (node.kind === 149) {
write("constructor");
}
else {
@@ -43862,15 +45439,15 @@ var ts;
var prevEnclosingDeclaration = enclosingDeclaration;
enclosingDeclaration = node;
var closeParenthesizedFunctionType = false;
- if (node.kind === 153) {
+ if (node.kind === 154) {
emitClassMemberDeclarationFlags(ts.getModifierFlags(node));
write("[");
}
else {
- if (node.kind === 152 || node.kind === 157) {
+ if (node.kind === 153 || node.kind === 158) {
write("new ");
}
- else if (node.kind === 156) {
+ else if (node.kind === 157) {
var currentOutput = writer.getText();
if (node.typeParameters && currentOutput.charAt(currentOutput.length - 1) === "<") {
closeParenthesizedFunctionType = true;
@@ -43881,20 +45458,20 @@ var ts;
write("(");
}
emitCommaList(node.parameters, emitParameterDeclaration);
- if (node.kind === 153) {
+ if (node.kind === 154) {
write("]");
}
else {
write(")");
}
- var isFunctionTypeOrConstructorType = node.kind === 156 || node.kind === 157;
- if (isFunctionTypeOrConstructorType || node.parent.kind === 159) {
+ var isFunctionTypeOrConstructorType = node.kind === 157 || node.kind === 158;
+ if (isFunctionTypeOrConstructorType || node.parent.kind === 160) {
if (node.type) {
write(isFunctionTypeOrConstructorType ? " => " : ": ");
emitType(node.type);
}
}
- else if (node.kind !== 148 && !ts.hasModifier(node, 8)) {
+ else if (node.kind !== 149 && !ts.hasModifier(node, 8)) {
writeReturnTypeAtSignature(node, getReturnTypeVisibilityError);
}
enclosingDeclaration = prevEnclosingDeclaration;
@@ -43908,23 +45485,23 @@ var ts;
function getReturnTypeVisibilityError(symbolAccessibilityResult) {
var diagnosticMessage;
switch (node.kind) {
- case 152:
+ case 153:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 151:
+ case 152:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 153:
+ case 154:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
+ case 148:
case 147:
- case 146:
if (ts.hasModifier(node, 32)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -43932,7 +45509,7 @@ var ts;
ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0;
}
- else if (node.parent.kind === 221) {
+ else if (node.parent.kind === 222) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named :
@@ -43945,7 +45522,7 @@ var ts;
ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;
}
break;
- case 220:
+ case 221:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named :
@@ -43977,9 +45554,9 @@ var ts;
write("?");
}
decreaseIndent();
- if (node.parent.kind === 156 ||
- node.parent.kind === 157 ||
- node.parent.parent.kind === 159) {
+ if (node.parent.kind === 157 ||
+ node.parent.kind === 158 ||
+ node.parent.parent.kind === 160) {
emitTypeOfVariableDeclarationFromTypeLiteral(node);
}
else if (!ts.hasModifier(node.parent, 8)) {
@@ -43995,22 +45572,22 @@ var ts;
}
function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
switch (node.parent.kind) {
- case 148:
+ case 149:
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;
- case 152:
+ case 153:
return symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 151:
+ case 152:
return symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
+ case 148:
case 147:
- case 146:
if (ts.hasModifier(node.parent, 32)) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -44018,7 +45595,7 @@ var ts;
ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
}
- else if (node.parent.parent.kind === 221) {
+ else if (node.parent.parent.kind === 222) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -44030,7 +45607,7 @@ var ts;
ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
- case 220:
+ case 221:
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -44041,12 +45618,12 @@ var ts;
}
}
function emitBindingPattern(bindingPattern) {
- if (bindingPattern.kind === 167) {
+ if (bindingPattern.kind === 168) {
write("{");
emitCommaList(bindingPattern.elements, emitBindingElement);
write("}");
}
- else if (bindingPattern.kind === 168) {
+ else if (bindingPattern.kind === 169) {
write("[");
var elements = bindingPattern.elements;
emitCommaList(elements, emitBindingElement);
@@ -44057,10 +45634,10 @@ var ts;
}
}
function emitBindingElement(bindingElement) {
- if (bindingElement.kind === 193) {
+ if (bindingElement.kind === 194) {
write(" ");
}
- else if (bindingElement.kind === 169) {
+ else if (bindingElement.kind === 170) {
if (bindingElement.propertyName) {
writeTextOfNode(currentText, bindingElement.propertyName);
write(": ");
@@ -44070,7 +45647,7 @@ var ts;
emitBindingPattern(bindingElement.name);
}
else {
- ts.Debug.assert(bindingElement.name.kind === 69);
+ ts.Debug.assert(bindingElement.name.kind === 70);
if (bindingElement.dotDotDotToken) {
write("...");
}
@@ -44082,37 +45659,37 @@ var ts;
}
function emitNode(node) {
switch (node.kind) {
- case 220:
- case 225:
- case 229:
- case 222:
case 221:
- case 223:
- case 224:
- return emitModuleElement(node, isModuleElementVisible(node));
- case 200:
- return emitModuleElement(node, isVariableStatementVisible(node));
+ case 226:
case 230:
+ case 223:
+ case 222:
+ case 224:
+ case 225:
+ return emitModuleElement(node, isModuleElementVisible(node));
+ case 201:
+ return emitModuleElement(node, isVariableStatementVisible(node));
+ case 231:
return emitModuleElement(node, !node.importClause);
- case 236:
+ case 237:
return emitExportDeclaration(node);
+ case 149:
case 148:
case 147:
- case 146:
return writeFunctionDeclaration(node);
- case 152:
- case 151:
case 153:
+ case 152:
+ case 154:
return emitSignatureDeclarationWithJsDocComments(node);
- case 149:
case 150:
+ case 151:
return emitAccessorDeclaration(node);
+ case 146:
case 145:
- case 144:
return emitPropertyDeclaration(node);
case 255:
return emitEnumMemberDeclaration(node);
- case 235:
+ case 236:
return emitExportAssignment(node);
case 256:
return emitSourceFile(node);
@@ -44132,7 +45709,7 @@ var ts;
referencesOutput += "/// " + newLine;
}
return addedBundledEmitReference;
- function getDeclFileName(emitFileNames, sourceFiles, isBundledEmit) {
+ function getDeclFileName(emitFileNames, _sourceFiles, isBundledEmit) {
if (isBundledEmit && !addBundledFileReference) {
return;
}
@@ -44169,8 +45746,14 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
+ var TempFlags;
+ (function (TempFlags) {
+ TempFlags[TempFlags["Auto"] = 0] = "Auto";
+ TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask";
+ TempFlags[TempFlags["_i"] = 268435456] = "_i";
+ })(TempFlags || (TempFlags = {}));
var id = function (s) { return s; };
- var nullTransformers = [function (ctx) { return id; }];
+ var nullTransformers = [function (_) { return id; }];
function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles) {
var delimiters = createDelimiterMap();
var brackets = createBracketsMap();
@@ -44348,191 +45931,205 @@ var ts;
function pipelineEmitInIdentifierNameContext(node) {
var kind = node.kind;
switch (kind) {
- case 69:
+ case 70:
return emitIdentifier(node);
}
}
function pipelineEmitInUnspecifiedContext(node) {
var kind = node.kind;
switch (kind) {
- case 12:
case 13:
case 14:
+ case 15:
return emitLiteral(node);
- case 69:
+ case 70:
return emitIdentifier(node);
- case 74:
- case 77:
- case 82:
- case 103:
- case 110:
+ case 75:
+ case 78:
+ case 83:
+ case 104:
case 111:
case 112:
case 113:
- case 115:
+ case 114:
+ case 116:
case 117:
case 118:
+ case 119:
case 120:
+ case 121:
case 122:
- case 130:
+ case 123:
+ case 124:
+ case 125:
+ case 126:
+ case 127:
case 128:
+ case 129:
+ case 130:
+ case 131:
case 132:
case 133:
+ case 134:
+ case 135:
+ case 136:
case 137:
+ case 138:
+ case 139:
writeTokenText(kind);
return;
- case 139:
- return emitQualifiedName(node);
case 140:
- return emitComputedPropertyName(node);
+ return emitQualifiedName(node);
case 141:
- return emitTypeParameter(node);
+ return emitComputedPropertyName(node);
case 142:
- return emitParameter(node);
+ return emitTypeParameter(node);
case 143:
- return emitDecorator(node);
+ return emitParameter(node);
case 144:
- return emitPropertySignature(node);
+ return emitDecorator(node);
case 145:
- return emitPropertyDeclaration(node);
+ return emitPropertySignature(node);
case 146:
- return emitMethodSignature(node);
+ return emitPropertyDeclaration(node);
case 147:
- return emitMethodDeclaration(node);
+ return emitMethodSignature(node);
case 148:
- return emitConstructor(node);
+ return emitMethodDeclaration(node);
case 149:
+ return emitConstructor(node);
case 150:
- return emitAccessorDeclaration(node);
case 151:
- return emitCallSignature(node);
+ return emitAccessorDeclaration(node);
case 152:
- return emitConstructSignature(node);
+ return emitCallSignature(node);
case 153:
- return emitIndexSignature(node);
+ return emitConstructSignature(node);
case 154:
- return emitTypePredicate(node);
+ return emitIndexSignature(node);
case 155:
- return emitTypeReference(node);
+ return emitTypePredicate(node);
case 156:
- return emitFunctionType(node);
+ return emitTypeReference(node);
case 157:
- return emitConstructorType(node);
+ return emitFunctionType(node);
case 158:
- return emitTypeQuery(node);
+ return emitConstructorType(node);
case 159:
- return emitTypeLiteral(node);
+ return emitTypeQuery(node);
case 160:
- return emitArrayType(node);
+ return emitTypeLiteral(node);
case 161:
- return emitTupleType(node);
+ return emitArrayType(node);
case 162:
- return emitUnionType(node);
+ return emitTupleType(node);
case 163:
- return emitIntersectionType(node);
+ return emitUnionType(node);
case 164:
- return emitParenthesizedType(node);
- case 194:
- return emitExpressionWithTypeArguments(node);
+ return emitIntersectionType(node);
case 165:
- return emitThisType(node);
+ return emitParenthesizedType(node);
+ case 195:
+ return emitExpressionWithTypeArguments(node);
case 166:
- return emitLiteralType(node);
+ return emitThisType();
case 167:
- return emitObjectBindingPattern(node);
+ return emitLiteralType(node);
case 168:
- return emitArrayBindingPattern(node);
+ return emitObjectBindingPattern(node);
case 169:
+ return emitArrayBindingPattern(node);
+ case 170:
return emitBindingElement(node);
- case 197:
- return emitTemplateSpan(node);
case 198:
- return emitSemicolonClassElement(node);
+ return emitTemplateSpan(node);
case 199:
- return emitBlock(node);
+ return emitSemicolonClassElement();
case 200:
- return emitVariableStatement(node);
+ return emitBlock(node);
case 201:
- return emitEmptyStatement(node);
+ return emitVariableStatement(node);
case 202:
- return emitExpressionStatement(node);
+ return emitEmptyStatement();
case 203:
- return emitIfStatement(node);
+ return emitExpressionStatement(node);
case 204:
- return emitDoStatement(node);
+ return emitIfStatement(node);
case 205:
- return emitWhileStatement(node);
+ return emitDoStatement(node);
case 206:
- return emitForStatement(node);
+ return emitWhileStatement(node);
case 207:
- return emitForInStatement(node);
+ return emitForStatement(node);
case 208:
- return emitForOfStatement(node);
+ return emitForInStatement(node);
case 209:
- return emitContinueStatement(node);
+ return emitForOfStatement(node);
case 210:
- return emitBreakStatement(node);
+ return emitContinueStatement(node);
case 211:
- return emitReturnStatement(node);
+ return emitBreakStatement(node);
case 212:
- return emitWithStatement(node);
+ return emitReturnStatement(node);
case 213:
- return emitSwitchStatement(node);
+ return emitWithStatement(node);
case 214:
- return emitLabeledStatement(node);
+ return emitSwitchStatement(node);
case 215:
- return emitThrowStatement(node);
+ return emitLabeledStatement(node);
case 216:
- return emitTryStatement(node);
+ return emitThrowStatement(node);
case 217:
- return emitDebuggerStatement(node);
+ return emitTryStatement(node);
case 218:
- return emitVariableDeclaration(node);
+ return emitDebuggerStatement(node);
case 219:
- return emitVariableDeclarationList(node);
+ return emitVariableDeclaration(node);
case 220:
- return emitFunctionDeclaration(node);
+ return emitVariableDeclarationList(node);
case 221:
- return emitClassDeclaration(node);
+ return emitFunctionDeclaration(node);
case 222:
- return emitInterfaceDeclaration(node);
+ return emitClassDeclaration(node);
case 223:
- return emitTypeAliasDeclaration(node);
+ return emitInterfaceDeclaration(node);
case 224:
- return emitEnumDeclaration(node);
+ return emitTypeAliasDeclaration(node);
case 225:
- return emitModuleDeclaration(node);
+ return emitEnumDeclaration(node);
case 226:
- return emitModuleBlock(node);
+ return emitModuleDeclaration(node);
case 227:
+ return emitModuleBlock(node);
+ case 228:
return emitCaseBlock(node);
- case 229:
- return emitImportEqualsDeclaration(node);
case 230:
- return emitImportDeclaration(node);
+ return emitImportEqualsDeclaration(node);
case 231:
- return emitImportClause(node);
+ return emitImportDeclaration(node);
case 232:
- return emitNamespaceImport(node);
+ return emitImportClause(node);
case 233:
- return emitNamedImports(node);
+ return emitNamespaceImport(node);
case 234:
- return emitImportSpecifier(node);
+ return emitNamedImports(node);
case 235:
- return emitExportAssignment(node);
+ return emitImportSpecifier(node);
case 236:
- return emitExportDeclaration(node);
+ return emitExportAssignment(node);
case 237:
- return emitNamedExports(node);
+ return emitExportDeclaration(node);
case 238:
- return emitExportSpecifier(node);
+ return emitNamedExports(node);
case 239:
- return;
+ return emitExportSpecifier(node);
case 240:
+ return;
+ case 241:
return emitExternalModuleReference(node);
- case 244:
+ case 10:
return emitJsxText(node);
- case 243:
+ case 244:
return emitJsxOpeningElement(node);
case 245:
return emitJsxClosingElement(node);
@@ -44567,73 +46164,73 @@ var ts;
case 8:
return emitNumericLiteral(node);
case 9:
- case 10:
case 11:
+ case 12:
return emitLiteral(node);
- case 69:
+ case 70:
return emitIdentifier(node);
- case 84:
- case 93:
- case 95:
- case 99:
- case 97:
+ case 85:
+ case 94:
+ case 96:
+ case 100:
+ case 98:
writeTokenText(kind);
return;
- case 170:
- return emitArrayLiteralExpression(node);
case 171:
- return emitObjectLiteralExpression(node);
+ return emitArrayLiteralExpression(node);
case 172:
- return emitPropertyAccessExpression(node);
+ return emitObjectLiteralExpression(node);
case 173:
- return emitElementAccessExpression(node);
+ return emitPropertyAccessExpression(node);
case 174:
- return emitCallExpression(node);
+ return emitElementAccessExpression(node);
case 175:
- return emitNewExpression(node);
+ return emitCallExpression(node);
case 176:
- return emitTaggedTemplateExpression(node);
+ return emitNewExpression(node);
case 177:
- return emitTypeAssertionExpression(node);
+ return emitTaggedTemplateExpression(node);
case 178:
- return emitParenthesizedExpression(node);
+ return emitTypeAssertionExpression(node);
case 179:
- return emitFunctionExpression(node);
+ return emitParenthesizedExpression(node);
case 180:
- return emitArrowFunction(node);
+ return emitFunctionExpression(node);
case 181:
- return emitDeleteExpression(node);
+ return emitArrowFunction(node);
case 182:
- return emitTypeOfExpression(node);
+ return emitDeleteExpression(node);
case 183:
- return emitVoidExpression(node);
+ return emitTypeOfExpression(node);
case 184:
- return emitAwaitExpression(node);
+ return emitVoidExpression(node);
case 185:
- return emitPrefixUnaryExpression(node);
+ return emitAwaitExpression(node);
case 186:
- return emitPostfixUnaryExpression(node);
+ return emitPrefixUnaryExpression(node);
case 187:
- return emitBinaryExpression(node);
+ return emitPostfixUnaryExpression(node);
case 188:
- return emitConditionalExpression(node);
+ return emitBinaryExpression(node);
case 189:
- return emitTemplateExpression(node);
+ return emitConditionalExpression(node);
case 190:
- return emitYieldExpression(node);
+ return emitTemplateExpression(node);
case 191:
- return emitSpreadElementExpression(node);
+ return emitYieldExpression(node);
case 192:
- return emitClassExpression(node);
+ return emitSpreadElementExpression(node);
case 193:
+ return emitClassExpression(node);
+ case 194:
return;
- case 195:
- return emitAsExpression(node);
case 196:
+ return emitAsExpression(node);
+ case 197:
return emitNonNullExpression(node);
- case 241:
- return emitJsxElement(node);
case 242:
+ return emitJsxElement(node);
+ case 243:
return emitJsxSelfClosingElement(node);
case 288:
return emitPartiallyEmittedExpression(node);
@@ -44669,7 +46266,7 @@ var ts;
emit(node.right);
}
function emitEntityName(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
emitExpression(node);
}
else {
@@ -44739,7 +46336,7 @@ var ts;
function emitAccessorDeclaration(node) {
emitDecorators(node, node.decorators);
emitModifiers(node, node.modifiers);
- write(node.kind === 149 ? "get " : "set ");
+ write(node.kind === 150 ? "get " : "set ");
emit(node.name);
emitSignatureAndBody(node, emitSignatureHead);
}
@@ -44767,7 +46364,7 @@ var ts;
emitWithPrefix(": ", node.type);
write(";");
}
- function emitSemicolonClassElement(node) {
+ function emitSemicolonClassElement() {
write(";");
}
function emitTypePredicate(node) {
@@ -44821,7 +46418,7 @@ var ts;
emit(node.type);
write(")");
}
- function emitThisType(node) {
+ function emitThisType() {
write("this");
}
function emitLiteralType(node) {
@@ -44889,7 +46486,7 @@ var ts;
if (!(ts.getEmitFlags(node) & 1048576)) {
var dotRangeStart = node.expression.end;
var dotRangeEnd = ts.skipTrivia(currentText, node.expression.end) + 1;
- var dotToken = { kind: 21, pos: dotRangeStart, end: dotRangeEnd };
+ var dotToken = { kind: 22, pos: dotRangeStart, end: dotRangeEnd };
indentBeforeDot = needsIndentation(node, node.expression, dotToken);
indentAfterDot = needsIndentation(node, dotToken, node.name);
}
@@ -44904,7 +46501,7 @@ var ts;
function needsDotDotForPropertyAccess(expression) {
if (expression.kind === 8) {
var text = getLiteralTextOfNode(expression);
- return text.indexOf(ts.tokenToString(21)) < 0;
+ return text.indexOf(ts.tokenToString(22)) < 0;
}
else if (ts.isPropertyAccessExpression(expression) || ts.isElementAccessExpression(expression)) {
var constantValue = ts.getConstantValue(expression);
@@ -44921,11 +46518,13 @@ var ts;
}
function emitCallExpression(node) {
emitExpression(node.expression);
+ emitTypeArguments(node, node.typeArguments);
emitExpressionList(node, node.arguments, 1296);
}
function emitNewExpression(node) {
write("new ");
emitExpression(node.expression);
+ emitTypeArguments(node, node.typeArguments);
emitExpressionList(node, node.arguments, 9488);
}
function emitTaggedTemplateExpression(node) {
@@ -44985,16 +46584,16 @@ var ts;
}
function shouldEmitWhitespaceBeforeOperand(node) {
var operand = node.operand;
- return operand.kind === 185
- && ((node.operator === 35 && (operand.operator === 35 || operand.operator === 41))
- || (node.operator === 36 && (operand.operator === 36 || operand.operator === 42)));
+ return operand.kind === 186
+ && ((node.operator === 36 && (operand.operator === 36 || operand.operator === 42))
+ || (node.operator === 37 && (operand.operator === 37 || operand.operator === 43)));
}
function emitPostfixUnaryExpression(node) {
emitExpression(node.operand);
writeTokenText(node.operator);
}
function emitBinaryExpression(node) {
- var isCommaOperator = node.operatorToken.kind !== 24;
+ var isCommaOperator = node.operatorToken.kind !== 25;
var indentBeforeOperator = needsIndentation(node, node.left, node.operatorToken);
var indentAfterOperator = needsIndentation(node, node.operatorToken, node.right);
emitExpression(node.left);
@@ -45055,16 +46654,16 @@ var ts;
emitExpression(node.expression);
emit(node.literal);
}
- function emitBlock(node, format) {
+ function emitBlock(node) {
if (isSingleLineEmptyBlock(node)) {
- writeToken(15, node.pos, node);
+ writeToken(16, node.pos, node);
write(" ");
- writeToken(16, node.statements.end, node);
+ writeToken(17, node.statements.end, node);
}
else {
- writeToken(15, node.pos, node);
+ writeToken(16, node.pos, node);
emitBlockStatements(node);
- writeToken(16, node.statements.end, node);
+ writeToken(17, node.statements.end, node);
}
}
function emitBlockStatements(node) {
@@ -45080,7 +46679,7 @@ var ts;
emit(node.declarationList);
write(";");
}
- function emitEmptyStatement(node) {
+ function emitEmptyStatement() {
write(";");
}
function emitExpressionStatement(node) {
@@ -45088,16 +46687,16 @@ var ts;
write(";");
}
function emitIfStatement(node) {
- var openParenPos = writeToken(88, node.pos, node);
+ var openParenPos = writeToken(89, node.pos, node);
write(" ");
- writeToken(17, openParenPos, node);
+ writeToken(18, openParenPos, node);
emitExpression(node.expression);
- writeToken(18, node.expression.end, node);
+ writeToken(19, node.expression.end, node);
emitEmbeddedStatement(node.thenStatement);
if (node.elseStatement) {
writeLine();
- writeToken(80, node.thenStatement.end, node);
- if (node.elseStatement.kind === 203) {
+ writeToken(81, node.thenStatement.end, node);
+ if (node.elseStatement.kind === 204) {
write(" ");
emit(node.elseStatement);
}
@@ -45126,9 +46725,9 @@ var ts;
emitEmbeddedStatement(node.statement);
}
function emitForStatement(node) {
- var openParenPos = writeToken(86, node.pos);
+ var openParenPos = writeToken(87, node.pos);
write(" ");
- writeToken(17, openParenPos, node);
+ writeToken(18, openParenPos, node);
emitForBinding(node.initializer);
write(";");
emitExpressionWithPrefix(" ", node.condition);
@@ -45138,28 +46737,28 @@ var ts;
emitEmbeddedStatement(node.statement);
}
function emitForInStatement(node) {
- var openParenPos = writeToken(86, node.pos);
+ var openParenPos = writeToken(87, node.pos);
write(" ");
- writeToken(17, openParenPos);
+ writeToken(18, openParenPos);
emitForBinding(node.initializer);
write(" in ");
emitExpression(node.expression);
- writeToken(18, node.expression.end);
+ writeToken(19, node.expression.end);
emitEmbeddedStatement(node.statement);
}
function emitForOfStatement(node) {
- var openParenPos = writeToken(86, node.pos);
+ var openParenPos = writeToken(87, node.pos);
write(" ");
- writeToken(17, openParenPos);
+ writeToken(18, openParenPos);
emitForBinding(node.initializer);
write(" of ");
emitExpression(node.expression);
- writeToken(18, node.expression.end);
+ writeToken(19, node.expression.end);
emitEmbeddedStatement(node.statement);
}
function emitForBinding(node) {
if (node !== undefined) {
- if (node.kind === 219) {
+ if (node.kind === 220) {
emit(node);
}
else {
@@ -45168,17 +46767,17 @@ var ts;
}
}
function emitContinueStatement(node) {
- writeToken(75, node.pos);
+ writeToken(76, node.pos);
emitWithPrefix(" ", node.label);
write(";");
}
function emitBreakStatement(node) {
- writeToken(70, node.pos);
+ writeToken(71, node.pos);
emitWithPrefix(" ", node.label);
write(";");
}
function emitReturnStatement(node) {
- writeToken(94, node.pos, node);
+ writeToken(95, node.pos, node);
emitExpressionWithPrefix(" ", node.expression);
write(";");
}
@@ -45189,11 +46788,11 @@ var ts;
emitEmbeddedStatement(node.statement);
}
function emitSwitchStatement(node) {
- var openParenPos = writeToken(96, node.pos);
+ var openParenPos = writeToken(97, node.pos);
write(" ");
- writeToken(17, openParenPos);
+ writeToken(18, openParenPos);
emitExpression(node.expression);
- writeToken(18, node.expression.end);
+ writeToken(19, node.expression.end);
write(" ");
emit(node.caseBlock);
}
@@ -45218,11 +46817,12 @@ var ts;
}
}
function emitDebuggerStatement(node) {
- writeToken(76, node.pos);
+ writeToken(77, node.pos);
write(";");
}
function emitVariableDeclaration(node) {
emit(node.name);
+ emitWithPrefix(": ", node.type);
emitExpressionWithPrefix(" = ", node.initializer);
}
function emitVariableDeclarationList(node) {
@@ -45249,13 +46849,13 @@ var ts;
}
if (ts.getEmitFlags(node) & 4194304) {
emitSignatureHead(node);
- emitBlockFunctionBody(node, body);
+ emitBlockFunctionBody(body);
}
else {
var savedTempFlags = tempFlags;
tempFlags = 0;
emitSignatureHead(node);
- emitBlockFunctionBody(node, body);
+ emitBlockFunctionBody(body);
tempFlags = savedTempFlags;
}
if (indentedFlag) {
@@ -45278,7 +46878,7 @@ var ts;
emitParameters(node, node.parameters);
emitWithPrefix(": ", node.type);
}
- function shouldEmitBlockFunctionBodyOnSingleLine(parentNode, body) {
+ function shouldEmitBlockFunctionBodyOnSingleLine(body) {
if (ts.getEmitFlags(body) & 32) {
return true;
}
@@ -45302,14 +46902,14 @@ var ts;
}
return true;
}
- function emitBlockFunctionBody(parentNode, body) {
+ function emitBlockFunctionBody(body) {
write(" {");
increaseIndent();
- emitBodyWithDetachedComments(body, body.statements, shouldEmitBlockFunctionBodyOnSingleLine(parentNode, body)
+ emitBodyWithDetachedComments(body, body.statements, shouldEmitBlockFunctionBodyOnSingleLine(body)
? emitBlockFunctionBodyOnSingleLine
: emitBlockFunctionBodyWorker);
decreaseIndent();
- writeToken(16, body.statements.end, body);
+ writeToken(17, body.statements.end, body);
}
function emitBlockFunctionBodyOnSingleLine(body) {
emitBlockFunctionBodyWorker(body, true);
@@ -45387,7 +46987,7 @@ var ts;
write(node.flags & 16 ? "namespace " : "module ");
emit(node.name);
var body = node.body;
- while (body.kind === 225) {
+ while (body.kind === 226) {
write(".");
emit(body.name);
body = body.body;
@@ -45410,9 +47010,9 @@ var ts;
}
}
function emitCaseBlock(node) {
- writeToken(15, node.pos);
+ writeToken(16, node.pos);
emitList(node, node.clauses, 65);
- writeToken(16, node.clauses.end);
+ writeToken(17, node.clauses.end);
}
function emitImportEqualsDeclaration(node) {
emitModifiers(node, node.modifiers);
@@ -45423,7 +47023,7 @@ var ts;
write(";");
}
function emitModuleReference(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
emitExpression(node);
}
else {
@@ -45543,7 +47143,7 @@ var ts;
}
}
function emitJsxTagName(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
emitExpression(node);
}
else {
@@ -45581,11 +47181,11 @@ var ts;
}
function emitCatchClause(node) {
writeLine();
- var openParenPos = writeToken(72, node.pos);
+ var openParenPos = writeToken(73, node.pos);
write(" ");
- writeToken(17, openParenPos);
+ writeToken(18, openParenPos);
emit(node.variableDeclaration);
- writeToken(18, node.variableDeclaration ? node.variableDeclaration.end : openParenPos);
+ writeToken(19, node.variableDeclaration ? node.variableDeclaration.end : openParenPos);
write(" ");
emit(node.block);
}
@@ -45692,7 +47292,7 @@ var ts;
paramEmitted = true;
helpersEmitted = true;
}
- if (!awaiterEmitted && node.flags & 8192) {
+ if ((languageVersion < 4) && (!awaiterEmitted && node.flags & 8192)) {
writeLines(awaiterHelper);
if (languageVersion < 2) {
writeLines(generatorHelper);
@@ -46001,7 +47601,7 @@ var ts;
&& !ts.rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile);
}
function skipSynthesizedParentheses(node) {
- while (node.kind === 178 && ts.nodeIsSynthesized(node)) {
+ while (node.kind === 179 && ts.nodeIsSynthesized(node)) {
node = node.expression;
}
return node;
@@ -46108,19 +47708,19 @@ var ts;
}
function generateNameForNode(node) {
switch (node.kind) {
- case 69:
+ case 70:
return makeUniqueName(getTextOfNode(node));
+ case 226:
case 225:
- case 224:
return generateNameForModuleOrEnum(node);
- case 230:
- case 236:
+ case 231:
+ case 237:
return generateNameForImportOrExportDeclaration(node);
- case 220:
case 221:
- case 235:
+ case 222:
+ case 236:
return generateNameForExportDefault();
- case 192:
+ case 193:
return generateNameForClassExpression();
default:
return makeTempVariableName(0);
@@ -46190,6 +47790,68 @@ var ts;
}
}
ts.emitFiles = emitFiles;
+ var ListFormat;
+ (function (ListFormat) {
+ ListFormat[ListFormat["None"] = 0] = "None";
+ ListFormat[ListFormat["SingleLine"] = 0] = "SingleLine";
+ ListFormat[ListFormat["MultiLine"] = 1] = "MultiLine";
+ ListFormat[ListFormat["PreserveLines"] = 2] = "PreserveLines";
+ ListFormat[ListFormat["LinesMask"] = 3] = "LinesMask";
+ ListFormat[ListFormat["NotDelimited"] = 0] = "NotDelimited";
+ ListFormat[ListFormat["BarDelimited"] = 4] = "BarDelimited";
+ ListFormat[ListFormat["AmpersandDelimited"] = 8] = "AmpersandDelimited";
+ ListFormat[ListFormat["CommaDelimited"] = 16] = "CommaDelimited";
+ ListFormat[ListFormat["DelimitersMask"] = 28] = "DelimitersMask";
+ ListFormat[ListFormat["AllowTrailingComma"] = 32] = "AllowTrailingComma";
+ ListFormat[ListFormat["Indented"] = 64] = "Indented";
+ ListFormat[ListFormat["SpaceBetweenBraces"] = 128] = "SpaceBetweenBraces";
+ ListFormat[ListFormat["SpaceBetweenSiblings"] = 256] = "SpaceBetweenSiblings";
+ ListFormat[ListFormat["Braces"] = 512] = "Braces";
+ ListFormat[ListFormat["Parenthesis"] = 1024] = "Parenthesis";
+ ListFormat[ListFormat["AngleBrackets"] = 2048] = "AngleBrackets";
+ ListFormat[ListFormat["SquareBrackets"] = 4096] = "SquareBrackets";
+ ListFormat[ListFormat["BracketsMask"] = 7680] = "BracketsMask";
+ ListFormat[ListFormat["OptionalIfUndefined"] = 8192] = "OptionalIfUndefined";
+ ListFormat[ListFormat["OptionalIfEmpty"] = 16384] = "OptionalIfEmpty";
+ ListFormat[ListFormat["Optional"] = 24576] = "Optional";
+ ListFormat[ListFormat["PreferNewLine"] = 32768] = "PreferNewLine";
+ ListFormat[ListFormat["NoTrailingNewLine"] = 65536] = "NoTrailingNewLine";
+ ListFormat[ListFormat["NoInterveningComments"] = 131072] = "NoInterveningComments";
+ ListFormat[ListFormat["Modifiers"] = 256] = "Modifiers";
+ ListFormat[ListFormat["HeritageClauses"] = 256] = "HeritageClauses";
+ ListFormat[ListFormat["TypeLiteralMembers"] = 65] = "TypeLiteralMembers";
+ ListFormat[ListFormat["TupleTypeElements"] = 336] = "TupleTypeElements";
+ ListFormat[ListFormat["UnionTypeConstituents"] = 260] = "UnionTypeConstituents";
+ ListFormat[ListFormat["IntersectionTypeConstituents"] = 264] = "IntersectionTypeConstituents";
+ ListFormat[ListFormat["ObjectBindingPatternElements"] = 432] = "ObjectBindingPatternElements";
+ ListFormat[ListFormat["ArrayBindingPatternElements"] = 304] = "ArrayBindingPatternElements";
+ ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 978] = "ObjectLiteralExpressionProperties";
+ ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 4466] = "ArrayLiteralExpressionElements";
+ ListFormat[ListFormat["CallExpressionArguments"] = 1296] = "CallExpressionArguments";
+ ListFormat[ListFormat["NewExpressionArguments"] = 9488] = "NewExpressionArguments";
+ ListFormat[ListFormat["TemplateExpressionSpans"] = 131072] = "TemplateExpressionSpans";
+ ListFormat[ListFormat["SingleLineBlockStatements"] = 384] = "SingleLineBlockStatements";
+ ListFormat[ListFormat["MultiLineBlockStatements"] = 65] = "MultiLineBlockStatements";
+ ListFormat[ListFormat["VariableDeclarationList"] = 272] = "VariableDeclarationList";
+ ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 384] = "SingleLineFunctionBodyStatements";
+ ListFormat[ListFormat["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements";
+ ListFormat[ListFormat["ClassHeritageClauses"] = 256] = "ClassHeritageClauses";
+ ListFormat[ListFormat["ClassMembers"] = 65] = "ClassMembers";
+ ListFormat[ListFormat["InterfaceMembers"] = 65] = "InterfaceMembers";
+ ListFormat[ListFormat["EnumMembers"] = 81] = "EnumMembers";
+ ListFormat[ListFormat["CaseBlockClauses"] = 65] = "CaseBlockClauses";
+ ListFormat[ListFormat["NamedImportsOrExportsElements"] = 432] = "NamedImportsOrExportsElements";
+ ListFormat[ListFormat["JsxElementChildren"] = 131072] = "JsxElementChildren";
+ ListFormat[ListFormat["JsxElementAttributes"] = 131328] = "JsxElementAttributes";
+ ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 81985] = "CaseOrDefaultClauseStatements";
+ ListFormat[ListFormat["HeritageClauseTypes"] = 272] = "HeritageClauseTypes";
+ ListFormat[ListFormat["SourceFileStatements"] = 65537] = "SourceFileStatements";
+ ListFormat[ListFormat["Decorators"] = 24577] = "Decorators";
+ ListFormat[ListFormat["TypeArguments"] = 26960] = "TypeArguments";
+ ListFormat[ListFormat["TypeParameters"] = 26960] = "TypeParameters";
+ ListFormat[ListFormat["Parameters"] = 1360] = "Parameters";
+ ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters";
+ })(ListFormat || (ListFormat = {}));
})(ts || (ts = {}));
var ts;
(function (ts) {
@@ -46643,7 +48305,7 @@ var ts;
getSourceFiles: program.getSourceFiles,
isSourceFileFromExternalLibrary: function (file) { return !!sourceFilesFoundSearchingNodeModules[file.path]; },
writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }),
- isEmitBlocked: isEmitBlocked
+ isEmitBlocked: isEmitBlocked,
};
}
function getDiagnosticsProducingTypeChecker() {
@@ -46721,7 +48383,7 @@ var ts;
return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken);
}
}
- function getSyntacticDiagnosticsForFile(sourceFile, cancellationToken) {
+ function getSyntacticDiagnosticsForFile(sourceFile) {
return sourceFile.parseDiagnostics;
}
function runWithCancellationToken(func) {
@@ -46742,14 +48404,14 @@ var ts;
ts.Debug.assert(!!sourceFile.bindDiagnostics);
var bindDiagnostics = sourceFile.bindDiagnostics;
var checkDiagnostics = ts.isSourceFileJavaScript(sourceFile) ?
- getJavaScriptSemanticDiagnosticsForFile(sourceFile, cancellationToken) :
+ getJavaScriptSemanticDiagnosticsForFile(sourceFile) :
typeChecker.getDiagnostics(sourceFile, cancellationToken);
var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName);
var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName);
- return bindDiagnostics.concat(checkDiagnostics).concat(fileProcessingDiagnosticsInFile).concat(programDiagnosticsInFile);
+ return bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile);
});
}
- function getJavaScriptSemanticDiagnosticsForFile(sourceFile, cancellationToken) {
+ function getJavaScriptSemanticDiagnosticsForFile(sourceFile) {
return runWithCancellationToken(function () {
var diagnostics = [];
walk(sourceFile);
@@ -46759,16 +48421,16 @@ var ts;
return false;
}
switch (node.kind) {
- case 229:
+ case 230:
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file));
return true;
- case 235:
+ case 236:
if (node.isExportEquals) {
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file));
return true;
}
break;
- case 221:
+ case 222:
var classDeclaration = node;
if (checkModifiers(classDeclaration.modifiers) ||
checkTypeParameters(classDeclaration.typeParameters)) {
@@ -46777,29 +48439,29 @@ var ts;
break;
case 251:
var heritageClause = node;
- if (heritageClause.token === 106) {
+ if (heritageClause.token === 107) {
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file));
return true;
}
break;
- case 222:
+ case 223:
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file));
return true;
- case 225:
+ case 226:
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file));
return true;
- case 223:
+ case 224:
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file));
return true;
- case 147:
- case 146:
case 148:
+ case 147:
case 149:
case 150:
- case 179:
- case 220:
+ case 151:
case 180:
- case 220:
+ case 221:
+ case 181:
+ case 221:
var functionDeclaration = node;
if (checkModifiers(functionDeclaration.modifiers) ||
checkTypeParameters(functionDeclaration.typeParameters) ||
@@ -46807,20 +48469,20 @@ var ts;
return true;
}
break;
- case 200:
+ case 201:
var variableStatement = node;
if (checkModifiers(variableStatement.modifiers)) {
return true;
}
break;
- case 218:
+ case 219:
var variableDeclaration = node;
if (checkTypeAnnotation(variableDeclaration.type)) {
return true;
}
break;
- case 174:
case 175:
+ case 176:
var expression = node;
if (expression.typeArguments && expression.typeArguments.length > 0) {
var start = expression.typeArguments.pos;
@@ -46828,7 +48490,7 @@ var ts;
return true;
}
break;
- case 142:
+ case 143:
var parameter = node;
if (parameter.modifiers) {
var start = parameter.modifiers.pos;
@@ -46844,12 +48506,12 @@ var ts;
return true;
}
break;
- case 145:
+ case 146:
var propertyDeclaration = node;
if (propertyDeclaration.modifiers) {
for (var _i = 0, _a = propertyDeclaration.modifiers; _i < _a.length; _i++) {
var modifier = _a[_i];
- if (modifier.kind !== 113) {
+ if (modifier.kind !== 114) {
diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind)));
return true;
}
@@ -46859,14 +48521,14 @@ var ts;
return true;
}
break;
- case 224:
+ case 225:
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file));
return true;
- case 177:
+ case 178:
var typeAssertionExpression = node;
diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file));
return true;
- case 143:
+ case 144:
if (!options.experimentalDecorators) {
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning));
}
@@ -46894,18 +48556,18 @@ var ts;
for (var _i = 0, modifiers_1 = modifiers; _i < modifiers_1.length; _i++) {
var modifier = modifiers_1[_i];
switch (modifier.kind) {
- case 112:
- case 110:
+ case 113:
case 111:
- case 128:
- case 122:
+ case 112:
+ case 129:
+ case 123:
diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind)));
return true;
- case 113:
- case 82:
- case 74:
- case 77:
- case 115:
+ case 114:
+ case 83:
+ case 75:
+ case 78:
+ case 116:
}
}
}
@@ -46938,7 +48600,7 @@ var ts;
return ts.getBaseFileName(fileName).indexOf(".") >= 0;
}
function processRootFile(fileName, isDefaultLib) {
- processSourceFile(ts.normalizePath(fileName), isDefaultLib, true);
+ processSourceFile(ts.normalizePath(fileName), isDefaultLib);
}
function fileReferenceIsEqualTo(a, b) {
return a.fileName === b.fileName;
@@ -46977,9 +48639,9 @@ var ts;
return;
function collectModuleReferences(node, inAmbientModule) {
switch (node.kind) {
+ case 231:
case 230:
- case 229:
- case 236:
+ case 237:
var moduleNameExpr = ts.getExternalModuleName(node);
if (!moduleNameExpr || moduleNameExpr.kind !== 9) {
break;
@@ -46991,7 +48653,7 @@ var ts;
(imports || (imports = [])).push(moduleNameExpr);
}
break;
- case 225:
+ case 226:
if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2) || ts.isDeclarationFile(file))) {
var moduleName = node.name;
if (isExternalModuleFile || (inAmbientModule && !ts.isExternalModuleNameRelative(moduleName.text))) {
@@ -47018,7 +48680,7 @@ var ts;
}
}
}
- function processSourceFile(fileName, isDefaultLib, isReference, refFile, refPos, refEnd) {
+ function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) {
var diagnosticArgument;
var diagnostic;
if (hasExtension(fileName)) {
@@ -47026,7 +48688,7 @@ var ts;
diagnostic = ts.Diagnostics.File_0_has_unsupported_extension_The_only_supported_extensions_are_1;
diagnosticArgument = [fileName, "'" + supportedExtensions.join("', '") + "'"];
}
- else if (!findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, isReference, refFile, refPos, refEnd)) {
+ else if (!findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd)) {
diagnostic = ts.Diagnostics.File_0_not_found;
diagnosticArgument = [fileName];
}
@@ -47036,13 +48698,13 @@ var ts;
}
}
else {
- var nonTsFile = options.allowNonTsExtensions && findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, isReference, refFile, refPos, refEnd);
+ var nonTsFile = options.allowNonTsExtensions && findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd);
if (!nonTsFile) {
if (options.allowNonTsExtensions) {
diagnostic = ts.Diagnostics.File_0_not_found;
diagnosticArgument = [fileName];
}
- else if (!ts.forEach(supportedExtensions, function (extension) { return findSourceFile(fileName + extension, ts.toPath(fileName + extension, currentDirectory, getCanonicalFileName), isDefaultLib, isReference, refFile, refPos, refEnd); })) {
+ else if (!ts.forEach(supportedExtensions, function (extension) { return findSourceFile(fileName + extension, ts.toPath(fileName + extension, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd); })) {
diagnostic = ts.Diagnostics.File_0_not_found;
fileName += ".ts";
diagnosticArgument = [fileName];
@@ -47066,7 +48728,7 @@ var ts;
fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, existingFileName));
}
}
- function findSourceFile(fileName, path, isDefaultLib, isReference, refFile, refPos, refEnd) {
+ function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd) {
if (filesByName.contains(path)) {
var file_1 = filesByName.get(path);
if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) {
@@ -47075,16 +48737,16 @@ var ts;
if (file_1 && sourceFilesFoundSearchingNodeModules[file_1.path] && currentNodeModulesDepth == 0) {
sourceFilesFoundSearchingNodeModules[file_1.path] = false;
if (!options.noResolve) {
- processReferencedFiles(file_1, ts.getDirectoryPath(fileName), isDefaultLib);
+ processReferencedFiles(file_1, isDefaultLib);
processTypeReferenceDirectives(file_1);
}
modulesWithElidedImports[file_1.path] = false;
- processImportedModules(file_1, ts.getDirectoryPath(fileName));
+ processImportedModules(file_1);
}
else if (file_1 && modulesWithElidedImports[file_1.path]) {
if (currentNodeModulesDepth < maxNodeModulesJsDepth) {
modulesWithElidedImports[file_1.path] = false;
- processImportedModules(file_1, ts.getDirectoryPath(fileName));
+ processImportedModules(file_1);
}
}
return file_1;
@@ -47111,12 +48773,11 @@ var ts;
}
}
skipDefaultLib = skipDefaultLib || file.hasNoDefaultLib;
- var basePath = ts.getDirectoryPath(fileName);
if (!options.noResolve) {
- processReferencedFiles(file, basePath, isDefaultLib);
+ processReferencedFiles(file, isDefaultLib);
processTypeReferenceDirectives(file);
}
- processImportedModules(file, basePath);
+ processImportedModules(file);
if (isDefaultLib) {
files.unshift(file);
}
@@ -47126,10 +48787,10 @@ var ts;
}
return file;
}
- function processReferencedFiles(file, basePath, isDefaultLib) {
+ function processReferencedFiles(file, isDefaultLib) {
ts.forEach(file.referencedFiles, function (ref) {
var referencedFileName = resolveTripleslashReference(ref.fileName, file.fileName);
- processSourceFile(referencedFileName, isDefaultLib, true, file, ref.pos, ref.end);
+ processSourceFile(referencedFileName, isDefaultLib, file, ref.pos, ref.end);
});
}
function processTypeReferenceDirectives(file) {
@@ -47151,7 +48812,7 @@ var ts;
var saveResolution = true;
if (resolvedTypeReferenceDirective) {
if (resolvedTypeReferenceDirective.primary) {
- processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, false, true, refFile, refPos, refEnd);
+ processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, false, refFile, refPos, refEnd);
}
else {
if (previousResolution) {
@@ -47162,7 +48823,7 @@ var ts;
saveResolution = false;
}
else {
- processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, false, true, refFile, refPos, refEnd);
+ processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, false, refFile, refPos, refEnd);
}
}
}
@@ -47188,7 +48849,7 @@ var ts;
function getCanonicalFileName(fileName) {
return host.getCanonicalFileName(fileName);
}
- function processImportedModules(file, basePath) {
+ function processImportedModules(file) {
collectExternalModuleReferences(file);
if (file.imports.length || file.moduleAugmentations.length) {
file.resolvedModules = ts.createMap();
@@ -47208,7 +48869,7 @@ var ts;
modulesWithElidedImports[file.path] = true;
}
else if (shouldAddFile) {
- findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end);
+ findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end);
}
if (isFromNodeModulesSearch) {
currentNodeModulesDepth--;
@@ -47378,7 +49039,7 @@ var ts;
if (!options.noEmit && !options.suppressOutputPathCheck) {
var emitHost = getEmitHost();
var emitFilesSeen_1 = ts.createFileMap(!host.useCaseSensitiveFileNames() ? function (key) { return key.toLocaleLowerCase(); } : undefined);
- ts.forEachExpectedEmitFile(emitHost, function (emitFileNames, sourceFiles, isBundledEmit) {
+ ts.forEachExpectedEmitFile(emitHost, function (emitFileNames) {
verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1);
verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1);
});
@@ -47387,10 +49048,10 @@ var ts;
if (emitFileName) {
var emitFilePath = ts.toPath(emitFileName, currentDirectory, getCanonicalFileName);
if (filesByName.contains(emitFilePath)) {
- createEmitBlockingDiagnostics(emitFileName, emitFilePath, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file);
+ createEmitBlockingDiagnostics(emitFileName, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file);
}
if (emitFilesSeen.contains(emitFilePath)) {
- createEmitBlockingDiagnostics(emitFileName, emitFilePath, ts.Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files);
+ createEmitBlockingDiagnostics(emitFileName, ts.Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files);
}
else {
emitFilesSeen.set(emitFilePath, true);
@@ -47398,7 +49059,7 @@ var ts;
}
}
}
- function createEmitBlockingDiagnostics(emitFileName, emitFilePath, message) {
+ function createEmitBlockingDiagnostics(emitFileName, message) {
hasEmitBlockingDiagnostics.set(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName), true);
programDiagnostics.add(ts.createCompilerDiagnostic(message, emitFileName));
}
@@ -47411,24 +49072,24 @@ var ts;
ts.optionDeclarations = [
{
name: "charset",
- type: "string"
+ type: "string",
},
ts.compileOnSaveCommandLineOption,
{
name: "declaration",
shortName: "d",
type: "boolean",
- description: ts.Diagnostics.Generates_corresponding_d_ts_file
+ description: ts.Diagnostics.Generates_corresponding_d_ts_file,
},
{
name: "declarationDir",
type: "string",
isFilePath: true,
- paramType: ts.Diagnostics.DIRECTORY
+ paramType: ts.Diagnostics.DIRECTORY,
},
{
name: "diagnostics",
- type: "boolean"
+ type: "boolean",
},
{
name: "extendedDiagnostics",
@@ -47443,7 +49104,7 @@ var ts;
name: "help",
shortName: "h",
type: "boolean",
- description: ts.Diagnostics.Print_this_message
+ description: ts.Diagnostics.Print_this_message,
},
{
name: "help",
@@ -47453,15 +49114,15 @@ var ts;
{
name: "init",
type: "boolean",
- description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file
+ description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,
},
{
name: "inlineSourceMap",
- type: "boolean"
+ type: "boolean",
},
{
name: "inlineSources",
- type: "boolean"
+ type: "boolean",
},
{
name: "jsx",
@@ -47470,7 +49131,7 @@ var ts;
"react": 2
}),
paramType: ts.Diagnostics.KIND,
- description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react
+ description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react,
},
{
name: "reactNamespace",
@@ -47479,18 +49140,18 @@ var ts;
},
{
name: "listFiles",
- type: "boolean"
+ type: "boolean",
},
{
name: "locale",
- type: "string"
+ type: "string",
},
{
name: "mapRoot",
type: "string",
isFilePath: true,
description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,
- paramType: ts.Diagnostics.LOCATION
+ paramType: ts.Diagnostics.LOCATION,
},
{
name: "module",
@@ -47501,11 +49162,11 @@ var ts;
"amd": ts.ModuleKind.AMD,
"system": ts.ModuleKind.System,
"umd": ts.ModuleKind.UMD,
- "es6": ts.ModuleKind.ES6,
- "es2015": ts.ModuleKind.ES2015
+ "es6": ts.ModuleKind.ES2015,
+ "es2015": ts.ModuleKind.ES2015,
}),
description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015,
- paramType: ts.Diagnostics.KIND
+ paramType: ts.Diagnostics.KIND,
},
{
name: "newLine",
@@ -47514,12 +49175,12 @@ var ts;
"lf": 1
}),
description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix,
- paramType: ts.Diagnostics.NEWLINE
+ paramType: ts.Diagnostics.NEWLINE,
},
{
name: "noEmit",
type: "boolean",
- description: ts.Diagnostics.Do_not_emit_outputs
+ description: ts.Diagnostics.Do_not_emit_outputs,
},
{
name: "noEmitHelpers",
@@ -47528,7 +49189,7 @@ var ts;
{
name: "noEmitOnError",
type: "boolean",
- description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported
+ description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported,
},
{
name: "noErrorTruncation",
@@ -47537,59 +49198,59 @@ var ts;
{
name: "noImplicitAny",
type: "boolean",
- description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type
+ description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type,
},
{
name: "noImplicitThis",
type: "boolean",
- description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type
+ description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type,
},
{
name: "noUnusedLocals",
type: "boolean",
- description: ts.Diagnostics.Report_errors_on_unused_locals
+ description: ts.Diagnostics.Report_errors_on_unused_locals,
},
{
name: "noUnusedParameters",
type: "boolean",
- description: ts.Diagnostics.Report_errors_on_unused_parameters
+ description: ts.Diagnostics.Report_errors_on_unused_parameters,
},
{
name: "noLib",
- type: "boolean"
+ type: "boolean",
},
{
name: "noResolve",
- type: "boolean"
+ type: "boolean",
},
{
name: "skipDefaultLibCheck",
- type: "boolean"
+ type: "boolean",
},
{
name: "skipLibCheck",
type: "boolean",
- description: ts.Diagnostics.Skip_type_checking_of_declaration_files
+ description: ts.Diagnostics.Skip_type_checking_of_declaration_files,
},
{
name: "out",
type: "string",
isFilePath: false,
- paramType: ts.Diagnostics.FILE
+ paramType: ts.Diagnostics.FILE,
},
{
name: "outFile",
type: "string",
isFilePath: true,
description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file,
- paramType: ts.Diagnostics.FILE
+ paramType: ts.Diagnostics.FILE,
},
{
name: "outDir",
type: "string",
isFilePath: true,
description: ts.Diagnostics.Redirect_output_structure_to_the_directory,
- paramType: ts.Diagnostics.DIRECTORY
+ paramType: ts.Diagnostics.DIRECTORY,
},
{
name: "preserveConstEnums",
@@ -47612,30 +49273,30 @@ var ts;
{
name: "removeComments",
type: "boolean",
- description: ts.Diagnostics.Do_not_emit_comments_to_output
+ description: ts.Diagnostics.Do_not_emit_comments_to_output,
},
{
name: "rootDir",
type: "string",
isFilePath: true,
paramType: ts.Diagnostics.LOCATION,
- description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir
+ description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir,
},
{
name: "isolatedModules",
- type: "boolean"
+ type: "boolean",
},
{
name: "sourceMap",
type: "boolean",
- description: ts.Diagnostics.Generates_corresponding_map_file
+ description: ts.Diagnostics.Generates_corresponding_map_file,
},
{
name: "sourceRoot",
type: "string",
isFilePath: true,
description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations,
- paramType: ts.Diagnostics.LOCATION
+ paramType: ts.Diagnostics.LOCATION,
},
{
name: "suppressExcessPropertyErrors",
@@ -47646,7 +49307,7 @@ var ts;
{
name: "suppressImplicitAnyIndexErrors",
type: "boolean",
- description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures
+ description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures,
},
{
name: "stripInternal",
@@ -47661,22 +49322,24 @@ var ts;
"es3": 0,
"es5": 1,
"es6": 2,
- "es2015": 2
+ "es2015": 2,
+ "es2016": 3,
+ "es2017": 4,
}),
description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015,
- paramType: ts.Diagnostics.VERSION
+ paramType: ts.Diagnostics.VERSION,
},
{
name: "version",
shortName: "v",
type: "boolean",
- description: ts.Diagnostics.Print_the_compiler_s_version
+ description: ts.Diagnostics.Print_the_compiler_s_version,
},
{
name: "watch",
shortName: "w",
type: "boolean",
- description: ts.Diagnostics.Watch_input_files
+ description: ts.Diagnostics.Watch_input_files,
},
{
name: "experimentalDecorators",
@@ -47693,10 +49356,10 @@ var ts;
name: "moduleResolution",
type: ts.createMap({
"node": ts.ModuleResolutionKind.NodeJs,
- "classic": ts.ModuleResolutionKind.Classic
+ "classic": ts.ModuleResolutionKind.Classic,
}),
description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6,
- paramType: ts.Diagnostics.STRATEGY
+ paramType: ts.Diagnostics.STRATEGY,
},
{
name: "allowUnusedLabels",
@@ -47819,7 +49482,7 @@ var ts;
"es2016.array.include": "lib.es2016.array.include.d.ts",
"es2017.object": "lib.es2017.object.d.ts",
"es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts"
- })
+ }),
},
description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon
},
@@ -47846,7 +49509,7 @@ var ts;
ts.typingOptionDeclarations = [
{
name: "enableAutoDiscovery",
- type: "boolean"
+ type: "boolean",
},
{
name: "include",
@@ -47869,7 +49532,7 @@ var ts;
module: ts.ModuleKind.CommonJS,
target: 1,
noImplicitAny: false,
- sourceMap: false
+ sourceMap: false,
};
var optionNameMapCache;
function getOptionNameMap() {
@@ -47889,10 +49552,7 @@ var ts;
}
ts.getOptionNameMap = getOptionNameMap;
function createCompilerDiagnosticForInvalidCustomType(opt) {
- var namesOfType = [];
- for (var key in opt.type) {
- namesOfType.push(" '" + key + "'");
- }
+ var namesOfType = Object.keys(opt.type).map(function (key) { return "'" + key + "'"; }).join(", ");
return ts.createCompilerDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
}
ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
@@ -48507,7 +50167,7 @@ var ts;
reportDiagnostic(diagnostic, host);
}
}
- function reportEmittedFiles(files, host) {
+ function reportEmittedFiles(files) {
if (!files || files.length == 0) {
return;
}
@@ -48566,10 +50226,10 @@ var ts;
});
return count;
}
- function getDiagnosticText(message) {
- var args = [];
+ function getDiagnosticText(_message) {
+ var _args = [];
for (var _i = 1; _i < arguments.length; _i++) {
- args[_i - 1] = arguments[_i];
+ _args[_i - 1] = arguments[_i];
}
var diagnostic = ts.createCompilerDiagnostic.apply(undefined, arguments);
return diagnostic.messageText;
@@ -48841,7 +50501,7 @@ var ts;
}
var sourceFile = hostGetSourceFile(fileName, languageVersion, onError);
if (sourceFile && ts.isWatchSet(compilerOptions) && ts.sys.watchFile) {
- sourceFile.fileWatcher = ts.sys.watchFile(sourceFile.fileName, function (fileName, removed) { return sourceFileChanged(sourceFile, removed); });
+ sourceFile.fileWatcher = ts.sys.watchFile(sourceFile.fileName, function (_fileName, removed) { return sourceFileChanged(sourceFile, removed); });
}
return sourceFile;
}
@@ -48963,7 +50623,7 @@ var ts;
var emitOutput = program.emit();
diagnostics = diagnostics.concat(emitOutput.diagnostics);
reportDiagnostics(ts.sortAndDeduplicateDiagnostics(diagnostics), compilerHost);
- reportEmittedFiles(emitOutput.emittedFiles, compilerHost);
+ reportEmittedFiles(emitOutput.emittedFiles);
if (emitOutput.emitSkipped && diagnostics.length > 0) {
return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
@@ -49105,3 +50765,5 @@ if (ts.sys.tryEnableSourceMapsForHost && /^development$/i.test(ts.sys.getEnviron
ts.sys.tryEnableSourceMapsForHost();
}
ts.executeCommandLine(ts.sys.args);
+
+//# sourceMappingURL=tsc.js.map
diff --git a/lib/tsserver.js b/lib/tsserver.js
index f5437988c1a..be6578b0762 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -20,6 +20,418 @@ var __extends = (this && this.__extends) || function (d, b) {
};
var ts;
(function (ts) {
+ (function (SyntaxKind) {
+ SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown";
+ SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken";
+ SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia";
+ SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia";
+ SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia";
+ SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia";
+ SyntaxKind[SyntaxKind["ShebangTrivia"] = 6] = "ShebangTrivia";
+ SyntaxKind[SyntaxKind["ConflictMarkerTrivia"] = 7] = "ConflictMarkerTrivia";
+ SyntaxKind[SyntaxKind["NumericLiteral"] = 8] = "NumericLiteral";
+ SyntaxKind[SyntaxKind["StringLiteral"] = 9] = "StringLiteral";
+ SyntaxKind[SyntaxKind["JsxText"] = 10] = "JsxText";
+ SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 11] = "RegularExpressionLiteral";
+ SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 12] = "NoSubstitutionTemplateLiteral";
+ SyntaxKind[SyntaxKind["TemplateHead"] = 13] = "TemplateHead";
+ SyntaxKind[SyntaxKind["TemplateMiddle"] = 14] = "TemplateMiddle";
+ SyntaxKind[SyntaxKind["TemplateTail"] = 15] = "TemplateTail";
+ SyntaxKind[SyntaxKind["OpenBraceToken"] = 16] = "OpenBraceToken";
+ SyntaxKind[SyntaxKind["CloseBraceToken"] = 17] = "CloseBraceToken";
+ SyntaxKind[SyntaxKind["OpenParenToken"] = 18] = "OpenParenToken";
+ SyntaxKind[SyntaxKind["CloseParenToken"] = 19] = "CloseParenToken";
+ SyntaxKind[SyntaxKind["OpenBracketToken"] = 20] = "OpenBracketToken";
+ SyntaxKind[SyntaxKind["CloseBracketToken"] = 21] = "CloseBracketToken";
+ SyntaxKind[SyntaxKind["DotToken"] = 22] = "DotToken";
+ SyntaxKind[SyntaxKind["DotDotDotToken"] = 23] = "DotDotDotToken";
+ SyntaxKind[SyntaxKind["SemicolonToken"] = 24] = "SemicolonToken";
+ SyntaxKind[SyntaxKind["CommaToken"] = 25] = "CommaToken";
+ SyntaxKind[SyntaxKind["LessThanToken"] = 26] = "LessThanToken";
+ SyntaxKind[SyntaxKind["LessThanSlashToken"] = 27] = "LessThanSlashToken";
+ SyntaxKind[SyntaxKind["GreaterThanToken"] = 28] = "GreaterThanToken";
+ SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 29] = "LessThanEqualsToken";
+ SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 30] = "GreaterThanEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 31] = "EqualsEqualsToken";
+ SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 32] = "ExclamationEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 33] = "EqualsEqualsEqualsToken";
+ SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 34] = "ExclamationEqualsEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 35] = "EqualsGreaterThanToken";
+ SyntaxKind[SyntaxKind["PlusToken"] = 36] = "PlusToken";
+ SyntaxKind[SyntaxKind["MinusToken"] = 37] = "MinusToken";
+ SyntaxKind[SyntaxKind["AsteriskToken"] = 38] = "AsteriskToken";
+ SyntaxKind[SyntaxKind["AsteriskAsteriskToken"] = 39] = "AsteriskAsteriskToken";
+ SyntaxKind[SyntaxKind["SlashToken"] = 40] = "SlashToken";
+ SyntaxKind[SyntaxKind["PercentToken"] = 41] = "PercentToken";
+ SyntaxKind[SyntaxKind["PlusPlusToken"] = 42] = "PlusPlusToken";
+ SyntaxKind[SyntaxKind["MinusMinusToken"] = 43] = "MinusMinusToken";
+ SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 44] = "LessThanLessThanToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 45] = "GreaterThanGreaterThanToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 46] = "GreaterThanGreaterThanGreaterThanToken";
+ SyntaxKind[SyntaxKind["AmpersandToken"] = 47] = "AmpersandToken";
+ SyntaxKind[SyntaxKind["BarToken"] = 48] = "BarToken";
+ SyntaxKind[SyntaxKind["CaretToken"] = 49] = "CaretToken";
+ SyntaxKind[SyntaxKind["ExclamationToken"] = 50] = "ExclamationToken";
+ SyntaxKind[SyntaxKind["TildeToken"] = 51] = "TildeToken";
+ SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 52] = "AmpersandAmpersandToken";
+ SyntaxKind[SyntaxKind["BarBarToken"] = 53] = "BarBarToken";
+ SyntaxKind[SyntaxKind["QuestionToken"] = 54] = "QuestionToken";
+ SyntaxKind[SyntaxKind["ColonToken"] = 55] = "ColonToken";
+ SyntaxKind[SyntaxKind["AtToken"] = 56] = "AtToken";
+ SyntaxKind[SyntaxKind["EqualsToken"] = 57] = "EqualsToken";
+ SyntaxKind[SyntaxKind["PlusEqualsToken"] = 58] = "PlusEqualsToken";
+ SyntaxKind[SyntaxKind["MinusEqualsToken"] = 59] = "MinusEqualsToken";
+ SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 60] = "AsteriskEqualsToken";
+ SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 61] = "AsteriskAsteriskEqualsToken";
+ SyntaxKind[SyntaxKind["SlashEqualsToken"] = 62] = "SlashEqualsToken";
+ SyntaxKind[SyntaxKind["PercentEqualsToken"] = 63] = "PercentEqualsToken";
+ SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 64] = "LessThanLessThanEqualsToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 65] = "GreaterThanGreaterThanEqualsToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 66] = "GreaterThanGreaterThanGreaterThanEqualsToken";
+ SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 67] = "AmpersandEqualsToken";
+ SyntaxKind[SyntaxKind["BarEqualsToken"] = 68] = "BarEqualsToken";
+ SyntaxKind[SyntaxKind["CaretEqualsToken"] = 69] = "CaretEqualsToken";
+ SyntaxKind[SyntaxKind["Identifier"] = 70] = "Identifier";
+ SyntaxKind[SyntaxKind["BreakKeyword"] = 71] = "BreakKeyword";
+ SyntaxKind[SyntaxKind["CaseKeyword"] = 72] = "CaseKeyword";
+ SyntaxKind[SyntaxKind["CatchKeyword"] = 73] = "CatchKeyword";
+ SyntaxKind[SyntaxKind["ClassKeyword"] = 74] = "ClassKeyword";
+ SyntaxKind[SyntaxKind["ConstKeyword"] = 75] = "ConstKeyword";
+ SyntaxKind[SyntaxKind["ContinueKeyword"] = 76] = "ContinueKeyword";
+ SyntaxKind[SyntaxKind["DebuggerKeyword"] = 77] = "DebuggerKeyword";
+ SyntaxKind[SyntaxKind["DefaultKeyword"] = 78] = "DefaultKeyword";
+ SyntaxKind[SyntaxKind["DeleteKeyword"] = 79] = "DeleteKeyword";
+ SyntaxKind[SyntaxKind["DoKeyword"] = 80] = "DoKeyword";
+ SyntaxKind[SyntaxKind["ElseKeyword"] = 81] = "ElseKeyword";
+ SyntaxKind[SyntaxKind["EnumKeyword"] = 82] = "EnumKeyword";
+ SyntaxKind[SyntaxKind["ExportKeyword"] = 83] = "ExportKeyword";
+ SyntaxKind[SyntaxKind["ExtendsKeyword"] = 84] = "ExtendsKeyword";
+ SyntaxKind[SyntaxKind["FalseKeyword"] = 85] = "FalseKeyword";
+ SyntaxKind[SyntaxKind["FinallyKeyword"] = 86] = "FinallyKeyword";
+ SyntaxKind[SyntaxKind["ForKeyword"] = 87] = "ForKeyword";
+ SyntaxKind[SyntaxKind["FunctionKeyword"] = 88] = "FunctionKeyword";
+ SyntaxKind[SyntaxKind["IfKeyword"] = 89] = "IfKeyword";
+ SyntaxKind[SyntaxKind["ImportKeyword"] = 90] = "ImportKeyword";
+ SyntaxKind[SyntaxKind["InKeyword"] = 91] = "InKeyword";
+ SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 92] = "InstanceOfKeyword";
+ SyntaxKind[SyntaxKind["NewKeyword"] = 93] = "NewKeyword";
+ SyntaxKind[SyntaxKind["NullKeyword"] = 94] = "NullKeyword";
+ SyntaxKind[SyntaxKind["ReturnKeyword"] = 95] = "ReturnKeyword";
+ SyntaxKind[SyntaxKind["SuperKeyword"] = 96] = "SuperKeyword";
+ SyntaxKind[SyntaxKind["SwitchKeyword"] = 97] = "SwitchKeyword";
+ SyntaxKind[SyntaxKind["ThisKeyword"] = 98] = "ThisKeyword";
+ SyntaxKind[SyntaxKind["ThrowKeyword"] = 99] = "ThrowKeyword";
+ SyntaxKind[SyntaxKind["TrueKeyword"] = 100] = "TrueKeyword";
+ SyntaxKind[SyntaxKind["TryKeyword"] = 101] = "TryKeyword";
+ SyntaxKind[SyntaxKind["TypeOfKeyword"] = 102] = "TypeOfKeyword";
+ SyntaxKind[SyntaxKind["VarKeyword"] = 103] = "VarKeyword";
+ SyntaxKind[SyntaxKind["VoidKeyword"] = 104] = "VoidKeyword";
+ SyntaxKind[SyntaxKind["WhileKeyword"] = 105] = "WhileKeyword";
+ SyntaxKind[SyntaxKind["WithKeyword"] = 106] = "WithKeyword";
+ SyntaxKind[SyntaxKind["ImplementsKeyword"] = 107] = "ImplementsKeyword";
+ SyntaxKind[SyntaxKind["InterfaceKeyword"] = 108] = "InterfaceKeyword";
+ SyntaxKind[SyntaxKind["LetKeyword"] = 109] = "LetKeyword";
+ SyntaxKind[SyntaxKind["PackageKeyword"] = 110] = "PackageKeyword";
+ SyntaxKind[SyntaxKind["PrivateKeyword"] = 111] = "PrivateKeyword";
+ SyntaxKind[SyntaxKind["ProtectedKeyword"] = 112] = "ProtectedKeyword";
+ SyntaxKind[SyntaxKind["PublicKeyword"] = 113] = "PublicKeyword";
+ SyntaxKind[SyntaxKind["StaticKeyword"] = 114] = "StaticKeyword";
+ SyntaxKind[SyntaxKind["YieldKeyword"] = 115] = "YieldKeyword";
+ SyntaxKind[SyntaxKind["AbstractKeyword"] = 116] = "AbstractKeyword";
+ SyntaxKind[SyntaxKind["AsKeyword"] = 117] = "AsKeyword";
+ SyntaxKind[SyntaxKind["AnyKeyword"] = 118] = "AnyKeyword";
+ SyntaxKind[SyntaxKind["AsyncKeyword"] = 119] = "AsyncKeyword";
+ SyntaxKind[SyntaxKind["AwaitKeyword"] = 120] = "AwaitKeyword";
+ SyntaxKind[SyntaxKind["BooleanKeyword"] = 121] = "BooleanKeyword";
+ SyntaxKind[SyntaxKind["ConstructorKeyword"] = 122] = "ConstructorKeyword";
+ SyntaxKind[SyntaxKind["DeclareKeyword"] = 123] = "DeclareKeyword";
+ SyntaxKind[SyntaxKind["GetKeyword"] = 124] = "GetKeyword";
+ SyntaxKind[SyntaxKind["IsKeyword"] = 125] = "IsKeyword";
+ SyntaxKind[SyntaxKind["ModuleKeyword"] = 126] = "ModuleKeyword";
+ SyntaxKind[SyntaxKind["NamespaceKeyword"] = 127] = "NamespaceKeyword";
+ SyntaxKind[SyntaxKind["NeverKeyword"] = 128] = "NeverKeyword";
+ SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 129] = "ReadonlyKeyword";
+ SyntaxKind[SyntaxKind["RequireKeyword"] = 130] = "RequireKeyword";
+ SyntaxKind[SyntaxKind["NumberKeyword"] = 131] = "NumberKeyword";
+ SyntaxKind[SyntaxKind["SetKeyword"] = 132] = "SetKeyword";
+ SyntaxKind[SyntaxKind["StringKeyword"] = 133] = "StringKeyword";
+ SyntaxKind[SyntaxKind["SymbolKeyword"] = 134] = "SymbolKeyword";
+ SyntaxKind[SyntaxKind["TypeKeyword"] = 135] = "TypeKeyword";
+ SyntaxKind[SyntaxKind["UndefinedKeyword"] = 136] = "UndefinedKeyword";
+ SyntaxKind[SyntaxKind["FromKeyword"] = 137] = "FromKeyword";
+ SyntaxKind[SyntaxKind["GlobalKeyword"] = 138] = "GlobalKeyword";
+ SyntaxKind[SyntaxKind["OfKeyword"] = 139] = "OfKeyword";
+ SyntaxKind[SyntaxKind["QualifiedName"] = 140] = "QualifiedName";
+ SyntaxKind[SyntaxKind["ComputedPropertyName"] = 141] = "ComputedPropertyName";
+ SyntaxKind[SyntaxKind["TypeParameter"] = 142] = "TypeParameter";
+ SyntaxKind[SyntaxKind["Parameter"] = 143] = "Parameter";
+ SyntaxKind[SyntaxKind["Decorator"] = 144] = "Decorator";
+ SyntaxKind[SyntaxKind["PropertySignature"] = 145] = "PropertySignature";
+ SyntaxKind[SyntaxKind["PropertyDeclaration"] = 146] = "PropertyDeclaration";
+ SyntaxKind[SyntaxKind["MethodSignature"] = 147] = "MethodSignature";
+ SyntaxKind[SyntaxKind["MethodDeclaration"] = 148] = "MethodDeclaration";
+ SyntaxKind[SyntaxKind["Constructor"] = 149] = "Constructor";
+ SyntaxKind[SyntaxKind["GetAccessor"] = 150] = "GetAccessor";
+ SyntaxKind[SyntaxKind["SetAccessor"] = 151] = "SetAccessor";
+ SyntaxKind[SyntaxKind["CallSignature"] = 152] = "CallSignature";
+ SyntaxKind[SyntaxKind["ConstructSignature"] = 153] = "ConstructSignature";
+ SyntaxKind[SyntaxKind["IndexSignature"] = 154] = "IndexSignature";
+ SyntaxKind[SyntaxKind["TypePredicate"] = 155] = "TypePredicate";
+ SyntaxKind[SyntaxKind["TypeReference"] = 156] = "TypeReference";
+ SyntaxKind[SyntaxKind["FunctionType"] = 157] = "FunctionType";
+ SyntaxKind[SyntaxKind["ConstructorType"] = 158] = "ConstructorType";
+ SyntaxKind[SyntaxKind["TypeQuery"] = 159] = "TypeQuery";
+ SyntaxKind[SyntaxKind["TypeLiteral"] = 160] = "TypeLiteral";
+ SyntaxKind[SyntaxKind["ArrayType"] = 161] = "ArrayType";
+ SyntaxKind[SyntaxKind["TupleType"] = 162] = "TupleType";
+ SyntaxKind[SyntaxKind["UnionType"] = 163] = "UnionType";
+ SyntaxKind[SyntaxKind["IntersectionType"] = 164] = "IntersectionType";
+ SyntaxKind[SyntaxKind["ParenthesizedType"] = 165] = "ParenthesizedType";
+ SyntaxKind[SyntaxKind["ThisType"] = 166] = "ThisType";
+ SyntaxKind[SyntaxKind["LiteralType"] = 167] = "LiteralType";
+ SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 168] = "ObjectBindingPattern";
+ SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 169] = "ArrayBindingPattern";
+ SyntaxKind[SyntaxKind["BindingElement"] = 170] = "BindingElement";
+ SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 171] = "ArrayLiteralExpression";
+ SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 172] = "ObjectLiteralExpression";
+ SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 173] = "PropertyAccessExpression";
+ SyntaxKind[SyntaxKind["ElementAccessExpression"] = 174] = "ElementAccessExpression";
+ SyntaxKind[SyntaxKind["CallExpression"] = 175] = "CallExpression";
+ SyntaxKind[SyntaxKind["NewExpression"] = 176] = "NewExpression";
+ SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 177] = "TaggedTemplateExpression";
+ SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 178] = "TypeAssertionExpression";
+ SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 179] = "ParenthesizedExpression";
+ SyntaxKind[SyntaxKind["FunctionExpression"] = 180] = "FunctionExpression";
+ SyntaxKind[SyntaxKind["ArrowFunction"] = 181] = "ArrowFunction";
+ SyntaxKind[SyntaxKind["DeleteExpression"] = 182] = "DeleteExpression";
+ SyntaxKind[SyntaxKind["TypeOfExpression"] = 183] = "TypeOfExpression";
+ SyntaxKind[SyntaxKind["VoidExpression"] = 184] = "VoidExpression";
+ SyntaxKind[SyntaxKind["AwaitExpression"] = 185] = "AwaitExpression";
+ SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 186] = "PrefixUnaryExpression";
+ SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 187] = "PostfixUnaryExpression";
+ SyntaxKind[SyntaxKind["BinaryExpression"] = 188] = "BinaryExpression";
+ SyntaxKind[SyntaxKind["ConditionalExpression"] = 189] = "ConditionalExpression";
+ SyntaxKind[SyntaxKind["TemplateExpression"] = 190] = "TemplateExpression";
+ SyntaxKind[SyntaxKind["YieldExpression"] = 191] = "YieldExpression";
+ SyntaxKind[SyntaxKind["SpreadElementExpression"] = 192] = "SpreadElementExpression";
+ SyntaxKind[SyntaxKind["ClassExpression"] = 193] = "ClassExpression";
+ SyntaxKind[SyntaxKind["OmittedExpression"] = 194] = "OmittedExpression";
+ SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 195] = "ExpressionWithTypeArguments";
+ SyntaxKind[SyntaxKind["AsExpression"] = 196] = "AsExpression";
+ SyntaxKind[SyntaxKind["NonNullExpression"] = 197] = "NonNullExpression";
+ SyntaxKind[SyntaxKind["TemplateSpan"] = 198] = "TemplateSpan";
+ SyntaxKind[SyntaxKind["SemicolonClassElement"] = 199] = "SemicolonClassElement";
+ SyntaxKind[SyntaxKind["Block"] = 200] = "Block";
+ SyntaxKind[SyntaxKind["VariableStatement"] = 201] = "VariableStatement";
+ SyntaxKind[SyntaxKind["EmptyStatement"] = 202] = "EmptyStatement";
+ SyntaxKind[SyntaxKind["ExpressionStatement"] = 203] = "ExpressionStatement";
+ SyntaxKind[SyntaxKind["IfStatement"] = 204] = "IfStatement";
+ SyntaxKind[SyntaxKind["DoStatement"] = 205] = "DoStatement";
+ SyntaxKind[SyntaxKind["WhileStatement"] = 206] = "WhileStatement";
+ SyntaxKind[SyntaxKind["ForStatement"] = 207] = "ForStatement";
+ SyntaxKind[SyntaxKind["ForInStatement"] = 208] = "ForInStatement";
+ SyntaxKind[SyntaxKind["ForOfStatement"] = 209] = "ForOfStatement";
+ SyntaxKind[SyntaxKind["ContinueStatement"] = 210] = "ContinueStatement";
+ SyntaxKind[SyntaxKind["BreakStatement"] = 211] = "BreakStatement";
+ SyntaxKind[SyntaxKind["ReturnStatement"] = 212] = "ReturnStatement";
+ SyntaxKind[SyntaxKind["WithStatement"] = 213] = "WithStatement";
+ SyntaxKind[SyntaxKind["SwitchStatement"] = 214] = "SwitchStatement";
+ SyntaxKind[SyntaxKind["LabeledStatement"] = 215] = "LabeledStatement";
+ SyntaxKind[SyntaxKind["ThrowStatement"] = 216] = "ThrowStatement";
+ SyntaxKind[SyntaxKind["TryStatement"] = 217] = "TryStatement";
+ SyntaxKind[SyntaxKind["DebuggerStatement"] = 218] = "DebuggerStatement";
+ SyntaxKind[SyntaxKind["VariableDeclaration"] = 219] = "VariableDeclaration";
+ SyntaxKind[SyntaxKind["VariableDeclarationList"] = 220] = "VariableDeclarationList";
+ SyntaxKind[SyntaxKind["FunctionDeclaration"] = 221] = "FunctionDeclaration";
+ SyntaxKind[SyntaxKind["ClassDeclaration"] = 222] = "ClassDeclaration";
+ SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 223] = "InterfaceDeclaration";
+ SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 224] = "TypeAliasDeclaration";
+ SyntaxKind[SyntaxKind["EnumDeclaration"] = 225] = "EnumDeclaration";
+ SyntaxKind[SyntaxKind["ModuleDeclaration"] = 226] = "ModuleDeclaration";
+ SyntaxKind[SyntaxKind["ModuleBlock"] = 227] = "ModuleBlock";
+ SyntaxKind[SyntaxKind["CaseBlock"] = 228] = "CaseBlock";
+ SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 229] = "NamespaceExportDeclaration";
+ SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 230] = "ImportEqualsDeclaration";
+ SyntaxKind[SyntaxKind["ImportDeclaration"] = 231] = "ImportDeclaration";
+ SyntaxKind[SyntaxKind["ImportClause"] = 232] = "ImportClause";
+ SyntaxKind[SyntaxKind["NamespaceImport"] = 233] = "NamespaceImport";
+ SyntaxKind[SyntaxKind["NamedImports"] = 234] = "NamedImports";
+ SyntaxKind[SyntaxKind["ImportSpecifier"] = 235] = "ImportSpecifier";
+ SyntaxKind[SyntaxKind["ExportAssignment"] = 236] = "ExportAssignment";
+ SyntaxKind[SyntaxKind["ExportDeclaration"] = 237] = "ExportDeclaration";
+ SyntaxKind[SyntaxKind["NamedExports"] = 238] = "NamedExports";
+ SyntaxKind[SyntaxKind["ExportSpecifier"] = 239] = "ExportSpecifier";
+ SyntaxKind[SyntaxKind["MissingDeclaration"] = 240] = "MissingDeclaration";
+ SyntaxKind[SyntaxKind["ExternalModuleReference"] = 241] = "ExternalModuleReference";
+ SyntaxKind[SyntaxKind["JsxElement"] = 242] = "JsxElement";
+ SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 243] = "JsxSelfClosingElement";
+ SyntaxKind[SyntaxKind["JsxOpeningElement"] = 244] = "JsxOpeningElement";
+ SyntaxKind[SyntaxKind["JsxClosingElement"] = 245] = "JsxClosingElement";
+ SyntaxKind[SyntaxKind["JsxAttribute"] = 246] = "JsxAttribute";
+ SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 247] = "JsxSpreadAttribute";
+ SyntaxKind[SyntaxKind["JsxExpression"] = 248] = "JsxExpression";
+ SyntaxKind[SyntaxKind["CaseClause"] = 249] = "CaseClause";
+ SyntaxKind[SyntaxKind["DefaultClause"] = 250] = "DefaultClause";
+ SyntaxKind[SyntaxKind["HeritageClause"] = 251] = "HeritageClause";
+ SyntaxKind[SyntaxKind["CatchClause"] = 252] = "CatchClause";
+ SyntaxKind[SyntaxKind["PropertyAssignment"] = 253] = "PropertyAssignment";
+ SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 254] = "ShorthandPropertyAssignment";
+ SyntaxKind[SyntaxKind["EnumMember"] = 255] = "EnumMember";
+ SyntaxKind[SyntaxKind["SourceFile"] = 256] = "SourceFile";
+ SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 257] = "JSDocTypeExpression";
+ SyntaxKind[SyntaxKind["JSDocAllType"] = 258] = "JSDocAllType";
+ SyntaxKind[SyntaxKind["JSDocUnknownType"] = 259] = "JSDocUnknownType";
+ SyntaxKind[SyntaxKind["JSDocArrayType"] = 260] = "JSDocArrayType";
+ SyntaxKind[SyntaxKind["JSDocUnionType"] = 261] = "JSDocUnionType";
+ SyntaxKind[SyntaxKind["JSDocTupleType"] = 262] = "JSDocTupleType";
+ SyntaxKind[SyntaxKind["JSDocNullableType"] = 263] = "JSDocNullableType";
+ SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 264] = "JSDocNonNullableType";
+ SyntaxKind[SyntaxKind["JSDocRecordType"] = 265] = "JSDocRecordType";
+ SyntaxKind[SyntaxKind["JSDocRecordMember"] = 266] = "JSDocRecordMember";
+ SyntaxKind[SyntaxKind["JSDocTypeReference"] = 267] = "JSDocTypeReference";
+ SyntaxKind[SyntaxKind["JSDocOptionalType"] = 268] = "JSDocOptionalType";
+ SyntaxKind[SyntaxKind["JSDocFunctionType"] = 269] = "JSDocFunctionType";
+ SyntaxKind[SyntaxKind["JSDocVariadicType"] = 270] = "JSDocVariadicType";
+ SyntaxKind[SyntaxKind["JSDocConstructorType"] = 271] = "JSDocConstructorType";
+ SyntaxKind[SyntaxKind["JSDocThisType"] = 272] = "JSDocThisType";
+ SyntaxKind[SyntaxKind["JSDocComment"] = 273] = "JSDocComment";
+ SyntaxKind[SyntaxKind["JSDocTag"] = 274] = "JSDocTag";
+ SyntaxKind[SyntaxKind["JSDocParameterTag"] = 275] = "JSDocParameterTag";
+ SyntaxKind[SyntaxKind["JSDocReturnTag"] = 276] = "JSDocReturnTag";
+ SyntaxKind[SyntaxKind["JSDocTypeTag"] = 277] = "JSDocTypeTag";
+ SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 278] = "JSDocTemplateTag";
+ SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 279] = "JSDocTypedefTag";
+ SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 280] = "JSDocPropertyTag";
+ SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 281] = "JSDocTypeLiteral";
+ SyntaxKind[SyntaxKind["JSDocLiteralType"] = 282] = "JSDocLiteralType";
+ SyntaxKind[SyntaxKind["JSDocNullKeyword"] = 283] = "JSDocNullKeyword";
+ SyntaxKind[SyntaxKind["JSDocUndefinedKeyword"] = 284] = "JSDocUndefinedKeyword";
+ SyntaxKind[SyntaxKind["JSDocNeverKeyword"] = 285] = "JSDocNeverKeyword";
+ SyntaxKind[SyntaxKind["SyntaxList"] = 286] = "SyntaxList";
+ SyntaxKind[SyntaxKind["NotEmittedStatement"] = 287] = "NotEmittedStatement";
+ SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 288] = "PartiallyEmittedExpression";
+ SyntaxKind[SyntaxKind["Count"] = 289] = "Count";
+ SyntaxKind[SyntaxKind["FirstAssignment"] = 57] = "FirstAssignment";
+ SyntaxKind[SyntaxKind["LastAssignment"] = 69] = "LastAssignment";
+ SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 58] = "FirstCompoundAssignment";
+ SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 69] = "LastCompoundAssignment";
+ SyntaxKind[SyntaxKind["FirstReservedWord"] = 71] = "FirstReservedWord";
+ SyntaxKind[SyntaxKind["LastReservedWord"] = 106] = "LastReservedWord";
+ SyntaxKind[SyntaxKind["FirstKeyword"] = 71] = "FirstKeyword";
+ SyntaxKind[SyntaxKind["LastKeyword"] = 139] = "LastKeyword";
+ SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 107] = "FirstFutureReservedWord";
+ SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 115] = "LastFutureReservedWord";
+ SyntaxKind[SyntaxKind["FirstTypeNode"] = 155] = "FirstTypeNode";
+ SyntaxKind[SyntaxKind["LastTypeNode"] = 167] = "LastTypeNode";
+ SyntaxKind[SyntaxKind["FirstPunctuation"] = 16] = "FirstPunctuation";
+ SyntaxKind[SyntaxKind["LastPunctuation"] = 69] = "LastPunctuation";
+ SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken";
+ SyntaxKind[SyntaxKind["LastToken"] = 139] = "LastToken";
+ SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken";
+ SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken";
+ SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken";
+ SyntaxKind[SyntaxKind["LastLiteralToken"] = 12] = "LastLiteralToken";
+ SyntaxKind[SyntaxKind["FirstTemplateToken"] = 12] = "FirstTemplateToken";
+ SyntaxKind[SyntaxKind["LastTemplateToken"] = 15] = "LastTemplateToken";
+ SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 26] = "FirstBinaryOperator";
+ SyntaxKind[SyntaxKind["LastBinaryOperator"] = 69] = "LastBinaryOperator";
+ SyntaxKind[SyntaxKind["FirstNode"] = 140] = "FirstNode";
+ SyntaxKind[SyntaxKind["FirstJSDocNode"] = 257] = "FirstJSDocNode";
+ SyntaxKind[SyntaxKind["LastJSDocNode"] = 282] = "LastJSDocNode";
+ SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 273] = "FirstJSDocTagNode";
+ SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 285] = "LastJSDocTagNode";
+ })(ts.SyntaxKind || (ts.SyntaxKind = {}));
+ var SyntaxKind = ts.SyntaxKind;
+ (function (NodeFlags) {
+ NodeFlags[NodeFlags["None"] = 0] = "None";
+ NodeFlags[NodeFlags["Let"] = 1] = "Let";
+ NodeFlags[NodeFlags["Const"] = 2] = "Const";
+ NodeFlags[NodeFlags["NestedNamespace"] = 4] = "NestedNamespace";
+ NodeFlags[NodeFlags["Synthesized"] = 8] = "Synthesized";
+ NodeFlags[NodeFlags["Namespace"] = 16] = "Namespace";
+ NodeFlags[NodeFlags["ExportContext"] = 32] = "ExportContext";
+ NodeFlags[NodeFlags["ContainsThis"] = 64] = "ContainsThis";
+ NodeFlags[NodeFlags["HasImplicitReturn"] = 128] = "HasImplicitReturn";
+ NodeFlags[NodeFlags["HasExplicitReturn"] = 256] = "HasExplicitReturn";
+ NodeFlags[NodeFlags["GlobalAugmentation"] = 512] = "GlobalAugmentation";
+ NodeFlags[NodeFlags["HasClassExtends"] = 1024] = "HasClassExtends";
+ NodeFlags[NodeFlags["HasDecorators"] = 2048] = "HasDecorators";
+ NodeFlags[NodeFlags["HasParamDecorators"] = 4096] = "HasParamDecorators";
+ NodeFlags[NodeFlags["HasAsyncFunctions"] = 8192] = "HasAsyncFunctions";
+ NodeFlags[NodeFlags["HasJsxSpreadAttributes"] = 16384] = "HasJsxSpreadAttributes";
+ NodeFlags[NodeFlags["DisallowInContext"] = 32768] = "DisallowInContext";
+ NodeFlags[NodeFlags["YieldContext"] = 65536] = "YieldContext";
+ NodeFlags[NodeFlags["DecoratorContext"] = 131072] = "DecoratorContext";
+ NodeFlags[NodeFlags["AwaitContext"] = 262144] = "AwaitContext";
+ NodeFlags[NodeFlags["ThisNodeHasError"] = 524288] = "ThisNodeHasError";
+ NodeFlags[NodeFlags["JavaScriptFile"] = 1048576] = "JavaScriptFile";
+ NodeFlags[NodeFlags["ThisNodeOrAnySubNodesHasError"] = 2097152] = "ThisNodeOrAnySubNodesHasError";
+ NodeFlags[NodeFlags["HasAggregatedChildData"] = 4194304] = "HasAggregatedChildData";
+ NodeFlags[NodeFlags["BlockScoped"] = 3] = "BlockScoped";
+ NodeFlags[NodeFlags["ReachabilityCheckFlags"] = 384] = "ReachabilityCheckFlags";
+ NodeFlags[NodeFlags["EmitHelperFlags"] = 31744] = "EmitHelperFlags";
+ NodeFlags[NodeFlags["ReachabilityAndEmitFlags"] = 32128] = "ReachabilityAndEmitFlags";
+ NodeFlags[NodeFlags["ContextFlags"] = 1540096] = "ContextFlags";
+ NodeFlags[NodeFlags["TypeExcludesFlags"] = 327680] = "TypeExcludesFlags";
+ })(ts.NodeFlags || (ts.NodeFlags = {}));
+ var NodeFlags = ts.NodeFlags;
+ (function (ModifierFlags) {
+ ModifierFlags[ModifierFlags["None"] = 0] = "None";
+ ModifierFlags[ModifierFlags["Export"] = 1] = "Export";
+ ModifierFlags[ModifierFlags["Ambient"] = 2] = "Ambient";
+ ModifierFlags[ModifierFlags["Public"] = 4] = "Public";
+ ModifierFlags[ModifierFlags["Private"] = 8] = "Private";
+ ModifierFlags[ModifierFlags["Protected"] = 16] = "Protected";
+ ModifierFlags[ModifierFlags["Static"] = 32] = "Static";
+ ModifierFlags[ModifierFlags["Readonly"] = 64] = "Readonly";
+ ModifierFlags[ModifierFlags["Abstract"] = 128] = "Abstract";
+ ModifierFlags[ModifierFlags["Async"] = 256] = "Async";
+ ModifierFlags[ModifierFlags["Default"] = 512] = "Default";
+ ModifierFlags[ModifierFlags["Const"] = 2048] = "Const";
+ ModifierFlags[ModifierFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags";
+ ModifierFlags[ModifierFlags["AccessibilityModifier"] = 28] = "AccessibilityModifier";
+ ModifierFlags[ModifierFlags["ParameterPropertyModifier"] = 92] = "ParameterPropertyModifier";
+ ModifierFlags[ModifierFlags["NonPublicAccessibilityModifier"] = 24] = "NonPublicAccessibilityModifier";
+ ModifierFlags[ModifierFlags["TypeScriptModifier"] = 2270] = "TypeScriptModifier";
+ })(ts.ModifierFlags || (ts.ModifierFlags = {}));
+ var ModifierFlags = ts.ModifierFlags;
+ (function (JsxFlags) {
+ JsxFlags[JsxFlags["None"] = 0] = "None";
+ JsxFlags[JsxFlags["IntrinsicNamedElement"] = 1] = "IntrinsicNamedElement";
+ JsxFlags[JsxFlags["IntrinsicIndexedElement"] = 2] = "IntrinsicIndexedElement";
+ JsxFlags[JsxFlags["IntrinsicElement"] = 3] = "IntrinsicElement";
+ })(ts.JsxFlags || (ts.JsxFlags = {}));
+ var JsxFlags = ts.JsxFlags;
+ (function (RelationComparisonResult) {
+ RelationComparisonResult[RelationComparisonResult["Succeeded"] = 1] = "Succeeded";
+ RelationComparisonResult[RelationComparisonResult["Failed"] = 2] = "Failed";
+ RelationComparisonResult[RelationComparisonResult["FailedAndReported"] = 3] = "FailedAndReported";
+ })(ts.RelationComparisonResult || (ts.RelationComparisonResult = {}));
+ var RelationComparisonResult = ts.RelationComparisonResult;
+ (function (GeneratedIdentifierKind) {
+ GeneratedIdentifierKind[GeneratedIdentifierKind["None"] = 0] = "None";
+ GeneratedIdentifierKind[GeneratedIdentifierKind["Auto"] = 1] = "Auto";
+ GeneratedIdentifierKind[GeneratedIdentifierKind["Loop"] = 2] = "Loop";
+ GeneratedIdentifierKind[GeneratedIdentifierKind["Unique"] = 3] = "Unique";
+ GeneratedIdentifierKind[GeneratedIdentifierKind["Node"] = 4] = "Node";
+ })(ts.GeneratedIdentifierKind || (ts.GeneratedIdentifierKind = {}));
+ var GeneratedIdentifierKind = ts.GeneratedIdentifierKind;
+ (function (FlowFlags) {
+ FlowFlags[FlowFlags["Unreachable"] = 1] = "Unreachable";
+ FlowFlags[FlowFlags["Start"] = 2] = "Start";
+ FlowFlags[FlowFlags["BranchLabel"] = 4] = "BranchLabel";
+ FlowFlags[FlowFlags["LoopLabel"] = 8] = "LoopLabel";
+ FlowFlags[FlowFlags["Assignment"] = 16] = "Assignment";
+ FlowFlags[FlowFlags["TrueCondition"] = 32] = "TrueCondition";
+ FlowFlags[FlowFlags["FalseCondition"] = 64] = "FalseCondition";
+ FlowFlags[FlowFlags["SwitchClause"] = 128] = "SwitchClause";
+ FlowFlags[FlowFlags["ArrayMutation"] = 256] = "ArrayMutation";
+ FlowFlags[FlowFlags["Referenced"] = 512] = "Referenced";
+ FlowFlags[FlowFlags["Shared"] = 1024] = "Shared";
+ FlowFlags[FlowFlags["Label"] = 12] = "Label";
+ FlowFlags[FlowFlags["Condition"] = 96] = "Condition";
+ })(ts.FlowFlags || (ts.FlowFlags = {}));
+ var FlowFlags = ts.FlowFlags;
var OperationCanceledException = (function () {
function OperationCanceledException() {
}
@@ -32,6 +444,38 @@ var ts;
ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated";
})(ts.ExitStatus || (ts.ExitStatus = {}));
var ExitStatus = ts.ExitStatus;
+ (function (TypeFormatFlags) {
+ TypeFormatFlags[TypeFormatFlags["None"] = 0] = "None";
+ TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 1] = "WriteArrayAsGenericType";
+ TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 2] = "UseTypeOfFunction";
+ TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 4] = "NoTruncation";
+ TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 8] = "WriteArrowStyleSignature";
+ TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 16] = "WriteOwnNameForAnyLike";
+ TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature";
+ TypeFormatFlags[TypeFormatFlags["InElementType"] = 64] = "InElementType";
+ TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 128] = "UseFullyQualifiedType";
+ TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 256] = "InFirstTypeArgument";
+ TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 512] = "InTypeAlias";
+ TypeFormatFlags[TypeFormatFlags["UseTypeAliasValue"] = 1024] = "UseTypeAliasValue";
+ })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {}));
+ var TypeFormatFlags = ts.TypeFormatFlags;
+ (function (SymbolFormatFlags) {
+ SymbolFormatFlags[SymbolFormatFlags["None"] = 0] = "None";
+ SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments";
+ SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing";
+ })(ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {}));
+ var SymbolFormatFlags = ts.SymbolFormatFlags;
+ (function (SymbolAccessibility) {
+ SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible";
+ SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible";
+ SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed";
+ })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {}));
+ var SymbolAccessibility = ts.SymbolAccessibility;
+ (function (TypePredicateKind) {
+ TypePredicateKind[TypePredicateKind["This"] = 0] = "This";
+ TypePredicateKind[TypePredicateKind["Identifier"] = 1] = "Identifier";
+ })(ts.TypePredicateKind || (ts.TypePredicateKind = {}));
+ var TypePredicateKind = ts.TypePredicateKind;
(function (TypeReferenceSerializationKind) {
TypeReferenceSerializationKind[TypeReferenceSerializationKind["Unknown"] = 0] = "Unknown";
TypeReferenceSerializationKind[TypeReferenceSerializationKind["TypeWithConstructSignatureAndValue"] = 1] = "TypeWithConstructSignatureAndValue";
@@ -46,6 +490,166 @@ var ts;
TypeReferenceSerializationKind[TypeReferenceSerializationKind["ObjectType"] = 10] = "ObjectType";
})(ts.TypeReferenceSerializationKind || (ts.TypeReferenceSerializationKind = {}));
var TypeReferenceSerializationKind = ts.TypeReferenceSerializationKind;
+ (function (SymbolFlags) {
+ SymbolFlags[SymbolFlags["None"] = 0] = "None";
+ SymbolFlags[SymbolFlags["FunctionScopedVariable"] = 1] = "FunctionScopedVariable";
+ SymbolFlags[SymbolFlags["BlockScopedVariable"] = 2] = "BlockScopedVariable";
+ SymbolFlags[SymbolFlags["Property"] = 4] = "Property";
+ SymbolFlags[SymbolFlags["EnumMember"] = 8] = "EnumMember";
+ SymbolFlags[SymbolFlags["Function"] = 16] = "Function";
+ SymbolFlags[SymbolFlags["Class"] = 32] = "Class";
+ SymbolFlags[SymbolFlags["Interface"] = 64] = "Interface";
+ SymbolFlags[SymbolFlags["ConstEnum"] = 128] = "ConstEnum";
+ SymbolFlags[SymbolFlags["RegularEnum"] = 256] = "RegularEnum";
+ SymbolFlags[SymbolFlags["ValueModule"] = 512] = "ValueModule";
+ SymbolFlags[SymbolFlags["NamespaceModule"] = 1024] = "NamespaceModule";
+ SymbolFlags[SymbolFlags["TypeLiteral"] = 2048] = "TypeLiteral";
+ SymbolFlags[SymbolFlags["ObjectLiteral"] = 4096] = "ObjectLiteral";
+ SymbolFlags[SymbolFlags["Method"] = 8192] = "Method";
+ SymbolFlags[SymbolFlags["Constructor"] = 16384] = "Constructor";
+ SymbolFlags[SymbolFlags["GetAccessor"] = 32768] = "GetAccessor";
+ SymbolFlags[SymbolFlags["SetAccessor"] = 65536] = "SetAccessor";
+ SymbolFlags[SymbolFlags["Signature"] = 131072] = "Signature";
+ SymbolFlags[SymbolFlags["TypeParameter"] = 262144] = "TypeParameter";
+ SymbolFlags[SymbolFlags["TypeAlias"] = 524288] = "TypeAlias";
+ SymbolFlags[SymbolFlags["ExportValue"] = 1048576] = "ExportValue";
+ SymbolFlags[SymbolFlags["ExportType"] = 2097152] = "ExportType";
+ SymbolFlags[SymbolFlags["ExportNamespace"] = 4194304] = "ExportNamespace";
+ SymbolFlags[SymbolFlags["Alias"] = 8388608] = "Alias";
+ SymbolFlags[SymbolFlags["Instantiated"] = 16777216] = "Instantiated";
+ SymbolFlags[SymbolFlags["Merged"] = 33554432] = "Merged";
+ SymbolFlags[SymbolFlags["Transient"] = 67108864] = "Transient";
+ SymbolFlags[SymbolFlags["Prototype"] = 134217728] = "Prototype";
+ SymbolFlags[SymbolFlags["SyntheticProperty"] = 268435456] = "SyntheticProperty";
+ SymbolFlags[SymbolFlags["Optional"] = 536870912] = "Optional";
+ SymbolFlags[SymbolFlags["ExportStar"] = 1073741824] = "ExportStar";
+ SymbolFlags[SymbolFlags["Enum"] = 384] = "Enum";
+ SymbolFlags[SymbolFlags["Variable"] = 3] = "Variable";
+ SymbolFlags[SymbolFlags["Value"] = 107455] = "Value";
+ SymbolFlags[SymbolFlags["Type"] = 793064] = "Type";
+ SymbolFlags[SymbolFlags["Namespace"] = 1920] = "Namespace";
+ SymbolFlags[SymbolFlags["Module"] = 1536] = "Module";
+ SymbolFlags[SymbolFlags["Accessor"] = 98304] = "Accessor";
+ SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = 107454] = "FunctionScopedVariableExcludes";
+ SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = 107455] = "BlockScopedVariableExcludes";
+ SymbolFlags[SymbolFlags["ParameterExcludes"] = 107455] = "ParameterExcludes";
+ SymbolFlags[SymbolFlags["PropertyExcludes"] = 0] = "PropertyExcludes";
+ SymbolFlags[SymbolFlags["EnumMemberExcludes"] = 900095] = "EnumMemberExcludes";
+ SymbolFlags[SymbolFlags["FunctionExcludes"] = 106927] = "FunctionExcludes";
+ SymbolFlags[SymbolFlags["ClassExcludes"] = 899519] = "ClassExcludes";
+ SymbolFlags[SymbolFlags["InterfaceExcludes"] = 792968] = "InterfaceExcludes";
+ SymbolFlags[SymbolFlags["RegularEnumExcludes"] = 899327] = "RegularEnumExcludes";
+ SymbolFlags[SymbolFlags["ConstEnumExcludes"] = 899967] = "ConstEnumExcludes";
+ SymbolFlags[SymbolFlags["ValueModuleExcludes"] = 106639] = "ValueModuleExcludes";
+ SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes";
+ SymbolFlags[SymbolFlags["MethodExcludes"] = 99263] = "MethodExcludes";
+ SymbolFlags[SymbolFlags["GetAccessorExcludes"] = 41919] = "GetAccessorExcludes";
+ SymbolFlags[SymbolFlags["SetAccessorExcludes"] = 74687] = "SetAccessorExcludes";
+ SymbolFlags[SymbolFlags["TypeParameterExcludes"] = 530920] = "TypeParameterExcludes";
+ SymbolFlags[SymbolFlags["TypeAliasExcludes"] = 793064] = "TypeAliasExcludes";
+ SymbolFlags[SymbolFlags["AliasExcludes"] = 8388608] = "AliasExcludes";
+ SymbolFlags[SymbolFlags["ModuleMember"] = 8914931] = "ModuleMember";
+ SymbolFlags[SymbolFlags["ExportHasLocal"] = 944] = "ExportHasLocal";
+ SymbolFlags[SymbolFlags["HasExports"] = 1952] = "HasExports";
+ SymbolFlags[SymbolFlags["HasMembers"] = 6240] = "HasMembers";
+ SymbolFlags[SymbolFlags["BlockScoped"] = 418] = "BlockScoped";
+ SymbolFlags[SymbolFlags["PropertyOrAccessor"] = 98308] = "PropertyOrAccessor";
+ SymbolFlags[SymbolFlags["Export"] = 7340032] = "Export";
+ SymbolFlags[SymbolFlags["ClassMember"] = 106500] = "ClassMember";
+ SymbolFlags[SymbolFlags["Classifiable"] = 788448] = "Classifiable";
+ })(ts.SymbolFlags || (ts.SymbolFlags = {}));
+ var SymbolFlags = ts.SymbolFlags;
+ (function (NodeCheckFlags) {
+ NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 1] = "TypeChecked";
+ NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 2] = "LexicalThis";
+ NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 4] = "CaptureThis";
+ NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 256] = "SuperInstance";
+ NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 512] = "SuperStatic";
+ NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 1024] = "ContextChecked";
+ NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuper"] = 2048] = "AsyncMethodWithSuper";
+ NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuperBinding"] = 4096] = "AsyncMethodWithSuperBinding";
+ NodeCheckFlags[NodeCheckFlags["CaptureArguments"] = 8192] = "CaptureArguments";
+ NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 16384] = "EnumValuesComputed";
+ NodeCheckFlags[NodeCheckFlags["LexicalModuleMergesWithClass"] = 32768] = "LexicalModuleMergesWithClass";
+ NodeCheckFlags[NodeCheckFlags["LoopWithCapturedBlockScopedBinding"] = 65536] = "LoopWithCapturedBlockScopedBinding";
+ NodeCheckFlags[NodeCheckFlags["CapturedBlockScopedBinding"] = 131072] = "CapturedBlockScopedBinding";
+ NodeCheckFlags[NodeCheckFlags["BlockScopedBindingInLoop"] = 262144] = "BlockScopedBindingInLoop";
+ NodeCheckFlags[NodeCheckFlags["ClassWithBodyScopedClassBinding"] = 524288] = "ClassWithBodyScopedClassBinding";
+ NodeCheckFlags[NodeCheckFlags["BodyScopedClassBinding"] = 1048576] = "BodyScopedClassBinding";
+ NodeCheckFlags[NodeCheckFlags["NeedsLoopOutParameter"] = 2097152] = "NeedsLoopOutParameter";
+ NodeCheckFlags[NodeCheckFlags["AssignmentsMarked"] = 4194304] = "AssignmentsMarked";
+ NodeCheckFlags[NodeCheckFlags["ClassWithConstructorReference"] = 8388608] = "ClassWithConstructorReference";
+ NodeCheckFlags[NodeCheckFlags["ConstructorReferenceInClass"] = 16777216] = "ConstructorReferenceInClass";
+ })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {}));
+ var NodeCheckFlags = ts.NodeCheckFlags;
+ (function (TypeFlags) {
+ TypeFlags[TypeFlags["Any"] = 1] = "Any";
+ TypeFlags[TypeFlags["String"] = 2] = "String";
+ TypeFlags[TypeFlags["Number"] = 4] = "Number";
+ TypeFlags[TypeFlags["Boolean"] = 8] = "Boolean";
+ TypeFlags[TypeFlags["Enum"] = 16] = "Enum";
+ TypeFlags[TypeFlags["StringLiteral"] = 32] = "StringLiteral";
+ TypeFlags[TypeFlags["NumberLiteral"] = 64] = "NumberLiteral";
+ TypeFlags[TypeFlags["BooleanLiteral"] = 128] = "BooleanLiteral";
+ TypeFlags[TypeFlags["EnumLiteral"] = 256] = "EnumLiteral";
+ TypeFlags[TypeFlags["ESSymbol"] = 512] = "ESSymbol";
+ TypeFlags[TypeFlags["Void"] = 1024] = "Void";
+ TypeFlags[TypeFlags["Undefined"] = 2048] = "Undefined";
+ TypeFlags[TypeFlags["Null"] = 4096] = "Null";
+ TypeFlags[TypeFlags["Never"] = 8192] = "Never";
+ TypeFlags[TypeFlags["TypeParameter"] = 16384] = "TypeParameter";
+ TypeFlags[TypeFlags["Class"] = 32768] = "Class";
+ TypeFlags[TypeFlags["Interface"] = 65536] = "Interface";
+ TypeFlags[TypeFlags["Reference"] = 131072] = "Reference";
+ TypeFlags[TypeFlags["Tuple"] = 262144] = "Tuple";
+ TypeFlags[TypeFlags["Union"] = 524288] = "Union";
+ TypeFlags[TypeFlags["Intersection"] = 1048576] = "Intersection";
+ TypeFlags[TypeFlags["Anonymous"] = 2097152] = "Anonymous";
+ TypeFlags[TypeFlags["Instantiated"] = 4194304] = "Instantiated";
+ TypeFlags[TypeFlags["ObjectLiteral"] = 8388608] = "ObjectLiteral";
+ TypeFlags[TypeFlags["FreshLiteral"] = 16777216] = "FreshLiteral";
+ TypeFlags[TypeFlags["ContainsWideningType"] = 33554432] = "ContainsWideningType";
+ TypeFlags[TypeFlags["ContainsObjectLiteral"] = 67108864] = "ContainsObjectLiteral";
+ TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 134217728] = "ContainsAnyFunctionType";
+ TypeFlags[TypeFlags["Nullable"] = 6144] = "Nullable";
+ TypeFlags[TypeFlags["Literal"] = 480] = "Literal";
+ TypeFlags[TypeFlags["StringOrNumberLiteral"] = 96] = "StringOrNumberLiteral";
+ TypeFlags[TypeFlags["DefinitelyFalsy"] = 7392] = "DefinitelyFalsy";
+ TypeFlags[TypeFlags["PossiblyFalsy"] = 7406] = "PossiblyFalsy";
+ TypeFlags[TypeFlags["Intrinsic"] = 16015] = "Intrinsic";
+ TypeFlags[TypeFlags["Primitive"] = 8190] = "Primitive";
+ TypeFlags[TypeFlags["StringLike"] = 34] = "StringLike";
+ TypeFlags[TypeFlags["NumberLike"] = 340] = "NumberLike";
+ TypeFlags[TypeFlags["BooleanLike"] = 136] = "BooleanLike";
+ TypeFlags[TypeFlags["EnumLike"] = 272] = "EnumLike";
+ TypeFlags[TypeFlags["ObjectType"] = 2588672] = "ObjectType";
+ TypeFlags[TypeFlags["UnionOrIntersection"] = 1572864] = "UnionOrIntersection";
+ TypeFlags[TypeFlags["StructuredType"] = 4161536] = "StructuredType";
+ TypeFlags[TypeFlags["StructuredOrTypeParameter"] = 4177920] = "StructuredOrTypeParameter";
+ TypeFlags[TypeFlags["Narrowable"] = 4178943] = "Narrowable";
+ TypeFlags[TypeFlags["NotUnionOrUnit"] = 2589185] = "NotUnionOrUnit";
+ TypeFlags[TypeFlags["RequiresWidening"] = 100663296] = "RequiresWidening";
+ TypeFlags[TypeFlags["PropagatingFlags"] = 234881024] = "PropagatingFlags";
+ })(ts.TypeFlags || (ts.TypeFlags = {}));
+ var TypeFlags = ts.TypeFlags;
+ (function (SignatureKind) {
+ SignatureKind[SignatureKind["Call"] = 0] = "Call";
+ SignatureKind[SignatureKind["Construct"] = 1] = "Construct";
+ })(ts.SignatureKind || (ts.SignatureKind = {}));
+ var SignatureKind = ts.SignatureKind;
+ (function (IndexKind) {
+ IndexKind[IndexKind["String"] = 0] = "String";
+ IndexKind[IndexKind["Number"] = 1] = "Number";
+ })(ts.IndexKind || (ts.IndexKind = {}));
+ var IndexKind = ts.IndexKind;
+ (function (SpecialPropertyAssignmentKind) {
+ SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["None"] = 0] = "None";
+ SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ExportsProperty"] = 1] = "ExportsProperty";
+ SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ModuleExports"] = 2] = "ModuleExports";
+ SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["PrototypeProperty"] = 3] = "PrototypeProperty";
+ SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ThisProperty"] = 4] = "ThisProperty";
+ })(ts.SpecialPropertyAssignmentKind || (ts.SpecialPropertyAssignmentKind = {}));
+ var SpecialPropertyAssignmentKind = ts.SpecialPropertyAssignmentKind;
(function (DiagnosticCategory) {
DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning";
DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error";
@@ -63,10 +667,267 @@ var ts;
ModuleKind[ModuleKind["AMD"] = 2] = "AMD";
ModuleKind[ModuleKind["UMD"] = 3] = "UMD";
ModuleKind[ModuleKind["System"] = 4] = "System";
- ModuleKind[ModuleKind["ES6"] = 5] = "ES6";
ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015";
})(ts.ModuleKind || (ts.ModuleKind = {}));
var ModuleKind = ts.ModuleKind;
+ (function (JsxEmit) {
+ JsxEmit[JsxEmit["None"] = 0] = "None";
+ JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve";
+ JsxEmit[JsxEmit["React"] = 2] = "React";
+ })(ts.JsxEmit || (ts.JsxEmit = {}));
+ var JsxEmit = ts.JsxEmit;
+ (function (NewLineKind) {
+ NewLineKind[NewLineKind["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed";
+ NewLineKind[NewLineKind["LineFeed"] = 1] = "LineFeed";
+ })(ts.NewLineKind || (ts.NewLineKind = {}));
+ var NewLineKind = ts.NewLineKind;
+ (function (ScriptKind) {
+ ScriptKind[ScriptKind["Unknown"] = 0] = "Unknown";
+ ScriptKind[ScriptKind["JS"] = 1] = "JS";
+ ScriptKind[ScriptKind["JSX"] = 2] = "JSX";
+ ScriptKind[ScriptKind["TS"] = 3] = "TS";
+ ScriptKind[ScriptKind["TSX"] = 4] = "TSX";
+ })(ts.ScriptKind || (ts.ScriptKind = {}));
+ var ScriptKind = ts.ScriptKind;
+ (function (ScriptTarget) {
+ ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3";
+ ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5";
+ ScriptTarget[ScriptTarget["ES2015"] = 2] = "ES2015";
+ ScriptTarget[ScriptTarget["ES2016"] = 3] = "ES2016";
+ ScriptTarget[ScriptTarget["ES2017"] = 4] = "ES2017";
+ ScriptTarget[ScriptTarget["Latest"] = 4] = "Latest";
+ })(ts.ScriptTarget || (ts.ScriptTarget = {}));
+ var ScriptTarget = ts.ScriptTarget;
+ (function (LanguageVariant) {
+ LanguageVariant[LanguageVariant["Standard"] = 0] = "Standard";
+ LanguageVariant[LanguageVariant["JSX"] = 1] = "JSX";
+ })(ts.LanguageVariant || (ts.LanguageVariant = {}));
+ var LanguageVariant = ts.LanguageVariant;
+ (function (DiagnosticStyle) {
+ DiagnosticStyle[DiagnosticStyle["Simple"] = 0] = "Simple";
+ DiagnosticStyle[DiagnosticStyle["Pretty"] = 1] = "Pretty";
+ })(ts.DiagnosticStyle || (ts.DiagnosticStyle = {}));
+ var DiagnosticStyle = ts.DiagnosticStyle;
+ (function (WatchDirectoryFlags) {
+ WatchDirectoryFlags[WatchDirectoryFlags["None"] = 0] = "None";
+ WatchDirectoryFlags[WatchDirectoryFlags["Recursive"] = 1] = "Recursive";
+ })(ts.WatchDirectoryFlags || (ts.WatchDirectoryFlags = {}));
+ var WatchDirectoryFlags = ts.WatchDirectoryFlags;
+ (function (CharacterCodes) {
+ CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter";
+ CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter";
+ CharacterCodes[CharacterCodes["lineFeed"] = 10] = "lineFeed";
+ CharacterCodes[CharacterCodes["carriageReturn"] = 13] = "carriageReturn";
+ CharacterCodes[CharacterCodes["lineSeparator"] = 8232] = "lineSeparator";
+ CharacterCodes[CharacterCodes["paragraphSeparator"] = 8233] = "paragraphSeparator";
+ CharacterCodes[CharacterCodes["nextLine"] = 133] = "nextLine";
+ CharacterCodes[CharacterCodes["space"] = 32] = "space";
+ CharacterCodes[CharacterCodes["nonBreakingSpace"] = 160] = "nonBreakingSpace";
+ CharacterCodes[CharacterCodes["enQuad"] = 8192] = "enQuad";
+ CharacterCodes[CharacterCodes["emQuad"] = 8193] = "emQuad";
+ CharacterCodes[CharacterCodes["enSpace"] = 8194] = "enSpace";
+ CharacterCodes[CharacterCodes["emSpace"] = 8195] = "emSpace";
+ CharacterCodes[CharacterCodes["threePerEmSpace"] = 8196] = "threePerEmSpace";
+ CharacterCodes[CharacterCodes["fourPerEmSpace"] = 8197] = "fourPerEmSpace";
+ CharacterCodes[CharacterCodes["sixPerEmSpace"] = 8198] = "sixPerEmSpace";
+ CharacterCodes[CharacterCodes["figureSpace"] = 8199] = "figureSpace";
+ CharacterCodes[CharacterCodes["punctuationSpace"] = 8200] = "punctuationSpace";
+ CharacterCodes[CharacterCodes["thinSpace"] = 8201] = "thinSpace";
+ CharacterCodes[CharacterCodes["hairSpace"] = 8202] = "hairSpace";
+ CharacterCodes[CharacterCodes["zeroWidthSpace"] = 8203] = "zeroWidthSpace";
+ CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 8239] = "narrowNoBreakSpace";
+ CharacterCodes[CharacterCodes["ideographicSpace"] = 12288] = "ideographicSpace";
+ CharacterCodes[CharacterCodes["mathematicalSpace"] = 8287] = "mathematicalSpace";
+ CharacterCodes[CharacterCodes["ogham"] = 5760] = "ogham";
+ CharacterCodes[CharacterCodes["_"] = 95] = "_";
+ CharacterCodes[CharacterCodes["$"] = 36] = "$";
+ CharacterCodes[CharacterCodes["_0"] = 48] = "_0";
+ CharacterCodes[CharacterCodes["_1"] = 49] = "_1";
+ CharacterCodes[CharacterCodes["_2"] = 50] = "_2";
+ CharacterCodes[CharacterCodes["_3"] = 51] = "_3";
+ CharacterCodes[CharacterCodes["_4"] = 52] = "_4";
+ CharacterCodes[CharacterCodes["_5"] = 53] = "_5";
+ CharacterCodes[CharacterCodes["_6"] = 54] = "_6";
+ CharacterCodes[CharacterCodes["_7"] = 55] = "_7";
+ CharacterCodes[CharacterCodes["_8"] = 56] = "_8";
+ CharacterCodes[CharacterCodes["_9"] = 57] = "_9";
+ CharacterCodes[CharacterCodes["a"] = 97] = "a";
+ CharacterCodes[CharacterCodes["b"] = 98] = "b";
+ CharacterCodes[CharacterCodes["c"] = 99] = "c";
+ CharacterCodes[CharacterCodes["d"] = 100] = "d";
+ CharacterCodes[CharacterCodes["e"] = 101] = "e";
+ CharacterCodes[CharacterCodes["f"] = 102] = "f";
+ CharacterCodes[CharacterCodes["g"] = 103] = "g";
+ CharacterCodes[CharacterCodes["h"] = 104] = "h";
+ CharacterCodes[CharacterCodes["i"] = 105] = "i";
+ CharacterCodes[CharacterCodes["j"] = 106] = "j";
+ CharacterCodes[CharacterCodes["k"] = 107] = "k";
+ CharacterCodes[CharacterCodes["l"] = 108] = "l";
+ CharacterCodes[CharacterCodes["m"] = 109] = "m";
+ CharacterCodes[CharacterCodes["n"] = 110] = "n";
+ CharacterCodes[CharacterCodes["o"] = 111] = "o";
+ CharacterCodes[CharacterCodes["p"] = 112] = "p";
+ CharacterCodes[CharacterCodes["q"] = 113] = "q";
+ CharacterCodes[CharacterCodes["r"] = 114] = "r";
+ CharacterCodes[CharacterCodes["s"] = 115] = "s";
+ CharacterCodes[CharacterCodes["t"] = 116] = "t";
+ CharacterCodes[CharacterCodes["u"] = 117] = "u";
+ CharacterCodes[CharacterCodes["v"] = 118] = "v";
+ CharacterCodes[CharacterCodes["w"] = 119] = "w";
+ CharacterCodes[CharacterCodes["x"] = 120] = "x";
+ CharacterCodes[CharacterCodes["y"] = 121] = "y";
+ CharacterCodes[CharacterCodes["z"] = 122] = "z";
+ CharacterCodes[CharacterCodes["A"] = 65] = "A";
+ CharacterCodes[CharacterCodes["B"] = 66] = "B";
+ CharacterCodes[CharacterCodes["C"] = 67] = "C";
+ CharacterCodes[CharacterCodes["D"] = 68] = "D";
+ CharacterCodes[CharacterCodes["E"] = 69] = "E";
+ CharacterCodes[CharacterCodes["F"] = 70] = "F";
+ CharacterCodes[CharacterCodes["G"] = 71] = "G";
+ CharacterCodes[CharacterCodes["H"] = 72] = "H";
+ CharacterCodes[CharacterCodes["I"] = 73] = "I";
+ CharacterCodes[CharacterCodes["J"] = 74] = "J";
+ CharacterCodes[CharacterCodes["K"] = 75] = "K";
+ CharacterCodes[CharacterCodes["L"] = 76] = "L";
+ CharacterCodes[CharacterCodes["M"] = 77] = "M";
+ CharacterCodes[CharacterCodes["N"] = 78] = "N";
+ CharacterCodes[CharacterCodes["O"] = 79] = "O";
+ CharacterCodes[CharacterCodes["P"] = 80] = "P";
+ CharacterCodes[CharacterCodes["Q"] = 81] = "Q";
+ CharacterCodes[CharacterCodes["R"] = 82] = "R";
+ CharacterCodes[CharacterCodes["S"] = 83] = "S";
+ CharacterCodes[CharacterCodes["T"] = 84] = "T";
+ CharacterCodes[CharacterCodes["U"] = 85] = "U";
+ CharacterCodes[CharacterCodes["V"] = 86] = "V";
+ CharacterCodes[CharacterCodes["W"] = 87] = "W";
+ CharacterCodes[CharacterCodes["X"] = 88] = "X";
+ CharacterCodes[CharacterCodes["Y"] = 89] = "Y";
+ CharacterCodes[CharacterCodes["Z"] = 90] = "Z";
+ CharacterCodes[CharacterCodes["ampersand"] = 38] = "ampersand";
+ CharacterCodes[CharacterCodes["asterisk"] = 42] = "asterisk";
+ CharacterCodes[CharacterCodes["at"] = 64] = "at";
+ CharacterCodes[CharacterCodes["backslash"] = 92] = "backslash";
+ CharacterCodes[CharacterCodes["backtick"] = 96] = "backtick";
+ CharacterCodes[CharacterCodes["bar"] = 124] = "bar";
+ CharacterCodes[CharacterCodes["caret"] = 94] = "caret";
+ CharacterCodes[CharacterCodes["closeBrace"] = 125] = "closeBrace";
+ CharacterCodes[CharacterCodes["closeBracket"] = 93] = "closeBracket";
+ CharacterCodes[CharacterCodes["closeParen"] = 41] = "closeParen";
+ CharacterCodes[CharacterCodes["colon"] = 58] = "colon";
+ CharacterCodes[CharacterCodes["comma"] = 44] = "comma";
+ CharacterCodes[CharacterCodes["dot"] = 46] = "dot";
+ CharacterCodes[CharacterCodes["doubleQuote"] = 34] = "doubleQuote";
+ CharacterCodes[CharacterCodes["equals"] = 61] = "equals";
+ CharacterCodes[CharacterCodes["exclamation"] = 33] = "exclamation";
+ CharacterCodes[CharacterCodes["greaterThan"] = 62] = "greaterThan";
+ CharacterCodes[CharacterCodes["hash"] = 35] = "hash";
+ CharacterCodes[CharacterCodes["lessThan"] = 60] = "lessThan";
+ CharacterCodes[CharacterCodes["minus"] = 45] = "minus";
+ CharacterCodes[CharacterCodes["openBrace"] = 123] = "openBrace";
+ CharacterCodes[CharacterCodes["openBracket"] = 91] = "openBracket";
+ CharacterCodes[CharacterCodes["openParen"] = 40] = "openParen";
+ CharacterCodes[CharacterCodes["percent"] = 37] = "percent";
+ CharacterCodes[CharacterCodes["plus"] = 43] = "plus";
+ CharacterCodes[CharacterCodes["question"] = 63] = "question";
+ CharacterCodes[CharacterCodes["semicolon"] = 59] = "semicolon";
+ CharacterCodes[CharacterCodes["singleQuote"] = 39] = "singleQuote";
+ CharacterCodes[CharacterCodes["slash"] = 47] = "slash";
+ CharacterCodes[CharacterCodes["tilde"] = 126] = "tilde";
+ CharacterCodes[CharacterCodes["backspace"] = 8] = "backspace";
+ CharacterCodes[CharacterCodes["formFeed"] = 12] = "formFeed";
+ CharacterCodes[CharacterCodes["byteOrderMark"] = 65279] = "byteOrderMark";
+ CharacterCodes[CharacterCodes["tab"] = 9] = "tab";
+ CharacterCodes[CharacterCodes["verticalTab"] = 11] = "verticalTab";
+ })(ts.CharacterCodes || (ts.CharacterCodes = {}));
+ var CharacterCodes = ts.CharacterCodes;
+ (function (TransformFlags) {
+ TransformFlags[TransformFlags["None"] = 0] = "None";
+ TransformFlags[TransformFlags["TypeScript"] = 1] = "TypeScript";
+ TransformFlags[TransformFlags["ContainsTypeScript"] = 2] = "ContainsTypeScript";
+ TransformFlags[TransformFlags["Jsx"] = 4] = "Jsx";
+ TransformFlags[TransformFlags["ContainsJsx"] = 8] = "ContainsJsx";
+ TransformFlags[TransformFlags["ES2017"] = 16] = "ES2017";
+ TransformFlags[TransformFlags["ContainsES2017"] = 32] = "ContainsES2017";
+ TransformFlags[TransformFlags["ES2016"] = 64] = "ES2016";
+ TransformFlags[TransformFlags["ContainsES2016"] = 128] = "ContainsES2016";
+ TransformFlags[TransformFlags["ES2015"] = 256] = "ES2015";
+ TransformFlags[TransformFlags["ContainsES2015"] = 512] = "ContainsES2015";
+ TransformFlags[TransformFlags["DestructuringAssignment"] = 1024] = "DestructuringAssignment";
+ TransformFlags[TransformFlags["Generator"] = 2048] = "Generator";
+ TransformFlags[TransformFlags["ContainsGenerator"] = 4096] = "ContainsGenerator";
+ TransformFlags[TransformFlags["ContainsDecorators"] = 8192] = "ContainsDecorators";
+ TransformFlags[TransformFlags["ContainsPropertyInitializer"] = 16384] = "ContainsPropertyInitializer";
+ TransformFlags[TransformFlags["ContainsLexicalThis"] = 32768] = "ContainsLexicalThis";
+ TransformFlags[TransformFlags["ContainsCapturedLexicalThis"] = 65536] = "ContainsCapturedLexicalThis";
+ TransformFlags[TransformFlags["ContainsLexicalThisInComputedPropertyName"] = 131072] = "ContainsLexicalThisInComputedPropertyName";
+ TransformFlags[TransformFlags["ContainsDefaultValueAssignments"] = 262144] = "ContainsDefaultValueAssignments";
+ TransformFlags[TransformFlags["ContainsParameterPropertyAssignments"] = 524288] = "ContainsParameterPropertyAssignments";
+ TransformFlags[TransformFlags["ContainsSpreadElementExpression"] = 1048576] = "ContainsSpreadElementExpression";
+ TransformFlags[TransformFlags["ContainsComputedPropertyName"] = 2097152] = "ContainsComputedPropertyName";
+ TransformFlags[TransformFlags["ContainsBlockScopedBinding"] = 4194304] = "ContainsBlockScopedBinding";
+ TransformFlags[TransformFlags["ContainsBindingPattern"] = 8388608] = "ContainsBindingPattern";
+ TransformFlags[TransformFlags["ContainsYield"] = 16777216] = "ContainsYield";
+ TransformFlags[TransformFlags["ContainsHoistedDeclarationOrCompletion"] = 33554432] = "ContainsHoistedDeclarationOrCompletion";
+ TransformFlags[TransformFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags";
+ TransformFlags[TransformFlags["AssertTypeScript"] = 3] = "AssertTypeScript";
+ TransformFlags[TransformFlags["AssertJsx"] = 12] = "AssertJsx";
+ TransformFlags[TransformFlags["AssertES2017"] = 48] = "AssertES2017";
+ TransformFlags[TransformFlags["AssertES2016"] = 192] = "AssertES2016";
+ TransformFlags[TransformFlags["AssertES2015"] = 768] = "AssertES2015";
+ TransformFlags[TransformFlags["AssertGenerator"] = 6144] = "AssertGenerator";
+ TransformFlags[TransformFlags["NodeExcludes"] = 536874325] = "NodeExcludes";
+ TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 592227669] = "ArrowFunctionExcludes";
+ TransformFlags[TransformFlags["FunctionExcludes"] = 592293205] = "FunctionExcludes";
+ TransformFlags[TransformFlags["ConstructorExcludes"] = 591760725] = "ConstructorExcludes";
+ TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 591760725] = "MethodOrAccessorExcludes";
+ TransformFlags[TransformFlags["ClassExcludes"] = 539749717] = "ClassExcludes";
+ TransformFlags[TransformFlags["ModuleExcludes"] = 574729557] = "ModuleExcludes";
+ TransformFlags[TransformFlags["TypeExcludes"] = -3] = "TypeExcludes";
+ TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 539110741] = "ObjectLiteralExcludes";
+ TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 537922901] = "ArrayLiteralOrCallOrNewExcludes";
+ TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 545262933] = "VariableDeclarationListExcludes";
+ TransformFlags[TransformFlags["ParameterExcludes"] = 545262933] = "ParameterExcludes";
+ TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 548864] = "TypeScriptClassSyntaxMask";
+ TransformFlags[TransformFlags["ES2015FunctionSyntaxMask"] = 327680] = "ES2015FunctionSyntaxMask";
+ })(ts.TransformFlags || (ts.TransformFlags = {}));
+ var TransformFlags = ts.TransformFlags;
+ (function (EmitFlags) {
+ EmitFlags[EmitFlags["EmitEmitHelpers"] = 1] = "EmitEmitHelpers";
+ EmitFlags[EmitFlags["EmitExportStar"] = 2] = "EmitExportStar";
+ EmitFlags[EmitFlags["EmitSuperHelper"] = 4] = "EmitSuperHelper";
+ EmitFlags[EmitFlags["EmitAdvancedSuperHelper"] = 8] = "EmitAdvancedSuperHelper";
+ EmitFlags[EmitFlags["UMDDefine"] = 16] = "UMDDefine";
+ EmitFlags[EmitFlags["SingleLine"] = 32] = "SingleLine";
+ EmitFlags[EmitFlags["AdviseOnEmitNode"] = 64] = "AdviseOnEmitNode";
+ EmitFlags[EmitFlags["NoSubstitution"] = 128] = "NoSubstitution";
+ EmitFlags[EmitFlags["CapturesThis"] = 256] = "CapturesThis";
+ EmitFlags[EmitFlags["NoLeadingSourceMap"] = 512] = "NoLeadingSourceMap";
+ EmitFlags[EmitFlags["NoTrailingSourceMap"] = 1024] = "NoTrailingSourceMap";
+ EmitFlags[EmitFlags["NoSourceMap"] = 1536] = "NoSourceMap";
+ EmitFlags[EmitFlags["NoNestedSourceMaps"] = 2048] = "NoNestedSourceMaps";
+ EmitFlags[EmitFlags["NoTokenLeadingSourceMaps"] = 4096] = "NoTokenLeadingSourceMaps";
+ EmitFlags[EmitFlags["NoTokenTrailingSourceMaps"] = 8192] = "NoTokenTrailingSourceMaps";
+ EmitFlags[EmitFlags["NoTokenSourceMaps"] = 12288] = "NoTokenSourceMaps";
+ EmitFlags[EmitFlags["NoLeadingComments"] = 16384] = "NoLeadingComments";
+ EmitFlags[EmitFlags["NoTrailingComments"] = 32768] = "NoTrailingComments";
+ EmitFlags[EmitFlags["NoComments"] = 49152] = "NoComments";
+ EmitFlags[EmitFlags["NoNestedComments"] = 65536] = "NoNestedComments";
+ EmitFlags[EmitFlags["ExportName"] = 131072] = "ExportName";
+ EmitFlags[EmitFlags["LocalName"] = 262144] = "LocalName";
+ EmitFlags[EmitFlags["Indented"] = 524288] = "Indented";
+ EmitFlags[EmitFlags["NoIndentation"] = 1048576] = "NoIndentation";
+ EmitFlags[EmitFlags["AsyncFunctionBody"] = 2097152] = "AsyncFunctionBody";
+ EmitFlags[EmitFlags["ReuseTempVariableScope"] = 4194304] = "ReuseTempVariableScope";
+ EmitFlags[EmitFlags["CustomPrologue"] = 8388608] = "CustomPrologue";
+ })(ts.EmitFlags || (ts.EmitFlags = {}));
+ var EmitFlags = ts.EmitFlags;
+ (function (EmitContext) {
+ EmitContext[EmitContext["SourceFile"] = 0] = "SourceFile";
+ EmitContext[EmitContext["Expression"] = 1] = "Expression";
+ EmitContext[EmitContext["IdentifierName"] = 2] = "IdentifierName";
+ EmitContext[EmitContext["Unspecified"] = 3] = "Unspecified";
+ })(ts.EmitContext || (ts.EmitContext = {}));
+ var EmitContext = ts.EmitContext;
})(ts || (ts = {}));
var ts;
(function (ts) {
@@ -77,7 +938,7 @@ var ts;
(function (performance) {
var profilerEvent = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true
? onProfilerEvent
- : function (markName) { };
+ : function (_markName) { };
var enabled = false;
var profilerStart = 0;
var counts;
@@ -129,7 +990,14 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
+ (function (Ternary) {
+ Ternary[Ternary["False"] = 0] = "False";
+ Ternary[Ternary["Maybe"] = 1] = "Maybe";
+ Ternary[Ternary["True"] = -1] = "True";
+ })(ts.Ternary || (ts.Ternary = {}));
+ var Ternary = ts.Ternary;
var createObject = Object.create;
+ ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined;
function createMap(template) {
var map = createObject(null);
map["__"] = undefined;
@@ -150,7 +1018,7 @@ var ts;
remove: remove,
forEachValue: forEachValueInMap,
getKeys: getKeys,
- clear: clear
+ clear: clear,
};
function forEachValueInMap(f) {
for (var key in files) {
@@ -192,6 +1060,12 @@ var ts;
return getCanonicalFileName(nonCanonicalizedPath);
}
ts.toPath = toPath;
+ (function (Comparison) {
+ Comparison[Comparison["LessThan"] = -1] = "LessThan";
+ Comparison[Comparison["EqualTo"] = 0] = "EqualTo";
+ Comparison[Comparison["GreaterThan"] = 1] = "GreaterThan";
+ })(ts.Comparison || (ts.Comparison = {}));
+ var Comparison = ts.Comparison;
function forEach(array, callback) {
if (array) {
for (var i = 0, len = array.length; i < len; i++) {
@@ -335,13 +1209,32 @@ var ts;
if (array) {
result = [];
for (var i = 0; i < array.length; i++) {
- var v = array[i];
- result.push(f(v, i));
+ result.push(f(array[i], i));
}
}
return result;
}
ts.map = map;
+ function sameMap(array, f) {
+ var result;
+ if (array) {
+ for (var i = 0; i < array.length; i++) {
+ if (result) {
+ result.push(f(array[i], i));
+ }
+ else {
+ var item = array[i];
+ var mapped = f(item, i);
+ if (item !== mapped) {
+ result = array.slice(0, i);
+ result.push(mapped);
+ }
+ }
+ }
+ }
+ return result || array;
+ }
+ ts.sameMap = sameMap;
function flatten(array) {
var result;
if (array) {
@@ -442,6 +1335,18 @@ var ts;
return result;
}
ts.mapObject = mapObject;
+ function some(array, predicate) {
+ if (array) {
+ for (var _i = 0, array_5 = array; _i < array_5.length; _i++) {
+ var v = array_5[_i];
+ if (!predicate || predicate(v)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ ts.some = some;
function concatenate(array1, array2) {
if (!array2 || !array2.length)
return array1;
@@ -454,8 +1359,8 @@ var ts;
var result;
if (array) {
result = [];
- loop: for (var _i = 0, array_5 = array; _i < array_5.length; _i++) {
- var item = array_5[_i];
+ loop: for (var _i = 0, array_6 = array; _i < array_6.length; _i++) {
+ var item = array_6[_i];
for (var _a = 0, result_1 = result; _a < result_1.length; _a++) {
var res = result_1[_a];
if (areEqual ? areEqual(res, item) : res === item) {
@@ -488,8 +1393,8 @@ var ts;
ts.compact = compact;
function sum(array, prop) {
var result = 0;
- for (var _i = 0, array_6 = array; _i < array_6.length; _i++) {
- var v = array_6[_i];
+ for (var _i = 0, array_7 = array; _i < array_7.length; _i++) {
+ var v = array_7[_i];
result += v[prop];
}
return result;
@@ -708,8 +1613,8 @@ var ts;
ts.equalOwnProperties = equalOwnProperties;
function arrayToMap(array, makeKey, makeValue) {
var result = createMap();
- for (var _i = 0, array_7 = array; _i < array_7.length; _i++) {
- var value = array_7[_i];
+ for (var _i = 0, array_8 = array; _i < array_8.length; _i++) {
+ var value = array_8[_i];
result[makeKey(value)] = makeValue ? makeValue(value) : value;
}
return result;
@@ -810,7 +1715,7 @@ var ts;
return function (t) { return compose(a(t)); };
}
else {
- return function (t) { return function (u) { return u; }; };
+ return function (_) { return function (u) { return u; }; };
}
}
ts.chain = chain;
@@ -841,7 +1746,7 @@ var ts;
ts.compose = compose;
function formatStringFromArgs(text, args, baseIndex) {
baseIndex = baseIndex || 0;
- return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; });
+ return text.replace(/{(\d+)}/g, function (_match, index) { return args[+index + baseIndex]; });
}
ts.localizedDiagnosticMessages = undefined;
function getLocaleSpecificMessage(message) {
@@ -866,11 +1771,11 @@ var ts;
length: length,
messageText: text,
category: message.category,
- code: message.code
+ code: message.code,
};
}
ts.createFileDiagnostic = createFileDiagnostic;
- function formatMessage(dummy, message) {
+ function formatMessage(_dummy, message) {
var text = getLocaleSpecificMessage(message);
if (arguments.length > 2) {
text = formatStringFromArgs(text, arguments, 2);
@@ -933,7 +1838,7 @@ var ts;
if (b === undefined)
return 1;
if (ignoreCase) {
- if (String.prototype.localeCompare) {
+ if (ts.collator && String.prototype.localeCompare) {
var result = a.localeCompare(b, undefined, { usage: "sort", sensitivity: "accent" });
return result < 0 ? -1 : result > 0 ? 1 : 0;
}
@@ -1086,7 +1991,7 @@ var ts;
function getEmitModuleKind(compilerOptions) {
return typeof compilerOptions.module === "number" ?
compilerOptions.module :
- getEmitScriptTarget(compilerOptions) === 2 ? ts.ModuleKind.ES6 : ts.ModuleKind.CommonJS;
+ getEmitScriptTarget(compilerOptions) >= 2 ? ts.ModuleKind.ES2015 : ts.ModuleKind.CommonJS;
}
ts.getEmitModuleKind = getEmitModuleKind;
function hasZeroOrOneAsteriskCharacter(str) {
@@ -1383,7 +2288,7 @@ var ts;
function replaceWildcardCharacter(match, singleAsteriskRegexFragment) {
return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match;
}
- function getFileMatcherPatterns(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {
+ function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {
path = normalizePath(path);
currentDirectory = normalizePath(currentDirectory);
var absolutePath = combinePaths(currentDirectory, path);
@@ -1398,7 +2303,7 @@ var ts;
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, getFileSystemEntries) {
path = normalizePath(path);
currentDirectory = normalizePath(currentDirectory);
- var patterns = getFileMatcherPatterns(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
+ var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
var regexFlag = useCaseSensitiveFileNames ? "" : "i";
var includeFileRegex = patterns.includeFilePattern && new RegExp(patterns.includeFilePattern, regexFlag);
var includeDirectoryRegex = patterns.includeDirectoryPattern && new RegExp(patterns.includeDirectoryPattern, regexFlag);
@@ -1508,6 +2413,14 @@ var ts;
return false;
}
ts.isSupportedSourceFileName = isSupportedSourceFileName;
+ (function (ExtensionPriority) {
+ ExtensionPriority[ExtensionPriority["TypeScriptFiles"] = 0] = "TypeScriptFiles";
+ ExtensionPriority[ExtensionPriority["DeclarationAndJavaScriptFiles"] = 2] = "DeclarationAndJavaScriptFiles";
+ ExtensionPriority[ExtensionPriority["Limit"] = 5] = "Limit";
+ ExtensionPriority[ExtensionPriority["Highest"] = 0] = "Highest";
+ ExtensionPriority[ExtensionPriority["Lowest"] = 2] = "Lowest";
+ })(ts.ExtensionPriority || (ts.ExtensionPriority = {}));
+ var ExtensionPriority = ts.ExtensionPriority;
function getExtensionPriority(path, supportedExtensions) {
for (var i = supportedExtensions.length - 1; i >= 0; i--) {
if (fileExtensionIs(path, supportedExtensions[i])) {
@@ -1571,10 +2484,10 @@ var ts;
this.name = name;
this.declarations = undefined;
}
- function Type(checker, flags) {
+ function Type(_checker, flags) {
this.flags = flags;
}
- function Signature(checker) {
+ function Signature() {
}
function Node(kind, pos, end) {
this.id = 0;
@@ -1596,6 +2509,13 @@ var ts;
getTypeConstructor: function () { return Type; },
getSignatureConstructor: function () { return Signature; }
};
+ (function (AssertionLevel) {
+ AssertionLevel[AssertionLevel["None"] = 0] = "None";
+ AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal";
+ AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive";
+ AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive";
+ })(ts.AssertionLevel || (ts.AssertionLevel = {}));
+ var AssertionLevel = ts.AssertionLevel;
var Debug;
(function (Debug) {
Debug.currentAssertionLevel = 0;
@@ -1908,7 +2828,7 @@ var ts;
}
var platform = _os.platform();
var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
- function readFile(fileName, encoding) {
+ function readFile(fileName, _encoding) {
if (!fileExists(fileName)) {
return undefined;
}
@@ -1980,6 +2900,11 @@ var ts;
function readDirectory(path, extensions, excludes, includes) {
return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), getAccessibleFileSystemEntries);
}
+ var FileSystemEntryKind;
+ (function (FileSystemEntryKind) {
+ FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File";
+ FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory";
+ })(FileSystemEntryKind || (FileSystemEntryKind = {}));
function fileSystemEntryExists(path, entryKind) {
try {
var stat = _fs.statSync(path);
@@ -2121,7 +3046,7 @@ var ts;
args: ChakraHost.args,
useCaseSensitiveFileNames: !!ChakraHost.useCaseSensitiveFileNames,
write: ChakraHost.echo,
- readFile: function (path, encoding) {
+ readFile: function (path, _encoding) {
return ChakraHost.readFile(path);
},
writeFile: function (path, data, writeByteOrderMark) {
@@ -2137,9 +3062,9 @@ var ts;
getExecutingFilePath: function () { return ChakraHost.executingFile; },
getCurrentDirectory: function () { return ChakraHost.currentDirectory; },
getDirectories: ChakraHost.getDirectories,
- getEnvironmentVariable: ChakraHost.getEnvironmentVariable || (function (name) { return ""; }),
+ getEnvironmentVariable: ChakraHost.getEnvironmentVariable || (function () { return ""; }),
readDirectory: function (path, extensions, excludes, includes) {
- var pattern = ts.getFileMatcherPatterns(path, extensions, excludes, includes, !!ChakraHost.useCaseSensitiveFileNames, ChakraHost.currentDirectory);
+ var pattern = ts.getFileMatcherPatterns(path, excludes, includes, !!ChakraHost.useCaseSensitiveFileNames, ChakraHost.currentDirectory);
return ChakraHost.readDirectory(path, extensions, pattern.basePaths, pattern.excludePattern, pattern.includeFilePattern, pattern.includeDirectoryPattern);
},
exit: ChakraHost.quit,
@@ -2927,7 +3852,7 @@ var ts;
Binding_element_0_implicitly_has_an_1_type: { code: 7031, category: ts.DiagnosticCategory.Error, key: "Binding_element_0_implicitly_has_an_1_type_7031", message: "Binding element '{0}' implicitly has an '{1}' type." },
Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: { code: 7032, category: ts.DiagnosticCategory.Error, key: "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032", message: "Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation." },
Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: { code: 7033, category: ts.DiagnosticCategory.Error, key: "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033", message: "Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation." },
- Variable_0_implicitly_has_type_any_in_some_locations_where_its_type_cannot_be_determined: { code: 7034, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_type_any_in_some_locations_where_its_type_cannot_be_determined_7034", message: "Variable '{0}' implicitly has type 'any' in some locations where its type cannot be determined." },
+ Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: { code: 7034, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", message: "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined." },
You_cannot_rename_this_element: { code: 8000, category: ts.DiagnosticCategory.Error, key: "You_cannot_rename_this_element_8000", message: "You cannot rename this element." },
You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: ts.DiagnosticCategory.Error, key: "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", message: "You cannot rename elements that are defined in the standard TypeScript library." },
import_can_only_be_used_in_a_ts_file: { code: 8002, category: ts.DiagnosticCategory.Error, key: "import_can_only_be_used_in_a_ts_file_8002", message: "'import ... =' can only be used in a .ts file." },
@@ -2964,3022 +3889,12 @@ var ts;
Remove_unused_identifiers: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_unused_identifiers_90004", message: "Remove unused identifiers" },
Implement_interface_on_reference: { code: 90005, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_reference_90005", message: "Implement interface on reference" },
Implement_interface_on_class: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_class_90006", message: "Implement interface on class" },
- Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" }
+ Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" },
};
})(ts || (ts = {}));
var ts;
(function (ts) {
- function tokenIsIdentifierOrKeyword(token) {
- return token >= 69;
- }
- ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword;
- var textToToken = ts.createMap({
- "abstract": 115,
- "any": 117,
- "as": 116,
- "boolean": 120,
- "break": 70,
- "case": 71,
- "catch": 72,
- "class": 73,
- "continue": 75,
- "const": 74,
- "constructor": 121,
- "debugger": 76,
- "declare": 122,
- "default": 77,
- "delete": 78,
- "do": 79,
- "else": 80,
- "enum": 81,
- "export": 82,
- "extends": 83,
- "false": 84,
- "finally": 85,
- "for": 86,
- "from": 136,
- "function": 87,
- "get": 123,
- "if": 88,
- "implements": 106,
- "import": 89,
- "in": 90,
- "instanceof": 91,
- "interface": 107,
- "is": 124,
- "let": 108,
- "module": 125,
- "namespace": 126,
- "never": 127,
- "new": 92,
- "null": 93,
- "number": 130,
- "package": 109,
- "private": 110,
- "protected": 111,
- "public": 112,
- "readonly": 128,
- "require": 129,
- "global": 137,
- "return": 94,
- "set": 131,
- "static": 113,
- "string": 132,
- "super": 95,
- "switch": 96,
- "symbol": 133,
- "this": 97,
- "throw": 98,
- "true": 99,
- "try": 100,
- "type": 134,
- "typeof": 101,
- "undefined": 135,
- "var": 102,
- "void": 103,
- "while": 104,
- "with": 105,
- "yield": 114,
- "async": 118,
- "await": 119,
- "of": 138,
- "{": 15,
- "}": 16,
- "(": 17,
- ")": 18,
- "[": 19,
- "]": 20,
- ".": 21,
- "...": 22,
- ";": 23,
- ",": 24,
- "<": 25,
- ">": 27,
- "<=": 28,
- ">=": 29,
- "==": 30,
- "!=": 31,
- "===": 32,
- "!==": 33,
- "=>": 34,
- "+": 35,
- "-": 36,
- "**": 38,
- "*": 37,
- "/": 39,
- "%": 40,
- "++": 41,
- "--": 42,
- "<<": 43,
- "": 26,
- ">>": 44,
- ">>>": 45,
- "&": 46,
- "|": 47,
- "^": 48,
- "!": 49,
- "~": 50,
- "&&": 51,
- "||": 52,
- "?": 53,
- ":": 54,
- "=": 56,
- "+=": 57,
- "-=": 58,
- "*=": 59,
- "**=": 60,
- "/=": 61,
- "%=": 62,
- "<<=": 63,
- ">>=": 64,
- ">>>=": 65,
- "&=": 66,
- "|=": 67,
- "^=": 68,
- "@": 55
- });
- var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
- var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
- var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
- var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
- function lookupInUnicodeMap(code, map) {
- if (code < map[0]) {
- return false;
- }
- var lo = 0;
- var hi = map.length;
- var mid;
- while (lo + 1 < hi) {
- mid = lo + (hi - lo) / 2;
- mid -= mid % 2;
- if (map[mid] <= code && code <= map[mid + 1]) {
- return true;
- }
- if (code < map[mid]) {
- hi = mid;
- }
- else {
- lo = mid + 2;
- }
- }
- return false;
- }
- function isUnicodeIdentifierStart(code, languageVersion) {
- return languageVersion >= 1 ?
- lookupInUnicodeMap(code, unicodeES5IdentifierStart) :
- lookupInUnicodeMap(code, unicodeES3IdentifierStart);
- }
- ts.isUnicodeIdentifierStart = isUnicodeIdentifierStart;
- function isUnicodeIdentifierPart(code, languageVersion) {
- return languageVersion >= 1 ?
- lookupInUnicodeMap(code, unicodeES5IdentifierPart) :
- lookupInUnicodeMap(code, unicodeES3IdentifierPart);
- }
- function makeReverseMap(source) {
- var result = [];
- for (var name_4 in source) {
- result[source[name_4]] = name_4;
- }
- return result;
- }
- var tokenStrings = makeReverseMap(textToToken);
- function tokenToString(t) {
- return tokenStrings[t];
- }
- ts.tokenToString = tokenToString;
- function stringToToken(s) {
- return textToToken[s];
- }
- ts.stringToToken = stringToToken;
- function computeLineStarts(text) {
- var result = new Array();
- var pos = 0;
- var lineStart = 0;
- while (pos < text.length) {
- var ch = text.charCodeAt(pos);
- pos++;
- switch (ch) {
- case 13:
- if (text.charCodeAt(pos) === 10) {
- pos++;
- }
- case 10:
- result.push(lineStart);
- lineStart = pos;
- break;
- default:
- if (ch > 127 && isLineBreak(ch)) {
- result.push(lineStart);
- lineStart = pos;
- }
- break;
- }
- }
- result.push(lineStart);
- return result;
- }
- ts.computeLineStarts = computeLineStarts;
- function getPositionOfLineAndCharacter(sourceFile, line, character) {
- return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character);
- }
- ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter;
- function computePositionOfLineAndCharacter(lineStarts, line, character) {
- ts.Debug.assert(line >= 0 && line < lineStarts.length);
- return lineStarts[line] + character;
- }
- ts.computePositionOfLineAndCharacter = computePositionOfLineAndCharacter;
- function getLineStarts(sourceFile) {
- return sourceFile.lineMap || (sourceFile.lineMap = computeLineStarts(sourceFile.text));
- }
- ts.getLineStarts = getLineStarts;
- function computeLineAndCharacterOfPosition(lineStarts, position) {
- var lineNumber = ts.binarySearch(lineStarts, position);
- if (lineNumber < 0) {
- lineNumber = ~lineNumber - 1;
- ts.Debug.assert(lineNumber !== -1, "position cannot precede the beginning of the file");
- }
- return {
- line: lineNumber,
- character: position - lineStarts[lineNumber]
- };
- }
- ts.computeLineAndCharacterOfPosition = computeLineAndCharacterOfPosition;
- function getLineAndCharacterOfPosition(sourceFile, position) {
- return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position);
- }
- ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition;
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function isWhiteSpace(ch) {
- return isWhiteSpaceSingleLine(ch) || isLineBreak(ch);
- }
- ts.isWhiteSpace = isWhiteSpace;
- function isWhiteSpaceSingleLine(ch) {
- return ch === 32 ||
- ch === 9 ||
- ch === 11 ||
- ch === 12 ||
- ch === 160 ||
- ch === 133 ||
- ch === 5760 ||
- ch >= 8192 && ch <= 8203 ||
- ch === 8239 ||
- ch === 8287 ||
- ch === 12288 ||
- ch === 65279;
- }
- ts.isWhiteSpaceSingleLine = isWhiteSpaceSingleLine;
- function isLineBreak(ch) {
- return ch === 10 ||
- ch === 13 ||
- ch === 8232 ||
- ch === 8233;
- }
- ts.isLineBreak = isLineBreak;
- function isDigit(ch) {
- return ch >= 48 && ch <= 57;
- }
- function isOctalDigit(ch) {
- return ch >= 48 && ch <= 55;
- }
- ts.isOctalDigit = isOctalDigit;
- function couldStartTrivia(text, pos) {
- var ch = text.charCodeAt(pos);
- switch (ch) {
- case 13:
- case 10:
- case 9:
- case 11:
- case 12:
- case 32:
- case 47:
- case 60:
- case 61:
- case 62:
- return true;
- case 35:
- return pos === 0;
- default:
- return ch > 127;
- }
- }
- ts.couldStartTrivia = couldStartTrivia;
- function skipTrivia(text, pos, stopAfterLineBreak, stopAtComments) {
- if (stopAtComments === void 0) { stopAtComments = false; }
- if (ts.positionIsSynthesized(pos)) {
- return pos;
- }
- while (true) {
- var ch = text.charCodeAt(pos);
- switch (ch) {
- case 13:
- if (text.charCodeAt(pos + 1) === 10) {
- pos++;
- }
- case 10:
- pos++;
- if (stopAfterLineBreak) {
- return pos;
- }
- continue;
- case 9:
- case 11:
- case 12:
- case 32:
- pos++;
- continue;
- case 47:
- if (stopAtComments) {
- break;
- }
- if (text.charCodeAt(pos + 1) === 47) {
- pos += 2;
- while (pos < text.length) {
- if (isLineBreak(text.charCodeAt(pos))) {
- break;
- }
- pos++;
- }
- continue;
- }
- if (text.charCodeAt(pos + 1) === 42) {
- pos += 2;
- while (pos < text.length) {
- if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) {
- pos += 2;
- break;
- }
- pos++;
- }
- continue;
- }
- break;
- case 60:
- case 61:
- case 62:
- if (isConflictMarkerTrivia(text, pos)) {
- pos = scanConflictMarkerTrivia(text, pos);
- continue;
- }
- break;
- case 35:
- if (pos === 0 && isShebangTrivia(text, pos)) {
- pos = scanShebangTrivia(text, pos);
- continue;
- }
- break;
- default:
- if (ch > 127 && (isWhiteSpace(ch))) {
- pos++;
- continue;
- }
- break;
- }
- return pos;
- }
- }
- ts.skipTrivia = skipTrivia;
- var mergeConflictMarkerLength = "<<<<<<<".length;
- function isConflictMarkerTrivia(text, pos) {
- ts.Debug.assert(pos >= 0);
- if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) {
- var ch = text.charCodeAt(pos);
- if ((pos + mergeConflictMarkerLength) < text.length) {
- for (var i = 0, n = mergeConflictMarkerLength; i < n; i++) {
- if (text.charCodeAt(pos + i) !== ch) {
- return false;
- }
- }
- return ch === 61 ||
- text.charCodeAt(pos + mergeConflictMarkerLength) === 32;
- }
- }
- return false;
- }
- function scanConflictMarkerTrivia(text, pos, error) {
- if (error) {
- error(ts.Diagnostics.Merge_conflict_marker_encountered, mergeConflictMarkerLength);
- }
- var ch = text.charCodeAt(pos);
- var len = text.length;
- if (ch === 60 || ch === 62) {
- while (pos < len && !isLineBreak(text.charCodeAt(pos))) {
- pos++;
- }
- }
- else {
- ts.Debug.assert(ch === 61);
- while (pos < len) {
- var ch_1 = text.charCodeAt(pos);
- if (ch_1 === 62 && isConflictMarkerTrivia(text, pos)) {
- break;
- }
- pos++;
- }
- }
- return pos;
- }
- var shebangTriviaRegex = /^#!.*/;
- function isShebangTrivia(text, pos) {
- ts.Debug.assert(pos === 0);
- return shebangTriviaRegex.test(text);
- }
- function scanShebangTrivia(text, pos) {
- var shebang = shebangTriviaRegex.exec(text)[0];
- pos = pos + shebang.length;
- return pos;
- }
- function iterateCommentRanges(reduce, text, pos, trailing, cb, state, initial) {
- var pendingPos;
- var pendingEnd;
- var pendingKind;
- var pendingHasTrailingNewLine;
- var hasPendingCommentRange = false;
- var collecting = trailing || pos === 0;
- var accumulator = initial;
- scan: while (pos >= 0 && pos < text.length) {
- var ch = text.charCodeAt(pos);
- switch (ch) {
- case 13:
- if (text.charCodeAt(pos + 1) === 10) {
- pos++;
- }
- case 10:
- pos++;
- if (trailing) {
- break scan;
- }
- collecting = true;
- if (hasPendingCommentRange) {
- pendingHasTrailingNewLine = true;
- }
- continue;
- case 9:
- case 11:
- case 12:
- case 32:
- pos++;
- continue;
- case 47:
- var nextChar = text.charCodeAt(pos + 1);
- var hasTrailingNewLine = false;
- if (nextChar === 47 || nextChar === 42) {
- var kind = nextChar === 47 ? 2 : 3;
- var startPos = pos;
- pos += 2;
- if (nextChar === 47) {
- while (pos < text.length) {
- if (isLineBreak(text.charCodeAt(pos))) {
- hasTrailingNewLine = true;
- break;
- }
- pos++;
- }
- }
- else {
- while (pos < text.length) {
- if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) {
- pos += 2;
- break;
- }
- pos++;
- }
- }
- if (collecting) {
- if (hasPendingCommentRange) {
- accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator);
- if (!reduce && accumulator) {
- return accumulator;
- }
- hasPendingCommentRange = false;
- }
- pendingPos = startPos;
- pendingEnd = pos;
- pendingKind = kind;
- pendingHasTrailingNewLine = hasTrailingNewLine;
- hasPendingCommentRange = true;
- }
- continue;
- }
- break scan;
- default:
- if (ch > 127 && (isWhiteSpace(ch))) {
- if (hasPendingCommentRange && isLineBreak(ch)) {
- pendingHasTrailingNewLine = true;
- }
- pos++;
- continue;
- }
- break scan;
- }
- }
- if (hasPendingCommentRange) {
- accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator);
- }
- return accumulator;
- }
- function forEachLeadingCommentRange(text, pos, cb, state) {
- return iterateCommentRanges(false, text, pos, false, cb, state);
- }
- ts.forEachLeadingCommentRange = forEachLeadingCommentRange;
- function forEachTrailingCommentRange(text, pos, cb, state) {
- return iterateCommentRanges(false, text, pos, true, cb, state);
- }
- ts.forEachTrailingCommentRange = forEachTrailingCommentRange;
- function reduceEachLeadingCommentRange(text, pos, cb, state, initial) {
- return iterateCommentRanges(true, text, pos, false, cb, state, initial);
- }
- ts.reduceEachLeadingCommentRange = reduceEachLeadingCommentRange;
- function reduceEachTrailingCommentRange(text, pos, cb, state, initial) {
- return iterateCommentRanges(true, text, pos, true, cb, state, initial);
- }
- ts.reduceEachTrailingCommentRange = reduceEachTrailingCommentRange;
- function appendCommentRange(pos, end, kind, hasTrailingNewLine, state, comments) {
- if (!comments) {
- comments = [];
- }
- comments.push({ pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine, kind: kind });
- return comments;
- }
- function getLeadingCommentRanges(text, pos) {
- return reduceEachLeadingCommentRange(text, pos, appendCommentRange, undefined, undefined);
- }
- ts.getLeadingCommentRanges = getLeadingCommentRanges;
- function getTrailingCommentRanges(text, pos) {
- return reduceEachTrailingCommentRange(text, pos, appendCommentRange, undefined, undefined);
- }
- ts.getTrailingCommentRanges = getTrailingCommentRanges;
- function getShebang(text) {
- return shebangTriviaRegex.test(text)
- ? shebangTriviaRegex.exec(text)[0]
- : undefined;
- }
- ts.getShebang = getShebang;
- function isIdentifierStart(ch, languageVersion) {
- return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 ||
- ch === 36 || ch === 95 ||
- ch > 127 && isUnicodeIdentifierStart(ch, languageVersion);
- }
- ts.isIdentifierStart = isIdentifierStart;
- function isIdentifierPart(ch, languageVersion) {
- return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 ||
- ch >= 48 && ch <= 57 || ch === 36 || ch === 95 ||
- ch > 127 && isUnicodeIdentifierPart(ch, languageVersion);
- }
- ts.isIdentifierPart = isIdentifierPart;
- function isIdentifierText(name, languageVersion) {
- if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) {
- return false;
- }
- for (var i = 1, n = name.length; i < n; i++) {
- if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) {
- return false;
- }
- }
- return true;
- }
- ts.isIdentifierText = isIdentifierText;
- function createScanner(languageVersion, skipTrivia, languageVariant, text, onError, start, length) {
- if (languageVariant === void 0) { languageVariant = 0; }
- var pos;
- var end;
- var startPos;
- var tokenPos;
- var token;
- var tokenValue;
- var precedingLineBreak;
- var hasExtendedUnicodeEscape;
- var tokenIsUnterminated;
- setText(text, start, length);
- return {
- getStartPos: function () { return startPos; },
- getTextPos: function () { return pos; },
- getToken: function () { return token; },
- getTokenPos: function () { return tokenPos; },
- getTokenText: function () { return text.substring(tokenPos, pos); },
- getTokenValue: function () { return tokenValue; },
- hasExtendedUnicodeEscape: function () { return hasExtendedUnicodeEscape; },
- hasPrecedingLineBreak: function () { return precedingLineBreak; },
- isIdentifier: function () { return token === 69 || token > 105; },
- isReservedWord: function () { return token >= 70 && token <= 105; },
- isUnterminated: function () { return tokenIsUnterminated; },
- reScanGreaterToken: reScanGreaterToken,
- reScanSlashToken: reScanSlashToken,
- reScanTemplateToken: reScanTemplateToken,
- scanJsxIdentifier: scanJsxIdentifier,
- scanJsxAttributeValue: scanJsxAttributeValue,
- reScanJsxToken: reScanJsxToken,
- scanJsxToken: scanJsxToken,
- scanJSDocToken: scanJSDocToken,
- scan: scan,
- getText: getText,
- setText: setText,
- setScriptTarget: setScriptTarget,
- setLanguageVariant: setLanguageVariant,
- setOnError: setOnError,
- setTextPos: setTextPos,
- tryScan: tryScan,
- lookAhead: lookAhead,
- scanRange: scanRange
- };
- function error(message, length) {
- if (onError) {
- onError(message, length || 0);
- }
- }
- function scanNumber() {
- var start = pos;
- while (isDigit(text.charCodeAt(pos)))
- pos++;
- if (text.charCodeAt(pos) === 46) {
- pos++;
- while (isDigit(text.charCodeAt(pos)))
- pos++;
- }
- var end = pos;
- if (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101) {
- pos++;
- if (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45)
- pos++;
- if (isDigit(text.charCodeAt(pos))) {
- pos++;
- while (isDigit(text.charCodeAt(pos)))
- pos++;
- end = pos;
- }
- else {
- error(ts.Diagnostics.Digit_expected);
- }
- }
- return "" + +(text.substring(start, end));
- }
- function scanOctalDigits() {
- var start = pos;
- while (isOctalDigit(text.charCodeAt(pos))) {
- pos++;
- }
- return +(text.substring(start, pos));
- }
- function scanExactNumberOfHexDigits(count) {
- return scanHexDigits(count, false);
- }
- function scanMinimumNumberOfHexDigits(count) {
- return scanHexDigits(count, true);
- }
- function scanHexDigits(minCount, scanAsManyAsPossible) {
- var digits = 0;
- var value = 0;
- while (digits < minCount || scanAsManyAsPossible) {
- var ch = text.charCodeAt(pos);
- if (ch >= 48 && ch <= 57) {
- value = value * 16 + ch - 48;
- }
- else if (ch >= 65 && ch <= 70) {
- value = value * 16 + ch - 65 + 10;
- }
- else if (ch >= 97 && ch <= 102) {
- value = value * 16 + ch - 97 + 10;
- }
- else {
- break;
- }
- pos++;
- digits++;
- }
- if (digits < minCount) {
- value = -1;
- }
- return value;
- }
- function scanString(allowEscapes) {
- if (allowEscapes === void 0) { allowEscapes = true; }
- var quote = text.charCodeAt(pos);
- pos++;
- var result = "";
- var start = pos;
- while (true) {
- if (pos >= end) {
- result += text.substring(start, pos);
- tokenIsUnterminated = true;
- error(ts.Diagnostics.Unterminated_string_literal);
- break;
- }
- var ch = text.charCodeAt(pos);
- if (ch === quote) {
- result += text.substring(start, pos);
- pos++;
- break;
- }
- if (ch === 92 && allowEscapes) {
- result += text.substring(start, pos);
- result += scanEscapeSequence();
- start = pos;
- continue;
- }
- if (isLineBreak(ch)) {
- result += text.substring(start, pos);
- tokenIsUnterminated = true;
- error(ts.Diagnostics.Unterminated_string_literal);
- break;
- }
- pos++;
- }
- return result;
- }
- function scanTemplateAndSetTokenValue() {
- var startedWithBacktick = text.charCodeAt(pos) === 96;
- pos++;
- var start = pos;
- var contents = "";
- var resultingToken;
- while (true) {
- if (pos >= end) {
- contents += text.substring(start, pos);
- tokenIsUnterminated = true;
- error(ts.Diagnostics.Unterminated_template_literal);
- resultingToken = startedWithBacktick ? 11 : 14;
- break;
- }
- var currChar = text.charCodeAt(pos);
- if (currChar === 96) {
- contents += text.substring(start, pos);
- pos++;
- resultingToken = startedWithBacktick ? 11 : 14;
- break;
- }
- if (currChar === 36 && pos + 1 < end && text.charCodeAt(pos + 1) === 123) {
- contents += text.substring(start, pos);
- pos += 2;
- resultingToken = startedWithBacktick ? 12 : 13;
- break;
- }
- if (currChar === 92) {
- contents += text.substring(start, pos);
- contents += scanEscapeSequence();
- start = pos;
- continue;
- }
- if (currChar === 13) {
- contents += text.substring(start, pos);
- pos++;
- if (pos < end && text.charCodeAt(pos) === 10) {
- pos++;
- }
- contents += "\n";
- start = pos;
- continue;
- }
- pos++;
- }
- ts.Debug.assert(resultingToken !== undefined);
- tokenValue = contents;
- return resultingToken;
- }
- function scanEscapeSequence() {
- pos++;
- if (pos >= end) {
- error(ts.Diagnostics.Unexpected_end_of_text);
- return "";
- }
- var ch = text.charCodeAt(pos);
- pos++;
- switch (ch) {
- case 48:
- return "\0";
- case 98:
- return "\b";
- case 116:
- return "\t";
- case 110:
- return "\n";
- case 118:
- return "\v";
- case 102:
- return "\f";
- case 114:
- return "\r";
- case 39:
- return "\'";
- case 34:
- return "\"";
- case 117:
- if (pos < end && text.charCodeAt(pos) === 123) {
- hasExtendedUnicodeEscape = true;
- pos++;
- return scanExtendedUnicodeEscape();
- }
- return scanHexadecimalEscape(4);
- case 120:
- return scanHexadecimalEscape(2);
- case 13:
- if (pos < end && text.charCodeAt(pos) === 10) {
- pos++;
- }
- case 10:
- case 8232:
- case 8233:
- return "";
- default:
- return String.fromCharCode(ch);
- }
- }
- function scanHexadecimalEscape(numDigits) {
- var escapedValue = scanExactNumberOfHexDigits(numDigits);
- if (escapedValue >= 0) {
- return String.fromCharCode(escapedValue);
- }
- else {
- error(ts.Diagnostics.Hexadecimal_digit_expected);
- return "";
- }
- }
- function scanExtendedUnicodeEscape() {
- var escapedValue = scanMinimumNumberOfHexDigits(1);
- var isInvalidExtendedEscape = false;
- if (escapedValue < 0) {
- error(ts.Diagnostics.Hexadecimal_digit_expected);
- isInvalidExtendedEscape = true;
- }
- else if (escapedValue > 0x10FFFF) {
- error(ts.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
- isInvalidExtendedEscape = true;
- }
- if (pos >= end) {
- error(ts.Diagnostics.Unexpected_end_of_text);
- isInvalidExtendedEscape = true;
- }
- else if (text.charCodeAt(pos) === 125) {
- pos++;
- }
- else {
- error(ts.Diagnostics.Unterminated_Unicode_escape_sequence);
- isInvalidExtendedEscape = true;
- }
- if (isInvalidExtendedEscape) {
- return "";
- }
- return utf16EncodeAsString(escapedValue);
- }
- function utf16EncodeAsString(codePoint) {
- ts.Debug.assert(0x0 <= codePoint && codePoint <= 0x10FFFF);
- if (codePoint <= 65535) {
- return String.fromCharCode(codePoint);
- }
- var codeUnit1 = Math.floor((codePoint - 65536) / 1024) + 0xD800;
- var codeUnit2 = ((codePoint - 65536) % 1024) + 0xDC00;
- return String.fromCharCode(codeUnit1, codeUnit2);
- }
- function peekUnicodeEscape() {
- if (pos + 5 < end && text.charCodeAt(pos + 1) === 117) {
- var start_1 = pos;
- pos += 2;
- var value = scanExactNumberOfHexDigits(4);
- pos = start_1;
- return value;
- }
- return -1;
- }
- function scanIdentifierParts() {
- var result = "";
- var start = pos;
- while (pos < end) {
- var ch = text.charCodeAt(pos);
- if (isIdentifierPart(ch, languageVersion)) {
- pos++;
- }
- else if (ch === 92) {
- ch = peekUnicodeEscape();
- if (!(ch >= 0 && isIdentifierPart(ch, languageVersion))) {
- break;
- }
- result += text.substring(start, pos);
- result += String.fromCharCode(ch);
- pos += 6;
- start = pos;
- }
- else {
- break;
- }
- }
- result += text.substring(start, pos);
- return result;
- }
- function getIdentifierToken() {
- var len = tokenValue.length;
- if (len >= 2 && len <= 11) {
- var ch = tokenValue.charCodeAt(0);
- if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) {
- return token = textToToken[tokenValue];
- }
- }
- return token = 69;
- }
- function scanBinaryOrOctalDigits(base) {
- ts.Debug.assert(base === 2 || base === 8, "Expected either base 2 or base 8");
- var value = 0;
- var numberOfDigits = 0;
- while (true) {
- var ch = text.charCodeAt(pos);
- var valueOfCh = ch - 48;
- if (!isDigit(ch) || valueOfCh >= base) {
- break;
- }
- value = value * base + valueOfCh;
- pos++;
- numberOfDigits++;
- }
- if (numberOfDigits === 0) {
- return -1;
- }
- return value;
- }
- function scan() {
- startPos = pos;
- hasExtendedUnicodeEscape = false;
- precedingLineBreak = false;
- tokenIsUnterminated = false;
- while (true) {
- tokenPos = pos;
- if (pos >= end) {
- return token = 1;
- }
- var ch = text.charCodeAt(pos);
- if (ch === 35 && pos === 0 && isShebangTrivia(text, pos)) {
- pos = scanShebangTrivia(text, pos);
- if (skipTrivia) {
- continue;
- }
- else {
- return token = 6;
- }
- }
- switch (ch) {
- case 10:
- case 13:
- precedingLineBreak = true;
- if (skipTrivia) {
- pos++;
- continue;
- }
- else {
- if (ch === 13 && pos + 1 < end && text.charCodeAt(pos + 1) === 10) {
- pos += 2;
- }
- else {
- pos++;
- }
- return token = 4;
- }
- case 9:
- case 11:
- case 12:
- case 32:
- if (skipTrivia) {
- pos++;
- continue;
- }
- else {
- while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) {
- pos++;
- }
- return token = 5;
- }
- case 33:
- if (text.charCodeAt(pos + 1) === 61) {
- if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 33;
- }
- return pos += 2, token = 31;
- }
- pos++;
- return token = 49;
- case 34:
- case 39:
- tokenValue = scanString();
- return token = 9;
- case 96:
- return token = scanTemplateAndSetTokenValue();
- case 37:
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 62;
- }
- pos++;
- return token = 40;
- case 38:
- if (text.charCodeAt(pos + 1) === 38) {
- return pos += 2, token = 51;
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 66;
- }
- pos++;
- return token = 46;
- case 40:
- pos++;
- return token = 17;
- case 41:
- pos++;
- return token = 18;
- case 42:
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 59;
- }
- if (text.charCodeAt(pos + 1) === 42) {
- if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 60;
- }
- return pos += 2, token = 38;
- }
- pos++;
- return token = 37;
- case 43:
- if (text.charCodeAt(pos + 1) === 43) {
- return pos += 2, token = 41;
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 57;
- }
- pos++;
- return token = 35;
- case 44:
- pos++;
- return token = 24;
- case 45:
- if (text.charCodeAt(pos + 1) === 45) {
- return pos += 2, token = 42;
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 58;
- }
- pos++;
- return token = 36;
- case 46:
- if (isDigit(text.charCodeAt(pos + 1))) {
- tokenValue = scanNumber();
- return token = 8;
- }
- if (text.charCodeAt(pos + 1) === 46 && text.charCodeAt(pos + 2) === 46) {
- return pos += 3, token = 22;
- }
- pos++;
- return token = 21;
- case 47:
- if (text.charCodeAt(pos + 1) === 47) {
- pos += 2;
- while (pos < end) {
- if (isLineBreak(text.charCodeAt(pos))) {
- break;
- }
- pos++;
- }
- if (skipTrivia) {
- continue;
- }
- else {
- return token = 2;
- }
- }
- if (text.charCodeAt(pos + 1) === 42) {
- pos += 2;
- var commentClosed = false;
- while (pos < end) {
- var ch_2 = text.charCodeAt(pos);
- if (ch_2 === 42 && text.charCodeAt(pos + 1) === 47) {
- pos += 2;
- commentClosed = true;
- break;
- }
- if (isLineBreak(ch_2)) {
- precedingLineBreak = true;
- }
- pos++;
- }
- if (!commentClosed) {
- error(ts.Diagnostics.Asterisk_Slash_expected);
- }
- if (skipTrivia) {
- continue;
- }
- else {
- tokenIsUnterminated = !commentClosed;
- return token = 3;
- }
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 61;
- }
- pos++;
- return token = 39;
- case 48:
- if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) {
- pos += 2;
- var value = scanMinimumNumberOfHexDigits(1);
- if (value < 0) {
- error(ts.Diagnostics.Hexadecimal_digit_expected);
- value = 0;
- }
- tokenValue = "" + value;
- return token = 8;
- }
- else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) {
- pos += 2;
- var value = scanBinaryOrOctalDigits(2);
- if (value < 0) {
- error(ts.Diagnostics.Binary_digit_expected);
- value = 0;
- }
- tokenValue = "" + value;
- return token = 8;
- }
- else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) {
- pos += 2;
- var value = scanBinaryOrOctalDigits(8);
- if (value < 0) {
- error(ts.Diagnostics.Octal_digit_expected);
- value = 0;
- }
- tokenValue = "" + value;
- return token = 8;
- }
- if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) {
- tokenValue = "" + scanOctalDigits();
- return token = 8;
- }
- case 49:
- case 50:
- case 51:
- case 52:
- case 53:
- case 54:
- case 55:
- case 56:
- case 57:
- tokenValue = scanNumber();
- return token = 8;
- case 58:
- pos++;
- return token = 54;
- case 59:
- pos++;
- return token = 23;
- case 60:
- if (isConflictMarkerTrivia(text, pos)) {
- pos = scanConflictMarkerTrivia(text, pos, error);
- if (skipTrivia) {
- continue;
- }
- else {
- return token = 7;
- }
- }
- if (text.charCodeAt(pos + 1) === 60) {
- if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 63;
- }
- return pos += 2, token = 43;
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 28;
- }
- if (languageVariant === 1 &&
- text.charCodeAt(pos + 1) === 47 &&
- text.charCodeAt(pos + 2) !== 42) {
- return pos += 2, token = 26;
- }
- pos++;
- return token = 25;
- case 61:
- if (isConflictMarkerTrivia(text, pos)) {
- pos = scanConflictMarkerTrivia(text, pos, error);
- if (skipTrivia) {
- continue;
- }
- else {
- return token = 7;
- }
- }
- if (text.charCodeAt(pos + 1) === 61) {
- if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 32;
- }
- return pos += 2, token = 30;
- }
- if (text.charCodeAt(pos + 1) === 62) {
- return pos += 2, token = 34;
- }
- pos++;
- return token = 56;
- case 62:
- if (isConflictMarkerTrivia(text, pos)) {
- pos = scanConflictMarkerTrivia(text, pos, error);
- if (skipTrivia) {
- continue;
- }
- else {
- return token = 7;
- }
- }
- pos++;
- return token = 27;
- case 63:
- pos++;
- return token = 53;
- case 91:
- pos++;
- return token = 19;
- case 93:
- pos++;
- return token = 20;
- case 94:
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 68;
- }
- pos++;
- return token = 48;
- case 123:
- pos++;
- return token = 15;
- case 124:
- if (text.charCodeAt(pos + 1) === 124) {
- return pos += 2, token = 52;
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 67;
- }
- pos++;
- return token = 47;
- case 125:
- pos++;
- return token = 16;
- case 126:
- pos++;
- return token = 50;
- case 64:
- pos++;
- return token = 55;
- case 92:
- var cookedChar = peekUnicodeEscape();
- if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) {
- pos += 6;
- tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts();
- return token = getIdentifierToken();
- }
- error(ts.Diagnostics.Invalid_character);
- pos++;
- return token = 0;
- default:
- if (isIdentifierStart(ch, languageVersion)) {
- pos++;
- while (pos < end && isIdentifierPart(ch = text.charCodeAt(pos), languageVersion))
- pos++;
- tokenValue = text.substring(tokenPos, pos);
- if (ch === 92) {
- tokenValue += scanIdentifierParts();
- }
- return token = getIdentifierToken();
- }
- else if (isWhiteSpaceSingleLine(ch)) {
- pos++;
- continue;
- }
- else if (isLineBreak(ch)) {
- precedingLineBreak = true;
- pos++;
- continue;
- }
- error(ts.Diagnostics.Invalid_character);
- pos++;
- return token = 0;
- }
- }
- }
- function reScanGreaterToken() {
- if (token === 27) {
- if (text.charCodeAt(pos) === 62) {
- if (text.charCodeAt(pos + 1) === 62) {
- if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 65;
- }
- return pos += 2, token = 45;
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 64;
- }
- pos++;
- return token = 44;
- }
- if (text.charCodeAt(pos) === 61) {
- pos++;
- return token = 29;
- }
- }
- return token;
- }
- function reScanSlashToken() {
- if (token === 39 || token === 61) {
- var p = tokenPos + 1;
- var inEscape = false;
- var inCharacterClass = false;
- while (true) {
- if (p >= end) {
- tokenIsUnterminated = true;
- error(ts.Diagnostics.Unterminated_regular_expression_literal);
- break;
- }
- var ch = text.charCodeAt(p);
- if (isLineBreak(ch)) {
- tokenIsUnterminated = true;
- error(ts.Diagnostics.Unterminated_regular_expression_literal);
- break;
- }
- if (inEscape) {
- inEscape = false;
- }
- else if (ch === 47 && !inCharacterClass) {
- p++;
- break;
- }
- else if (ch === 91) {
- inCharacterClass = true;
- }
- else if (ch === 92) {
- inEscape = true;
- }
- else if (ch === 93) {
- inCharacterClass = false;
- }
- p++;
- }
- while (p < end && isIdentifierPart(text.charCodeAt(p), languageVersion)) {
- p++;
- }
- pos = p;
- tokenValue = text.substring(tokenPos, pos);
- token = 10;
- }
- return token;
- }
- function reScanTemplateToken() {
- ts.Debug.assert(token === 16, "'reScanTemplateToken' should only be called on a '}'");
- pos = tokenPos;
- return token = scanTemplateAndSetTokenValue();
- }
- function reScanJsxToken() {
- pos = tokenPos = startPos;
- return token = scanJsxToken();
- }
- function scanJsxToken() {
- startPos = tokenPos = pos;
- if (pos >= end) {
- return token = 1;
- }
- var char = text.charCodeAt(pos);
- if (char === 60) {
- if (text.charCodeAt(pos + 1) === 47) {
- pos += 2;
- return token = 26;
- }
- pos++;
- return token = 25;
- }
- if (char === 123) {
- pos++;
- return token = 15;
- }
- while (pos < end) {
- pos++;
- char = text.charCodeAt(pos);
- if ((char === 123) || (char === 60)) {
- break;
- }
- }
- return token = 244;
- }
- function scanJsxIdentifier() {
- if (tokenIsIdentifierOrKeyword(token)) {
- var firstCharPosition = pos;
- while (pos < end) {
- var ch = text.charCodeAt(pos);
- if (ch === 45 || ((firstCharPosition === pos) ? isIdentifierStart(ch, languageVersion) : isIdentifierPart(ch, languageVersion))) {
- pos++;
- }
- else {
- break;
- }
- }
- tokenValue += text.substr(firstCharPosition, pos - firstCharPosition);
- }
- return token;
- }
- function scanJsxAttributeValue() {
- startPos = pos;
- switch (text.charCodeAt(pos)) {
- case 34:
- case 39:
- tokenValue = scanString(false);
- return token = 9;
- default:
- return scan();
- }
- }
- function scanJSDocToken() {
- if (pos >= end) {
- return token = 1;
- }
- startPos = pos;
- tokenPos = pos;
- var ch = text.charCodeAt(pos);
- switch (ch) {
- case 9:
- case 11:
- case 12:
- case 32:
- while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) {
- pos++;
- }
- return token = 5;
- case 64:
- pos++;
- return token = 55;
- case 10:
- case 13:
- pos++;
- return token = 4;
- case 42:
- pos++;
- return token = 37;
- case 123:
- pos++;
- return token = 15;
- case 125:
- pos++;
- return token = 16;
- case 91:
- pos++;
- return token = 19;
- case 93:
- pos++;
- return token = 20;
- case 61:
- pos++;
- return token = 56;
- case 44:
- pos++;
- return token = 24;
- }
- if (isIdentifierStart(ch, 2)) {
- pos++;
- while (isIdentifierPart(text.charCodeAt(pos), 2) && pos < end) {
- pos++;
- }
- return token = 69;
- }
- else {
- return pos += 1, token = 0;
- }
- }
- function speculationHelper(callback, isLookahead) {
- var savePos = pos;
- var saveStartPos = startPos;
- var saveTokenPos = tokenPos;
- var saveToken = token;
- var saveTokenValue = tokenValue;
- var savePrecedingLineBreak = precedingLineBreak;
- var result = callback();
- if (!result || isLookahead) {
- pos = savePos;
- startPos = saveStartPos;
- tokenPos = saveTokenPos;
- token = saveToken;
- tokenValue = saveTokenValue;
- precedingLineBreak = savePrecedingLineBreak;
- }
- return result;
- }
- function scanRange(start, length, callback) {
- var saveEnd = end;
- var savePos = pos;
- var saveStartPos = startPos;
- var saveTokenPos = tokenPos;
- var saveToken = token;
- var savePrecedingLineBreak = precedingLineBreak;
- var saveTokenValue = tokenValue;
- var saveHasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
- var saveTokenIsUnterminated = tokenIsUnterminated;
- setText(text, start, length);
- var result = callback();
- end = saveEnd;
- pos = savePos;
- startPos = saveStartPos;
- tokenPos = saveTokenPos;
- token = saveToken;
- precedingLineBreak = savePrecedingLineBreak;
- tokenValue = saveTokenValue;
- hasExtendedUnicodeEscape = saveHasExtendedUnicodeEscape;
- tokenIsUnterminated = saveTokenIsUnterminated;
- return result;
- }
- function lookAhead(callback) {
- return speculationHelper(callback, true);
- }
- function tryScan(callback) {
- return speculationHelper(callback, false);
- }
- function getText() {
- return text;
- }
- function setText(newText, start, length) {
- text = newText || "";
- end = length === undefined ? text.length : start + length;
- setTextPos(start || 0);
- }
- function setOnError(errorCallback) {
- onError = errorCallback;
- }
- function setScriptTarget(scriptTarget) {
- languageVersion = scriptTarget;
- }
- function setLanguageVariant(variant) {
- languageVariant = variant;
- }
- function setTextPos(textPos) {
- ts.Debug.assert(textPos >= 0);
- pos = textPos;
- startPos = textPos;
- tokenPos = textPos;
- token = 0;
- precedingLineBreak = false;
- tokenValue = undefined;
- hasExtendedUnicodeEscape = false;
- tokenIsUnterminated = false;
- }
- }
- ts.createScanner = createScanner;
-})(ts || (ts = {}));
-var ts;
-(function (ts) {
- ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" };
- ts.optionDeclarations = [
- {
- name: "charset",
- type: "string"
- },
- ts.compileOnSaveCommandLineOption,
- {
- name: "declaration",
- shortName: "d",
- type: "boolean",
- description: ts.Diagnostics.Generates_corresponding_d_ts_file
- },
- {
- name: "declarationDir",
- type: "string",
- isFilePath: true,
- paramType: ts.Diagnostics.DIRECTORY
- },
- {
- name: "diagnostics",
- type: "boolean"
- },
- {
- name: "extendedDiagnostics",
- type: "boolean",
- experimental: true
- },
- {
- name: "emitBOM",
- type: "boolean"
- },
- {
- name: "help",
- shortName: "h",
- type: "boolean",
- description: ts.Diagnostics.Print_this_message
- },
- {
- name: "help",
- shortName: "?",
- type: "boolean"
- },
- {
- name: "init",
- type: "boolean",
- description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file
- },
- {
- name: "inlineSourceMap",
- type: "boolean"
- },
- {
- name: "inlineSources",
- type: "boolean"
- },
- {
- name: "jsx",
- type: ts.createMap({
- "preserve": 1,
- "react": 2
- }),
- paramType: ts.Diagnostics.KIND,
- description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react
- },
- {
- name: "reactNamespace",
- type: "string",
- description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit
- },
- {
- name: "listFiles",
- type: "boolean"
- },
- {
- name: "locale",
- type: "string"
- },
- {
- name: "mapRoot",
- type: "string",
- isFilePath: true,
- description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,
- paramType: ts.Diagnostics.LOCATION
- },
- {
- name: "module",
- shortName: "m",
- type: ts.createMap({
- "none": ts.ModuleKind.None,
- "commonjs": ts.ModuleKind.CommonJS,
- "amd": ts.ModuleKind.AMD,
- "system": ts.ModuleKind.System,
- "umd": ts.ModuleKind.UMD,
- "es6": ts.ModuleKind.ES6,
- "es2015": ts.ModuleKind.ES2015
- }),
- description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015,
- paramType: ts.Diagnostics.KIND
- },
- {
- name: "newLine",
- type: ts.createMap({
- "crlf": 0,
- "lf": 1
- }),
- description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix,
- paramType: ts.Diagnostics.NEWLINE
- },
- {
- name: "noEmit",
- type: "boolean",
- description: ts.Diagnostics.Do_not_emit_outputs
- },
- {
- name: "noEmitHelpers",
- type: "boolean"
- },
- {
- name: "noEmitOnError",
- type: "boolean",
- description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported
- },
- {
- name: "noErrorTruncation",
- type: "boolean"
- },
- {
- name: "noImplicitAny",
- type: "boolean",
- description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type
- },
- {
- name: "noImplicitThis",
- type: "boolean",
- description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type
- },
- {
- name: "noUnusedLocals",
- type: "boolean",
- description: ts.Diagnostics.Report_errors_on_unused_locals
- },
- {
- name: "noUnusedParameters",
- type: "boolean",
- description: ts.Diagnostics.Report_errors_on_unused_parameters
- },
- {
- name: "noLib",
- type: "boolean"
- },
- {
- name: "noResolve",
- type: "boolean"
- },
- {
- name: "skipDefaultLibCheck",
- type: "boolean"
- },
- {
- name: "skipLibCheck",
- type: "boolean",
- description: ts.Diagnostics.Skip_type_checking_of_declaration_files
- },
- {
- name: "out",
- type: "string",
- isFilePath: false,
- paramType: ts.Diagnostics.FILE
- },
- {
- name: "outFile",
- type: "string",
- isFilePath: true,
- description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file,
- paramType: ts.Diagnostics.FILE
- },
- {
- name: "outDir",
- type: "string",
- isFilePath: true,
- description: ts.Diagnostics.Redirect_output_structure_to_the_directory,
- paramType: ts.Diagnostics.DIRECTORY
- },
- {
- name: "preserveConstEnums",
- type: "boolean",
- description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code
- },
- {
- name: "pretty",
- description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental,
- type: "boolean"
- },
- {
- name: "project",
- shortName: "p",
- type: "string",
- isFilePath: true,
- description: ts.Diagnostics.Compile_the_project_in_the_given_directory,
- paramType: ts.Diagnostics.DIRECTORY
- },
- {
- name: "removeComments",
- type: "boolean",
- description: ts.Diagnostics.Do_not_emit_comments_to_output
- },
- {
- name: "rootDir",
- type: "string",
- isFilePath: true,
- paramType: ts.Diagnostics.LOCATION,
- description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir
- },
- {
- name: "isolatedModules",
- type: "boolean"
- },
- {
- name: "sourceMap",
- type: "boolean",
- description: ts.Diagnostics.Generates_corresponding_map_file
- },
- {
- name: "sourceRoot",
- type: "string",
- isFilePath: true,
- description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations,
- paramType: ts.Diagnostics.LOCATION
- },
- {
- name: "suppressExcessPropertyErrors",
- type: "boolean",
- description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals,
- experimental: true
- },
- {
- name: "suppressImplicitAnyIndexErrors",
- type: "boolean",
- description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures
- },
- {
- name: "stripInternal",
- type: "boolean",
- description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation,
- experimental: true
- },
- {
- name: "target",
- shortName: "t",
- type: ts.createMap({
- "es3": 0,
- "es5": 1,
- "es6": 2,
- "es2015": 2
- }),
- description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015,
- paramType: ts.Diagnostics.VERSION
- },
- {
- name: "version",
- shortName: "v",
- type: "boolean",
- description: ts.Diagnostics.Print_the_compiler_s_version
- },
- {
- name: "watch",
- shortName: "w",
- type: "boolean",
- description: ts.Diagnostics.Watch_input_files
- },
- {
- name: "experimentalDecorators",
- type: "boolean",
- description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators
- },
- {
- name: "emitDecoratorMetadata",
- type: "boolean",
- experimental: true,
- description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators
- },
- {
- name: "moduleResolution",
- type: ts.createMap({
- "node": ts.ModuleResolutionKind.NodeJs,
- "classic": ts.ModuleResolutionKind.Classic
- }),
- description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6,
- paramType: ts.Diagnostics.STRATEGY
- },
- {
- name: "allowUnusedLabels",
- type: "boolean",
- description: ts.Diagnostics.Do_not_report_errors_on_unused_labels
- },
- {
- name: "noImplicitReturns",
- type: "boolean",
- description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value
- },
- {
- name: "noFallthroughCasesInSwitch",
- type: "boolean",
- description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement
- },
- {
- name: "allowUnreachableCode",
- type: "boolean",
- description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code
- },
- {
- name: "forceConsistentCasingInFileNames",
- type: "boolean",
- description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file
- },
- {
- name: "baseUrl",
- type: "string",
- isFilePath: true,
- description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names
- },
- {
- name: "paths",
- type: "object",
- isTSConfigOnly: true
- },
- {
- name: "rootDirs",
- type: "list",
- isTSConfigOnly: true,
- element: {
- name: "rootDirs",
- type: "string",
- isFilePath: true
- }
- },
- {
- name: "typeRoots",
- type: "list",
- element: {
- name: "typeRoots",
- type: "string",
- isFilePath: true
- }
- },
- {
- name: "types",
- type: "list",
- element: {
- name: "types",
- type: "string"
- },
- description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation
- },
- {
- name: "traceResolution",
- type: "boolean",
- description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process
- },
- {
- name: "allowJs",
- type: "boolean",
- description: ts.Diagnostics.Allow_javascript_files_to_be_compiled
- },
- {
- name: "allowSyntheticDefaultImports",
- type: "boolean",
- description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking
- },
- {
- name: "noImplicitUseStrict",
- type: "boolean",
- description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output
- },
- {
- name: "maxNodeModuleJsDepth",
- type: "number",
- description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files
- },
- {
- name: "listEmittedFiles",
- type: "boolean"
- },
- {
- name: "lib",
- type: "list",
- element: {
- name: "lib",
- type: ts.createMap({
- "es5": "lib.es5.d.ts",
- "es6": "lib.es2015.d.ts",
- "es2015": "lib.es2015.d.ts",
- "es7": "lib.es2016.d.ts",
- "es2016": "lib.es2016.d.ts",
- "es2017": "lib.es2017.d.ts",
- "dom": "lib.dom.d.ts",
- "dom.iterable": "lib.dom.iterable.d.ts",
- "webworker": "lib.webworker.d.ts",
- "scripthost": "lib.scripthost.d.ts",
- "es2015.core": "lib.es2015.core.d.ts",
- "es2015.collection": "lib.es2015.collection.d.ts",
- "es2015.generator": "lib.es2015.generator.d.ts",
- "es2015.iterable": "lib.es2015.iterable.d.ts",
- "es2015.promise": "lib.es2015.promise.d.ts",
- "es2015.proxy": "lib.es2015.proxy.d.ts",
- "es2015.reflect": "lib.es2015.reflect.d.ts",
- "es2015.symbol": "lib.es2015.symbol.d.ts",
- "es2015.symbol.wellknown": "lib.es2015.symbol.wellknown.d.ts",
- "es2016.array.include": "lib.es2016.array.include.d.ts",
- "es2017.object": "lib.es2017.object.d.ts",
- "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts"
- })
- },
- description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon
- },
- {
- name: "disableSizeLimit",
- type: "boolean"
- },
- {
- name: "strictNullChecks",
- type: "boolean",
- description: ts.Diagnostics.Enable_strict_null_checks
- },
- {
- name: "importHelpers",
- type: "boolean",
- description: ts.Diagnostics.Import_emit_helpers_from_tslib
- },
- {
- name: "alwaysStrict",
- type: "boolean",
- description: ts.Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file
- }
- ];
- ts.typingOptionDeclarations = [
- {
- name: "enableAutoDiscovery",
- type: "boolean"
- },
- {
- name: "include",
- type: "list",
- element: {
- name: "include",
- type: "string"
- }
- },
- {
- name: "exclude",
- type: "list",
- element: {
- name: "exclude",
- type: "string"
- }
- }
- ];
- ts.defaultInitCompilerOptions = {
- module: ts.ModuleKind.CommonJS,
- target: 1,
- noImplicitAny: false,
- sourceMap: false
- };
- var optionNameMapCache;
- function getOptionNameMap() {
- if (optionNameMapCache) {
- return optionNameMapCache;
- }
- var optionNameMap = ts.createMap();
- var shortOptionNames = ts.createMap();
- ts.forEach(ts.optionDeclarations, function (option) {
- optionNameMap[option.name.toLowerCase()] = option;
- if (option.shortName) {
- shortOptionNames[option.shortName] = option.name;
- }
- });
- optionNameMapCache = { optionNameMap: optionNameMap, shortOptionNames: shortOptionNames };
- return optionNameMapCache;
- }
- ts.getOptionNameMap = getOptionNameMap;
- function createCompilerDiagnosticForInvalidCustomType(opt) {
- var namesOfType = [];
- for (var key in opt.type) {
- namesOfType.push(" '" + key + "'");
- }
- return ts.createCompilerDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
- }
- ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
- function parseCustomTypeOption(opt, value, errors) {
- var key = trimString((value || "")).toLowerCase();
- var map = opt.type;
- if (key in map) {
- return map[key];
- }
- else {
- errors.push(createCompilerDiagnosticForInvalidCustomType(opt));
- }
- }
- ts.parseCustomTypeOption = parseCustomTypeOption;
- function parseListTypeOption(opt, value, errors) {
- if (value === void 0) { value = ""; }
- value = trimString(value);
- if (ts.startsWith(value, "-")) {
- return undefined;
- }
- if (value === "") {
- return [];
- }
- var values = value.split(",");
- switch (opt.element.type) {
- case "number":
- return ts.map(values, parseInt);
- case "string":
- return ts.map(values, function (v) { return v || ""; });
- default:
- return ts.filter(ts.map(values, function (v) { return parseCustomTypeOption(opt.element, v, errors); }), function (v) { return !!v; });
- }
- }
- ts.parseListTypeOption = parseListTypeOption;
- function parseCommandLine(commandLine, readFile) {
- var options = {};
- var fileNames = [];
- var errors = [];
- var _a = getOptionNameMap(), optionNameMap = _a.optionNameMap, shortOptionNames = _a.shortOptionNames;
- parseStrings(commandLine);
- return {
- options: options,
- fileNames: fileNames,
- errors: errors
- };
- function parseStrings(args) {
- var i = 0;
- while (i < args.length) {
- var s = args[i];
- i++;
- if (s.charCodeAt(0) === 64) {
- parseResponseFile(s.slice(1));
- }
- else if (s.charCodeAt(0) === 45) {
- s = s.slice(s.charCodeAt(1) === 45 ? 2 : 1).toLowerCase();
- if (s in shortOptionNames) {
- s = shortOptionNames[s];
- }
- if (s in optionNameMap) {
- var opt = optionNameMap[s];
- if (opt.isTSConfigOnly) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name));
- }
- else {
- if (!args[i] && opt.type !== "boolean") {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_expects_an_argument, opt.name));
- }
- switch (opt.type) {
- case "number":
- options[opt.name] = parseInt(args[i]);
- i++;
- break;
- case "boolean":
- options[opt.name] = true;
- break;
- case "string":
- options[opt.name] = args[i] || "";
- i++;
- break;
- case "list":
- var result = parseListTypeOption(opt, args[i], errors);
- options[opt.name] = result || [];
- if (result) {
- i++;
- }
- break;
- default:
- options[opt.name] = parseCustomTypeOption(opt, args[i], errors);
- i++;
- break;
- }
- }
- }
- else {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_compiler_option_0, s));
- }
- }
- else {
- fileNames.push(s);
- }
- }
- }
- function parseResponseFile(fileName) {
- var text = readFile ? readFile(fileName) : ts.sys.readFile(fileName);
- if (!text) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, fileName));
- return;
- }
- var args = [];
- var pos = 0;
- while (true) {
- while (pos < text.length && text.charCodeAt(pos) <= 32)
- pos++;
- if (pos >= text.length)
- break;
- var start = pos;
- if (text.charCodeAt(start) === 34) {
- pos++;
- while (pos < text.length && text.charCodeAt(pos) !== 34)
- pos++;
- if (pos < text.length) {
- args.push(text.substring(start + 1, pos));
- pos++;
- }
- else {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unterminated_quoted_string_in_response_file_0, fileName));
- }
- }
- else {
- while (text.charCodeAt(pos) > 32)
- pos++;
- args.push(text.substring(start, pos));
- }
- }
- parseStrings(args);
- }
- }
- ts.parseCommandLine = parseCommandLine;
- function readConfigFile(fileName, readFile) {
- var text = "";
- try {
- text = readFile(fileName);
- }
- catch (e) {
- return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) };
- }
- return parseConfigFileTextToJson(fileName, text);
- }
- ts.readConfigFile = readConfigFile;
- function parseConfigFileTextToJson(fileName, jsonText, stripComments) {
- if (stripComments === void 0) { stripComments = true; }
- try {
- var jsonTextToParse = stripComments ? removeComments(jsonText) : jsonText;
- return { config: /\S/.test(jsonTextToParse) ? JSON.parse(jsonTextToParse) : {} };
- }
- catch (e) {
- return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Failed_to_parse_file_0_Colon_1, fileName, e.message) };
- }
- }
- ts.parseConfigFileTextToJson = parseConfigFileTextToJson;
- function generateTSConfig(options, fileNames) {
- var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions);
- var configurations = {
- compilerOptions: serializeCompilerOptions(compilerOptions)
- };
- if (fileNames && fileNames.length) {
- configurations.files = fileNames;
- }
- return configurations;
- function getCustomTypeMapOfCommandLineOption(optionDefinition) {
- if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") {
- return undefined;
- }
- else if (optionDefinition.type === "list") {
- return getCustomTypeMapOfCommandLineOption(optionDefinition.element);
- }
- else {
- return optionDefinition.type;
- }
- }
- function getNameOfCompilerOptionValue(value, customTypeMap) {
- for (var key in customTypeMap) {
- if (customTypeMap[key] === value) {
- return key;
- }
- }
- return undefined;
- }
- function serializeCompilerOptions(options) {
- var result = ts.createMap();
- var optionsNameMap = getOptionNameMap().optionNameMap;
- for (var name_5 in options) {
- if (ts.hasProperty(options, name_5)) {
- switch (name_5) {
- case "init":
- case "watch":
- case "version":
- case "help":
- case "project":
- break;
- default:
- var value = options[name_5];
- var optionDefinition = optionsNameMap[name_5.toLowerCase()];
- if (optionDefinition) {
- var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition);
- if (!customTypeMap) {
- result[name_5] = value;
- }
- else {
- if (optionDefinition.type === "list") {
- var convertedValue = [];
- for (var _i = 0, _a = value; _i < _a.length; _i++) {
- var element = _a[_i];
- convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap));
- }
- result[name_5] = convertedValue;
- }
- else {
- result[name_5] = getNameOfCompilerOptionValue(value, customTypeMap);
- }
- }
- }
- break;
- }
- }
- }
- return result;
- }
- }
- ts.generateTSConfig = generateTSConfig;
- function removeComments(jsonText) {
- var output = "";
- var scanner = ts.createScanner(1, false, 0, jsonText);
- var token;
- while ((token = scanner.scan()) !== 1) {
- switch (token) {
- case 2:
- case 3:
- output += scanner.getTokenText().replace(/\S/g, " ");
- break;
- default:
- output += scanner.getTokenText();
- break;
- }
- }
- return output;
- }
- function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack) {
- if (existingOptions === void 0) { existingOptions = {}; }
- if (resolutionStack === void 0) { resolutionStack = []; }
- var errors = [];
- var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames);
- var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName);
- if (resolutionStack.indexOf(resolvedPath) >= 0) {
- return {
- options: {},
- fileNames: [],
- typingOptions: {},
- raw: json,
- errors: [ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> "))],
- wildcardDirectories: {}
- };
- }
- var options = convertCompilerOptionsFromJsonWorker(json["compilerOptions"], basePath, errors, configFileName);
- var typingOptions = convertTypingOptionsFromJsonWorker(json["typingOptions"], basePath, errors, configFileName);
- if (json["extends"]) {
- var _a = [undefined, undefined, undefined, {}], include = _a[0], exclude = _a[1], files = _a[2], baseOptions = _a[3];
- if (typeof json["extends"] === "string") {
- _b = (tryExtendsName(json["extends"]) || [include, exclude, files, baseOptions]), include = _b[0], exclude = _b[1], files = _b[2], baseOptions = _b[3];
- }
- else {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", "string"));
- }
- if (include && !json["include"]) {
- json["include"] = include;
- }
- if (exclude && !json["exclude"]) {
- json["exclude"] = exclude;
- }
- if (files && !json["files"]) {
- json["files"] = files;
- }
- options = ts.assign({}, baseOptions, options);
- }
- options = ts.extend(existingOptions, options);
- options.configFilePath = configFileName;
- var _c = getFileNames(errors), fileNames = _c.fileNames, wildcardDirectories = _c.wildcardDirectories;
- var compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors);
- return {
- options: options,
- fileNames: fileNames,
- typingOptions: typingOptions,
- raw: json,
- errors: errors,
- wildcardDirectories: wildcardDirectories,
- compileOnSave: compileOnSave
- };
- function tryExtendsName(extendedConfig) {
- if (!(ts.isRootedDiskPath(extendedConfig) || ts.startsWith(ts.normalizeSlashes(extendedConfig), "./") || ts.startsWith(ts.normalizeSlashes(extendedConfig), "../"))) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.The_path_in_an_extends_options_must_be_relative_or_rooted));
- return;
- }
- var extendedConfigPath = ts.toPath(extendedConfig, basePath, getCanonicalFileName);
- if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json")) {
- extendedConfigPath = extendedConfigPath + ".json";
- if (!host.fileExists(extendedConfigPath)) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_does_not_exist, extendedConfig));
- return;
- }
- }
- var extendedResult = readConfigFile(extendedConfigPath, function (path) { return host.readFile(path); });
- if (extendedResult.error) {
- errors.push(extendedResult.error);
- return;
- }
- var extendedDirname = ts.getDirectoryPath(extendedConfigPath);
- var relativeDifference = ts.convertToRelativePath(extendedDirname, basePath, getCanonicalFileName);
- var updatePath = function (path) { return ts.isRootedDiskPath(path) ? path : ts.combinePaths(relativeDifference, path); };
- var result = parseJsonConfigFileContent(extendedResult.config, host, extendedDirname, undefined, ts.getBaseFileName(extendedConfigPath), resolutionStack.concat([resolvedPath]));
- errors.push.apply(errors, result.errors);
- var _a = ts.map(["include", "exclude", "files"], function (key) {
- if (!json[key] && extendedResult.config[key]) {
- return ts.map(extendedResult.config[key], updatePath);
- }
- }), include = _a[0], exclude = _a[1], files = _a[2];
- return [include, exclude, files, result.options];
- }
- function getFileNames(errors) {
- var fileNames;
- if (ts.hasProperty(json, "files")) {
- if (ts.isArray(json["files"])) {
- fileNames = json["files"];
- }
- else {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "files", "Array"));
- }
- }
- var includeSpecs;
- if (ts.hasProperty(json, "include")) {
- if (ts.isArray(json["include"])) {
- includeSpecs = json["include"];
- }
- else {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "include", "Array"));
- }
- }
- var excludeSpecs;
- if (ts.hasProperty(json, "exclude")) {
- if (ts.isArray(json["exclude"])) {
- excludeSpecs = json["exclude"];
- }
- else {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "exclude", "Array"));
- }
- }
- else if (ts.hasProperty(json, "excludes")) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));
- }
- else {
- excludeSpecs = ["node_modules", "bower_components", "jspm_packages"];
- var outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"];
- if (outDir) {
- excludeSpecs.push(outDir);
- }
- }
- if (fileNames === undefined && includeSpecs === undefined) {
- includeSpecs = ["**/*"];
- }
- return matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors);
- }
- var _b;
- }
- ts.parseJsonConfigFileContent = parseJsonConfigFileContent;
- function convertCompileOnSaveOptionFromJson(jsonOption, basePath, errors) {
- if (!ts.hasProperty(jsonOption, ts.compileOnSaveCommandLineOption.name)) {
- return false;
- }
- var result = convertJsonOption(ts.compileOnSaveCommandLineOption, jsonOption["compileOnSave"], basePath, errors);
- if (typeof result === "boolean" && result) {
- return result;
- }
- return false;
- }
- ts.convertCompileOnSaveOptionFromJson = convertCompileOnSaveOptionFromJson;
- function convertCompilerOptionsFromJson(jsonOptions, basePath, configFileName) {
- var errors = [];
- var options = convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName);
- return { options: options, errors: errors };
- }
- ts.convertCompilerOptionsFromJson = convertCompilerOptionsFromJson;
- function convertTypingOptionsFromJson(jsonOptions, basePath, configFileName) {
- var errors = [];
- var options = convertTypingOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName);
- return { options: options, errors: errors };
- }
- ts.convertTypingOptionsFromJson = convertTypingOptionsFromJson;
- function convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) {
- var options = ts.getBaseFileName(configFileName) === "jsconfig.json"
- ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true }
- : {};
- convertOptionsFromJson(ts.optionDeclarations, jsonOptions, basePath, options, ts.Diagnostics.Unknown_compiler_option_0, errors);
- return options;
- }
- function convertTypingOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) {
- var options = ts.getBaseFileName(configFileName) === "jsconfig.json"
- ? { enableAutoDiscovery: true, include: [], exclude: [] }
- : { enableAutoDiscovery: false, include: [], exclude: [] };
- convertOptionsFromJson(ts.typingOptionDeclarations, jsonOptions, basePath, options, ts.Diagnostics.Unknown_typing_option_0, errors);
- return options;
- }
- function convertOptionsFromJson(optionDeclarations, jsonOptions, basePath, defaultOptions, diagnosticMessage, errors) {
- if (!jsonOptions) {
- return;
- }
- var optionNameMap = ts.arrayToMap(optionDeclarations, function (opt) { return opt.name; });
- for (var id in jsonOptions) {
- if (id in optionNameMap) {
- var opt = optionNameMap[id];
- defaultOptions[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors);
- }
- else {
- errors.push(ts.createCompilerDiagnostic(diagnosticMessage, id));
- }
- }
- }
- function convertJsonOption(opt, value, basePath, errors) {
- var optType = opt.type;
- var expectedType = typeof optType === "string" ? optType : "string";
- if (optType === "list" && ts.isArray(value)) {
- return convertJsonOptionOfListType(opt, value, basePath, errors);
- }
- else if (typeof value === expectedType) {
- if (typeof optType !== "string") {
- return convertJsonOptionOfCustomType(opt, value, errors);
- }
- else {
- if (opt.isFilePath) {
- value = ts.normalizePath(ts.combinePaths(basePath, value));
- if (value === "") {
- value = ".";
- }
- }
- }
- return value;
- }
- else {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, opt.name, expectedType));
- }
- }
- function convertJsonOptionOfCustomType(opt, value, errors) {
- var key = value.toLowerCase();
- if (key in opt.type) {
- return opt.type[key];
- }
- else {
- errors.push(createCompilerDiagnosticForInvalidCustomType(opt));
- }
- }
- function convertJsonOptionOfListType(option, values, basePath, errors) {
- return ts.filter(ts.map(values, function (v) { return convertJsonOption(option.element, v, basePath, errors); }), function (v) { return !!v; });
- }
- function trimString(s) {
- return typeof s.trim === "function" ? s.trim() : s.replace(/^[\s]+|[\s]+$/g, "");
- }
- var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/;
- var invalidMultipleRecursionPatterns = /(^|\/)\*\*\/(.*\/)?\*\*($|\/)/;
- var invalidDotDotAfterRecursiveWildcardPattern = /(^|\/)\*\*\/(.*\/)?\.\.($|\/)/;
- var watchRecursivePattern = /\/[^/]*?[*?][^/]*\//;
- var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/;
- function matchFileNames(fileNames, include, exclude, basePath, options, host, errors) {
- basePath = ts.normalizePath(basePath);
- var keyMapper = host.useCaseSensitiveFileNames ? caseSensitiveKeyMapper : caseInsensitiveKeyMapper;
- var literalFileMap = ts.createMap();
- var wildcardFileMap = ts.createMap();
- if (include) {
- include = validateSpecs(include, errors, false);
- }
- if (exclude) {
- exclude = validateSpecs(exclude, errors, true);
- }
- var wildcardDirectories = getWildcardDirectories(include, exclude, basePath, host.useCaseSensitiveFileNames);
- var supportedExtensions = ts.getSupportedExtensions(options);
- if (fileNames) {
- for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) {
- var fileName = fileNames_1[_i];
- var file = ts.combinePaths(basePath, fileName);
- literalFileMap[keyMapper(file)] = file;
- }
- }
- if (include && include.length > 0) {
- for (var _a = 0, _b = host.readDirectory(basePath, supportedExtensions, exclude, include); _a < _b.length; _a++) {
- var file = _b[_a];
- if (hasFileWithHigherPriorityExtension(file, literalFileMap, wildcardFileMap, supportedExtensions, keyMapper)) {
- continue;
- }
- removeWildcardFilesWithLowerPriorityExtension(file, wildcardFileMap, supportedExtensions, keyMapper);
- var key = keyMapper(file);
- if (!(key in literalFileMap) && !(key in wildcardFileMap)) {
- wildcardFileMap[key] = file;
- }
- }
- }
- var literalFiles = ts.reduceProperties(literalFileMap, addFileToOutput, []);
- var wildcardFiles = ts.reduceProperties(wildcardFileMap, addFileToOutput, []);
- wildcardFiles.sort(host.useCaseSensitiveFileNames ? ts.compareStrings : ts.compareStringsCaseInsensitive);
- return {
- fileNames: literalFiles.concat(wildcardFiles),
- wildcardDirectories: wildcardDirectories
- };
- }
- function validateSpecs(specs, errors, allowTrailingRecursion) {
- var validSpecs = [];
- for (var _i = 0, specs_2 = specs; _i < specs_2.length; _i++) {
- var spec = specs_2[_i];
- if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec));
- }
- else if (invalidMultipleRecursionPatterns.test(spec)) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0, spec));
- }
- else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec));
- }
- else {
- validSpecs.push(spec);
- }
- }
- return validSpecs;
- }
- function getWildcardDirectories(include, exclude, path, useCaseSensitiveFileNames) {
- var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude");
- var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i");
- var wildcardDirectories = ts.createMap();
- if (include !== undefined) {
- var recursiveKeys = [];
- for (var _i = 0, include_1 = include; _i < include_1.length; _i++) {
- var file = include_1[_i];
- var name_6 = ts.normalizePath(ts.combinePaths(path, file));
- if (excludeRegex && excludeRegex.test(name_6)) {
- continue;
- }
- var match = wildcardDirectoryPattern.exec(name_6);
- if (match) {
- var key = useCaseSensitiveFileNames ? match[0] : match[0].toLowerCase();
- var flags = watchRecursivePattern.test(name_6) ? 1 : 0;
- var existingFlags = wildcardDirectories[key];
- if (existingFlags === undefined || existingFlags < flags) {
- wildcardDirectories[key] = flags;
- if (flags === 1) {
- recursiveKeys.push(key);
- }
- }
- }
- }
- for (var key in wildcardDirectories) {
- for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) {
- var recursiveKey = recursiveKeys_1[_a];
- if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) {
- delete wildcardDirectories[key];
- }
- }
- }
- }
- return wildcardDirectories;
- }
- function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) {
- var extensionPriority = ts.getExtensionPriority(file, extensions);
- var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority);
- for (var i = 0; i < adjustedExtensionPriority; i++) {
- var higherPriorityExtension = extensions[i];
- var higherPriorityPath = keyMapper(ts.changeExtension(file, higherPriorityExtension));
- if (higherPriorityPath in literalFiles || higherPriorityPath in wildcardFiles) {
- return true;
- }
- }
- return false;
- }
- function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) {
- var extensionPriority = ts.getExtensionPriority(file, extensions);
- var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority);
- for (var i = nextExtensionPriority; i < extensions.length; i++) {
- var lowerPriorityExtension = extensions[i];
- var lowerPriorityPath = keyMapper(ts.changeExtension(file, lowerPriorityExtension));
- delete wildcardFiles[lowerPriorityPath];
- }
- }
- function addFileToOutput(output, file) {
- output.push(file);
- return output;
- }
- function caseSensitiveKeyMapper(key) {
- return key;
- }
- function caseInsensitiveKeyMapper(key) {
- return key.toLowerCase();
- }
-})(ts || (ts = {}));
-var ts;
-(function (ts) {
- var JsTyping;
- (function (JsTyping) {
- ;
- ;
- var safeList;
- var EmptySafeList = ts.createMap();
- function discoverTypings(host, fileNames, projectRootPath, safeListPath, packageNameToTypingLocation, typingOptions, compilerOptions) {
- var inferredTypings = ts.createMap();
- if (!typingOptions || !typingOptions.enableAutoDiscovery) {
- return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] };
- }
- fileNames = ts.filter(ts.map(fileNames, ts.normalizePath), function (f) {
- var kind = ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f));
- return kind === 1 || kind === 2;
- });
- if (!safeList) {
- var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); });
- safeList = result.config ? ts.createMap(result.config) : EmptySafeList;
- }
- var filesToWatch = [];
- var searchDirs = [];
- var exclude = [];
- mergeTypings(typingOptions.include);
- exclude = typingOptions.exclude || [];
- var possibleSearchDirs = ts.map(fileNames, ts.getDirectoryPath);
- if (projectRootPath !== undefined) {
- possibleSearchDirs.push(projectRootPath);
- }
- searchDirs = ts.deduplicate(possibleSearchDirs);
- for (var _i = 0, searchDirs_1 = searchDirs; _i < searchDirs_1.length; _i++) {
- var searchDir = searchDirs_1[_i];
- var packageJsonPath = ts.combinePaths(searchDir, "package.json");
- getTypingNamesFromJson(packageJsonPath, filesToWatch);
- var bowerJsonPath = ts.combinePaths(searchDir, "bower.json");
- getTypingNamesFromJson(bowerJsonPath, filesToWatch);
- var nodeModulesPath = ts.combinePaths(searchDir, "node_modules");
- getTypingNamesFromNodeModuleFolder(nodeModulesPath);
- }
- getTypingNamesFromSourceFileNames(fileNames);
- for (var name_7 in packageNameToTypingLocation) {
- if (name_7 in inferredTypings && !inferredTypings[name_7]) {
- inferredTypings[name_7] = packageNameToTypingLocation[name_7];
- }
- }
- for (var _a = 0, exclude_1 = exclude; _a < exclude_1.length; _a++) {
- var excludeTypingName = exclude_1[_a];
- delete inferredTypings[excludeTypingName];
- }
- var newTypingNames = [];
- var cachedTypingPaths = [];
- for (var typing in inferredTypings) {
- if (inferredTypings[typing] !== undefined) {
- cachedTypingPaths.push(inferredTypings[typing]);
- }
- else {
- newTypingNames.push(typing);
- }
- }
- return { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };
- function mergeTypings(typingNames) {
- if (!typingNames) {
- return;
- }
- for (var _i = 0, typingNames_1 = typingNames; _i < typingNames_1.length; _i++) {
- var typing = typingNames_1[_i];
- if (!(typing in inferredTypings)) {
- inferredTypings[typing] = undefined;
- }
- }
- }
- function getTypingNamesFromJson(jsonPath, filesToWatch) {
- var result = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); });
- if (result.config) {
- var jsonConfig = result.config;
- filesToWatch.push(jsonPath);
- if (jsonConfig.dependencies) {
- mergeTypings(ts.getOwnKeys(jsonConfig.dependencies));
- }
- if (jsonConfig.devDependencies) {
- mergeTypings(ts.getOwnKeys(jsonConfig.devDependencies));
- }
- if (jsonConfig.optionalDependencies) {
- mergeTypings(ts.getOwnKeys(jsonConfig.optionalDependencies));
- }
- if (jsonConfig.peerDependencies) {
- mergeTypings(ts.getOwnKeys(jsonConfig.peerDependencies));
- }
- }
- }
- function getTypingNamesFromSourceFileNames(fileNames) {
- var jsFileNames = ts.filter(fileNames, ts.hasJavaScriptFileExtension);
- var inferredTypingNames = ts.map(jsFileNames, function (f) { return ts.removeFileExtension(ts.getBaseFileName(f.toLowerCase())); });
- var cleanedTypingNames = ts.map(inferredTypingNames, function (f) { return f.replace(/((?:\.|-)min(?=\.|$))|((?:-|\.)\d+)/g, ""); });
- if (safeList !== EmptySafeList) {
- mergeTypings(ts.filter(cleanedTypingNames, function (f) { return f in safeList; }));
- }
- var hasJsxFile = ts.forEach(fileNames, function (f) { return ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)) === 2; });
- if (hasJsxFile) {
- mergeTypings(["react"]);
- }
- }
- function getTypingNamesFromNodeModuleFolder(nodeModulesPath) {
- if (!host.directoryExists(nodeModulesPath)) {
- return;
- }
- var typingNames = [];
- var fileNames = host.readDirectory(nodeModulesPath, [".json"], undefined, undefined, 2);
- for (var _i = 0, fileNames_2 = fileNames; _i < fileNames_2.length; _i++) {
- var fileName = fileNames_2[_i];
- var normalizedFileName = ts.normalizePath(fileName);
- if (ts.getBaseFileName(normalizedFileName) !== "package.json") {
- continue;
- }
- var result = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); });
- if (!result.config) {
- continue;
- }
- var packageJson = result.config;
- if (packageJson._requiredBy &&
- ts.filter(packageJson._requiredBy, function (r) { return r[0] === "#" || r === "/"; }).length === 0) {
- continue;
- }
- if (!packageJson.name) {
- continue;
- }
- if (packageJson.typings) {
- var absolutePath = ts.getNormalizedAbsolutePath(packageJson.typings, ts.getDirectoryPath(normalizedFileName));
- inferredTypings[packageJson.name] = absolutePath;
- }
- else {
- typingNames.push(packageJson.name);
- }
- }
- mergeTypings(typingNames);
- }
- }
- JsTyping.discoverTypings = discoverTypings;
- })(JsTyping = ts.JsTyping || (ts.JsTyping = {}));
-})(ts || (ts = {}));
-var ts;
-(function (ts) {
- var server;
- (function (server) {
- (function (LogLevel) {
- LogLevel[LogLevel["terse"] = 0] = "terse";
- LogLevel[LogLevel["normal"] = 1] = "normal";
- LogLevel[LogLevel["requestTime"] = 2] = "requestTime";
- LogLevel[LogLevel["verbose"] = 3] = "verbose";
- })(server.LogLevel || (server.LogLevel = {}));
- var LogLevel = server.LogLevel;
- server.emptyArray = [];
- var Msg;
- (function (Msg) {
- Msg.Err = "Err";
- Msg.Info = "Info";
- Msg.Perf = "Perf";
- })(Msg = server.Msg || (server.Msg = {}));
- function getProjectRootPath(project) {
- switch (project.projectKind) {
- case server.ProjectKind.Configured:
- return ts.getDirectoryPath(project.getProjectName());
- case server.ProjectKind.Inferred:
- return "";
- case server.ProjectKind.External:
- var projectName = ts.normalizeSlashes(project.getProjectName());
- return project.projectService.host.fileExists(projectName) ? ts.getDirectoryPath(projectName) : projectName;
- }
- }
- function createInstallTypingsRequest(project, typingOptions, cachePath) {
- return {
- projectName: project.getProjectName(),
- fileNames: project.getFileNames(),
- compilerOptions: project.getCompilerOptions(),
- typingOptions: typingOptions,
- projectRootPath: getProjectRootPath(project),
- cachePath: cachePath,
- kind: "discover"
- };
- }
- server.createInstallTypingsRequest = createInstallTypingsRequest;
- var Errors;
- (function (Errors) {
- function ThrowNoProject() {
- throw new Error("No Project.");
- }
- Errors.ThrowNoProject = ThrowNoProject;
- function ThrowProjectLanguageServiceDisabled() {
- throw new Error("The project's language service is disabled.");
- }
- Errors.ThrowProjectLanguageServiceDisabled = ThrowProjectLanguageServiceDisabled;
- function ThrowProjectDoesNotContainDocument(fileName, project) {
- throw new Error("Project '" + project.getProjectName() + "' does not contain document '" + fileName + "'");
- }
- Errors.ThrowProjectDoesNotContainDocument = ThrowProjectDoesNotContainDocument;
- })(Errors = server.Errors || (server.Errors = {}));
- function getDefaultFormatCodeSettings(host) {
- return {
- indentSize: 4,
- tabSize: 4,
- newLineCharacter: host.newLine || "\n",
- convertTabsToSpaces: true,
- indentStyle: ts.IndentStyle.Smart,
- insertSpaceAfterCommaDelimiter: true,
- insertSpaceAfterSemicolonInForStatements: true,
- insertSpaceBeforeAndAfterBinaryOperators: true,
- insertSpaceAfterKeywordsInControlFlowStatements: true,
- insertSpaceAfterFunctionKeywordForAnonymousFunctions: false,
- insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false,
- insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false,
- insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false,
- insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false,
- placeOpenBraceOnNewLineForFunctions: false,
- placeOpenBraceOnNewLineForControlBlocks: false
- };
- }
- server.getDefaultFormatCodeSettings = getDefaultFormatCodeSettings;
- function mergeMaps(target, source) {
- for (var key in source) {
- if (ts.hasProperty(source, key)) {
- target[key] = source[key];
- }
- }
- }
- server.mergeMaps = mergeMaps;
- function removeItemFromSet(items, itemToRemove) {
- if (items.length === 0) {
- return;
- }
- var index = items.indexOf(itemToRemove);
- if (index < 0) {
- return;
- }
- if (index === items.length - 1) {
- items.pop();
- }
- else {
- items[index] = items.pop();
- }
- }
- server.removeItemFromSet = removeItemFromSet;
- function toNormalizedPath(fileName) {
- return ts.normalizePath(fileName);
- }
- server.toNormalizedPath = toNormalizedPath;
- function normalizedPathToPath(normalizedPath, currentDirectory, getCanonicalFileName) {
- var f = ts.isRootedDiskPath(normalizedPath) ? normalizedPath : ts.getNormalizedAbsolutePath(normalizedPath, currentDirectory);
- return getCanonicalFileName(f);
- }
- server.normalizedPathToPath = normalizedPathToPath;
- function asNormalizedPath(fileName) {
- return fileName;
- }
- server.asNormalizedPath = asNormalizedPath;
- function createNormalizedPathMap() {
- var map = Object.create(null);
- return {
- get: function (path) {
- return map[path];
- },
- set: function (path, value) {
- map[path] = value;
- },
- contains: function (path) {
- return ts.hasProperty(map, path);
- },
- remove: function (path) {
- delete map[path];
- }
- };
- }
- server.createNormalizedPathMap = createNormalizedPathMap;
- function throwLanguageServiceIsDisabledError() {
- throw new Error("LanguageService is disabled");
- }
- server.nullLanguageService = {
- cleanupSemanticCache: throwLanguageServiceIsDisabledError,
- getSyntacticDiagnostics: throwLanguageServiceIsDisabledError,
- getSemanticDiagnostics: throwLanguageServiceIsDisabledError,
- getCompilerOptionsDiagnostics: throwLanguageServiceIsDisabledError,
- getSyntacticClassifications: throwLanguageServiceIsDisabledError,
- getEncodedSyntacticClassifications: throwLanguageServiceIsDisabledError,
- getSemanticClassifications: throwLanguageServiceIsDisabledError,
- getEncodedSemanticClassifications: throwLanguageServiceIsDisabledError,
- getCompletionsAtPosition: throwLanguageServiceIsDisabledError,
- findReferences: throwLanguageServiceIsDisabledError,
- getCompletionEntryDetails: throwLanguageServiceIsDisabledError,
- getQuickInfoAtPosition: throwLanguageServiceIsDisabledError,
- findRenameLocations: throwLanguageServiceIsDisabledError,
- getNameOrDottedNameSpan: throwLanguageServiceIsDisabledError,
- getBreakpointStatementAtPosition: throwLanguageServiceIsDisabledError,
- getBraceMatchingAtPosition: throwLanguageServiceIsDisabledError,
- getSignatureHelpItems: throwLanguageServiceIsDisabledError,
- getDefinitionAtPosition: throwLanguageServiceIsDisabledError,
- getRenameInfo: throwLanguageServiceIsDisabledError,
- getTypeDefinitionAtPosition: throwLanguageServiceIsDisabledError,
- getReferencesAtPosition: throwLanguageServiceIsDisabledError,
- getDocumentHighlights: throwLanguageServiceIsDisabledError,
- getOccurrencesAtPosition: throwLanguageServiceIsDisabledError,
- getNavigateToItems: throwLanguageServiceIsDisabledError,
- getNavigationBarItems: throwLanguageServiceIsDisabledError,
- getNavigationTree: throwLanguageServiceIsDisabledError,
- getOutliningSpans: throwLanguageServiceIsDisabledError,
- getTodoComments: throwLanguageServiceIsDisabledError,
- getIndentationAtPosition: throwLanguageServiceIsDisabledError,
- getFormattingEditsForRange: throwLanguageServiceIsDisabledError,
- getFormattingEditsForDocument: throwLanguageServiceIsDisabledError,
- getFormattingEditsAfterKeystroke: throwLanguageServiceIsDisabledError,
- getDocCommentTemplateAtPosition: throwLanguageServiceIsDisabledError,
- isValidBraceCompletionAtPosition: throwLanguageServiceIsDisabledError,
- getEmitOutput: throwLanguageServiceIsDisabledError,
- getProgram: throwLanguageServiceIsDisabledError,
- getNonBoundSourceFile: throwLanguageServiceIsDisabledError,
- dispose: throwLanguageServiceIsDisabledError,
- getCompletionEntrySymbol: throwLanguageServiceIsDisabledError,
- getImplementationAtPosition: throwLanguageServiceIsDisabledError,
- getSourceFile: throwLanguageServiceIsDisabledError,
- getCodeFixesAtPosition: throwLanguageServiceIsDisabledError
- };
- server.nullLanguageServiceHost = {
- setCompilationSettings: function () { return undefined; },
- notifyFileRemoved: function () { return undefined; }
- };
- function isInferredProjectName(name) {
- return /dev\/null\/inferredProject\d+\*/.test(name);
- }
- server.isInferredProjectName = isInferredProjectName;
- function makeInferredProjectName(counter) {
- return "/dev/null/inferredProject" + counter + "*";
- }
- server.makeInferredProjectName = makeInferredProjectName;
- var ThrottledOperations = (function () {
- function ThrottledOperations(host) {
- this.host = host;
- this.pendingTimeouts = ts.createMap();
- }
- ThrottledOperations.prototype.schedule = function (operationId, delay, cb) {
- if (ts.hasProperty(this.pendingTimeouts, operationId)) {
- this.host.clearTimeout(this.pendingTimeouts[operationId]);
- }
- this.pendingTimeouts[operationId] = this.host.setTimeout(ThrottledOperations.run, delay, this, operationId, cb);
- };
- ThrottledOperations.run = function (self, operationId, cb) {
- delete self.pendingTimeouts[operationId];
- cb();
- };
- return ThrottledOperations;
- }());
- server.ThrottledOperations = ThrottledOperations;
- var GcTimer = (function () {
- function GcTimer(host, delay, logger) {
- this.host = host;
- this.delay = delay;
- this.logger = logger;
- }
- GcTimer.prototype.scheduleCollect = function () {
- if (!this.host.gc || this.timerId != undefined) {
- return;
- }
- this.timerId = this.host.setTimeout(GcTimer.run, this.delay, this);
- };
- GcTimer.run = function (self) {
- self.timerId = undefined;
- var log = self.logger.hasLevel(LogLevel.requestTime);
- var before = log && self.host.getMemoryUsage();
- self.host.gc();
- if (log) {
- var after = self.host.getMemoryUsage();
- self.logger.perftrc("GC::before " + before + ", after " + after);
- }
- };
- return GcTimer;
- }());
- server.GcTimer = GcTimer;
- })(server = ts.server || (ts.server = {}));
-})(ts || (ts = {}));
-var ts;
-(function (ts) {
- function trace(host, message) {
+ function trace(host) {
host.trace(ts.formatMessage.apply(undefined, arguments));
}
ts.trace = trace;
@@ -6668,11 +4583,11 @@ var ts;
ts.getSourceFileOfNode = getSourceFileOfNode;
function isStatementWithLocals(node) {
switch (node.kind) {
- case 199:
- case 227:
- case 206:
+ case 200:
+ case 228:
case 207:
case 208:
+ case 209:
return true;
}
return false;
@@ -6793,13 +4708,13 @@ var ts;
switch (node.kind) {
case 9:
return getQuotedEscapedLiteralText('"', node.text, '"');
- case 11:
- return getQuotedEscapedLiteralText("`", node.text, "`");
case 12:
- return getQuotedEscapedLiteralText("`", node.text, "${");
+ return getQuotedEscapedLiteralText("`", node.text, "`");
case 13:
- return getQuotedEscapedLiteralText("}", node.text, "${");
+ return getQuotedEscapedLiteralText("`", node.text, "${");
case 14:
+ return getQuotedEscapedLiteralText("}", node.text, "${");
+ case 15:
return getQuotedEscapedLiteralText("}", node.text, "`");
case 8:
return node.text;
@@ -6841,7 +4756,7 @@ var ts;
}
ts.isBlockOrCatchScoped = isBlockOrCatchScoped;
function isAmbientModule(node) {
- return node && node.kind === 225 &&
+ return node && node.kind === 226 &&
(node.name.kind === 9 || isGlobalScopeAugmentation(node));
}
ts.isAmbientModule = isAmbientModule;
@@ -6850,11 +4765,11 @@ var ts;
}
ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;
function isShorthandAmbientModule(node) {
- return node.kind === 225 && (!node.body);
+ return node.kind === 226 && (!node.body);
}
function isBlockScopedContainerTopLevel(node) {
return node.kind === 256 ||
- node.kind === 225 ||
+ node.kind === 226 ||
isFunctionLike(node);
}
ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel;
@@ -6869,7 +4784,7 @@ var ts;
switch (node.parent.kind) {
case 256:
return ts.isExternalModule(node.parent);
- case 226:
+ case 227:
return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent);
}
return false;
@@ -6878,21 +4793,21 @@ var ts;
function isBlockScope(node, parentNode) {
switch (node.kind) {
case 256:
- case 227:
+ case 228:
case 252:
- case 225:
- case 206:
+ case 226:
case 207:
case 208:
- case 148:
- case 147:
+ case 209:
case 149:
+ case 148:
case 150:
- case 220:
- case 179:
+ case 151:
+ case 221:
case 180:
+ case 181:
return true;
- case 199:
+ case 200:
return parentNode && !isFunctionLike(parentNode);
}
return false;
@@ -6910,7 +4825,7 @@ var ts;
ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer;
function isCatchClauseVariableDeclaration(declaration) {
return declaration &&
- declaration.kind === 218 &&
+ declaration.kind === 219 &&
declaration.parent &&
declaration.parent.kind === 252;
}
@@ -6947,7 +4862,7 @@ var ts;
ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition;
function getErrorSpanForArrowFunction(sourceFile, node) {
var pos = ts.skipTrivia(sourceFile.text, node.pos);
- if (node.body && node.body.kind === 199) {
+ if (node.body && node.body.kind === 200) {
var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line;
var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line;
if (startLine < endLine) {
@@ -6965,23 +4880,23 @@ var ts;
return ts.createTextSpan(0, 0);
}
return getSpanOfTokenAtPosition(sourceFile, pos_1);
- case 218:
- case 169:
- case 221:
- case 192:
+ case 219:
+ case 170:
case 222:
- case 225:
- case 224:
- case 255:
- case 220:
- case 179:
- case 147:
- case 149:
- case 150:
+ case 193:
case 223:
+ case 226:
+ case 225:
+ case 255:
+ case 221:
+ case 180:
+ case 148:
+ case 150:
+ case 151:
+ case 224:
errorNode = node.name;
break;
- case 180:
+ case 181:
return getErrorSpanForArrowFunction(sourceFile, node);
}
if (errorNode === undefined) {
@@ -7002,7 +4917,7 @@ var ts;
}
ts.isDeclarationFile = isDeclarationFile;
function isConstEnumDeclaration(node) {
- return node.kind === 224 && isConst(node);
+ return node.kind === 225 && isConst(node);
}
ts.isConstEnumDeclaration = isConstEnumDeclaration;
function isConst(node) {
@@ -7015,11 +4930,11 @@ var ts;
}
ts.isLet = isLet;
function isSuperCall(n) {
- return n.kind === 174 && n.expression.kind === 95;
+ return n.kind === 175 && n.expression.kind === 96;
}
ts.isSuperCall = isSuperCall;
function isPrologueDirective(node) {
- return node.kind === 202 && node.expression.kind === 9;
+ return node.kind === 203 && node.expression.kind === 9;
}
ts.isPrologueDirective = isPrologueDirective;
function getLeadingCommentRangesOfNode(node, sourceFileOfNode) {
@@ -7035,10 +4950,10 @@ var ts;
}
ts.getJsDocComments = getJsDocComments;
function getJsDocCommentsFromText(node, text) {
- var commentRanges = (node.kind === 142 ||
- node.kind === 141 ||
- node.kind === 179 ||
- node.kind === 180) ?
+ var commentRanges = (node.kind === 143 ||
+ node.kind === 142 ||
+ node.kind === 180 ||
+ node.kind === 181) ?
ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
getLeadingCommentRangesOfNodeFromText(node, text);
return ts.filter(commentRanges, isJsDocComment);
@@ -7053,69 +4968,69 @@ var ts;
ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/;
ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/;
function isPartOfTypeNode(node) {
- if (154 <= node.kind && node.kind <= 166) {
+ if (155 <= node.kind && node.kind <= 167) {
return true;
}
switch (node.kind) {
- case 117:
- case 130:
- case 132:
- case 120:
+ case 118:
+ case 131:
case 133:
- case 135:
- case 127:
+ case 121:
+ case 134:
+ case 136:
+ case 128:
return true;
- case 103:
- return node.parent.kind !== 183;
- case 194:
+ case 104:
+ return node.parent.kind !== 184;
+ case 195:
return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
- case 69:
- if (node.parent.kind === 139 && node.parent.right === node) {
+ case 70:
+ if (node.parent.kind === 140 && node.parent.right === node) {
node = node.parent;
}
- else if (node.parent.kind === 172 && node.parent.name === node) {
+ else if (node.parent.kind === 173 && node.parent.name === node) {
node = node.parent;
}
- ts.Debug.assert(node.kind === 69 || node.kind === 139 || node.kind === 172, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
- case 139:
- case 172:
- case 97:
+ ts.Debug.assert(node.kind === 70 || node.kind === 140 || node.kind === 173, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
+ case 140:
+ case 173:
+ case 98:
var parent_2 = node.parent;
- if (parent_2.kind === 158) {
+ if (parent_2.kind === 159) {
return false;
}
- if (154 <= parent_2.kind && parent_2.kind <= 166) {
+ if (155 <= parent_2.kind && parent_2.kind <= 167) {
return true;
}
switch (parent_2.kind) {
- case 194:
+ case 195:
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_2);
- case 141:
- return node === parent_2.constraint;
- case 145:
- case 144:
case 142:
- case 218:
+ return node === parent_2.constraint;
+ case 146:
+ case 145:
+ case 143:
+ case 219:
return node === parent_2.type;
- case 220:
- case 179:
+ case 221:
case 180:
+ case 181:
+ case 149:
case 148:
case 147:
- case 146:
- case 149:
case 150:
- return node === parent_2.type;
case 151:
+ return node === parent_2.type;
case 152:
case 153:
+ case 154:
return node === parent_2.type;
- case 177:
+ case 178:
return node === parent_2.type;
- case 174:
case 175:
- return parent_2.typeArguments && ts.indexOf(parent_2.typeArguments, node) >= 0;
case 176:
+ return parent_2.typeArguments && ts.indexOf(parent_2.typeArguments, node) >= 0;
+ case 177:
return false;
}
}
@@ -7126,22 +5041,22 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 211:
+ case 212:
return visitor(node);
- case 227:
- case 199:
- case 203:
+ case 228:
+ case 200:
case 204:
case 205:
case 206:
case 207:
case 208:
- case 212:
+ case 209:
case 213:
+ case 214:
case 249:
case 250:
- case 214:
- case 216:
+ case 215:
+ case 217:
case 252:
return ts.forEachChild(node, traverse);
}
@@ -7152,24 +5067,24 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 190:
+ case 191:
visitor(node);
var operand = node.expression;
if (operand) {
traverse(operand);
}
- case 224:
- case 222:
case 225:
case 223:
- case 221:
- case 192:
+ case 226:
+ case 224:
+ case 222:
+ case 193:
return;
default:
if (isFunctionLike(node)) {
- var name_8 = node.name;
- if (name_8 && name_8.kind === 140) {
- traverse(name_8.expression);
+ var name_4 = node.name;
+ if (name_4 && name_4.kind === 141) {
+ traverse(name_4.expression);
return;
}
}
@@ -7183,14 +5098,14 @@ var ts;
function isVariableLike(node) {
if (node) {
switch (node.kind) {
- case 169:
+ case 170:
case 255:
- case 142:
+ case 143:
case 253:
+ case 146:
case 145:
- case 144:
case 254:
- case 218:
+ case 219:
return true;
}
}
@@ -7198,11 +5113,11 @@ var ts;
}
ts.isVariableLike = isVariableLike;
function isAccessor(node) {
- return node && (node.kind === 149 || node.kind === 150);
+ return node && (node.kind === 150 || node.kind === 151);
}
ts.isAccessor = isAccessor;
function isClassLike(node) {
- return node && (node.kind === 221 || node.kind === 192);
+ return node && (node.kind === 222 || node.kind === 193);
}
ts.isClassLike = isClassLike;
function isFunctionLike(node) {
@@ -7211,19 +5126,19 @@ var ts;
ts.isFunctionLike = isFunctionLike;
function isFunctionLikeKind(kind) {
switch (kind) {
- case 148:
- case 179:
- case 220:
- case 180:
- case 147:
- case 146:
case 149:
+ case 180:
+ case 221:
+ case 181:
+ case 148:
+ case 147:
case 150:
case 151:
case 152:
case 153:
- case 156:
+ case 154:
case 157:
+ case 158:
return true;
}
return false;
@@ -7231,13 +5146,13 @@ var ts;
ts.isFunctionLikeKind = isFunctionLikeKind;
function introducesArgumentsExoticObject(node) {
switch (node.kind) {
- case 147:
- case 146:
case 148:
+ case 147:
case 149:
case 150:
- case 220:
- case 179:
+ case 151:
+ case 221:
+ case 180:
return true;
}
return false;
@@ -7245,30 +5160,30 @@ var ts;
ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject;
function isIterationStatement(node, lookInLabeledStatements) {
switch (node.kind) {
- case 206:
case 207:
case 208:
- case 204:
+ case 209:
case 205:
+ case 206:
return true;
- case 214:
+ case 215:
return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements);
}
return false;
}
ts.isIterationStatement = isIterationStatement;
function isFunctionBlock(node) {
- return node && node.kind === 199 && isFunctionLike(node.parent);
+ return node && node.kind === 200 && isFunctionLike(node.parent);
}
ts.isFunctionBlock = isFunctionBlock;
function isObjectLiteralMethod(node) {
- return node && node.kind === 147 && node.parent.kind === 171;
+ return node && node.kind === 148 && node.parent.kind === 172;
}
ts.isObjectLiteralMethod = isObjectLiteralMethod;
function isObjectLiteralOrClassExpressionMethod(node) {
- return node.kind === 147 &&
- (node.parent.kind === 171 ||
- node.parent.kind === 192);
+ return node.kind === 148 &&
+ (node.parent.kind === 172 ||
+ node.parent.kind === 193);
}
ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod;
function isIdentifierTypePredicate(predicate) {
@@ -7304,38 +5219,38 @@ var ts;
return undefined;
}
switch (node.kind) {
- case 140:
+ case 141:
if (isClassLike(node.parent.parent)) {
return node;
}
node = node.parent;
break;
- case 143:
- if (node.parent.kind === 142 && isClassElement(node.parent.parent)) {
+ case 144:
+ if (node.parent.kind === 143 && isClassElement(node.parent.parent)) {
node = node.parent.parent;
}
else if (isClassElement(node.parent)) {
node = node.parent;
}
break;
- case 180:
+ case 181:
if (!includeArrowFunctions) {
continue;
}
- case 220:
- case 179:
- case 225:
- case 145:
- case 144:
- case 147:
+ case 221:
+ case 180:
+ case 226:
case 146:
+ case 145:
case 148:
+ case 147:
case 149:
case 150:
case 151:
case 152:
case 153:
- case 224:
+ case 154:
+ case 225:
case 256:
return node;
}
@@ -7349,25 +5264,25 @@ var ts;
return node;
}
switch (node.kind) {
- case 140:
+ case 141:
node = node.parent;
break;
- case 220:
- case 179:
+ case 221:
case 180:
+ case 181:
if (!stopOnFunctions) {
continue;
}
- case 145:
- case 144:
- case 147:
case 146:
+ case 145:
case 148:
+ case 147:
case 149:
case 150:
+ case 151:
return node;
- case 143:
- if (node.parent.kind === 142 && isClassElement(node.parent.parent)) {
+ case 144:
+ if (node.parent.kind === 143 && isClassElement(node.parent.parent)) {
node = node.parent.parent;
}
else if (isClassElement(node.parent)) {
@@ -7379,14 +5294,14 @@ var ts;
}
ts.getSuperContainer = getSuperContainer;
function getImmediatelyInvokedFunctionExpression(func) {
- if (func.kind === 179 || func.kind === 180) {
+ if (func.kind === 180 || func.kind === 181) {
var prev = func;
var parent_3 = func.parent;
- while (parent_3.kind === 178) {
+ while (parent_3.kind === 179) {
prev = parent_3;
parent_3 = parent_3.parent;
}
- if (parent_3.kind === 174 && parent_3.expression === prev) {
+ if (parent_3.kind === 175 && parent_3.expression === prev) {
return parent_3;
}
}
@@ -7394,20 +5309,20 @@ var ts;
ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression;
function isSuperProperty(node) {
var kind = node.kind;
- return (kind === 172 || kind === 173)
- && node.expression.kind === 95;
+ return (kind === 173 || kind === 174)
+ && node.expression.kind === 96;
}
ts.isSuperProperty = isSuperProperty;
function getEntityNameFromTypeNode(node) {
if (node) {
switch (node.kind) {
- case 155:
+ case 156:
return node.typeName;
- case 194:
+ case 195:
ts.Debug.assert(isEntityNameExpression(node.expression));
return node.expression;
- case 69:
- case 139:
+ case 70:
+ case 140:
return node;
}
}
@@ -7416,10 +5331,10 @@ var ts;
ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode;
function isCallLikeExpression(node) {
switch (node.kind) {
- case 174:
case 175:
case 176:
- case 143:
+ case 177:
+ case 144:
return true;
default:
return false;
@@ -7427,7 +5342,7 @@ var ts;
}
ts.isCallLikeExpression = isCallLikeExpression;
function getInvokedExpression(node) {
- if (node.kind === 176) {
+ if (node.kind === 177) {
return node.tag;
}
return node.expression;
@@ -7435,21 +5350,21 @@ var ts;
ts.getInvokedExpression = getInvokedExpression;
function nodeCanBeDecorated(node) {
switch (node.kind) {
- case 221:
+ case 222:
return true;
- case 145:
- return node.parent.kind === 221;
- case 149:
+ case 146:
+ return node.parent.kind === 222;
case 150:
- case 147:
+ case 151:
+ case 148:
return node.body !== undefined
- && node.parent.kind === 221;
- case 142:
+ && node.parent.kind === 222;
+ case 143:
return node.parent.body !== undefined
- && (node.parent.kind === 148
- || node.parent.kind === 147
- || node.parent.kind === 150)
- && node.parent.parent.kind === 221;
+ && (node.parent.kind === 149
+ || node.parent.kind === 148
+ || node.parent.kind === 151)
+ && node.parent.parent.kind === 222;
}
return false;
}
@@ -7465,18 +5380,18 @@ var ts;
ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated;
function childIsDecorated(node) {
switch (node.kind) {
- case 221:
+ case 222:
return ts.forEach(node.members, nodeOrChildIsDecorated);
- case 147:
- case 150:
+ case 148:
+ case 151:
return ts.forEach(node.parameters, nodeIsDecorated);
}
}
ts.childIsDecorated = childIsDecorated;
function isJSXTagName(node) {
var parent = node.parent;
- if (parent.kind === 243 ||
- parent.kind === 242 ||
+ if (parent.kind === 244 ||
+ parent.kind === 243 ||
parent.kind === 245) {
return parent.tagName === node;
}
@@ -7485,97 +5400,97 @@ var ts;
ts.isJSXTagName = isJSXTagName;
function isPartOfExpression(node) {
switch (node.kind) {
- case 97:
- case 95:
- case 93:
- case 99:
- case 84:
- case 10:
- case 170:
+ case 98:
+ case 96:
+ case 94:
+ case 100:
+ case 85:
+ case 11:
case 171:
case 172:
case 173:
case 174:
case 175:
case 176:
- case 195:
case 177:
case 196:
case 178:
+ case 197:
case 179:
- case 192:
case 180:
- case 183:
+ case 193:
case 181:
+ case 184:
case 182:
- case 185:
+ case 183:
case 186:
case 187:
case 188:
- case 191:
case 189:
- case 11:
- case 193:
- case 241:
- case 242:
+ case 192:
case 190:
- case 184:
+ case 12:
+ case 194:
+ case 242:
+ case 243:
+ case 191:
+ case 185:
return true;
- case 139:
- while (node.parent.kind === 139) {
+ case 140:
+ while (node.parent.kind === 140) {
node = node.parent;
}
- return node.parent.kind === 158 || isJSXTagName(node);
- case 69:
- if (node.parent.kind === 158 || isJSXTagName(node)) {
+ return node.parent.kind === 159 || isJSXTagName(node);
+ case 70:
+ if (node.parent.kind === 159 || isJSXTagName(node)) {
return true;
}
case 8:
case 9:
- case 97:
+ case 98:
var parent_4 = node.parent;
switch (parent_4.kind) {
- case 218:
- case 142:
+ case 219:
+ case 143:
+ case 146:
case 145:
- case 144:
case 255:
case 253:
- case 169:
+ case 170:
return parent_4.initializer === node;
- case 202:
case 203:
case 204:
case 205:
- case 211:
+ case 206:
case 212:
case 213:
+ case 214:
case 249:
- case 215:
- case 213:
+ case 216:
+ case 214:
return parent_4.expression === node;
- case 206:
+ case 207:
var forStatement = parent_4;
- return (forStatement.initializer === node && forStatement.initializer.kind !== 219) ||
+ return (forStatement.initializer === node && forStatement.initializer.kind !== 220) ||
forStatement.condition === node ||
forStatement.incrementor === node;
- case 207:
case 208:
+ case 209:
var forInStatement = parent_4;
- return (forInStatement.initializer === node && forInStatement.initializer.kind !== 219) ||
+ return (forInStatement.initializer === node && forInStatement.initializer.kind !== 220) ||
forInStatement.expression === node;
- case 177:
- case 195:
+ case 178:
+ case 196:
return node === parent_4.expression;
- case 197:
+ case 198:
return node === parent_4.expression;
- case 140:
+ case 141:
return node === parent_4.expression;
- case 143:
+ case 144:
case 248:
case 247:
return true;
- case 194:
+ case 195:
return parent_4.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_4);
default:
if (isPartOfExpression(parent_4)) {
@@ -7593,7 +5508,7 @@ var ts;
}
ts.isInstantiatedModule = isInstantiatedModule;
function isExternalModuleImportEqualsDeclaration(node) {
- return node.kind === 229 && node.moduleReference.kind === 240;
+ return node.kind === 230 && node.moduleReference.kind === 241;
}
ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration;
function getExternalModuleImportEqualsDeclarationExpression(node) {
@@ -7602,7 +5517,7 @@ var ts;
}
ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
function isInternalModuleImportEqualsDeclaration(node) {
- return node.kind === 229 && node.moduleReference.kind !== 240;
+ return node.kind === 230 && node.moduleReference.kind !== 241;
}
ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration;
function isSourceFileJavaScript(file) {
@@ -7614,8 +5529,8 @@ var ts;
}
ts.isInJavaScriptFile = isInJavaScriptFile;
function isRequireCall(expression, checkArgumentIsStringLiteral) {
- var isRequire = expression.kind === 174 &&
- expression.expression.kind === 69 &&
+ var isRequire = expression.kind === 175 &&
+ expression.expression.kind === 70 &&
expression.expression.text === "require" &&
expression.arguments.length === 1;
return isRequire && (!checkArgumentIsStringLiteral || expression.arguments[0].kind === 9);
@@ -7626,9 +5541,9 @@ var ts;
}
ts.isSingleOrDoubleQuote = isSingleOrDoubleQuote;
function isDeclarationOfFunctionExpression(s) {
- if (s.valueDeclaration && s.valueDeclaration.kind === 218) {
+ if (s.valueDeclaration && s.valueDeclaration.kind === 219) {
var declaration = s.valueDeclaration;
- return declaration.initializer && declaration.initializer.kind === 179;
+ return declaration.initializer && declaration.initializer.kind === 180;
}
return false;
}
@@ -7637,15 +5552,15 @@ var ts;
if (!isInJavaScriptFile(expression)) {
return 0;
}
- if (expression.kind !== 187) {
+ if (expression.kind !== 188) {
return 0;
}
var expr = expression;
- if (expr.operatorToken.kind !== 56 || expr.left.kind !== 172) {
+ if (expr.operatorToken.kind !== 57 || expr.left.kind !== 173) {
return 0;
}
var lhs = expr.left;
- if (lhs.expression.kind === 69) {
+ if (lhs.expression.kind === 70) {
var lhsId = lhs.expression;
if (lhsId.text === "exports") {
return 1;
@@ -7654,12 +5569,12 @@ var ts;
return 2;
}
}
- else if (lhs.expression.kind === 97) {
+ else if (lhs.expression.kind === 98) {
return 4;
}
- else if (lhs.expression.kind === 172) {
+ else if (lhs.expression.kind === 173) {
var innerPropertyAccess = lhs.expression;
- if (innerPropertyAccess.expression.kind === 69) {
+ if (innerPropertyAccess.expression.kind === 70) {
var innerPropertyAccessIdentifier = innerPropertyAccess.expression;
if (innerPropertyAccessIdentifier.text === "module" && innerPropertyAccess.name.text === "exports") {
return 1;
@@ -7673,35 +5588,35 @@ var ts;
}
ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind;
function getExternalModuleName(node) {
- if (node.kind === 230) {
+ if (node.kind === 231) {
return node.moduleSpecifier;
}
- if (node.kind === 229) {
+ if (node.kind === 230) {
var reference = node.moduleReference;
- if (reference.kind === 240) {
+ if (reference.kind === 241) {
return reference.expression;
}
}
- if (node.kind === 236) {
+ if (node.kind === 237) {
return node.moduleSpecifier;
}
- if (node.kind === 225 && node.name.kind === 9) {
+ if (node.kind === 226 && node.name.kind === 9) {
return node.name;
}
}
ts.getExternalModuleName = getExternalModuleName;
function getNamespaceDeclarationNode(node) {
- if (node.kind === 229) {
+ if (node.kind === 230) {
return node;
}
var importClause = node.importClause;
- if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 232) {
+ if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 233) {
return importClause.namedBindings;
}
}
ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode;
function isDefaultImport(node) {
- return node.kind === 230
+ return node.kind === 231
&& node.importClause
&& !!node.importClause.name;
}
@@ -7709,13 +5624,13 @@ var ts;
function hasQuestionToken(node) {
if (node) {
switch (node.kind) {
- case 142:
+ case 143:
+ case 148:
case 147:
- case 146:
case 254:
case 253:
+ case 146:
case 145:
- case 144:
return node.questionToken !== undefined;
}
}
@@ -7776,24 +5691,24 @@ var ts;
if (checkParentVariableStatement) {
var isInitializerOfVariableDeclarationInStatement = isVariableLike(node.parent) &&
(node.parent).initializer === node &&
- node.parent.parent.parent.kind === 200;
+ node.parent.parent.parent.kind === 201;
var isVariableOfVariableDeclarationStatement = isVariableLike(node) &&
- node.parent.parent.kind === 200;
+ node.parent.parent.kind === 201;
var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? node.parent.parent.parent :
isVariableOfVariableDeclarationStatement ? node.parent.parent :
undefined;
if (variableStatementNode) {
result = append(result, getJSDocs(variableStatementNode, checkParentVariableStatement, getDocs, getTags));
}
- if (node.kind === 225 &&
- node.parent && node.parent.kind === 225) {
+ if (node.kind === 226 &&
+ node.parent && node.parent.kind === 226) {
result = append(result, getJSDocs(node.parent, checkParentVariableStatement, getDocs, getTags));
}
var parent_5 = node.parent;
var isSourceOfAssignmentExpressionStatement = parent_5 && parent_5.parent &&
- parent_5.kind === 187 &&
- parent_5.operatorToken.kind === 56 &&
- parent_5.parent.kind === 202;
+ parent_5.kind === 188 &&
+ parent_5.operatorToken.kind === 57 &&
+ parent_5.parent.kind === 203;
if (isSourceOfAssignmentExpressionStatement) {
result = append(result, getJSDocs(parent_5.parent, checkParentVariableStatement, getDocs, getTags));
}
@@ -7801,7 +5716,7 @@ var ts;
if (isPropertyAssignmentExpression) {
result = append(result, getJSDocs(parent_5, checkParentVariableStatement, getDocs, getTags));
}
- if (node.kind === 142) {
+ if (node.kind === 143) {
var paramTags = getJSDocParameterTag(node, checkParentVariableStatement);
if (paramTags) {
result = append(result, getTags(paramTags));
@@ -7831,9 +5746,9 @@ var ts;
return [paramTags[i]];
}
}
- else if (param.name.kind === 69) {
- var name_9 = param.name.text;
- var paramTags = ts.filter(tags, function (tag) { return tag.kind === 275 && tag.parameterName.text === name_9; });
+ else if (param.name.kind === 70) {
+ var name_5 = param.name.text;
+ var paramTags = ts.filter(tags, function (tag) { return tag.kind === 275 && tag.parameterName.text === name_5; });
if (paramTags) {
return paramTags;
}
@@ -7855,7 +5770,7 @@ var ts;
}
ts.getJSDocTemplateTag = getJSDocTemplateTag;
function getCorrespondingJSDocParameterTag(parameter) {
- if (parameter.name && parameter.name.kind === 69) {
+ if (parameter.name && parameter.name.kind === 70) {
var parameterName = parameter.name.text;
var jsDocTags = getJSDocTags(parameter.parent, true);
if (!jsDocTags) {
@@ -7900,12 +5815,12 @@ var ts;
}
ts.isDeclaredRestParam = isDeclaredRestParam;
function isAssignmentTarget(node) {
- while (node.parent.kind === 178) {
+ while (node.parent.kind === 179) {
node = node.parent;
}
while (true) {
var parent_6 = node.parent;
- if (parent_6.kind === 170 || parent_6.kind === 191) {
+ if (parent_6.kind === 171 || parent_6.kind === 192) {
node = parent_6;
continue;
}
@@ -7913,10 +5828,10 @@ var ts;
node = parent_6.parent;
continue;
}
- return parent_6.kind === 187 &&
+ return parent_6.kind === 188 &&
isAssignmentOperator(parent_6.operatorToken.kind) &&
parent_6.left === node ||
- (parent_6.kind === 207 || parent_6.kind === 208) &&
+ (parent_6.kind === 208 || parent_6.kind === 209) &&
parent_6.initializer === node;
}
}
@@ -7941,11 +5856,11 @@ var ts;
}
ts.isInAmbientContext = isInAmbientContext;
function isDeclarationName(name) {
- if (name.kind !== 69 && name.kind !== 9 && name.kind !== 8) {
+ if (name.kind !== 70 && name.kind !== 9 && name.kind !== 8) {
return false;
}
var parent = name.parent;
- if (parent.kind === 234 || parent.kind === 238) {
+ if (parent.kind === 235 || parent.kind === 239) {
if (parent.propertyName) {
return true;
}
@@ -7958,48 +5873,48 @@ var ts;
ts.isDeclarationName = isDeclarationName;
function isLiteralComputedPropertyDeclarationName(node) {
return (node.kind === 9 || node.kind === 8) &&
- node.parent.kind === 140 &&
+ node.parent.kind === 141 &&
isDeclaration(node.parent.parent);
}
ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName;
function isIdentifierName(node) {
var parent = node.parent;
switch (parent.kind) {
- case 145:
- case 144:
- case 147:
case 146:
- case 149:
+ case 145:
+ case 148:
+ case 147:
case 150:
+ case 151:
case 255:
case 253:
- case 172:
+ case 173:
return parent.name === node;
- case 139:
+ case 140:
if (parent.right === node) {
- while (parent.kind === 139) {
+ while (parent.kind === 140) {
parent = parent.parent;
}
- return parent.kind === 158;
+ return parent.kind === 159;
}
return false;
- case 169:
- case 234:
+ case 170:
+ case 235:
return parent.propertyName === node;
- case 238:
+ case 239:
return true;
}
return false;
}
ts.isIdentifierName = isIdentifierName;
function isAliasSymbolDeclaration(node) {
- return node.kind === 229 ||
- node.kind === 228 ||
- node.kind === 231 && !!node.name ||
- node.kind === 232 ||
- node.kind === 234 ||
- node.kind === 238 ||
- node.kind === 235 && exportAssignmentIsAlias(node);
+ return node.kind === 230 ||
+ node.kind === 229 ||
+ node.kind === 232 && !!node.name ||
+ node.kind === 233 ||
+ node.kind === 235 ||
+ node.kind === 239 ||
+ node.kind === 236 && exportAssignmentIsAlias(node);
}
ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration;
function exportAssignmentIsAlias(node) {
@@ -8007,17 +5922,17 @@ var ts;
}
ts.exportAssignmentIsAlias = exportAssignmentIsAlias;
function getClassExtendsHeritageClauseElement(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 83);
+ var heritageClause = getHeritageClause(node.heritageClauses, 84);
return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined;
}
ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement;
function getClassImplementsHeritageClauseElements(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 106);
+ var heritageClause = getHeritageClause(node.heritageClauses, 107);
return heritageClause ? heritageClause.types : undefined;
}
ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements;
function getInterfaceBaseTypeNodes(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 83);
+ var heritageClause = getHeritageClause(node.heritageClauses, 84);
return heritageClause ? heritageClause.types : undefined;
}
ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes;
@@ -8085,7 +6000,7 @@ var ts;
}
ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath;
function isKeyword(token) {
- return 70 <= token && token <= 138;
+ return 71 <= token && token <= 139;
}
ts.isKeyword = isKeyword;
function isTrivia(token) {
@@ -8105,7 +6020,7 @@ var ts;
}
ts.hasDynamicName = hasDynamicName;
function isDynamicName(name) {
- return name.kind === 140 &&
+ return name.kind === 141 &&
!isStringOrNumericLiteral(name.expression.kind) &&
!isWellKnownSymbolSyntactically(name.expression);
}
@@ -8115,10 +6030,10 @@ var ts;
}
ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically;
function getPropertyNameForPropertyNameNode(name) {
- if (name.kind === 69 || name.kind === 9 || name.kind === 8 || name.kind === 142) {
+ if (name.kind === 70 || name.kind === 9 || name.kind === 8 || name.kind === 143) {
return name.text;
}
- if (name.kind === 140) {
+ if (name.kind === 141) {
var nameExpression = name.expression;
if (isWellKnownSymbolSyntactically(nameExpression)) {
var rightHandSideName = nameExpression.name.text;
@@ -8136,22 +6051,26 @@ var ts;
}
ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName;
function isESSymbolIdentifier(node) {
- return node.kind === 69 && node.text === "Symbol";
+ return node.kind === 70 && node.text === "Symbol";
}
ts.isESSymbolIdentifier = isESSymbolIdentifier;
+ function isPushOrUnshiftIdentifier(node) {
+ return node.text === "push" || node.text === "unshift";
+ }
+ ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier;
function isModifierKind(token) {
switch (token) {
- case 115:
- case 118:
- case 74:
- case 122:
- case 77:
- case 82:
- case 112:
- case 110:
- case 111:
- case 128:
+ case 116:
+ case 119:
+ case 75:
+ case 123:
+ case 78:
+ case 83:
case 113:
+ case 111:
+ case 112:
+ case 129:
+ case 114:
return true;
}
return false;
@@ -8159,11 +6078,11 @@ var ts;
ts.isModifierKind = isModifierKind;
function isParameterDeclaration(node) {
var root = getRootDeclaration(node);
- return root.kind === 142;
+ return root.kind === 143;
}
ts.isParameterDeclaration = isParameterDeclaration;
function getRootDeclaration(node) {
- while (node.kind === 169) {
+ while (node.kind === 170) {
node = node.parent.parent;
}
return node;
@@ -8171,14 +6090,14 @@ var ts;
ts.getRootDeclaration = getRootDeclaration;
function nodeStartsNewLexicalEnvironment(node) {
var kind = node.kind;
- return kind === 148
- || kind === 179
- || kind === 220
+ return kind === 149
|| kind === 180
- || kind === 147
- || kind === 149
+ || kind === 221
+ || kind === 181
+ || kind === 148
|| kind === 150
- || kind === 225
+ || kind === 151
+ || kind === 226
|| kind === 256;
}
ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment;
@@ -8228,40 +6147,45 @@ var ts;
return node ? ts.getNodeId(node) : 0;
}
ts.getOriginalNodeId = getOriginalNodeId;
+ (function (Associativity) {
+ Associativity[Associativity["Left"] = 0] = "Left";
+ Associativity[Associativity["Right"] = 1] = "Right";
+ })(ts.Associativity || (ts.Associativity = {}));
+ var Associativity = ts.Associativity;
function getExpressionAssociativity(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 175 && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 176 && expression.arguments !== undefined;
return getOperatorAssociativity(expression.kind, operator, hasArguments);
}
ts.getExpressionAssociativity = getExpressionAssociativity;
function getOperatorAssociativity(kind, operator, hasArguments) {
switch (kind) {
- case 175:
+ case 176:
return hasArguments ? 0 : 1;
- case 185:
- case 182:
+ case 186:
case 183:
- case 181:
case 184:
- case 188:
- case 190:
+ case 182:
+ case 185:
+ case 189:
+ case 191:
return 1;
- case 187:
+ case 188:
switch (operator) {
- case 38:
- case 56:
+ case 39:
case 57:
case 58:
- case 60:
case 59:
case 61:
+ case 60:
case 62:
case 63:
case 64:
case 65:
case 66:
- case 68:
case 67:
+ case 69:
+ case 68:
return 1;
}
}
@@ -8270,15 +6194,15 @@ var ts;
ts.getOperatorAssociativity = getOperatorAssociativity;
function getExpressionPrecedence(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 175 && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 176 && expression.arguments !== undefined;
return getOperatorPrecedence(expression.kind, operator, hasArguments);
}
ts.getExpressionPrecedence = getExpressionPrecedence;
function getOperator(expression) {
- if (expression.kind === 187) {
+ if (expression.kind === 188) {
return expression.operatorToken.kind;
}
- else if (expression.kind === 185 || expression.kind === 186) {
+ else if (expression.kind === 186 || expression.kind === 187) {
return expression.operator;
}
else {
@@ -8288,106 +6212,106 @@ var ts;
ts.getOperator = getOperator;
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
switch (nodeKind) {
- case 97:
- case 95:
- case 69:
- case 93:
- case 99:
- case 84:
+ case 98:
+ case 96:
+ case 70:
+ case 94:
+ case 100:
+ case 85:
case 8:
case 9:
- case 170:
case 171:
- case 179:
- case 180:
- case 192:
- case 241:
- case 242:
- case 10:
- case 11:
- case 189:
- case 178:
- case 193:
- return 19;
- case 176:
case 172:
- case 173:
- return 18;
- case 175:
- return hasArguments ? 18 : 17;
- case 174:
- return 17;
- case 186:
- return 16;
- case 185:
- case 182:
- case 183:
+ case 180:
case 181:
- case 184:
- return 15;
+ case 193:
+ case 242:
+ case 243:
+ case 11:
+ case 12:
+ case 190:
+ case 179:
+ case 194:
+ return 19;
+ case 177:
+ case 173:
+ case 174:
+ return 18;
+ case 176:
+ return hasArguments ? 18 : 17;
+ case 175:
+ return 17;
case 187:
+ return 16;
+ case 186:
+ case 183:
+ case 184:
+ case 182:
+ case 185:
+ return 15;
+ case 188:
switch (operatorKind) {
- case 49:
case 50:
+ case 51:
return 15;
- case 38:
- case 37:
case 39:
+ case 38:
case 40:
+ case 41:
return 14;
- case 35:
case 36:
+ case 37:
return 13;
- case 43:
case 44:
case 45:
+ case 46:
return 12;
- case 25:
- case 28:
- case 27:
+ case 26:
case 29:
- case 90:
- case 91:
- return 11;
+ case 28:
case 30:
- case 32:
+ case 91:
+ case 92:
+ return 11;
case 31:
case 33:
+ case 32:
+ case 34:
return 10;
- case 46:
- return 9;
- case 48:
- return 8;
case 47:
+ return 9;
+ case 49:
+ return 8;
+ case 48:
return 7;
- case 51:
- return 6;
case 52:
+ return 6;
+ case 53:
return 5;
- case 56:
case 57:
case 58:
- case 60:
case 59:
case 61:
+ case 60:
case 62:
case 63:
case 64:
case 65:
case 66:
- case 68:
case 67:
+ case 69:
+ case 68:
return 3;
- case 24:
+ case 25:
return 0;
default:
return -1;
}
- case 188:
+ case 189:
return 4;
- case 190:
- return 2;
case 191:
+ return 2;
+ case 192:
return 1;
default:
return -1;
@@ -8651,7 +6575,7 @@ var ts;
function forEachTransformedEmitFile(host, sourceFiles, action, emitOnlyDtsFiles) {
var options = host.getCompilerOptions();
if (options.outFile || options.out) {
- onBundledEmit(host, sourceFiles);
+ onBundledEmit(sourceFiles);
}
else {
for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) {
@@ -8678,7 +6602,7 @@ var ts;
var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (options.declaration || emitOnlyDtsFiles) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined;
action(jsFilePath, sourceMapFilePath, declarationFilePath, [sourceFile], false);
}
- function onBundledEmit(host, sourceFiles) {
+ function onBundledEmit(sourceFiles) {
if (sourceFiles.length) {
var jsFilePath = options.outFile || options.out;
var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options);
@@ -8767,7 +6691,7 @@ var ts;
ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap;
function getFirstConstructorWithBody(node) {
return ts.forEach(node.members, function (member) {
- if (member.kind === 148 && nodeIsPresent(member.body)) {
+ if (member.kind === 149 && nodeIsPresent(member.body)) {
return member;
}
});
@@ -8794,11 +6718,11 @@ var ts;
}
ts.parameterIsThisKeyword = parameterIsThisKeyword;
function isThisIdentifier(node) {
- return node && node.kind === 69 && identifierIsThisKeyword(node);
+ return node && node.kind === 70 && identifierIsThisKeyword(node);
}
ts.isThisIdentifier = isThisIdentifier;
function identifierIsThisKeyword(id) {
- return id.originalKeywordKind === 97;
+ return id.originalKeywordKind === 98;
}
ts.identifierIsThisKeyword = identifierIsThisKeyword;
function getAllAccessorDeclarations(declarations, accessor) {
@@ -8808,10 +6732,10 @@ var ts;
var setAccessor;
if (hasDynamicName(accessor)) {
firstAccessor = accessor;
- if (accessor.kind === 149) {
+ if (accessor.kind === 150) {
getAccessor = accessor;
}
- else if (accessor.kind === 150) {
+ else if (accessor.kind === 151) {
setAccessor = accessor;
}
else {
@@ -8820,7 +6744,7 @@ var ts;
}
else {
ts.forEach(declarations, function (member) {
- if ((member.kind === 149 || member.kind === 150)
+ if ((member.kind === 150 || member.kind === 151)
&& hasModifier(member, 32) === hasModifier(accessor, 32)) {
var memberName = getPropertyNameForPropertyNameNode(member.name);
var accessorName = getPropertyNameForPropertyNameNode(accessor.name);
@@ -8831,10 +6755,10 @@ var ts;
else if (!secondAccessor) {
secondAccessor = member;
}
- if (member.kind === 149 && !getAccessor) {
+ if (member.kind === 150 && !getAccessor) {
getAccessor = member;
}
- if (member.kind === 150 && !setAccessor) {
+ if (member.kind === 151 && !setAccessor) {
setAccessor = member;
}
}
@@ -9026,34 +6950,34 @@ var ts;
ts.getModifierFlags = getModifierFlags;
function modifierToFlag(token) {
switch (token) {
- case 113: return 32;
- case 112: return 4;
- case 111: return 16;
- case 110: return 8;
- case 115: return 128;
- case 82: return 1;
- case 122: return 2;
- case 74: return 2048;
- case 77: return 512;
- case 118: return 256;
- case 128: return 64;
+ case 114: return 32;
+ case 113: return 4;
+ case 112: return 16;
+ case 111: return 8;
+ case 116: return 128;
+ case 83: return 1;
+ case 123: return 2;
+ case 75: return 2048;
+ case 78: return 512;
+ case 119: return 256;
+ case 129: return 64;
}
return 0;
}
ts.modifierToFlag = modifierToFlag;
function isLogicalOperator(token) {
- return token === 52
- || token === 51
- || token === 49;
+ return token === 53
+ || token === 52
+ || token === 50;
}
ts.isLogicalOperator = isLogicalOperator;
function isAssignmentOperator(token) {
- return token >= 56 && token <= 68;
+ return token >= 57 && token <= 69;
}
ts.isAssignmentOperator = isAssignmentOperator;
function tryGetClassExtendingExpressionWithTypeArguments(node) {
- if (node.kind === 194 &&
- node.parent.token === 83 &&
+ if (node.kind === 195 &&
+ node.parent.token === 84 &&
isClassLike(node.parent.parent)) {
return node.parent.parent;
}
@@ -9061,10 +6985,10 @@ var ts;
ts.tryGetClassExtendingExpressionWithTypeArguments = tryGetClassExtendingExpressionWithTypeArguments;
function isDestructuringAssignment(node) {
if (isBinaryExpression(node)) {
- if (node.operatorToken.kind === 56) {
+ if (node.operatorToken.kind === 57) {
var kind = node.left.kind;
- return kind === 171
- || kind === 170;
+ return kind === 172
+ || kind === 171;
}
}
return false;
@@ -9075,7 +6999,7 @@ var ts;
}
ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments;
function isSupportedExpressionWithTypeArgumentsRest(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
return true;
}
else if (isPropertyAccessExpression(node)) {
@@ -9090,21 +7014,21 @@ var ts;
}
ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause;
function isEntityNameExpression(node) {
- return node.kind === 69 ||
- node.kind === 172 && isEntityNameExpression(node.expression);
+ return node.kind === 70 ||
+ node.kind === 173 && isEntityNameExpression(node.expression);
}
ts.isEntityNameExpression = isEntityNameExpression;
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
- return (node.parent.kind === 139 && node.parent.right === node) ||
- (node.parent.kind === 172 && node.parent.name === node);
+ return (node.parent.kind === 140 && node.parent.right === node) ||
+ (node.parent.kind === 173 && node.parent.name === node);
}
ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess;
function isEmptyObjectLiteralOrArrayLiteral(expression) {
var kind = expression.kind;
- if (kind === 171) {
+ if (kind === 172) {
return expression.properties.length === 0;
}
- if (kind === 170) {
+ if (kind === 171) {
return expression.elements.length === 0;
}
return false;
@@ -9228,49 +7152,49 @@ var ts;
var kind = node.kind;
if (kind === 9
|| kind === 8
- || kind === 10
|| kind === 11
- || kind === 69
- || kind === 97
- || kind === 95
- || kind === 99
- || kind === 84
- || kind === 93) {
+ || kind === 12
+ || kind === 70
+ || kind === 98
+ || kind === 96
+ || kind === 100
+ || kind === 85
+ || kind === 94) {
return true;
}
- else if (kind === 172) {
+ else if (kind === 173) {
return isSimpleExpressionWorker(node.expression, depth + 1);
}
- else if (kind === 173) {
+ else if (kind === 174) {
return isSimpleExpressionWorker(node.expression, depth + 1)
&& isSimpleExpressionWorker(node.argumentExpression, depth + 1);
}
- else if (kind === 185
- || kind === 186) {
+ else if (kind === 186
+ || kind === 187) {
return isSimpleExpressionWorker(node.operand, depth + 1);
}
- else if (kind === 187) {
- return node.operatorToken.kind !== 38
+ else if (kind === 188) {
+ return node.operatorToken.kind !== 39
&& isSimpleExpressionWorker(node.left, depth + 1)
&& isSimpleExpressionWorker(node.right, depth + 1);
}
- else if (kind === 188) {
+ else if (kind === 189) {
return isSimpleExpressionWorker(node.condition, depth + 1)
&& isSimpleExpressionWorker(node.whenTrue, depth + 1)
&& isSimpleExpressionWorker(node.whenFalse, depth + 1);
}
- else if (kind === 183
- || kind === 182
- || kind === 181) {
+ else if (kind === 184
+ || kind === 183
+ || kind === 182) {
return isSimpleExpressionWorker(node.expression, depth + 1);
}
- else if (kind === 170) {
+ else if (kind === 171) {
return node.elements.length === 0;
}
- else if (kind === 171) {
+ else if (kind === 172) {
return node.properties.length === 0;
}
- else if (kind === 174) {
+ else if (kind === 175) {
if (!isSimpleExpressionWorker(node.expression, depth + 1)) {
return false;
}
@@ -9292,9 +7216,9 @@ var ts;
if (syntaxKindCache[kind]) {
return syntaxKindCache[kind];
}
- for (var name_10 in syntaxKindEnum) {
- if (syntaxKindEnum[name_10] === kind) {
- return syntaxKindCache[kind] = kind.toString() + " (" + name_10 + ")";
+ for (var name_6 in syntaxKindEnum) {
+ if (syntaxKindEnum[name_6] === kind) {
+ return syntaxKindCache[kind] = kind.toString() + " (" + name_6 + ")";
}
}
}
@@ -9376,7 +7300,7 @@ var ts;
return ts.positionIsSynthesized(range.pos) ? -1 : ts.skipTrivia(sourceFile.text, range.pos);
}
ts.getStartPositionOfRange = getStartPositionOfRange;
- function collectExternalModuleInfo(sourceFile, resolver) {
+ function collectExternalModuleInfo(sourceFile) {
var externalImports = [];
var exportSpecifiers = ts.createMap();
var exportEquals = undefined;
@@ -9384,38 +7308,33 @@ var ts;
for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
var node = _a[_i];
switch (node.kind) {
+ case 231:
+ externalImports.push(node);
+ break;
case 230:
- if (!node.importClause ||
- resolver.isReferencedAliasDeclaration(node.importClause, true)) {
+ if (node.moduleReference.kind === 241) {
externalImports.push(node);
}
break;
- case 229:
- if (node.moduleReference.kind === 240 && resolver.isReferencedAliasDeclaration(node)) {
- externalImports.push(node);
- }
- break;
- case 236:
+ case 237:
if (node.moduleSpecifier) {
if (!node.exportClause) {
- if (resolver.moduleExportsSomeValue(node.moduleSpecifier)) {
- externalImports.push(node);
- hasExportStarsToExportValues = true;
- }
+ externalImports.push(node);
+ hasExportStarsToExportValues = true;
}
- else if (resolver.isValueAliasDeclaration(node)) {
+ else {
externalImports.push(node);
}
}
else {
for (var _b = 0, _c = node.exportClause.elements; _b < _c.length; _b++) {
var specifier = _c[_b];
- var name_11 = (specifier.propertyName || specifier.name).text;
- (exportSpecifiers[name_11] || (exportSpecifiers[name_11] = [])).push(specifier);
+ var name_7 = (specifier.propertyName || specifier.name).text;
+ (exportSpecifiers[name_7] || (exportSpecifiers[name_7] = [])).push(specifier);
}
}
break;
- case 235:
+ case 236:
if (node.isExportEquals && !exportEquals) {
exportEquals = node;
}
@@ -9436,7 +7355,7 @@ var ts;
if (node.symbol) {
for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 221 && declaration !== node) {
+ if (declaration.kind === 222 && declaration !== node) {
return true;
}
}
@@ -9454,15 +7373,15 @@ var ts;
}
ts.isNodeArray = isNodeArray;
function isNoSubstitutionTemplateLiteral(node) {
- return node.kind === 11;
+ return node.kind === 12;
}
ts.isNoSubstitutionTemplateLiteral = isNoSubstitutionTemplateLiteral;
function isLiteralKind(kind) {
- return 8 <= kind && kind <= 11;
+ return 8 <= kind && kind <= 12;
}
ts.isLiteralKind = isLiteralKind;
function isTextualLiteralKind(kind) {
- return kind === 9 || kind === 11;
+ return kind === 9 || kind === 12;
}
ts.isTextualLiteralKind = isTextualLiteralKind;
function isLiteralExpression(node) {
@@ -9470,21 +7389,21 @@ var ts;
}
ts.isLiteralExpression = isLiteralExpression;
function isTemplateLiteralKind(kind) {
- return 11 <= kind && kind <= 14;
+ return 12 <= kind && kind <= 15;
}
ts.isTemplateLiteralKind = isTemplateLiteralKind;
function isTemplateHead(node) {
- return node.kind === 12;
+ return node.kind === 13;
}
ts.isTemplateHead = isTemplateHead;
function isTemplateMiddleOrTemplateTail(node) {
var kind = node.kind;
- return kind === 13
- || kind === 14;
+ return kind === 14
+ || kind === 15;
}
ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail;
function isIdentifier(node) {
- return node.kind === 69;
+ return node.kind === 70;
}
ts.isIdentifier = isIdentifier;
function isGeneratedIdentifier(node) {
@@ -9496,87 +7415,87 @@ var ts;
}
ts.isModifier = isModifier;
function isQualifiedName(node) {
- return node.kind === 139;
+ return node.kind === 140;
}
ts.isQualifiedName = isQualifiedName;
function isComputedPropertyName(node) {
- return node.kind === 140;
+ return node.kind === 141;
}
ts.isComputedPropertyName = isComputedPropertyName;
function isEntityName(node) {
var kind = node.kind;
- return kind === 139
- || kind === 69;
+ return kind === 140
+ || kind === 70;
}
ts.isEntityName = isEntityName;
function isPropertyName(node) {
var kind = node.kind;
- return kind === 69
+ return kind === 70
|| kind === 9
|| kind === 8
- || kind === 140;
+ || kind === 141;
}
ts.isPropertyName = isPropertyName;
function isModuleName(node) {
var kind = node.kind;
- return kind === 69
+ return kind === 70
|| kind === 9;
}
ts.isModuleName = isModuleName;
function isBindingName(node) {
var kind = node.kind;
- return kind === 69
- || kind === 167
- || kind === 168;
+ return kind === 70
+ || kind === 168
+ || kind === 169;
}
ts.isBindingName = isBindingName;
function isTypeParameter(node) {
- return node.kind === 141;
+ return node.kind === 142;
}
ts.isTypeParameter = isTypeParameter;
function isParameter(node) {
- return node.kind === 142;
+ return node.kind === 143;
}
ts.isParameter = isParameter;
function isDecorator(node) {
- return node.kind === 143;
+ return node.kind === 144;
}
ts.isDecorator = isDecorator;
function isMethodDeclaration(node) {
- return node.kind === 147;
+ return node.kind === 148;
}
ts.isMethodDeclaration = isMethodDeclaration;
function isClassElement(node) {
var kind = node.kind;
- return kind === 148
- || kind === 145
- || kind === 147
- || kind === 149
+ return kind === 149
+ || kind === 146
+ || kind === 148
|| kind === 150
- || kind === 153
- || kind === 198;
+ || kind === 151
+ || kind === 154
+ || kind === 199;
}
ts.isClassElement = isClassElement;
function isObjectLiteralElementLike(node) {
var kind = node.kind;
return kind === 253
|| kind === 254
- || kind === 147
- || kind === 149
+ || kind === 148
|| kind === 150
- || kind === 239;
+ || kind === 151
+ || kind === 240;
}
ts.isObjectLiteralElementLike = isObjectLiteralElementLike;
function isTypeNodeKind(kind) {
- return (kind >= 154 && kind <= 166)
- || kind === 117
- || kind === 130
- || kind === 120
- || kind === 132
+ return (kind >= 155 && kind <= 167)
+ || kind === 118
+ || kind === 131
+ || kind === 121
|| kind === 133
- || kind === 103
- || kind === 127
- || kind === 194;
+ || kind === 134
+ || kind === 104
+ || kind === 128
+ || kind === 195;
}
function isTypeNode(node) {
return isTypeNodeKind(node.kind);
@@ -9585,94 +7504,94 @@ var ts;
function isBindingPattern(node) {
if (node) {
var kind = node.kind;
- return kind === 168
- || kind === 167;
+ return kind === 169
+ || kind === 168;
}
return false;
}
ts.isBindingPattern = isBindingPattern;
function isBindingElement(node) {
- return node.kind === 169;
+ return node.kind === 170;
}
ts.isBindingElement = isBindingElement;
function isArrayBindingElement(node) {
var kind = node.kind;
- return kind === 169
- || kind === 193;
+ return kind === 170
+ || kind === 194;
}
ts.isArrayBindingElement = isArrayBindingElement;
function isPropertyAccessExpression(node) {
- return node.kind === 172;
+ return node.kind === 173;
}
ts.isPropertyAccessExpression = isPropertyAccessExpression;
function isElementAccessExpression(node) {
- return node.kind === 173;
+ return node.kind === 174;
}
ts.isElementAccessExpression = isElementAccessExpression;
function isBinaryExpression(node) {
- return node.kind === 187;
+ return node.kind === 188;
}
ts.isBinaryExpression = isBinaryExpression;
function isConditionalExpression(node) {
- return node.kind === 188;
+ return node.kind === 189;
}
ts.isConditionalExpression = isConditionalExpression;
function isCallExpression(node) {
- return node.kind === 174;
+ return node.kind === 175;
}
ts.isCallExpression = isCallExpression;
function isTemplateLiteral(node) {
var kind = node.kind;
- return kind === 189
- || kind === 11;
+ return kind === 190
+ || kind === 12;
}
ts.isTemplateLiteral = isTemplateLiteral;
function isSpreadElementExpression(node) {
- return node.kind === 191;
+ return node.kind === 192;
}
ts.isSpreadElementExpression = isSpreadElementExpression;
function isExpressionWithTypeArguments(node) {
- return node.kind === 194;
+ return node.kind === 195;
}
ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments;
function isLeftHandSideExpressionKind(kind) {
- return kind === 172
- || kind === 173
- || kind === 175
+ return kind === 173
|| kind === 174
- || kind === 241
- || kind === 242
|| kind === 176
- || kind === 170
- || kind === 178
+ || kind === 175
+ || kind === 242
+ || kind === 243
+ || kind === 177
|| kind === 171
- || kind === 192
|| kind === 179
- || kind === 69
- || kind === 10
+ || kind === 172
+ || kind === 193
+ || kind === 180
+ || kind === 70
+ || kind === 11
|| kind === 8
|| kind === 9
- || kind === 11
- || kind === 189
- || kind === 84
- || kind === 93
- || kind === 97
- || kind === 99
- || kind === 95
- || kind === 196;
+ || kind === 12
+ || kind === 190
+ || kind === 85
+ || kind === 94
+ || kind === 98
+ || kind === 100
+ || kind === 96
+ || kind === 197;
}
function isLeftHandSideExpression(node) {
return isLeftHandSideExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind);
}
ts.isLeftHandSideExpression = isLeftHandSideExpression;
function isUnaryExpressionKind(kind) {
- return kind === 185
- || kind === 186
- || kind === 181
+ return kind === 186
+ || kind === 187
|| kind === 182
|| kind === 183
|| kind === 184
- || kind === 177
+ || kind === 185
+ || kind === 178
|| isLeftHandSideExpressionKind(kind);
}
function isUnaryExpression(node) {
@@ -9680,13 +7599,13 @@ var ts;
}
ts.isUnaryExpression = isUnaryExpression;
function isExpressionKind(kind) {
- return kind === 188
- || kind === 190
- || kind === 180
- || kind === 187
+ return kind === 189
|| kind === 191
- || kind === 195
- || kind === 193
+ || kind === 181
+ || kind === 188
+ || kind === 192
+ || kind === 196
+ || kind === 194
|| isUnaryExpressionKind(kind);
}
function isExpression(node) {
@@ -9695,8 +7614,8 @@ var ts;
ts.isExpression = isExpression;
function isAssertionExpression(node) {
var kind = node.kind;
- return kind === 177
- || kind === 195;
+ return kind === 178
+ || kind === 196;
}
ts.isAssertionExpression = isAssertionExpression;
function isPartiallyEmittedExpression(node) {
@@ -9713,15 +7632,15 @@ var ts;
}
ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode;
function isOmittedExpression(node) {
- return node.kind === 193;
+ return node.kind === 194;
}
ts.isOmittedExpression = isOmittedExpression;
function isTemplateSpan(node) {
- return node.kind === 197;
+ return node.kind === 198;
}
ts.isTemplateSpan = isTemplateSpan;
function isBlock(node) {
- return node.kind === 199;
+ return node.kind === 200;
}
ts.isBlock = isBlock;
function isConciseBody(node) {
@@ -9739,118 +7658,118 @@ var ts;
}
ts.isForInitializer = isForInitializer;
function isVariableDeclaration(node) {
- return node.kind === 218;
+ return node.kind === 219;
}
ts.isVariableDeclaration = isVariableDeclaration;
function isVariableDeclarationList(node) {
- return node.kind === 219;
+ return node.kind === 220;
}
ts.isVariableDeclarationList = isVariableDeclarationList;
function isCaseBlock(node) {
- return node.kind === 227;
+ return node.kind === 228;
}
ts.isCaseBlock = isCaseBlock;
function isModuleBody(node) {
var kind = node.kind;
- return kind === 226
- || kind === 225;
+ return kind === 227
+ || kind === 226;
}
ts.isModuleBody = isModuleBody;
function isImportEqualsDeclaration(node) {
- return node.kind === 229;
+ return node.kind === 230;
}
ts.isImportEqualsDeclaration = isImportEqualsDeclaration;
function isImportClause(node) {
- return node.kind === 231;
+ return node.kind === 232;
}
ts.isImportClause = isImportClause;
function isNamedImportBindings(node) {
var kind = node.kind;
- return kind === 233
- || kind === 232;
+ return kind === 234
+ || kind === 233;
}
ts.isNamedImportBindings = isNamedImportBindings;
function isImportSpecifier(node) {
- return node.kind === 234;
+ return node.kind === 235;
}
ts.isImportSpecifier = isImportSpecifier;
function isNamedExports(node) {
- return node.kind === 237;
+ return node.kind === 238;
}
ts.isNamedExports = isNamedExports;
function isExportSpecifier(node) {
- return node.kind === 238;
+ return node.kind === 239;
}
ts.isExportSpecifier = isExportSpecifier;
function isModuleOrEnumDeclaration(node) {
- return node.kind === 225 || node.kind === 224;
+ return node.kind === 226 || node.kind === 225;
}
ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration;
function isDeclarationKind(kind) {
- return kind === 180
- || kind === 169
- || kind === 221
- || kind === 192
- || kind === 148
- || kind === 224
- || kind === 255
- || kind === 238
- || kind === 220
- || kind === 179
- || kind === 149
- || kind === 231
- || kind === 229
- || kind === 234
+ return kind === 181
+ || kind === 170
|| kind === 222
- || kind === 147
- || kind === 146
+ || kind === 193
+ || kind === 149
|| kind === 225
- || kind === 228
- || kind === 232
- || kind === 142
- || kind === 253
- || kind === 145
- || kind === 144
+ || kind === 255
+ || kind === 239
+ || kind === 221
+ || kind === 180
|| kind === 150
- || kind === 254
+ || kind === 232
+ || kind === 230
+ || kind === 235
|| kind === 223
- || kind === 141
- || kind === 218
+ || kind === 148
+ || kind === 147
+ || kind === 226
+ || kind === 229
+ || kind === 233
+ || kind === 143
+ || kind === 253
+ || kind === 146
+ || kind === 145
+ || kind === 151
+ || kind === 254
+ || kind === 224
+ || kind === 142
+ || kind === 219
|| kind === 279;
}
function isDeclarationStatementKind(kind) {
- return kind === 220
- || kind === 239
- || kind === 221
+ return kind === 221
+ || kind === 240
|| kind === 222
|| kind === 223
|| kind === 224
|| kind === 225
+ || kind === 226
+ || kind === 231
|| kind === 230
- || kind === 229
+ || kind === 237
|| kind === 236
- || kind === 235
- || kind === 228;
+ || kind === 229;
}
function isStatementKindButNotDeclarationKind(kind) {
- return kind === 210
- || kind === 209
- || kind === 217
- || kind === 204
- || kind === 202
- || kind === 201
- || kind === 207
- || kind === 208
- || kind === 206
- || kind === 203
- || kind === 214
- || kind === 211
- || kind === 213
- || kind === 215
- || kind === 216
- || kind === 200
+ return kind === 211
+ || kind === 210
+ || kind === 218
|| kind === 205
+ || kind === 203
+ || kind === 202
+ || kind === 208
+ || kind === 209
+ || kind === 207
+ || kind === 204
+ || kind === 215
|| kind === 212
+ || kind === 214
+ || kind === 216
+ || kind === 217
+ || kind === 201
+ || kind === 206
+ || kind === 213
|| kind === 287;
}
function isDeclaration(node) {
@@ -9869,18 +7788,18 @@ var ts;
var kind = node.kind;
return isStatementKindButNotDeclarationKind(kind)
|| isDeclarationStatementKind(kind)
- || kind === 199;
+ || kind === 200;
}
ts.isStatement = isStatement;
function isModuleReference(node) {
var kind = node.kind;
- return kind === 240
- || kind === 139
- || kind === 69;
+ return kind === 241
+ || kind === 140
+ || kind === 70;
}
ts.isModuleReference = isModuleReference;
function isJsxOpeningElement(node) {
- return node.kind === 243;
+ return node.kind === 244;
}
ts.isJsxOpeningElement = isJsxOpeningElement;
function isJsxClosingElement(node) {
@@ -9889,17 +7808,17 @@ var ts;
ts.isJsxClosingElement = isJsxClosingElement;
function isJsxTagNameExpression(node) {
var kind = node.kind;
- return kind === 97
- || kind === 69
- || kind === 172;
+ return kind === 98
+ || kind === 70
+ || kind === 173;
}
ts.isJsxTagNameExpression = isJsxTagNameExpression;
function isJsxChild(node) {
var kind = node.kind;
- return kind === 241
+ return kind === 242
|| kind === 248
- || kind === 242
- || kind === 244;
+ || kind === 243
+ || kind === 10;
}
ts.isJsxChild = isJsxChild;
function isJsxAttributeLike(node) {
@@ -9959,7 +7878,16 @@ var ts;
})(ts || (ts = {}));
(function (ts) {
function getDefaultLibFileName(options) {
- return options.target === 2 ? "lib.es6.d.ts" : "lib.d.ts";
+ switch (options.target) {
+ case 4:
+ return "lib.es2017.d.ts";
+ case 3:
+ return "lib.es2016.d.ts";
+ case 2:
+ return "lib.es6.d.ts";
+ default:
+ return "lib.d.ts";
+ }
}
ts.getDefaultLibFileName = getDefaultLibFileName;
function textSpanEnd(span) {
@@ -10078,9 +8006,9 @@ var ts;
}
ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
function getTypeParameterOwner(d) {
- if (d && d.kind === 141) {
+ if (d && d.kind === 142) {
for (var current = d; current; current = current.parent) {
- if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 222) {
+ if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 223) {
return current;
}
}
@@ -10088,11 +8016,11 @@ var ts;
}
ts.getTypeParameterOwner = getTypeParameterOwner;
function isParameterPropertyDeclaration(node) {
- return ts.hasModifier(node, 92) && node.parent.kind === 148 && ts.isClassLike(node.parent.parent);
+ return ts.hasModifier(node, 92) && node.parent.kind === 149 && ts.isClassLike(node.parent.parent);
}
ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration;
function walkUpBindingElementsAndPatterns(node) {
- while (node && (node.kind === 169 || ts.isBindingPattern(node))) {
+ while (node && (node.kind === 170 || ts.isBindingPattern(node))) {
node = node.parent;
}
return node;
@@ -10100,14 +8028,14 @@ var ts;
function getCombinedModifierFlags(node) {
node = walkUpBindingElementsAndPatterns(node);
var flags = ts.getModifierFlags(node);
- if (node.kind === 218) {
+ if (node.kind === 219) {
node = node.parent;
}
- if (node && node.kind === 219) {
+ if (node && node.kind === 220) {
flags |= ts.getModifierFlags(node);
node = node.parent;
}
- if (node && node.kind === 200) {
+ if (node && node.kind === 201) {
flags |= ts.getModifierFlags(node);
}
return flags;
@@ -10116,14 +8044,14 @@ var ts;
function getCombinedNodeFlags(node) {
node = walkUpBindingElementsAndPatterns(node);
var flags = node.flags;
- if (node.kind === 218) {
+ if (node.kind === 219) {
node = node.parent;
}
- if (node && node.kind === 219) {
+ if (node && node.kind === 220) {
flags |= node.flags;
node = node.parent;
}
- if (node && node.kind === 200) {
+ if (node && node.kind === 201) {
flags |= node.flags;
}
return flags;
@@ -10131,6 +8059,1554 @@ var ts;
ts.getCombinedNodeFlags = getCombinedNodeFlags;
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ function tokenIsIdentifierOrKeyword(token) {
+ return token >= 70;
+ }
+ ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword;
+ var textToToken = ts.createMap({
+ "abstract": 116,
+ "any": 118,
+ "as": 117,
+ "boolean": 121,
+ "break": 71,
+ "case": 72,
+ "catch": 73,
+ "class": 74,
+ "continue": 76,
+ "const": 75,
+ "constructor": 122,
+ "debugger": 77,
+ "declare": 123,
+ "default": 78,
+ "delete": 79,
+ "do": 80,
+ "else": 81,
+ "enum": 82,
+ "export": 83,
+ "extends": 84,
+ "false": 85,
+ "finally": 86,
+ "for": 87,
+ "from": 137,
+ "function": 88,
+ "get": 124,
+ "if": 89,
+ "implements": 107,
+ "import": 90,
+ "in": 91,
+ "instanceof": 92,
+ "interface": 108,
+ "is": 125,
+ "let": 109,
+ "module": 126,
+ "namespace": 127,
+ "never": 128,
+ "new": 93,
+ "null": 94,
+ "number": 131,
+ "package": 110,
+ "private": 111,
+ "protected": 112,
+ "public": 113,
+ "readonly": 129,
+ "require": 130,
+ "global": 138,
+ "return": 95,
+ "set": 132,
+ "static": 114,
+ "string": 133,
+ "super": 96,
+ "switch": 97,
+ "symbol": 134,
+ "this": 98,
+ "throw": 99,
+ "true": 100,
+ "try": 101,
+ "type": 135,
+ "typeof": 102,
+ "undefined": 136,
+ "var": 103,
+ "void": 104,
+ "while": 105,
+ "with": 106,
+ "yield": 115,
+ "async": 119,
+ "await": 120,
+ "of": 139,
+ "{": 16,
+ "}": 17,
+ "(": 18,
+ ")": 19,
+ "[": 20,
+ "]": 21,
+ ".": 22,
+ "...": 23,
+ ";": 24,
+ ",": 25,
+ "<": 26,
+ ">": 28,
+ "<=": 29,
+ ">=": 30,
+ "==": 31,
+ "!=": 32,
+ "===": 33,
+ "!==": 34,
+ "=>": 35,
+ "+": 36,
+ "-": 37,
+ "**": 39,
+ "*": 38,
+ "/": 40,
+ "%": 41,
+ "++": 42,
+ "--": 43,
+ "<<": 44,
+ "": 27,
+ ">>": 45,
+ ">>>": 46,
+ "&": 47,
+ "|": 48,
+ "^": 49,
+ "!": 50,
+ "~": 51,
+ "&&": 52,
+ "||": 53,
+ "?": 54,
+ ":": 55,
+ "=": 57,
+ "+=": 58,
+ "-=": 59,
+ "*=": 60,
+ "**=": 61,
+ "/=": 62,
+ "%=": 63,
+ "<<=": 64,
+ ">>=": 65,
+ ">>>=": 66,
+ "&=": 67,
+ "|=": 68,
+ "^=": 69,
+ "@": 56,
+ });
+ var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
+ var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
+ var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
+ var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
+ function lookupInUnicodeMap(code, map) {
+ if (code < map[0]) {
+ return false;
+ }
+ var lo = 0;
+ var hi = map.length;
+ var mid;
+ while (lo + 1 < hi) {
+ mid = lo + (hi - lo) / 2;
+ mid -= mid % 2;
+ if (map[mid] <= code && code <= map[mid + 1]) {
+ return true;
+ }
+ if (code < map[mid]) {
+ hi = mid;
+ }
+ else {
+ lo = mid + 2;
+ }
+ }
+ return false;
+ }
+ function isUnicodeIdentifierStart(code, languageVersion) {
+ return languageVersion >= 1 ?
+ lookupInUnicodeMap(code, unicodeES5IdentifierStart) :
+ lookupInUnicodeMap(code, unicodeES3IdentifierStart);
+ }
+ ts.isUnicodeIdentifierStart = isUnicodeIdentifierStart;
+ function isUnicodeIdentifierPart(code, languageVersion) {
+ return languageVersion >= 1 ?
+ lookupInUnicodeMap(code, unicodeES5IdentifierPart) :
+ lookupInUnicodeMap(code, unicodeES3IdentifierPart);
+ }
+ function makeReverseMap(source) {
+ var result = [];
+ for (var name_8 in source) {
+ result[source[name_8]] = name_8;
+ }
+ return result;
+ }
+ var tokenStrings = makeReverseMap(textToToken);
+ function tokenToString(t) {
+ return tokenStrings[t];
+ }
+ ts.tokenToString = tokenToString;
+ function stringToToken(s) {
+ return textToToken[s];
+ }
+ ts.stringToToken = stringToToken;
+ function computeLineStarts(text) {
+ var result = new Array();
+ var pos = 0;
+ var lineStart = 0;
+ while (pos < text.length) {
+ var ch = text.charCodeAt(pos);
+ pos++;
+ switch (ch) {
+ case 13:
+ if (text.charCodeAt(pos) === 10) {
+ pos++;
+ }
+ case 10:
+ result.push(lineStart);
+ lineStart = pos;
+ break;
+ default:
+ if (ch > 127 && isLineBreak(ch)) {
+ result.push(lineStart);
+ lineStart = pos;
+ }
+ break;
+ }
+ }
+ result.push(lineStart);
+ return result;
+ }
+ ts.computeLineStarts = computeLineStarts;
+ function getPositionOfLineAndCharacter(sourceFile, line, character) {
+ return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character);
+ }
+ ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter;
+ function computePositionOfLineAndCharacter(lineStarts, line, character) {
+ ts.Debug.assert(line >= 0 && line < lineStarts.length);
+ return lineStarts[line] + character;
+ }
+ ts.computePositionOfLineAndCharacter = computePositionOfLineAndCharacter;
+ function getLineStarts(sourceFile) {
+ return sourceFile.lineMap || (sourceFile.lineMap = computeLineStarts(sourceFile.text));
+ }
+ ts.getLineStarts = getLineStarts;
+ function computeLineAndCharacterOfPosition(lineStarts, position) {
+ var lineNumber = ts.binarySearch(lineStarts, position);
+ if (lineNumber < 0) {
+ lineNumber = ~lineNumber - 1;
+ ts.Debug.assert(lineNumber !== -1, "position cannot precede the beginning of the file");
+ }
+ return {
+ line: lineNumber,
+ character: position - lineStarts[lineNumber]
+ };
+ }
+ ts.computeLineAndCharacterOfPosition = computeLineAndCharacterOfPosition;
+ function getLineAndCharacterOfPosition(sourceFile, position) {
+ return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position);
+ }
+ ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition;
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+ function isWhiteSpace(ch) {
+ return isWhiteSpaceSingleLine(ch) || isLineBreak(ch);
+ }
+ ts.isWhiteSpace = isWhiteSpace;
+ function isWhiteSpaceSingleLine(ch) {
+ return ch === 32 ||
+ ch === 9 ||
+ ch === 11 ||
+ ch === 12 ||
+ ch === 160 ||
+ ch === 133 ||
+ ch === 5760 ||
+ ch >= 8192 && ch <= 8203 ||
+ ch === 8239 ||
+ ch === 8287 ||
+ ch === 12288 ||
+ ch === 65279;
+ }
+ ts.isWhiteSpaceSingleLine = isWhiteSpaceSingleLine;
+ function isLineBreak(ch) {
+ return ch === 10 ||
+ ch === 13 ||
+ ch === 8232 ||
+ ch === 8233;
+ }
+ ts.isLineBreak = isLineBreak;
+ function isDigit(ch) {
+ return ch >= 48 && ch <= 57;
+ }
+ function isOctalDigit(ch) {
+ return ch >= 48 && ch <= 55;
+ }
+ ts.isOctalDigit = isOctalDigit;
+ function couldStartTrivia(text, pos) {
+ var ch = text.charCodeAt(pos);
+ switch (ch) {
+ case 13:
+ case 10:
+ case 9:
+ case 11:
+ case 12:
+ case 32:
+ case 47:
+ case 60:
+ case 61:
+ case 62:
+ return true;
+ case 35:
+ return pos === 0;
+ default:
+ return ch > 127;
+ }
+ }
+ ts.couldStartTrivia = couldStartTrivia;
+ function skipTrivia(text, pos, stopAfterLineBreak, stopAtComments) {
+ if (stopAtComments === void 0) { stopAtComments = false; }
+ if (ts.positionIsSynthesized(pos)) {
+ return pos;
+ }
+ while (true) {
+ var ch = text.charCodeAt(pos);
+ switch (ch) {
+ case 13:
+ if (text.charCodeAt(pos + 1) === 10) {
+ pos++;
+ }
+ case 10:
+ pos++;
+ if (stopAfterLineBreak) {
+ return pos;
+ }
+ continue;
+ case 9:
+ case 11:
+ case 12:
+ case 32:
+ pos++;
+ continue;
+ case 47:
+ if (stopAtComments) {
+ break;
+ }
+ if (text.charCodeAt(pos + 1) === 47) {
+ pos += 2;
+ while (pos < text.length) {
+ if (isLineBreak(text.charCodeAt(pos))) {
+ break;
+ }
+ pos++;
+ }
+ continue;
+ }
+ if (text.charCodeAt(pos + 1) === 42) {
+ pos += 2;
+ while (pos < text.length) {
+ if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) {
+ pos += 2;
+ break;
+ }
+ pos++;
+ }
+ continue;
+ }
+ break;
+ case 60:
+ case 61:
+ case 62:
+ if (isConflictMarkerTrivia(text, pos)) {
+ pos = scanConflictMarkerTrivia(text, pos);
+ continue;
+ }
+ break;
+ case 35:
+ if (pos === 0 && isShebangTrivia(text, pos)) {
+ pos = scanShebangTrivia(text, pos);
+ continue;
+ }
+ break;
+ default:
+ if (ch > 127 && (isWhiteSpace(ch))) {
+ pos++;
+ continue;
+ }
+ break;
+ }
+ return pos;
+ }
+ }
+ ts.skipTrivia = skipTrivia;
+ var mergeConflictMarkerLength = "<<<<<<<".length;
+ function isConflictMarkerTrivia(text, pos) {
+ ts.Debug.assert(pos >= 0);
+ if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) {
+ var ch = text.charCodeAt(pos);
+ if ((pos + mergeConflictMarkerLength) < text.length) {
+ for (var i = 0, n = mergeConflictMarkerLength; i < n; i++) {
+ if (text.charCodeAt(pos + i) !== ch) {
+ return false;
+ }
+ }
+ return ch === 61 ||
+ text.charCodeAt(pos + mergeConflictMarkerLength) === 32;
+ }
+ }
+ return false;
+ }
+ function scanConflictMarkerTrivia(text, pos, error) {
+ if (error) {
+ error(ts.Diagnostics.Merge_conflict_marker_encountered, mergeConflictMarkerLength);
+ }
+ var ch = text.charCodeAt(pos);
+ var len = text.length;
+ if (ch === 60 || ch === 62) {
+ while (pos < len && !isLineBreak(text.charCodeAt(pos))) {
+ pos++;
+ }
+ }
+ else {
+ ts.Debug.assert(ch === 61);
+ while (pos < len) {
+ var ch_1 = text.charCodeAt(pos);
+ if (ch_1 === 62 && isConflictMarkerTrivia(text, pos)) {
+ break;
+ }
+ pos++;
+ }
+ }
+ return pos;
+ }
+ var shebangTriviaRegex = /^#!.*/;
+ function isShebangTrivia(text, pos) {
+ ts.Debug.assert(pos === 0);
+ return shebangTriviaRegex.test(text);
+ }
+ function scanShebangTrivia(text, pos) {
+ var shebang = shebangTriviaRegex.exec(text)[0];
+ pos = pos + shebang.length;
+ return pos;
+ }
+ function iterateCommentRanges(reduce, text, pos, trailing, cb, state, initial) {
+ var pendingPos;
+ var pendingEnd;
+ var pendingKind;
+ var pendingHasTrailingNewLine;
+ var hasPendingCommentRange = false;
+ var collecting = trailing || pos === 0;
+ var accumulator = initial;
+ scan: while (pos >= 0 && pos < text.length) {
+ var ch = text.charCodeAt(pos);
+ switch (ch) {
+ case 13:
+ if (text.charCodeAt(pos + 1) === 10) {
+ pos++;
+ }
+ case 10:
+ pos++;
+ if (trailing) {
+ break scan;
+ }
+ collecting = true;
+ if (hasPendingCommentRange) {
+ pendingHasTrailingNewLine = true;
+ }
+ continue;
+ case 9:
+ case 11:
+ case 12:
+ case 32:
+ pos++;
+ continue;
+ case 47:
+ var nextChar = text.charCodeAt(pos + 1);
+ var hasTrailingNewLine = false;
+ if (nextChar === 47 || nextChar === 42) {
+ var kind = nextChar === 47 ? 2 : 3;
+ var startPos = pos;
+ pos += 2;
+ if (nextChar === 47) {
+ while (pos < text.length) {
+ if (isLineBreak(text.charCodeAt(pos))) {
+ hasTrailingNewLine = true;
+ break;
+ }
+ pos++;
+ }
+ }
+ else {
+ while (pos < text.length) {
+ if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) {
+ pos += 2;
+ break;
+ }
+ pos++;
+ }
+ }
+ if (collecting) {
+ if (hasPendingCommentRange) {
+ accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator);
+ if (!reduce && accumulator) {
+ return accumulator;
+ }
+ hasPendingCommentRange = false;
+ }
+ pendingPos = startPos;
+ pendingEnd = pos;
+ pendingKind = kind;
+ pendingHasTrailingNewLine = hasTrailingNewLine;
+ hasPendingCommentRange = true;
+ }
+ continue;
+ }
+ break scan;
+ default:
+ if (ch > 127 && (isWhiteSpace(ch))) {
+ if (hasPendingCommentRange && isLineBreak(ch)) {
+ pendingHasTrailingNewLine = true;
+ }
+ pos++;
+ continue;
+ }
+ break scan;
+ }
+ }
+ if (hasPendingCommentRange) {
+ accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator);
+ }
+ return accumulator;
+ }
+ function forEachLeadingCommentRange(text, pos, cb, state) {
+ return iterateCommentRanges(false, text, pos, false, cb, state);
+ }
+ ts.forEachLeadingCommentRange = forEachLeadingCommentRange;
+ function forEachTrailingCommentRange(text, pos, cb, state) {
+ return iterateCommentRanges(false, text, pos, true, cb, state);
+ }
+ ts.forEachTrailingCommentRange = forEachTrailingCommentRange;
+ function reduceEachLeadingCommentRange(text, pos, cb, state, initial) {
+ return iterateCommentRanges(true, text, pos, false, cb, state, initial);
+ }
+ ts.reduceEachLeadingCommentRange = reduceEachLeadingCommentRange;
+ function reduceEachTrailingCommentRange(text, pos, cb, state, initial) {
+ return iterateCommentRanges(true, text, pos, true, cb, state, initial);
+ }
+ ts.reduceEachTrailingCommentRange = reduceEachTrailingCommentRange;
+ function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments) {
+ if (!comments) {
+ comments = [];
+ }
+ comments.push({ pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine, kind: kind });
+ return comments;
+ }
+ function getLeadingCommentRanges(text, pos) {
+ return reduceEachLeadingCommentRange(text, pos, appendCommentRange, undefined, undefined);
+ }
+ ts.getLeadingCommentRanges = getLeadingCommentRanges;
+ function getTrailingCommentRanges(text, pos) {
+ return reduceEachTrailingCommentRange(text, pos, appendCommentRange, undefined, undefined);
+ }
+ ts.getTrailingCommentRanges = getTrailingCommentRanges;
+ function getShebang(text) {
+ return shebangTriviaRegex.test(text)
+ ? shebangTriviaRegex.exec(text)[0]
+ : undefined;
+ }
+ ts.getShebang = getShebang;
+ function isIdentifierStart(ch, languageVersion) {
+ return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 ||
+ ch === 36 || ch === 95 ||
+ ch > 127 && isUnicodeIdentifierStart(ch, languageVersion);
+ }
+ ts.isIdentifierStart = isIdentifierStart;
+ function isIdentifierPart(ch, languageVersion) {
+ return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 ||
+ ch >= 48 && ch <= 57 || ch === 36 || ch === 95 ||
+ ch > 127 && isUnicodeIdentifierPart(ch, languageVersion);
+ }
+ ts.isIdentifierPart = isIdentifierPart;
+ function isIdentifierText(name, languageVersion) {
+ if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) {
+ return false;
+ }
+ for (var i = 1, n = name.length; i < n; i++) {
+ if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ ts.isIdentifierText = isIdentifierText;
+ function createScanner(languageVersion, skipTrivia, languageVariant, text, onError, start, length) {
+ if (languageVariant === void 0) { languageVariant = 0; }
+ var pos;
+ var end;
+ var startPos;
+ var tokenPos;
+ var token;
+ var tokenValue;
+ var precedingLineBreak;
+ var hasExtendedUnicodeEscape;
+ var tokenIsUnterminated;
+ setText(text, start, length);
+ return {
+ getStartPos: function () { return startPos; },
+ getTextPos: function () { return pos; },
+ getToken: function () { return token; },
+ getTokenPos: function () { return tokenPos; },
+ getTokenText: function () { return text.substring(tokenPos, pos); },
+ getTokenValue: function () { return tokenValue; },
+ hasExtendedUnicodeEscape: function () { return hasExtendedUnicodeEscape; },
+ hasPrecedingLineBreak: function () { return precedingLineBreak; },
+ isIdentifier: function () { return token === 70 || token > 106; },
+ isReservedWord: function () { return token >= 71 && token <= 106; },
+ isUnterminated: function () { return tokenIsUnterminated; },
+ reScanGreaterToken: reScanGreaterToken,
+ reScanSlashToken: reScanSlashToken,
+ reScanTemplateToken: reScanTemplateToken,
+ scanJsxIdentifier: scanJsxIdentifier,
+ scanJsxAttributeValue: scanJsxAttributeValue,
+ reScanJsxToken: reScanJsxToken,
+ scanJsxToken: scanJsxToken,
+ scanJSDocToken: scanJSDocToken,
+ scan: scan,
+ getText: getText,
+ setText: setText,
+ setScriptTarget: setScriptTarget,
+ setLanguageVariant: setLanguageVariant,
+ setOnError: setOnError,
+ setTextPos: setTextPos,
+ tryScan: tryScan,
+ lookAhead: lookAhead,
+ scanRange: scanRange,
+ };
+ function error(message, length) {
+ if (onError) {
+ onError(message, length || 0);
+ }
+ }
+ function scanNumber() {
+ var start = pos;
+ while (isDigit(text.charCodeAt(pos)))
+ pos++;
+ if (text.charCodeAt(pos) === 46) {
+ pos++;
+ while (isDigit(text.charCodeAt(pos)))
+ pos++;
+ }
+ var end = pos;
+ if (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101) {
+ pos++;
+ if (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45)
+ pos++;
+ if (isDigit(text.charCodeAt(pos))) {
+ pos++;
+ while (isDigit(text.charCodeAt(pos)))
+ pos++;
+ end = pos;
+ }
+ else {
+ error(ts.Diagnostics.Digit_expected);
+ }
+ }
+ return "" + +(text.substring(start, end));
+ }
+ function scanOctalDigits() {
+ var start = pos;
+ while (isOctalDigit(text.charCodeAt(pos))) {
+ pos++;
+ }
+ return +(text.substring(start, pos));
+ }
+ function scanExactNumberOfHexDigits(count) {
+ return scanHexDigits(count, false);
+ }
+ function scanMinimumNumberOfHexDigits(count) {
+ return scanHexDigits(count, true);
+ }
+ function scanHexDigits(minCount, scanAsManyAsPossible) {
+ var digits = 0;
+ var value = 0;
+ while (digits < minCount || scanAsManyAsPossible) {
+ var ch = text.charCodeAt(pos);
+ if (ch >= 48 && ch <= 57) {
+ value = value * 16 + ch - 48;
+ }
+ else if (ch >= 65 && ch <= 70) {
+ value = value * 16 + ch - 65 + 10;
+ }
+ else if (ch >= 97 && ch <= 102) {
+ value = value * 16 + ch - 97 + 10;
+ }
+ else {
+ break;
+ }
+ pos++;
+ digits++;
+ }
+ if (digits < minCount) {
+ value = -1;
+ }
+ return value;
+ }
+ function scanString(allowEscapes) {
+ if (allowEscapes === void 0) { allowEscapes = true; }
+ var quote = text.charCodeAt(pos);
+ pos++;
+ var result = "";
+ var start = pos;
+ while (true) {
+ if (pos >= end) {
+ result += text.substring(start, pos);
+ tokenIsUnterminated = true;
+ error(ts.Diagnostics.Unterminated_string_literal);
+ break;
+ }
+ var ch = text.charCodeAt(pos);
+ if (ch === quote) {
+ result += text.substring(start, pos);
+ pos++;
+ break;
+ }
+ if (ch === 92 && allowEscapes) {
+ result += text.substring(start, pos);
+ result += scanEscapeSequence();
+ start = pos;
+ continue;
+ }
+ if (isLineBreak(ch)) {
+ result += text.substring(start, pos);
+ tokenIsUnterminated = true;
+ error(ts.Diagnostics.Unterminated_string_literal);
+ break;
+ }
+ pos++;
+ }
+ return result;
+ }
+ function scanTemplateAndSetTokenValue() {
+ var startedWithBacktick = text.charCodeAt(pos) === 96;
+ pos++;
+ var start = pos;
+ var contents = "";
+ var resultingToken;
+ while (true) {
+ if (pos >= end) {
+ contents += text.substring(start, pos);
+ tokenIsUnterminated = true;
+ error(ts.Diagnostics.Unterminated_template_literal);
+ resultingToken = startedWithBacktick ? 12 : 15;
+ break;
+ }
+ var currChar = text.charCodeAt(pos);
+ if (currChar === 96) {
+ contents += text.substring(start, pos);
+ pos++;
+ resultingToken = startedWithBacktick ? 12 : 15;
+ break;
+ }
+ if (currChar === 36 && pos + 1 < end && text.charCodeAt(pos + 1) === 123) {
+ contents += text.substring(start, pos);
+ pos += 2;
+ resultingToken = startedWithBacktick ? 13 : 14;
+ break;
+ }
+ if (currChar === 92) {
+ contents += text.substring(start, pos);
+ contents += scanEscapeSequence();
+ start = pos;
+ continue;
+ }
+ if (currChar === 13) {
+ contents += text.substring(start, pos);
+ pos++;
+ if (pos < end && text.charCodeAt(pos) === 10) {
+ pos++;
+ }
+ contents += "\n";
+ start = pos;
+ continue;
+ }
+ pos++;
+ }
+ ts.Debug.assert(resultingToken !== undefined);
+ tokenValue = contents;
+ return resultingToken;
+ }
+ function scanEscapeSequence() {
+ pos++;
+ if (pos >= end) {
+ error(ts.Diagnostics.Unexpected_end_of_text);
+ return "";
+ }
+ var ch = text.charCodeAt(pos);
+ pos++;
+ switch (ch) {
+ case 48:
+ return "\0";
+ case 98:
+ return "\b";
+ case 116:
+ return "\t";
+ case 110:
+ return "\n";
+ case 118:
+ return "\v";
+ case 102:
+ return "\f";
+ case 114:
+ return "\r";
+ case 39:
+ return "\'";
+ case 34:
+ return "\"";
+ case 117:
+ if (pos < end && text.charCodeAt(pos) === 123) {
+ hasExtendedUnicodeEscape = true;
+ pos++;
+ return scanExtendedUnicodeEscape();
+ }
+ return scanHexadecimalEscape(4);
+ case 120:
+ return scanHexadecimalEscape(2);
+ case 13:
+ if (pos < end && text.charCodeAt(pos) === 10) {
+ pos++;
+ }
+ case 10:
+ case 8232:
+ case 8233:
+ return "";
+ default:
+ return String.fromCharCode(ch);
+ }
+ }
+ function scanHexadecimalEscape(numDigits) {
+ var escapedValue = scanExactNumberOfHexDigits(numDigits);
+ if (escapedValue >= 0) {
+ return String.fromCharCode(escapedValue);
+ }
+ else {
+ error(ts.Diagnostics.Hexadecimal_digit_expected);
+ return "";
+ }
+ }
+ function scanExtendedUnicodeEscape() {
+ var escapedValue = scanMinimumNumberOfHexDigits(1);
+ var isInvalidExtendedEscape = false;
+ if (escapedValue < 0) {
+ error(ts.Diagnostics.Hexadecimal_digit_expected);
+ isInvalidExtendedEscape = true;
+ }
+ else if (escapedValue > 0x10FFFF) {
+ error(ts.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
+ isInvalidExtendedEscape = true;
+ }
+ if (pos >= end) {
+ error(ts.Diagnostics.Unexpected_end_of_text);
+ isInvalidExtendedEscape = true;
+ }
+ else if (text.charCodeAt(pos) === 125) {
+ pos++;
+ }
+ else {
+ error(ts.Diagnostics.Unterminated_Unicode_escape_sequence);
+ isInvalidExtendedEscape = true;
+ }
+ if (isInvalidExtendedEscape) {
+ return "";
+ }
+ return utf16EncodeAsString(escapedValue);
+ }
+ function utf16EncodeAsString(codePoint) {
+ ts.Debug.assert(0x0 <= codePoint && codePoint <= 0x10FFFF);
+ if (codePoint <= 65535) {
+ return String.fromCharCode(codePoint);
+ }
+ var codeUnit1 = Math.floor((codePoint - 65536) / 1024) + 0xD800;
+ var codeUnit2 = ((codePoint - 65536) % 1024) + 0xDC00;
+ return String.fromCharCode(codeUnit1, codeUnit2);
+ }
+ function peekUnicodeEscape() {
+ if (pos + 5 < end && text.charCodeAt(pos + 1) === 117) {
+ var start_1 = pos;
+ pos += 2;
+ var value = scanExactNumberOfHexDigits(4);
+ pos = start_1;
+ return value;
+ }
+ return -1;
+ }
+ function scanIdentifierParts() {
+ var result = "";
+ var start = pos;
+ while (pos < end) {
+ var ch = text.charCodeAt(pos);
+ if (isIdentifierPart(ch, languageVersion)) {
+ pos++;
+ }
+ else if (ch === 92) {
+ ch = peekUnicodeEscape();
+ if (!(ch >= 0 && isIdentifierPart(ch, languageVersion))) {
+ break;
+ }
+ result += text.substring(start, pos);
+ result += String.fromCharCode(ch);
+ pos += 6;
+ start = pos;
+ }
+ else {
+ break;
+ }
+ }
+ result += text.substring(start, pos);
+ return result;
+ }
+ function getIdentifierToken() {
+ var len = tokenValue.length;
+ if (len >= 2 && len <= 11) {
+ var ch = tokenValue.charCodeAt(0);
+ if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) {
+ return token = textToToken[tokenValue];
+ }
+ }
+ return token = 70;
+ }
+ function scanBinaryOrOctalDigits(base) {
+ ts.Debug.assert(base === 2 || base === 8, "Expected either base 2 or base 8");
+ var value = 0;
+ var numberOfDigits = 0;
+ while (true) {
+ var ch = text.charCodeAt(pos);
+ var valueOfCh = ch - 48;
+ if (!isDigit(ch) || valueOfCh >= base) {
+ break;
+ }
+ value = value * base + valueOfCh;
+ pos++;
+ numberOfDigits++;
+ }
+ if (numberOfDigits === 0) {
+ return -1;
+ }
+ return value;
+ }
+ function scan() {
+ startPos = pos;
+ hasExtendedUnicodeEscape = false;
+ precedingLineBreak = false;
+ tokenIsUnterminated = false;
+ while (true) {
+ tokenPos = pos;
+ if (pos >= end) {
+ return token = 1;
+ }
+ var ch = text.charCodeAt(pos);
+ if (ch === 35 && pos === 0 && isShebangTrivia(text, pos)) {
+ pos = scanShebangTrivia(text, pos);
+ if (skipTrivia) {
+ continue;
+ }
+ else {
+ return token = 6;
+ }
+ }
+ switch (ch) {
+ case 10:
+ case 13:
+ precedingLineBreak = true;
+ if (skipTrivia) {
+ pos++;
+ continue;
+ }
+ else {
+ if (ch === 13 && pos + 1 < end && text.charCodeAt(pos + 1) === 10) {
+ pos += 2;
+ }
+ else {
+ pos++;
+ }
+ return token = 4;
+ }
+ case 9:
+ case 11:
+ case 12:
+ case 32:
+ if (skipTrivia) {
+ pos++;
+ continue;
+ }
+ else {
+ while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) {
+ pos++;
+ }
+ return token = 5;
+ }
+ case 33:
+ if (text.charCodeAt(pos + 1) === 61) {
+ if (text.charCodeAt(pos + 2) === 61) {
+ return pos += 3, token = 34;
+ }
+ return pos += 2, token = 32;
+ }
+ pos++;
+ return token = 50;
+ case 34:
+ case 39:
+ tokenValue = scanString();
+ return token = 9;
+ case 96:
+ return token = scanTemplateAndSetTokenValue();
+ case 37:
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 63;
+ }
+ pos++;
+ return token = 41;
+ case 38:
+ if (text.charCodeAt(pos + 1) === 38) {
+ return pos += 2, token = 52;
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 67;
+ }
+ pos++;
+ return token = 47;
+ case 40:
+ pos++;
+ return token = 18;
+ case 41:
+ pos++;
+ return token = 19;
+ case 42:
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 60;
+ }
+ if (text.charCodeAt(pos + 1) === 42) {
+ if (text.charCodeAt(pos + 2) === 61) {
+ return pos += 3, token = 61;
+ }
+ return pos += 2, token = 39;
+ }
+ pos++;
+ return token = 38;
+ case 43:
+ if (text.charCodeAt(pos + 1) === 43) {
+ return pos += 2, token = 42;
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 58;
+ }
+ pos++;
+ return token = 36;
+ case 44:
+ pos++;
+ return token = 25;
+ case 45:
+ if (text.charCodeAt(pos + 1) === 45) {
+ return pos += 2, token = 43;
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 59;
+ }
+ pos++;
+ return token = 37;
+ case 46:
+ if (isDigit(text.charCodeAt(pos + 1))) {
+ tokenValue = scanNumber();
+ return token = 8;
+ }
+ if (text.charCodeAt(pos + 1) === 46 && text.charCodeAt(pos + 2) === 46) {
+ return pos += 3, token = 23;
+ }
+ pos++;
+ return token = 22;
+ case 47:
+ if (text.charCodeAt(pos + 1) === 47) {
+ pos += 2;
+ while (pos < end) {
+ if (isLineBreak(text.charCodeAt(pos))) {
+ break;
+ }
+ pos++;
+ }
+ if (skipTrivia) {
+ continue;
+ }
+ else {
+ return token = 2;
+ }
+ }
+ if (text.charCodeAt(pos + 1) === 42) {
+ pos += 2;
+ var commentClosed = false;
+ while (pos < end) {
+ var ch_2 = text.charCodeAt(pos);
+ if (ch_2 === 42 && text.charCodeAt(pos + 1) === 47) {
+ pos += 2;
+ commentClosed = true;
+ break;
+ }
+ if (isLineBreak(ch_2)) {
+ precedingLineBreak = true;
+ }
+ pos++;
+ }
+ if (!commentClosed) {
+ error(ts.Diagnostics.Asterisk_Slash_expected);
+ }
+ if (skipTrivia) {
+ continue;
+ }
+ else {
+ tokenIsUnterminated = !commentClosed;
+ return token = 3;
+ }
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 62;
+ }
+ pos++;
+ return token = 40;
+ case 48:
+ if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) {
+ pos += 2;
+ var value = scanMinimumNumberOfHexDigits(1);
+ if (value < 0) {
+ error(ts.Diagnostics.Hexadecimal_digit_expected);
+ value = 0;
+ }
+ tokenValue = "" + value;
+ return token = 8;
+ }
+ else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) {
+ pos += 2;
+ var value = scanBinaryOrOctalDigits(2);
+ if (value < 0) {
+ error(ts.Diagnostics.Binary_digit_expected);
+ value = 0;
+ }
+ tokenValue = "" + value;
+ return token = 8;
+ }
+ else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) {
+ pos += 2;
+ var value = scanBinaryOrOctalDigits(8);
+ if (value < 0) {
+ error(ts.Diagnostics.Octal_digit_expected);
+ value = 0;
+ }
+ tokenValue = "" + value;
+ return token = 8;
+ }
+ if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) {
+ tokenValue = "" + scanOctalDigits();
+ return token = 8;
+ }
+ case 49:
+ case 50:
+ case 51:
+ case 52:
+ case 53:
+ case 54:
+ case 55:
+ case 56:
+ case 57:
+ tokenValue = scanNumber();
+ return token = 8;
+ case 58:
+ pos++;
+ return token = 55;
+ case 59:
+ pos++;
+ return token = 24;
+ case 60:
+ if (isConflictMarkerTrivia(text, pos)) {
+ pos = scanConflictMarkerTrivia(text, pos, error);
+ if (skipTrivia) {
+ continue;
+ }
+ else {
+ return token = 7;
+ }
+ }
+ if (text.charCodeAt(pos + 1) === 60) {
+ if (text.charCodeAt(pos + 2) === 61) {
+ return pos += 3, token = 64;
+ }
+ return pos += 2, token = 44;
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 29;
+ }
+ if (languageVariant === 1 &&
+ text.charCodeAt(pos + 1) === 47 &&
+ text.charCodeAt(pos + 2) !== 42) {
+ return pos += 2, token = 27;
+ }
+ pos++;
+ return token = 26;
+ case 61:
+ if (isConflictMarkerTrivia(text, pos)) {
+ pos = scanConflictMarkerTrivia(text, pos, error);
+ if (skipTrivia) {
+ continue;
+ }
+ else {
+ return token = 7;
+ }
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ if (text.charCodeAt(pos + 2) === 61) {
+ return pos += 3, token = 33;
+ }
+ return pos += 2, token = 31;
+ }
+ if (text.charCodeAt(pos + 1) === 62) {
+ return pos += 2, token = 35;
+ }
+ pos++;
+ return token = 57;
+ case 62:
+ if (isConflictMarkerTrivia(text, pos)) {
+ pos = scanConflictMarkerTrivia(text, pos, error);
+ if (skipTrivia) {
+ continue;
+ }
+ else {
+ return token = 7;
+ }
+ }
+ pos++;
+ return token = 28;
+ case 63:
+ pos++;
+ return token = 54;
+ case 91:
+ pos++;
+ return token = 20;
+ case 93:
+ pos++;
+ return token = 21;
+ case 94:
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 69;
+ }
+ pos++;
+ return token = 49;
+ case 123:
+ pos++;
+ return token = 16;
+ case 124:
+ if (text.charCodeAt(pos + 1) === 124) {
+ return pos += 2, token = 53;
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 68;
+ }
+ pos++;
+ return token = 48;
+ case 125:
+ pos++;
+ return token = 17;
+ case 126:
+ pos++;
+ return token = 51;
+ case 64:
+ pos++;
+ return token = 56;
+ case 92:
+ var cookedChar = peekUnicodeEscape();
+ if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) {
+ pos += 6;
+ tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts();
+ return token = getIdentifierToken();
+ }
+ error(ts.Diagnostics.Invalid_character);
+ pos++;
+ return token = 0;
+ default:
+ if (isIdentifierStart(ch, languageVersion)) {
+ pos++;
+ while (pos < end && isIdentifierPart(ch = text.charCodeAt(pos), languageVersion))
+ pos++;
+ tokenValue = text.substring(tokenPos, pos);
+ if (ch === 92) {
+ tokenValue += scanIdentifierParts();
+ }
+ return token = getIdentifierToken();
+ }
+ else if (isWhiteSpaceSingleLine(ch)) {
+ pos++;
+ continue;
+ }
+ else if (isLineBreak(ch)) {
+ precedingLineBreak = true;
+ pos++;
+ continue;
+ }
+ error(ts.Diagnostics.Invalid_character);
+ pos++;
+ return token = 0;
+ }
+ }
+ }
+ function reScanGreaterToken() {
+ if (token === 28) {
+ if (text.charCodeAt(pos) === 62) {
+ if (text.charCodeAt(pos + 1) === 62) {
+ if (text.charCodeAt(pos + 2) === 61) {
+ return pos += 3, token = 66;
+ }
+ return pos += 2, token = 46;
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 65;
+ }
+ pos++;
+ return token = 45;
+ }
+ if (text.charCodeAt(pos) === 61) {
+ pos++;
+ return token = 30;
+ }
+ }
+ return token;
+ }
+ function reScanSlashToken() {
+ if (token === 40 || token === 62) {
+ var p = tokenPos + 1;
+ var inEscape = false;
+ var inCharacterClass = false;
+ while (true) {
+ if (p >= end) {
+ tokenIsUnterminated = true;
+ error(ts.Diagnostics.Unterminated_regular_expression_literal);
+ break;
+ }
+ var ch = text.charCodeAt(p);
+ if (isLineBreak(ch)) {
+ tokenIsUnterminated = true;
+ error(ts.Diagnostics.Unterminated_regular_expression_literal);
+ break;
+ }
+ if (inEscape) {
+ inEscape = false;
+ }
+ else if (ch === 47 && !inCharacterClass) {
+ p++;
+ break;
+ }
+ else if (ch === 91) {
+ inCharacterClass = true;
+ }
+ else if (ch === 92) {
+ inEscape = true;
+ }
+ else if (ch === 93) {
+ inCharacterClass = false;
+ }
+ p++;
+ }
+ while (p < end && isIdentifierPart(text.charCodeAt(p), languageVersion)) {
+ p++;
+ }
+ pos = p;
+ tokenValue = text.substring(tokenPos, pos);
+ token = 11;
+ }
+ return token;
+ }
+ function reScanTemplateToken() {
+ ts.Debug.assert(token === 17, "'reScanTemplateToken' should only be called on a '}'");
+ pos = tokenPos;
+ return token = scanTemplateAndSetTokenValue();
+ }
+ function reScanJsxToken() {
+ pos = tokenPos = startPos;
+ return token = scanJsxToken();
+ }
+ function scanJsxToken() {
+ startPos = tokenPos = pos;
+ if (pos >= end) {
+ return token = 1;
+ }
+ var char = text.charCodeAt(pos);
+ if (char === 60) {
+ if (text.charCodeAt(pos + 1) === 47) {
+ pos += 2;
+ return token = 27;
+ }
+ pos++;
+ return token = 26;
+ }
+ if (char === 123) {
+ pos++;
+ return token = 16;
+ }
+ while (pos < end) {
+ pos++;
+ char = text.charCodeAt(pos);
+ if ((char === 123) || (char === 60)) {
+ break;
+ }
+ }
+ return token = 10;
+ }
+ function scanJsxIdentifier() {
+ if (tokenIsIdentifierOrKeyword(token)) {
+ var firstCharPosition = pos;
+ while (pos < end) {
+ var ch = text.charCodeAt(pos);
+ if (ch === 45 || ((firstCharPosition === pos) ? isIdentifierStart(ch, languageVersion) : isIdentifierPart(ch, languageVersion))) {
+ pos++;
+ }
+ else {
+ break;
+ }
+ }
+ tokenValue += text.substr(firstCharPosition, pos - firstCharPosition);
+ }
+ return token;
+ }
+ function scanJsxAttributeValue() {
+ startPos = pos;
+ switch (text.charCodeAt(pos)) {
+ case 34:
+ case 39:
+ tokenValue = scanString(false);
+ return token = 9;
+ default:
+ return scan();
+ }
+ }
+ function scanJSDocToken() {
+ if (pos >= end) {
+ return token = 1;
+ }
+ startPos = pos;
+ tokenPos = pos;
+ var ch = text.charCodeAt(pos);
+ switch (ch) {
+ case 9:
+ case 11:
+ case 12:
+ case 32:
+ while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) {
+ pos++;
+ }
+ return token = 5;
+ case 64:
+ pos++;
+ return token = 56;
+ case 10:
+ case 13:
+ pos++;
+ return token = 4;
+ case 42:
+ pos++;
+ return token = 38;
+ case 123:
+ pos++;
+ return token = 16;
+ case 125:
+ pos++;
+ return token = 17;
+ case 91:
+ pos++;
+ return token = 20;
+ case 93:
+ pos++;
+ return token = 21;
+ case 61:
+ pos++;
+ return token = 57;
+ case 44:
+ pos++;
+ return token = 25;
+ }
+ if (isIdentifierStart(ch, 4)) {
+ pos++;
+ while (isIdentifierPart(text.charCodeAt(pos), 4) && pos < end) {
+ pos++;
+ }
+ return token = 70;
+ }
+ else {
+ return pos += 1, token = 0;
+ }
+ }
+ function speculationHelper(callback, isLookahead) {
+ var savePos = pos;
+ var saveStartPos = startPos;
+ var saveTokenPos = tokenPos;
+ var saveToken = token;
+ var saveTokenValue = tokenValue;
+ var savePrecedingLineBreak = precedingLineBreak;
+ var result = callback();
+ if (!result || isLookahead) {
+ pos = savePos;
+ startPos = saveStartPos;
+ tokenPos = saveTokenPos;
+ token = saveToken;
+ tokenValue = saveTokenValue;
+ precedingLineBreak = savePrecedingLineBreak;
+ }
+ return result;
+ }
+ function scanRange(start, length, callback) {
+ var saveEnd = end;
+ var savePos = pos;
+ var saveStartPos = startPos;
+ var saveTokenPos = tokenPos;
+ var saveToken = token;
+ var savePrecedingLineBreak = precedingLineBreak;
+ var saveTokenValue = tokenValue;
+ var saveHasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
+ var saveTokenIsUnterminated = tokenIsUnterminated;
+ setText(text, start, length);
+ var result = callback();
+ end = saveEnd;
+ pos = savePos;
+ startPos = saveStartPos;
+ tokenPos = saveTokenPos;
+ token = saveToken;
+ precedingLineBreak = savePrecedingLineBreak;
+ tokenValue = saveTokenValue;
+ hasExtendedUnicodeEscape = saveHasExtendedUnicodeEscape;
+ tokenIsUnterminated = saveTokenIsUnterminated;
+ return result;
+ }
+ function lookAhead(callback) {
+ return speculationHelper(callback, true);
+ }
+ function tryScan(callback) {
+ return speculationHelper(callback, false);
+ }
+ function getText() {
+ return text;
+ }
+ function setText(newText, start, length) {
+ text = newText || "";
+ end = length === undefined ? text.length : start + length;
+ setTextPos(start || 0);
+ }
+ function setOnError(errorCallback) {
+ onError = errorCallback;
+ }
+ function setScriptTarget(scriptTarget) {
+ languageVersion = scriptTarget;
+ }
+ function setLanguageVariant(variant) {
+ languageVariant = variant;
+ }
+ function setTextPos(textPos) {
+ ts.Debug.assert(textPos >= 0);
+ pos = textPos;
+ startPos = textPos;
+ tokenPos = textPos;
+ token = 0;
+ precedingLineBreak = false;
+ tokenValue = undefined;
+ hasExtendedUnicodeEscape = false;
+ tokenIsUnterminated = false;
+ }
+ }
+ ts.createScanner = createScanner;
+})(ts || (ts = {}));
+var ts;
(function (ts) {
var NodeConstructor;
var SourceFileConstructor;
@@ -10216,7 +9692,7 @@ var ts;
return node;
}
else if (typeof value === "boolean") {
- return createNode(value ? 99 : 84, location, undefined);
+ return createNode(value ? 100 : 85, location, undefined);
}
else if (typeof value === "string") {
var node = createNode(9, location, undefined);
@@ -10233,7 +9709,7 @@ var ts;
ts.createLiteral = createLiteral;
var nextAutoGenerateId = 0;
function createIdentifier(text, location) {
- var node = createNode(69, location);
+ var node = createNode(70, location);
node.text = ts.escapeIdentifier(text);
node.originalKeywordKind = ts.stringToToken(text);
node.autoGenerateKind = 0;
@@ -10242,7 +9718,7 @@ var ts;
}
ts.createIdentifier = createIdentifier;
function createTempVariable(recordTempVariable, location) {
- var name = createNode(69, location);
+ var name = createNode(70, location);
name.text = "";
name.originalKeywordKind = 0;
name.autoGenerateKind = 1;
@@ -10255,7 +9731,7 @@ var ts;
}
ts.createTempVariable = createTempVariable;
function createLoopVariable(location) {
- var name = createNode(69, location);
+ var name = createNode(70, location);
name.text = "";
name.originalKeywordKind = 0;
name.autoGenerateKind = 2;
@@ -10265,7 +9741,7 @@ var ts;
}
ts.createLoopVariable = createLoopVariable;
function createUniqueName(text, location) {
- var name = createNode(69, location);
+ var name = createNode(70, location);
name.text = text;
name.originalKeywordKind = 0;
name.autoGenerateKind = 3;
@@ -10275,7 +9751,7 @@ var ts;
}
ts.createUniqueName = createUniqueName;
function getGeneratedNameForNode(node, location) {
- var name = createNode(69, location);
+ var name = createNode(70, location);
name.original = node;
name.text = "";
name.originalKeywordKind = 0;
@@ -10290,22 +9766,22 @@ var ts;
}
ts.createToken = createToken;
function createSuper() {
- var node = createNode(95);
+ var node = createNode(96);
return node;
}
ts.createSuper = createSuper;
function createThis(location) {
- var node = createNode(97, location);
+ var node = createNode(98, location);
return node;
}
ts.createThis = createThis;
function createNull() {
- var node = createNode(93);
+ var node = createNode(94);
return node;
}
ts.createNull = createNull;
function createComputedPropertyName(expression, location) {
- var node = createNode(140, location);
+ var node = createNode(141, location);
node.expression = expression;
return node;
}
@@ -10322,7 +9798,7 @@ var ts;
}
ts.createParameter = createParameter;
function createParameterDeclaration(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer, location, flags) {
- var node = createNode(142, location, flags);
+ var node = createNode(143, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.dotDotDotToken = dotDotDotToken;
@@ -10341,7 +9817,7 @@ var ts;
}
ts.updateParameterDeclaration = updateParameterDeclaration;
function createProperty(decorators, modifiers, name, questionToken, type, initializer, location) {
- var node = createNode(145, location);
+ var node = createNode(146, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -10359,7 +9835,7 @@ var ts;
}
ts.updateProperty = updateProperty;
function createMethod(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
- var node = createNode(147, location, flags);
+ var node = createNode(148, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.asteriskToken = asteriskToken;
@@ -10379,7 +9855,7 @@ var ts;
}
ts.updateMethod = updateMethod;
function createConstructor(decorators, modifiers, parameters, body, location, flags) {
- var node = createNode(148, location, flags);
+ var node = createNode(149, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.typeParameters = undefined;
@@ -10397,7 +9873,7 @@ var ts;
}
ts.updateConstructor = updateConstructor;
function createGetAccessor(decorators, modifiers, name, parameters, type, body, location, flags) {
- var node = createNode(149, location, flags);
+ var node = createNode(150, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -10416,7 +9892,7 @@ var ts;
}
ts.updateGetAccessor = updateGetAccessor;
function createSetAccessor(decorators, modifiers, name, parameters, body, location, flags) {
- var node = createNode(150, location, flags);
+ var node = createNode(151, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -10434,7 +9910,7 @@ var ts;
}
ts.updateSetAccessor = updateSetAccessor;
function createObjectBindingPattern(elements, location) {
- var node = createNode(167, location);
+ var node = createNode(168, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -10447,7 +9923,7 @@ var ts;
}
ts.updateObjectBindingPattern = updateObjectBindingPattern;
function createArrayBindingPattern(elements, location) {
- var node = createNode(168, location);
+ var node = createNode(169, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -10460,7 +9936,7 @@ var ts;
}
ts.updateArrayBindingPattern = updateArrayBindingPattern;
function createBindingElement(propertyName, dotDotDotToken, name, initializer, location) {
- var node = createNode(169, location);
+ var node = createNode(170, location);
node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName;
node.dotDotDotToken = dotDotDotToken;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -10476,7 +9952,7 @@ var ts;
}
ts.updateBindingElement = updateBindingElement;
function createArrayLiteral(elements, location, multiLine) {
- var node = createNode(170, location);
+ var node = createNode(171, location);
node.elements = parenthesizeListElements(createNodeArray(elements));
if (multiLine) {
node.multiLine = true;
@@ -10492,7 +9968,7 @@ var ts;
}
ts.updateArrayLiteral = updateArrayLiteral;
function createObjectLiteral(properties, location, multiLine) {
- var node = createNode(171, location);
+ var node = createNode(172, location);
node.properties = createNodeArray(properties);
if (multiLine) {
node.multiLine = true;
@@ -10508,7 +9984,7 @@ var ts;
}
ts.updateObjectLiteral = updateObjectLiteral;
function createPropertyAccess(expression, name, location, flags) {
- var node = createNode(172, location, flags);
+ var node = createNode(173, location, flags);
node.expression = parenthesizeForAccess(expression);
(node.emitNode || (node.emitNode = {})).flags |= 1048576;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -10525,7 +10001,7 @@ var ts;
}
ts.updatePropertyAccess = updatePropertyAccess;
function createElementAccess(expression, index, location) {
- var node = createNode(173, location);
+ var node = createNode(174, location);
node.expression = parenthesizeForAccess(expression);
node.argumentExpression = typeof index === "number" ? createLiteral(index) : index;
return node;
@@ -10539,7 +10015,7 @@ var ts;
}
ts.updateElementAccess = updateElementAccess;
function createCall(expression, typeArguments, argumentsArray, location, flags) {
- var node = createNode(174, location, flags);
+ var node = createNode(175, location, flags);
node.expression = parenthesizeForAccess(expression);
if (typeArguments) {
node.typeArguments = createNodeArray(typeArguments);
@@ -10556,7 +10032,7 @@ var ts;
}
ts.updateCall = updateCall;
function createNew(expression, typeArguments, argumentsArray, location, flags) {
- var node = createNode(175, location, flags);
+ var node = createNode(176, location, flags);
node.expression = parenthesizeForNew(expression);
node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined;
node.arguments = argumentsArray ? parenthesizeListElements(createNodeArray(argumentsArray)) : undefined;
@@ -10571,7 +10047,7 @@ var ts;
}
ts.updateNew = updateNew;
function createTaggedTemplate(tag, template, location) {
- var node = createNode(176, location);
+ var node = createNode(177, location);
node.tag = parenthesizeForAccess(tag);
node.template = template;
return node;
@@ -10585,7 +10061,7 @@ var ts;
}
ts.updateTaggedTemplate = updateTaggedTemplate;
function createParen(expression, location) {
- var node = createNode(178, location);
+ var node = createNode(179, location);
node.expression = expression;
return node;
}
@@ -10597,9 +10073,9 @@ var ts;
return node;
}
ts.updateParen = updateParen;
- function createFunctionExpression(asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
- var node = createNode(179, location, flags);
- node.modifiers = undefined;
+ function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
+ var node = createNode(180, location, flags);
+ node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.asteriskToken = asteriskToken;
node.name = typeof name === "string" ? createIdentifier(name) : name;
node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined;
@@ -10609,20 +10085,20 @@ var ts;
return node;
}
ts.createFunctionExpression = createFunctionExpression;
- function updateFunctionExpression(node, name, typeParameters, parameters, type, body) {
- if (node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) {
- return updateNode(createFunctionExpression(node.asteriskToken, name, typeParameters, parameters, type, body, node, node.flags), node);
+ function updateFunctionExpression(node, modifiers, name, typeParameters, parameters, type, body) {
+ if (node.name !== name || node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) {
+ return updateNode(createFunctionExpression(modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, node, node.flags), node);
}
return node;
}
ts.updateFunctionExpression = updateFunctionExpression;
function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body, location, flags) {
- var node = createNode(180, location, flags);
+ var node = createNode(181, location, flags);
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined;
node.parameters = createNodeArray(parameters);
node.type = type;
- node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(34);
+ node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(35);
node.body = parenthesizeConciseBody(body);
return node;
}
@@ -10635,7 +10111,7 @@ var ts;
}
ts.updateArrowFunction = updateArrowFunction;
function createDelete(expression, location) {
- var node = createNode(181, location);
+ var node = createNode(182, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -10648,7 +10124,7 @@ var ts;
}
ts.updateDelete = updateDelete;
function createTypeOf(expression, location) {
- var node = createNode(182, location);
+ var node = createNode(183, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -10661,7 +10137,7 @@ var ts;
}
ts.updateTypeOf = updateTypeOf;
function createVoid(expression, location) {
- var node = createNode(183, location);
+ var node = createNode(184, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -10674,7 +10150,7 @@ var ts;
}
ts.updateVoid = updateVoid;
function createAwait(expression, location) {
- var node = createNode(184, location);
+ var node = createNode(185, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -10687,7 +10163,7 @@ var ts;
}
ts.updateAwait = updateAwait;
function createPrefix(operator, operand, location) {
- var node = createNode(185, location);
+ var node = createNode(186, location);
node.operator = operator;
node.operand = parenthesizePrefixOperand(operand);
return node;
@@ -10701,7 +10177,7 @@ var ts;
}
ts.updatePrefix = updatePrefix;
function createPostfix(operand, operator, location) {
- var node = createNode(186, location);
+ var node = createNode(187, location);
node.operand = parenthesizePostfixOperand(operand);
node.operator = operator;
return node;
@@ -10717,7 +10193,7 @@ var ts;
function createBinary(left, operator, right, location) {
var operatorToken = typeof operator === "number" ? createToken(operator) : operator;
var operatorKind = operatorToken.kind;
- var node = createNode(187, location);
+ var node = createNode(188, location);
node.left = parenthesizeBinaryOperand(operatorKind, left, true, undefined);
node.operatorToken = operatorToken;
node.right = parenthesizeBinaryOperand(operatorKind, right, false, node.left);
@@ -10732,7 +10208,7 @@ var ts;
}
ts.updateBinary = updateBinary;
function createConditional(condition, questionToken, whenTrue, colonToken, whenFalse, location) {
- var node = createNode(188, location);
+ var node = createNode(189, location);
node.condition = condition;
node.questionToken = questionToken;
node.whenTrue = whenTrue;
@@ -10749,7 +10225,7 @@ var ts;
}
ts.updateConditional = updateConditional;
function createTemplateExpression(head, templateSpans, location) {
- var node = createNode(189, location);
+ var node = createNode(190, location);
node.head = head;
node.templateSpans = createNodeArray(templateSpans);
return node;
@@ -10763,7 +10239,7 @@ var ts;
}
ts.updateTemplateExpression = updateTemplateExpression;
function createYield(asteriskToken, expression, location) {
- var node = createNode(190, location);
+ var node = createNode(191, location);
node.asteriskToken = asteriskToken;
node.expression = expression;
return node;
@@ -10777,7 +10253,7 @@ var ts;
}
ts.updateYield = updateYield;
function createSpread(expression, location) {
- var node = createNode(191, location);
+ var node = createNode(192, location);
node.expression = parenthesizeExpressionForList(expression);
return node;
}
@@ -10790,7 +10266,7 @@ var ts;
}
ts.updateSpread = updateSpread;
function createClassExpression(modifiers, name, typeParameters, heritageClauses, members, location) {
- var node = createNode(192, location);
+ var node = createNode(193, location);
node.decorators = undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = name;
@@ -10808,12 +10284,12 @@ var ts;
}
ts.updateClassExpression = updateClassExpression;
function createOmittedExpression(location) {
- var node = createNode(193, location);
+ var node = createNode(194, location);
return node;
}
ts.createOmittedExpression = createOmittedExpression;
function createExpressionWithTypeArguments(typeArguments, expression, location) {
- var node = createNode(194, location);
+ var node = createNode(195, location);
node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined;
node.expression = parenthesizeForAccess(expression);
return node;
@@ -10827,7 +10303,7 @@ var ts;
}
ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments;
function createTemplateSpan(expression, literal, location) {
- var node = createNode(197, location);
+ var node = createNode(198, location);
node.expression = expression;
node.literal = literal;
return node;
@@ -10841,7 +10317,7 @@ var ts;
}
ts.updateTemplateSpan = updateTemplateSpan;
function createBlock(statements, location, multiLine, flags) {
- var block = createNode(199, location, flags);
+ var block = createNode(200, location, flags);
block.statements = createNodeArray(statements);
if (multiLine) {
block.multiLine = true;
@@ -10857,7 +10333,7 @@ var ts;
}
ts.updateBlock = updateBlock;
function createVariableStatement(modifiers, declarationList, location, flags) {
- var node = createNode(200, location, flags);
+ var node = createNode(201, location, flags);
node.decorators = undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
@@ -10872,7 +10348,7 @@ var ts;
}
ts.updateVariableStatement = updateVariableStatement;
function createVariableDeclarationList(declarations, location, flags) {
- var node = createNode(219, location, flags);
+ var node = createNode(220, location, flags);
node.declarations = createNodeArray(declarations);
return node;
}
@@ -10885,7 +10361,7 @@ var ts;
}
ts.updateVariableDeclarationList = updateVariableDeclarationList;
function createVariableDeclaration(name, type, initializer, location, flags) {
- var node = createNode(218, location, flags);
+ var node = createNode(219, location, flags);
node.name = typeof name === "string" ? createIdentifier(name) : name;
node.type = type;
node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined;
@@ -10900,11 +10376,11 @@ var ts;
}
ts.updateVariableDeclaration = updateVariableDeclaration;
function createEmptyStatement(location) {
- return createNode(201, location);
+ return createNode(202, location);
}
ts.createEmptyStatement = createEmptyStatement;
function createStatement(expression, location, flags) {
- var node = createNode(202, location, flags);
+ var node = createNode(203, location, flags);
node.expression = parenthesizeExpressionForExpressionStatement(expression);
return node;
}
@@ -10917,7 +10393,7 @@ var ts;
}
ts.updateStatement = updateStatement;
function createIf(expression, thenStatement, elseStatement, location) {
- var node = createNode(203, location);
+ var node = createNode(204, location);
node.expression = expression;
node.thenStatement = thenStatement;
node.elseStatement = elseStatement;
@@ -10932,7 +10408,7 @@ var ts;
}
ts.updateIf = updateIf;
function createDo(statement, expression, location) {
- var node = createNode(204, location);
+ var node = createNode(205, location);
node.statement = statement;
node.expression = expression;
return node;
@@ -10946,7 +10422,7 @@ var ts;
}
ts.updateDo = updateDo;
function createWhile(expression, statement, location) {
- var node = createNode(205, location);
+ var node = createNode(206, location);
node.expression = expression;
node.statement = statement;
return node;
@@ -10960,7 +10436,7 @@ var ts;
}
ts.updateWhile = updateWhile;
function createFor(initializer, condition, incrementor, statement, location) {
- var node = createNode(206, location, undefined);
+ var node = createNode(207, location, undefined);
node.initializer = initializer;
node.condition = condition;
node.incrementor = incrementor;
@@ -10976,7 +10452,7 @@ var ts;
}
ts.updateFor = updateFor;
function createForIn(initializer, expression, statement, location) {
- var node = createNode(207, location);
+ var node = createNode(208, location);
node.initializer = initializer;
node.expression = expression;
node.statement = statement;
@@ -10991,7 +10467,7 @@ var ts;
}
ts.updateForIn = updateForIn;
function createForOf(initializer, expression, statement, location) {
- var node = createNode(208, location);
+ var node = createNode(209, location);
node.initializer = initializer;
node.expression = expression;
node.statement = statement;
@@ -11006,7 +10482,7 @@ var ts;
}
ts.updateForOf = updateForOf;
function createContinue(label, location) {
- var node = createNode(209, location);
+ var node = createNode(210, location);
if (label) {
node.label = label;
}
@@ -11021,7 +10497,7 @@ var ts;
}
ts.updateContinue = updateContinue;
function createBreak(label, location) {
- var node = createNode(210, location);
+ var node = createNode(211, location);
if (label) {
node.label = label;
}
@@ -11036,7 +10512,7 @@ var ts;
}
ts.updateBreak = updateBreak;
function createReturn(expression, location) {
- var node = createNode(211, location);
+ var node = createNode(212, location);
node.expression = expression;
return node;
}
@@ -11049,7 +10525,7 @@ var ts;
}
ts.updateReturn = updateReturn;
function createWith(expression, statement, location) {
- var node = createNode(212, location);
+ var node = createNode(213, location);
node.expression = expression;
node.statement = statement;
return node;
@@ -11063,7 +10539,7 @@ var ts;
}
ts.updateWith = updateWith;
function createSwitch(expression, caseBlock, location) {
- var node = createNode(213, location);
+ var node = createNode(214, location);
node.expression = parenthesizeExpressionForList(expression);
node.caseBlock = caseBlock;
return node;
@@ -11077,7 +10553,7 @@ var ts;
}
ts.updateSwitch = updateSwitch;
function createLabel(label, statement, location) {
- var node = createNode(214, location);
+ var node = createNode(215, location);
node.label = typeof label === "string" ? createIdentifier(label) : label;
node.statement = statement;
return node;
@@ -11091,7 +10567,7 @@ var ts;
}
ts.updateLabel = updateLabel;
function createThrow(expression, location) {
- var node = createNode(215, location);
+ var node = createNode(216, location);
node.expression = expression;
return node;
}
@@ -11104,7 +10580,7 @@ var ts;
}
ts.updateThrow = updateThrow;
function createTry(tryBlock, catchClause, finallyBlock, location) {
- var node = createNode(216, location);
+ var node = createNode(217, location);
node.tryBlock = tryBlock;
node.catchClause = catchClause;
node.finallyBlock = finallyBlock;
@@ -11119,7 +10595,7 @@ var ts;
}
ts.updateTry = updateTry;
function createCaseBlock(clauses, location) {
- var node = createNode(227, location);
+ var node = createNode(228, location);
node.clauses = createNodeArray(clauses);
return node;
}
@@ -11132,7 +10608,7 @@ var ts;
}
ts.updateCaseBlock = updateCaseBlock;
function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
- var node = createNode(220, location, flags);
+ var node = createNode(221, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.asteriskToken = asteriskToken;
@@ -11152,7 +10628,7 @@ var ts;
}
ts.updateFunctionDeclaration = updateFunctionDeclaration;
function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, location) {
- var node = createNode(221, location);
+ var node = createNode(222, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = name;
@@ -11170,7 +10646,7 @@ var ts;
}
ts.updateClassDeclaration = updateClassDeclaration;
function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, location) {
- var node = createNode(230, location);
+ var node = createNode(231, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.importClause = importClause;
@@ -11186,7 +10662,7 @@ var ts;
}
ts.updateImportDeclaration = updateImportDeclaration;
function createImportClause(name, namedBindings, location) {
- var node = createNode(231, location);
+ var node = createNode(232, location);
node.name = name;
node.namedBindings = namedBindings;
return node;
@@ -11200,7 +10676,7 @@ var ts;
}
ts.updateImportClause = updateImportClause;
function createNamespaceImport(name, location) {
- var node = createNode(232, location);
+ var node = createNode(233, location);
node.name = name;
return node;
}
@@ -11213,7 +10689,7 @@ var ts;
}
ts.updateNamespaceImport = updateNamespaceImport;
function createNamedImports(elements, location) {
- var node = createNode(233, location);
+ var node = createNode(234, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -11226,7 +10702,7 @@ var ts;
}
ts.updateNamedImports = updateNamedImports;
function createImportSpecifier(propertyName, name, location) {
- var node = createNode(234, location);
+ var node = createNode(235, location);
node.propertyName = propertyName;
node.name = name;
return node;
@@ -11240,7 +10716,7 @@ var ts;
}
ts.updateImportSpecifier = updateImportSpecifier;
function createExportAssignment(decorators, modifiers, isExportEquals, expression, location) {
- var node = createNode(235, location);
+ var node = createNode(236, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.isExportEquals = isExportEquals;
@@ -11256,7 +10732,7 @@ var ts;
}
ts.updateExportAssignment = updateExportAssignment;
function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, location) {
- var node = createNode(236, location);
+ var node = createNode(237, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.exportClause = exportClause;
@@ -11272,7 +10748,7 @@ var ts;
}
ts.updateExportDeclaration = updateExportDeclaration;
function createNamedExports(elements, location) {
- var node = createNode(237, location);
+ var node = createNode(238, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -11285,7 +10761,7 @@ var ts;
}
ts.updateNamedExports = updateNamedExports;
function createExportSpecifier(name, propertyName, location) {
- var node = createNode(238, location);
+ var node = createNode(239, location);
node.name = typeof name === "string" ? createIdentifier(name) : name;
node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName;
return node;
@@ -11299,7 +10775,7 @@ var ts;
}
ts.updateExportSpecifier = updateExportSpecifier;
function createJsxElement(openingElement, children, closingElement, location) {
- var node = createNode(241, location);
+ var node = createNode(242, location);
node.openingElement = openingElement;
node.children = createNodeArray(children);
node.closingElement = closingElement;
@@ -11314,7 +10790,7 @@ var ts;
}
ts.updateJsxElement = updateJsxElement;
function createJsxSelfClosingElement(tagName, attributes, location) {
- var node = createNode(242, location);
+ var node = createNode(243, location);
node.tagName = tagName;
node.attributes = createNodeArray(attributes);
return node;
@@ -11328,7 +10804,7 @@ var ts;
}
ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement;
function createJsxOpeningElement(tagName, attributes, location) {
- var node = createNode(243, location);
+ var node = createNode(244, location);
node.tagName = tagName;
node.attributes = createNodeArray(attributes);
return node;
@@ -11562,47 +11038,47 @@ var ts;
}
ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression;
function createComma(left, right) {
- return createBinary(left, 24, right);
+ return createBinary(left, 25, right);
}
ts.createComma = createComma;
function createLessThan(left, right, location) {
- return createBinary(left, 25, right, location);
+ return createBinary(left, 26, right, location);
}
ts.createLessThan = createLessThan;
function createAssignment(left, right, location) {
- return createBinary(left, 56, right, location);
+ return createBinary(left, 57, right, location);
}
ts.createAssignment = createAssignment;
function createStrictEquality(left, right) {
- return createBinary(left, 32, right);
+ return createBinary(left, 33, right);
}
ts.createStrictEquality = createStrictEquality;
function createStrictInequality(left, right) {
- return createBinary(left, 33, right);
+ return createBinary(left, 34, right);
}
ts.createStrictInequality = createStrictInequality;
function createAdd(left, right) {
- return createBinary(left, 35, right);
+ return createBinary(left, 36, right);
}
ts.createAdd = createAdd;
function createSubtract(left, right) {
- return createBinary(left, 36, right);
+ return createBinary(left, 37, right);
}
ts.createSubtract = createSubtract;
function createPostfixIncrement(operand, location) {
- return createPostfix(operand, 41, location);
+ return createPostfix(operand, 42, location);
}
ts.createPostfixIncrement = createPostfixIncrement;
function createLogicalAnd(left, right) {
- return createBinary(left, 51, right);
+ return createBinary(left, 52, right);
}
ts.createLogicalAnd = createLogicalAnd;
function createLogicalOr(left, right) {
- return createBinary(left, 52, right);
+ return createBinary(left, 53, right);
}
ts.createLogicalOr = createLogicalOr;
function createLogicalNot(operand) {
- return createPrefix(49, operand);
+ return createPrefix(50, operand);
}
ts.createLogicalNot = createLogicalNot;
function createVoidZero() {
@@ -11621,7 +11097,7 @@ var ts;
}
ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName;
function createRestParameter(name) {
- return createParameterDeclaration(undefined, undefined, createToken(22), name, undefined, undefined, undefined);
+ return createParameterDeclaration(undefined, undefined, createToken(23), name, undefined, undefined, undefined);
}
ts.createRestParameter = createRestParameter;
function createFunctionCall(func, thisArg, argumentsList, location) {
@@ -11735,7 +11211,7 @@ var ts;
}
ts.createDecorateHelper = createDecorateHelper;
function createAwaiterHelper(externalHelpersModuleName, hasLexicalArguments, promiseConstructor, body) {
- var generatorFunc = createFunctionExpression(createToken(37), undefined, undefined, [], undefined, body);
+ var generatorFunc = createFunctionExpression(undefined, createToken(38), undefined, undefined, [], undefined, body);
(generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 2097152;
return createCall(createHelperName(externalHelpersModuleName, "__awaiter"), undefined, [
createThis(),
@@ -11779,7 +11255,7 @@ var ts;
setter
]))))));
return createVariableStatement(undefined, createConstDeclarationList([
- createVariableDeclaration("_super", undefined, createCall(createParen(createFunctionExpression(undefined, undefined, undefined, [
+ createVariableDeclaration("_super", undefined, createCall(createParen(createFunctionExpression(undefined, undefined, undefined, undefined, [
createParameter("geti"),
createParameter("seti")
], undefined, createBlock([
@@ -11801,19 +11277,19 @@ var ts;
function shouldBeCapturedInTempVariable(node, cacheIdentifiers) {
var target = skipParentheses(node);
switch (target.kind) {
- case 69:
+ case 70:
return cacheIdentifiers;
- case 97:
+ case 98:
case 8:
case 9:
return false;
- case 170:
+ case 171:
var elements = target.elements;
if (elements.length === 0) {
return false;
}
return true;
- case 171:
+ case 172:
return target.properties.length > 0;
default:
return true;
@@ -11827,13 +11303,13 @@ var ts;
thisArg = createThis();
target = callee;
}
- else if (callee.kind === 95) {
+ else if (callee.kind === 96) {
thisArg = createThis();
target = languageVersion < 2 ? createIdentifier("_super", callee) : callee;
}
else {
switch (callee.kind) {
- case 172: {
+ case 173: {
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
thisArg = createTempVariable(recordTempVariable);
target = createPropertyAccess(createAssignment(thisArg, callee.expression, callee.expression), callee.name, callee);
@@ -11844,7 +11320,7 @@ var ts;
}
break;
}
- case 173: {
+ case 174: {
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
thisArg = createTempVariable(recordTempVariable);
target = createElementAccess(createAssignment(thisArg, callee.expression, callee.expression), callee.argumentExpression, callee);
@@ -11894,14 +11370,14 @@ var ts;
ts.createExpressionForPropertyName = createExpressionForPropertyName;
function createExpressionForObjectLiteralElementLike(node, property, receiver) {
switch (property.kind) {
- case 149:
case 150:
+ case 151:
return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine);
case 253:
return createExpressionForPropertyAssignment(property, receiver);
case 254:
return createExpressionForShorthandPropertyAssignment(property, receiver);
- case 147:
+ case 148:
return createExpressionForMethodDeclaration(property, receiver);
}
}
@@ -11911,13 +11387,13 @@ var ts;
if (property === firstAccessor) {
var properties_1 = [];
if (getAccessor) {
- var getterFunction = createFunctionExpression(undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body, getAccessor);
+ var getterFunction = createFunctionExpression(getAccessor.modifiers, undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body, getAccessor);
setOriginalNode(getterFunction, getAccessor);
var getter = createPropertyAssignment("get", getterFunction);
properties_1.push(getter);
}
if (setAccessor) {
- var setterFunction = createFunctionExpression(undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body, setAccessor);
+ var setterFunction = createFunctionExpression(setAccessor.modifiers, undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body, setAccessor);
setOriginalNode(setterFunction, setAccessor);
var setter = createPropertyAssignment("set", setterFunction);
properties_1.push(setter);
@@ -11940,13 +11416,13 @@ var ts;
return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, property.name, property.name), getSynthesizedClone(property.name), property), property));
}
function createExpressionForMethodDeclaration(method, receiver) {
- return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, method.name, method.name), setOriginalNode(createFunctionExpression(method.asteriskToken, undefined, undefined, method.parameters, undefined, method.body, method), method), method), method));
+ return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, method.name, method.name), setOriginalNode(createFunctionExpression(method.modifiers, method.asteriskToken, undefined, undefined, method.parameters, undefined, method.body, method), method), method), method));
}
function isUseStrictPrologue(node) {
return node.expression.text === "use strict";
}
function addPrologueDirectives(target, source, ensureUseStrict, visitor) {
- ts.Debug.assert(target.length === 0, "PrologueDirectives should be at the first statement in the target statements array");
+ ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array");
var foundUseStrict = false;
var statementOffset = 0;
var numStatements = source.length;
@@ -11959,16 +11435,20 @@ var ts;
target.push(statement);
}
else {
- if (ensureUseStrict && !foundUseStrict) {
- target.push(startOnNewLine(createStatement(createLiteral("use strict"))));
- foundUseStrict = true;
- }
- if (getEmitFlags(statement) & 8388608) {
- target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement);
- }
- else {
- break;
- }
+ break;
+ }
+ statementOffset++;
+ }
+ if (ensureUseStrict && !foundUseStrict) {
+ target.push(startOnNewLine(createStatement(createLiteral("use strict"))));
+ }
+ while (statementOffset < numStatements) {
+ var statement = source[statementOffset];
+ if (getEmitFlags(statement) & 8388608) {
+ target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement);
+ }
+ else {
+ break;
}
statementOffset++;
}
@@ -11999,7 +11479,7 @@ var ts;
ts.ensureUseStrict = ensureUseStrict;
function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
var skipped = skipPartiallyEmittedExpressions(operand);
- if (skipped.kind === 178) {
+ if (skipped.kind === 179) {
return operand;
}
return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand)
@@ -12008,15 +11488,15 @@ var ts;
}
ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand;
function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
- var binaryOperatorPrecedence = ts.getOperatorPrecedence(187, binaryOperator);
- var binaryOperatorAssociativity = ts.getOperatorAssociativity(187, binaryOperator);
+ var binaryOperatorPrecedence = ts.getOperatorPrecedence(188, binaryOperator);
+ var binaryOperatorAssociativity = ts.getOperatorAssociativity(188, binaryOperator);
var emittedOperand = skipPartiallyEmittedExpressions(operand);
var operandPrecedence = ts.getExpressionPrecedence(emittedOperand);
switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) {
case -1:
if (!isLeftSideOfBinary
&& binaryOperatorAssociativity === 1
- && operand.kind === 190) {
+ && operand.kind === 191) {
return false;
}
return true;
@@ -12032,7 +11512,7 @@ var ts;
if (operatorHasAssociativeProperty(binaryOperator)) {
return false;
}
- if (binaryOperator === 35) {
+ if (binaryOperator === 36) {
var leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0;
if (ts.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) {
return false;
@@ -12045,17 +11525,17 @@ var ts;
}
}
function operatorHasAssociativeProperty(binaryOperator) {
- return binaryOperator === 37
+ return binaryOperator === 38
+ || binaryOperator === 48
|| binaryOperator === 47
- || binaryOperator === 46
- || binaryOperator === 48;
+ || binaryOperator === 49;
}
function getLiteralKindOfBinaryPlusOperand(node) {
node = skipPartiallyEmittedExpressions(node);
if (ts.isLiteralKind(node.kind)) {
return node.kind;
}
- if (node.kind === 187 && node.operatorToken.kind === 35) {
+ if (node.kind === 188 && node.operatorToken.kind === 36) {
if (node.cachedLiteralKind !== undefined) {
return node.cachedLiteralKind;
}
@@ -12072,9 +11552,9 @@ var ts;
function parenthesizeForNew(expression) {
var emittedExpression = skipPartiallyEmittedExpressions(expression);
switch (emittedExpression.kind) {
- case 174:
- return createParen(expression);
case 175:
+ return createParen(expression);
+ case 176:
return emittedExpression.arguments
? expression
: createParen(expression);
@@ -12085,7 +11565,7 @@ var ts;
function parenthesizeForAccess(expression) {
var emittedExpression = skipPartiallyEmittedExpressions(expression);
if (ts.isLeftHandSideExpression(emittedExpression)
- && (emittedExpression.kind !== 175 || emittedExpression.arguments)
+ && (emittedExpression.kind !== 176 || emittedExpression.arguments)
&& emittedExpression.kind !== 8) {
return expression;
}
@@ -12123,7 +11603,7 @@ var ts;
function parenthesizeExpressionForList(expression) {
var emittedExpression = skipPartiallyEmittedExpressions(expression);
var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression);
- var commaPrecedence = ts.getOperatorPrecedence(187, 24);
+ var commaPrecedence = ts.getOperatorPrecedence(188, 25);
return expressionPrecedence > commaPrecedence
? expression
: createParen(expression, expression);
@@ -12134,7 +11614,7 @@ var ts;
if (ts.isCallExpression(emittedExpression)) {
var callee = emittedExpression.expression;
var kind = skipPartiallyEmittedExpressions(callee).kind;
- if (kind === 179 || kind === 180) {
+ if (kind === 180 || kind === 181) {
var mutableCall = getMutableClone(emittedExpression);
mutableCall.expression = createParen(callee, callee);
return recreatePartiallyEmittedExpressions(expression, mutableCall);
@@ -12142,7 +11622,7 @@ var ts;
}
else {
var leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind;
- if (leftmostExpressionKind === 171 || leftmostExpressionKind === 179) {
+ if (leftmostExpressionKind === 172 || leftmostExpressionKind === 180) {
return createParen(expression, expression);
}
}
@@ -12160,18 +11640,18 @@ var ts;
function getLeftmostExpression(node) {
while (true) {
switch (node.kind) {
- case 186:
+ case 187:
node = node.operand;
continue;
- case 187:
+ case 188:
node = node.left;
continue;
- case 188:
+ case 189:
node = node.condition;
continue;
+ case 175:
case 174:
case 173:
- case 172:
node = node.expression;
continue;
case 288:
@@ -12183,12 +11663,19 @@ var ts;
}
function parenthesizeConciseBody(body) {
var emittedBody = skipPartiallyEmittedExpressions(body);
- if (emittedBody.kind === 171) {
+ if (emittedBody.kind === 172) {
return createParen(body, body);
}
return body;
}
ts.parenthesizeConciseBody = parenthesizeConciseBody;
+ (function (OuterExpressionKinds) {
+ OuterExpressionKinds[OuterExpressionKinds["Parentheses"] = 1] = "Parentheses";
+ OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 2] = "Assertions";
+ OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 4] = "PartiallyEmittedExpressions";
+ OuterExpressionKinds[OuterExpressionKinds["All"] = 7] = "All";
+ })(ts.OuterExpressionKinds || (ts.OuterExpressionKinds = {}));
+ var OuterExpressionKinds = ts.OuterExpressionKinds;
function skipOuterExpressions(node, kinds) {
if (kinds === void 0) { kinds = 7; }
var previousNode;
@@ -12208,7 +11695,7 @@ var ts;
}
ts.skipOuterExpressions = skipOuterExpressions;
function skipParentheses(node) {
- while (node.kind === 178) {
+ while (node.kind === 179) {
node = node.expression;
}
return node;
@@ -12368,13 +11855,13 @@ var ts;
function getLocalNameForExternalImport(node, sourceFile) {
var namespaceDeclaration = ts.getNamespaceDeclarationNode(node);
if (namespaceDeclaration && !ts.isDefaultImport(node)) {
- var name_12 = namespaceDeclaration.name;
- return ts.isGeneratedIdentifier(name_12) ? name_12 : createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name));
+ var name_9 = namespaceDeclaration.name;
+ return ts.isGeneratedIdentifier(name_9) ? name_9 : createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name));
}
- if (node.kind === 230 && node.importClause) {
+ if (node.kind === 231 && node.importClause) {
return getGeneratedNameForNode(node);
}
- if (node.kind === 236 && node.moduleSpecifier) {
+ if (node.kind === 237 && node.moduleSpecifier) {
return getGeneratedNameForNode(node);
}
return undefined;
@@ -12423,10 +11910,10 @@ var ts;
if (kind === 256) {
return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end);
}
- else if (kind === 69) {
+ else if (kind === 70) {
return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, pos, end);
}
- else if (kind < 139) {
+ else if (kind < 140) {
return new (TokenConstructor || (TokenConstructor = ts.objectAllocator.getTokenConstructor()))(kind, pos, end);
}
else {
@@ -12462,10 +11949,10 @@ var ts;
var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode;
var cbNodes = cbNodeArray || cbNode;
switch (node.kind) {
- case 139:
+ case 140:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.right);
- case 141:
+ case 142:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.constraint) ||
visitNode(cbNode, node.expression);
@@ -12476,12 +11963,12 @@ var ts;
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.equalsToken) ||
visitNode(cbNode, node.objectAssignmentInitializer);
- case 142:
+ case 143:
+ case 146:
case 145:
- case 144:
case 253:
- case 218:
- case 169:
+ case 219:
+ case 170:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.propertyName) ||
@@ -12490,24 +11977,24 @@ var ts;
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
- case 156:
case 157:
- case 151:
+ case 158:
case 152:
case 153:
+ case 154:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNodes(cbNodes, node.typeParameters) ||
visitNodes(cbNodes, node.parameters) ||
visitNode(cbNode, node.type);
- case 147:
- case 146:
case 148:
+ case 147:
case 149:
case 150:
- case 179:
- case 220:
+ case 151:
case 180:
+ case 221:
+ case 181:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.asteriskToken) ||
@@ -12518,163 +12005,156 @@ var ts;
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.equalsGreaterThanToken) ||
visitNode(cbNode, node.body);
- case 155:
+ case 156:
return visitNode(cbNode, node.typeName) ||
visitNodes(cbNodes, node.typeArguments);
- case 154:
+ case 155:
return visitNode(cbNode, node.parameterName) ||
visitNode(cbNode, node.type);
- case 158:
- return visitNode(cbNode, node.exprName);
case 159:
- return visitNodes(cbNodes, node.members);
+ return visitNode(cbNode, node.exprName);
case 160:
- return visitNode(cbNode, node.elementType);
+ return visitNodes(cbNodes, node.members);
case 161:
- return visitNodes(cbNodes, node.elementTypes);
+ return visitNode(cbNode, node.elementType);
case 162:
+ return visitNodes(cbNodes, node.elementTypes);
case 163:
- return visitNodes(cbNodes, node.types);
case 164:
+ return visitNodes(cbNodes, node.types);
+ case 165:
return visitNode(cbNode, node.type);
- case 166:
- return visitNode(cbNode, node.literal);
case 167:
+ return visitNode(cbNode, node.literal);
case 168:
- return visitNodes(cbNodes, node.elements);
- case 170:
+ case 169:
return visitNodes(cbNodes, node.elements);
case 171:
- return visitNodes(cbNodes, node.properties);
+ return visitNodes(cbNodes, node.elements);
case 172:
- return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.name);
+ return visitNodes(cbNodes, node.properties);
case 173:
return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.argumentExpression);
+ visitNode(cbNode, node.name);
case 174:
+ return visitNode(cbNode, node.expression) ||
+ visitNode(cbNode, node.argumentExpression);
case 175:
+ case 176:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNodes, node.typeArguments) ||
visitNodes(cbNodes, node.arguments);
- case 176:
+ case 177:
return visitNode(cbNode, node.tag) ||
visitNode(cbNode, node.template);
- case 177:
+ case 178:
return visitNode(cbNode, node.type) ||
visitNode(cbNode, node.expression);
- case 178:
- return visitNode(cbNode, node.expression);
- case 181:
+ case 179:
return visitNode(cbNode, node.expression);
case 182:
return visitNode(cbNode, node.expression);
case 183:
return visitNode(cbNode, node.expression);
- case 185:
- return visitNode(cbNode, node.operand);
- case 190:
- return visitNode(cbNode, node.asteriskToken) ||
- visitNode(cbNode, node.expression);
case 184:
return visitNode(cbNode, node.expression);
case 186:
return visitNode(cbNode, node.operand);
+ case 191:
+ return visitNode(cbNode, node.asteriskToken) ||
+ visitNode(cbNode, node.expression);
+ case 185:
+ return visitNode(cbNode, node.expression);
case 187:
+ return visitNode(cbNode, node.operand);
+ case 188:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.operatorToken) ||
visitNode(cbNode, node.right);
- case 195:
+ case 196:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.type);
- case 196:
+ case 197:
return visitNode(cbNode, node.expression);
- case 188:
+ case 189:
return visitNode(cbNode, node.condition) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.whenTrue) ||
visitNode(cbNode, node.colonToken) ||
visitNode(cbNode, node.whenFalse);
- case 191:
+ case 192:
return visitNode(cbNode, node.expression);
- case 199:
- case 226:
+ case 200:
+ case 227:
return visitNodes(cbNodes, node.statements);
case 256:
return visitNodes(cbNodes, node.statements) ||
visitNode(cbNode, node.endOfFileToken);
- case 200:
+ case 201:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.declarationList);
- case 219:
+ case 220:
return visitNodes(cbNodes, node.declarations);
- case 202:
- return visitNode(cbNode, node.expression);
case 203:
+ return visitNode(cbNode, node.expression);
+ case 204:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.thenStatement) ||
visitNode(cbNode, node.elseStatement);
- case 204:
+ case 205:
return visitNode(cbNode, node.statement) ||
visitNode(cbNode, node.expression);
- case 205:
- return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.statement);
case 206:
- return visitNode(cbNode, node.initializer) ||
- visitNode(cbNode, node.condition) ||
- visitNode(cbNode, node.incrementor) ||
+ return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
case 207:
return visitNode(cbNode, node.initializer) ||
- visitNode(cbNode, node.expression) ||
+ visitNode(cbNode, node.condition) ||
+ visitNode(cbNode, node.incrementor) ||
visitNode(cbNode, node.statement);
case 208:
return visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
case 209:
- case 210:
- return visitNode(cbNode, node.label);
- case 211:
- return visitNode(cbNode, node.expression);
- case 212:
- return visitNode(cbNode, node.expression) ||
+ return visitNode(cbNode, node.initializer) ||
+ visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
+ case 210:
+ case 211:
+ return visitNode(cbNode, node.label);
+ case 212:
+ return visitNode(cbNode, node.expression);
case 213:
+ return visitNode(cbNode, node.expression) ||
+ visitNode(cbNode, node.statement);
+ case 214:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.caseBlock);
- case 227:
+ case 228:
return visitNodes(cbNodes, node.clauses);
case 249:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNodes, node.statements);
case 250:
return visitNodes(cbNodes, node.statements);
- case 214:
+ case 215:
return visitNode(cbNode, node.label) ||
visitNode(cbNode, node.statement);
- case 215:
- return visitNode(cbNode, node.expression);
case 216:
+ return visitNode(cbNode, node.expression);
+ case 217:
return visitNode(cbNode, node.tryBlock) ||
visitNode(cbNode, node.catchClause) ||
visitNode(cbNode, node.finallyBlock);
case 252:
return visitNode(cbNode, node.variableDeclaration) ||
visitNode(cbNode, node.block);
- case 143:
+ case 144:
return visitNode(cbNode, node.expression);
- case 221:
- case 192:
- return visitNodes(cbNodes, node.decorators) ||
- visitNodes(cbNodes, node.modifiers) ||
- visitNode(cbNode, node.name) ||
- visitNodes(cbNodes, node.typeParameters) ||
- visitNodes(cbNodes, node.heritageClauses) ||
- visitNodes(cbNodes, node.members);
case 222:
+ case 193:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
@@ -12686,8 +12166,15 @@ var ts;
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNodes(cbNodes, node.typeParameters) ||
- visitNode(cbNode, node.type);
+ visitNodes(cbNodes, node.heritageClauses) ||
+ visitNodes(cbNodes, node.members);
case 224:
+ return visitNodes(cbNodes, node.decorators) ||
+ visitNodes(cbNodes, node.modifiers) ||
+ visitNode(cbNode, node.name) ||
+ visitNodes(cbNodes, node.typeParameters) ||
+ visitNode(cbNode, node.type);
+ case 225:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
@@ -12695,65 +12182,65 @@ var ts;
case 255:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.initializer);
- case 225:
+ case 226:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.body);
- case 229:
+ case 230:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.moduleReference);
- case 230:
+ case 231:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.importClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 231:
+ case 232:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.namedBindings);
- case 228:
- return visitNode(cbNode, node.name);
- case 232:
+ case 229:
return visitNode(cbNode, node.name);
case 233:
- case 237:
+ return visitNode(cbNode, node.name);
+ case 234:
+ case 238:
return visitNodes(cbNodes, node.elements);
- case 236:
+ case 237:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.exportClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 234:
- case 238:
+ case 235:
+ case 239:
return visitNode(cbNode, node.propertyName) ||
visitNode(cbNode, node.name);
- case 235:
+ case 236:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.expression);
- case 189:
+ case 190:
return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans);
- case 197:
+ case 198:
return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal);
- case 140:
+ case 141:
return visitNode(cbNode, node.expression);
case 251:
return visitNodes(cbNodes, node.types);
- case 194:
+ case 195:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNodes, node.typeArguments);
- case 240:
- return visitNode(cbNode, node.expression);
- case 239:
- return visitNodes(cbNodes, node.decorators);
case 241:
+ return visitNode(cbNode, node.expression);
+ case 240:
+ return visitNodes(cbNodes, node.decorators);
+ case 242:
return visitNode(cbNode, node.openingElement) ||
visitNodes(cbNodes, node.children) ||
visitNode(cbNode, node.closingElement);
- case 242:
case 243:
+ case 244:
return visitNode(cbNode, node.tagName) ||
visitNodes(cbNodes, node.attributes);
case 246:
@@ -12855,7 +12342,7 @@ var ts;
ts.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests;
var Parser;
(function (Parser) {
- var scanner = ts.createScanner(2, true);
+ var scanner = ts.createScanner(4, true);
var disallowInAndDecoratorContext = 32768 | 131072;
var NodeConstructor;
var TokenConstructor;
@@ -12872,9 +12359,9 @@ var ts;
var parsingContext;
var contextFlags;
var parseErrorBeforeNextFinishedNode = false;
- function parseSourceFile(fileName, _sourceText, languageVersion, _syntaxCursor, setParentNodes, scriptKind) {
+ function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind) {
scriptKind = ts.ensureScriptKind(fileName, scriptKind);
- initializeState(fileName, _sourceText, languageVersion, _syntaxCursor, scriptKind);
+ initializeState(sourceText, languageVersion, syntaxCursor, scriptKind);
var result = parseSourceFileWorker(fileName, languageVersion, setParentNodes, scriptKind);
clearState();
return result;
@@ -12883,7 +12370,7 @@ var ts;
function getLanguageVariant(scriptKind) {
return scriptKind === 4 || scriptKind === 2 || scriptKind === 1 ? 1 : 0;
}
- function initializeState(fileName, _sourceText, languageVersion, _syntaxCursor, scriptKind) {
+ function initializeState(_sourceText, languageVersion, _syntaxCursor, scriptKind) {
NodeConstructor = ts.objectAllocator.getNodeConstructor();
TokenConstructor = ts.objectAllocator.getTokenConstructor();
IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor();
@@ -13126,16 +12613,16 @@ var ts;
return speculationHelper(callback, false);
}
function isIdentifier() {
- if (token() === 69) {
+ if (token() === 70) {
return true;
}
- if (token() === 114 && inYieldContext()) {
+ if (token() === 115 && inYieldContext()) {
return false;
}
- if (token() === 119 && inAwaitContext()) {
+ if (token() === 120 && inAwaitContext()) {
return false;
}
- return token() > 105;
+ return token() > 106;
}
function parseExpected(kind, diagnosticMessage, shouldAdvance) {
if (shouldAdvance === void 0) { shouldAdvance = true; }
@@ -13176,20 +12663,20 @@ var ts;
return finishNode(node);
}
function canParseSemicolon() {
- if (token() === 23) {
+ if (token() === 24) {
return true;
}
- return token() === 16 || token() === 1 || scanner.hasPrecedingLineBreak();
+ return token() === 17 || token() === 1 || scanner.hasPrecedingLineBreak();
}
function parseSemicolon() {
if (canParseSemicolon()) {
- if (token() === 23) {
+ if (token() === 24) {
nextToken();
}
return true;
}
else {
- return parseExpected(23);
+ return parseExpected(24);
}
}
function createNode(kind, pos) {
@@ -13197,8 +12684,8 @@ var ts;
if (!(pos >= 0)) {
pos = scanner.getStartPos();
}
- return kind >= 139 ? new NodeConstructor(kind, pos, pos) :
- kind === 69 ? new IdentifierConstructor(kind, pos, pos) :
+ return kind >= 140 ? new NodeConstructor(kind, pos, pos) :
+ kind === 70 ? new IdentifierConstructor(kind, pos, pos) :
new TokenConstructor(kind, pos, pos);
}
function createNodeArray(elements, pos) {
@@ -13239,15 +12726,15 @@ var ts;
function createIdentifier(isIdentifier, diagnosticMessage) {
identifierCount++;
if (isIdentifier) {
- var node = createNode(69);
- if (token() !== 69) {
+ var node = createNode(70);
+ if (token() !== 70) {
node.originalKeywordKind = token();
}
node.text = internIdentifier(scanner.getTokenValue());
nextToken();
return finishNode(node);
}
- return createMissingNode(69, false, diagnosticMessage || ts.Diagnostics.Identifier_expected);
+ return createMissingNode(70, false, diagnosticMessage || ts.Diagnostics.Identifier_expected);
}
function parseIdentifier(diagnosticMessage) {
return createIdentifier(isIdentifier(), diagnosticMessage);
@@ -13264,7 +12751,7 @@ var ts;
if (token() === 9 || token() === 8) {
return parseLiteralNode(true);
}
- if (allowComputedPropertyNames && token() === 19) {
+ if (allowComputedPropertyNames && token() === 20) {
return parseComputedPropertyName();
}
return parseIdentifierName();
@@ -13279,10 +12766,10 @@ var ts;
return token() === 9 || token() === 8 || ts.tokenIsIdentifierOrKeyword(token());
}
function parseComputedPropertyName() {
- var node = createNode(140);
- parseExpected(19);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(141);
parseExpected(20);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(21);
return finishNode(node);
}
function parseContextualModifier(t) {
@@ -13296,20 +12783,20 @@ var ts;
return canFollowModifier();
}
function nextTokenCanFollowModifier() {
- if (token() === 74) {
- return nextToken() === 81;
+ if (token() === 75) {
+ return nextToken() === 82;
}
- if (token() === 82) {
+ if (token() === 83) {
nextToken();
- if (token() === 77) {
+ if (token() === 78) {
return lookAhead(nextTokenIsClassOrFunctionOrAsync);
}
- return token() !== 37 && token() !== 116 && token() !== 15 && canFollowModifier();
+ return token() !== 38 && token() !== 117 && token() !== 16 && canFollowModifier();
}
- if (token() === 77) {
+ if (token() === 78) {
return nextTokenIsClassOrFunctionOrAsync();
}
- if (token() === 113) {
+ if (token() === 114) {
nextToken();
return canFollowModifier();
}
@@ -13319,16 +12806,16 @@ var ts;
return ts.isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 19
- || token() === 15
- || token() === 37
- || token() === 22
+ return token() === 20
+ || token() === 16
+ || token() === 38
+ || token() === 23
|| isLiteralPropertyName();
}
function nextTokenIsClassOrFunctionOrAsync() {
nextToken();
- return token() === 73 || token() === 87 ||
- (token() === 118 && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
+ return token() === 74 || token() === 88 ||
+ (token() === 119 && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
}
function isListElement(parsingContext, inErrorRecovery) {
var node = currentNode(parsingContext);
@@ -13339,21 +12826,21 @@ var ts;
case 0:
case 1:
case 3:
- return !(token() === 23 && inErrorRecovery) && isStartOfStatement();
+ return !(token() === 24 && inErrorRecovery) && isStartOfStatement();
case 2:
- return token() === 71 || token() === 77;
+ return token() === 72 || token() === 78;
case 4:
return lookAhead(isTypeMemberStart);
case 5:
- return lookAhead(isClassMemberStart) || (token() === 23 && !inErrorRecovery);
+ return lookAhead(isClassMemberStart) || (token() === 24 && !inErrorRecovery);
case 6:
- return token() === 19 || isLiteralPropertyName();
+ return token() === 20 || isLiteralPropertyName();
case 12:
- return token() === 19 || token() === 37 || isLiteralPropertyName();
+ return token() === 20 || token() === 38 || isLiteralPropertyName();
case 9:
- return token() === 19 || isLiteralPropertyName();
+ return token() === 20 || isLiteralPropertyName();
case 7:
- if (token() === 15) {
+ if (token() === 16) {
return lookAhead(isValidHeritageClauseObjectLiteral);
}
if (!inErrorRecovery) {
@@ -13365,23 +12852,23 @@ var ts;
case 8:
return isIdentifierOrPattern();
case 10:
- return token() === 24 || token() === 22 || isIdentifierOrPattern();
+ return token() === 25 || token() === 23 || isIdentifierOrPattern();
case 17:
return isIdentifier();
case 11:
case 15:
- return token() === 24 || token() === 22 || isStartOfExpression();
+ return token() === 25 || token() === 23 || isStartOfExpression();
case 16:
return isStartOfParameter();
case 18:
case 19:
- return token() === 24 || isStartOfType();
+ return token() === 25 || isStartOfType();
case 20:
return isHeritageClause();
case 21:
return ts.tokenIsIdentifierOrKeyword(token());
case 13:
- return ts.tokenIsIdentifierOrKeyword(token()) || token() === 15;
+ return ts.tokenIsIdentifierOrKeyword(token()) || token() === 16;
case 14:
return true;
case 22:
@@ -13394,10 +12881,10 @@ var ts;
ts.Debug.fail("Non-exhaustive case in 'isListElement'.");
}
function isValidHeritageClauseObjectLiteral() {
- ts.Debug.assert(token() === 15);
- if (nextToken() === 16) {
+ ts.Debug.assert(token() === 16);
+ if (nextToken() === 17) {
var next = nextToken();
- return next === 24 || next === 15 || next === 83 || next === 106;
+ return next === 25 || next === 16 || next === 84 || next === 107;
}
return true;
}
@@ -13410,8 +12897,8 @@ var ts;
return ts.tokenIsIdentifierOrKeyword(token());
}
function isHeritageClauseExtendsOrImplementsKeyword() {
- if (token() === 106 ||
- token() === 83) {
+ if (token() === 107 ||
+ token() === 84) {
return lookAhead(nextTokenIsStartOfExpression);
}
return false;
@@ -13433,39 +12920,39 @@ var ts;
case 12:
case 9:
case 21:
- return token() === 16;
+ return token() === 17;
case 3:
- return token() === 16 || token() === 71 || token() === 77;
+ return token() === 17 || token() === 72 || token() === 78;
case 7:
- return token() === 15 || token() === 83 || token() === 106;
+ return token() === 16 || token() === 84 || token() === 107;
case 8:
return isVariableDeclaratorListTerminator();
case 17:
- return token() === 27 || token() === 17 || token() === 15 || token() === 83 || token() === 106;
+ return token() === 28 || token() === 18 || token() === 16 || token() === 84 || token() === 107;
case 11:
- return token() === 18 || token() === 23;
+ return token() === 19 || token() === 24;
case 15:
case 19:
case 10:
- return token() === 20;
+ return token() === 21;
case 16:
- return token() === 18 || token() === 20;
+ return token() === 19 || token() === 21;
case 18:
- return token() !== 24;
+ return token() !== 25;
case 20:
- return token() === 15 || token() === 16;
+ return token() === 16 || token() === 17;
case 13:
- return token() === 27 || token() === 39;
+ return token() === 28 || token() === 40;
case 14:
- return token() === 25 && lookAhead(nextTokenIsSlash);
+ return token() === 26 && lookAhead(nextTokenIsSlash);
case 22:
- return token() === 18 || token() === 54 || token() === 16;
+ return token() === 19 || token() === 55 || token() === 17;
case 23:
- return token() === 27 || token() === 16;
+ return token() === 28 || token() === 17;
case 25:
- return token() === 20 || token() === 16;
+ return token() === 21 || token() === 17;
case 24:
- return token() === 16;
+ return token() === 17;
}
}
function isVariableDeclaratorListTerminator() {
@@ -13475,7 +12962,7 @@ var ts;
if (isInOrOfKeyword(token())) {
return true;
}
- if (token() === 34) {
+ if (token() === 35) {
return true;
}
return false;
@@ -13579,17 +13066,17 @@ var ts;
function isReusableClassMember(node) {
if (node) {
switch (node.kind) {
- case 148:
- case 153:
case 149:
+ case 154:
case 150:
- case 145:
- case 198:
+ case 151:
+ case 146:
+ case 199:
return true;
- case 147:
+ case 148:
var methodDeclaration = node;
- var nameIsConstructor = methodDeclaration.name.kind === 69 &&
- methodDeclaration.name.originalKeywordKind === 121;
+ var nameIsConstructor = methodDeclaration.name.kind === 70 &&
+ methodDeclaration.name.originalKeywordKind === 122;
return !nameIsConstructor;
}
}
@@ -13608,35 +13095,35 @@ var ts;
function isReusableStatement(node) {
if (node) {
switch (node.kind) {
- case 220:
+ case 221:
+ case 201:
case 200:
- case 199:
+ case 204:
case 203:
- case 202:
- case 215:
+ case 216:
+ case 212:
+ case 214:
case 211:
- case 213:
case 210:
+ case 208:
case 209:
case 207:
- case 208:
case 206:
- case 205:
- case 212:
- case 201:
- case 216:
- case 214:
- case 204:
+ case 213:
+ case 202:
case 217:
+ case 215:
+ case 205:
+ case 218:
+ case 231:
case 230:
- case 229:
+ case 237:
case 236:
- case 235:
- case 225:
- case 221:
+ case 226:
case 222:
- case 224:
case 223:
+ case 225:
+ case 224:
return true;
}
}
@@ -13648,25 +13135,25 @@ var ts;
function isReusableTypeMember(node) {
if (node) {
switch (node.kind) {
- case 152:
- case 146:
case 153:
- case 144:
- case 151:
+ case 147:
+ case 154:
+ case 145:
+ case 152:
return true;
}
}
return false;
}
function isReusableVariableDeclaration(node) {
- if (node.kind !== 218) {
+ if (node.kind !== 219) {
return false;
}
var variableDeclarator = node;
return variableDeclarator.initializer === undefined;
}
function isReusableParameter(node) {
- if (node.kind !== 142) {
+ if (node.kind !== 143) {
return false;
}
var parameter = node;
@@ -13720,15 +13207,15 @@ var ts;
if (isListElement(kind, false)) {
result.push(parseListElement(kind, parseElement));
commaStart = scanner.getTokenPos();
- if (parseOptional(24)) {
+ if (parseOptional(25)) {
continue;
}
commaStart = -1;
if (isListTerminator(kind)) {
break;
}
- parseExpected(24);
- if (considerSemicolonAsDelimiter && token() === 23 && !scanner.hasPrecedingLineBreak()) {
+ parseExpected(25);
+ if (considerSemicolonAsDelimiter && token() === 24 && !scanner.hasPrecedingLineBreak()) {
nextToken();
}
continue;
@@ -13760,8 +13247,8 @@ var ts;
}
function parseEntityName(allowReservedWords, diagnosticMessage) {
var entity = parseIdentifier(diagnosticMessage);
- while (parseOptional(21)) {
- var node = createNode(139, entity.pos);
+ while (parseOptional(22)) {
+ var node = createNode(140, entity.pos);
node.left = entity;
node.right = parseRightSideOfDot(allowReservedWords);
entity = finishNode(node);
@@ -13772,33 +13259,33 @@ var ts;
if (scanner.hasPrecedingLineBreak() && ts.tokenIsIdentifierOrKeyword(token())) {
var matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);
if (matchesPattern) {
- return createMissingNode(69, true, ts.Diagnostics.Identifier_expected);
+ return createMissingNode(70, true, ts.Diagnostics.Identifier_expected);
}
}
return allowIdentifierNames ? parseIdentifierName() : parseIdentifier();
}
function parseTemplateExpression() {
- var template = createNode(189);
+ var template = createNode(190);
template.head = parseTemplateHead();
- ts.Debug.assert(template.head.kind === 12, "Template head has wrong token kind");
+ ts.Debug.assert(template.head.kind === 13, "Template head has wrong token kind");
var templateSpans = createNodeArray();
do {
templateSpans.push(parseTemplateSpan());
- } while (ts.lastOrUndefined(templateSpans).literal.kind === 13);
+ } while (ts.lastOrUndefined(templateSpans).literal.kind === 14);
templateSpans.end = getNodeEnd();
template.templateSpans = templateSpans;
return finishNode(template);
}
function parseTemplateSpan() {
- var span = createNode(197);
+ var span = createNode(198);
span.expression = allowInAnd(parseExpression);
var literal;
- if (token() === 16) {
+ if (token() === 17) {
reScanTemplateToken();
literal = parseTemplateMiddleOrTemplateTail();
}
else {
- literal = parseExpectedToken(14, false, ts.Diagnostics._0_expected, ts.tokenToString(16));
+ literal = parseExpectedToken(15, false, ts.Diagnostics._0_expected, ts.tokenToString(17));
}
span.literal = literal;
return finishNode(span);
@@ -13808,12 +13295,12 @@ var ts;
}
function parseTemplateHead() {
var fragment = parseLiteralLikeNode(token(), false);
- ts.Debug.assert(fragment.kind === 12, "Template head has wrong token kind");
+ ts.Debug.assert(fragment.kind === 13, "Template head has wrong token kind");
return fragment;
}
function parseTemplateMiddleOrTemplateTail() {
var fragment = parseLiteralLikeNode(token(), false);
- ts.Debug.assert(fragment.kind === 13 || fragment.kind === 14, "Template fragment has wrong token kind");
+ ts.Debug.assert(fragment.kind === 14 || fragment.kind === 15, "Template fragment has wrong token kind");
return fragment;
}
function parseLiteralLikeNode(kind, internName) {
@@ -13838,35 +13325,35 @@ var ts;
}
function parseTypeReference() {
var typeName = parseEntityName(false, ts.Diagnostics.Type_expected);
- var node = createNode(155, typeName.pos);
+ var node = createNode(156, typeName.pos);
node.typeName = typeName;
- if (!scanner.hasPrecedingLineBreak() && token() === 25) {
- node.typeArguments = parseBracketedList(18, parseType, 25, 27);
+ if (!scanner.hasPrecedingLineBreak() && token() === 26) {
+ node.typeArguments = parseBracketedList(18, parseType, 26, 28);
}
return finishNode(node);
}
function parseThisTypePredicate(lhs) {
nextToken();
- var node = createNode(154, lhs.pos);
+ var node = createNode(155, lhs.pos);
node.parameterName = lhs;
node.type = parseType();
return finishNode(node);
}
function parseThisTypeNode() {
- var node = createNode(165);
+ var node = createNode(166);
nextToken();
return finishNode(node);
}
function parseTypeQuery() {
- var node = createNode(158);
- parseExpected(101);
+ var node = createNode(159);
+ parseExpected(102);
node.exprName = parseEntityName(true);
return finishNode(node);
}
function parseTypeParameter() {
- var node = createNode(141);
+ var node = createNode(142);
node.name = parseIdentifier();
- if (parseOptional(83)) {
+ if (parseOptional(84)) {
if (isStartOfType() || !isStartOfExpression()) {
node.constraint = parseType();
}
@@ -13877,34 +13364,34 @@ var ts;
return finishNode(node);
}
function parseTypeParameters() {
- if (token() === 25) {
- return parseBracketedList(17, parseTypeParameter, 25, 27);
+ if (token() === 26) {
+ return parseBracketedList(17, parseTypeParameter, 26, 28);
}
}
function parseParameterType() {
- if (parseOptional(54)) {
+ if (parseOptional(55)) {
return parseType();
}
return undefined;
}
function isStartOfParameter() {
- return token() === 22 || isIdentifierOrPattern() || ts.isModifierKind(token()) || token() === 55 || token() === 97;
+ return token() === 23 || isIdentifierOrPattern() || ts.isModifierKind(token()) || token() === 56 || token() === 98;
}
function parseParameter() {
- var node = createNode(142);
- if (token() === 97) {
+ var node = createNode(143);
+ if (token() === 98) {
node.name = createIdentifier(true, undefined);
node.type = parseParameterType();
return finishNode(node);
}
node.decorators = parseDecorators();
node.modifiers = parseModifiers();
- node.dotDotDotToken = parseOptionalToken(22);
+ node.dotDotDotToken = parseOptionalToken(23);
node.name = parseIdentifierOrPattern();
if (ts.getFullWidth(node.name) === 0 && !ts.hasModifiers(node) && ts.isModifierKind(token())) {
nextToken();
}
- node.questionToken = parseOptionalToken(53);
+ node.questionToken = parseOptionalToken(54);
node.type = parseParameterType();
node.initializer = parseBindingElementInitializer(true);
return addJSDocComment(finishNode(node));
@@ -13916,7 +13403,7 @@ var ts;
return parseInitializer(true);
}
function fillSignature(returnToken, yieldContext, awaitContext, requireCompleteParameterList, signature) {
- var returnTokenRequired = returnToken === 34;
+ var returnTokenRequired = returnToken === 35;
signature.typeParameters = parseTypeParameters();
signature.parameters = parseParameterList(yieldContext, awaitContext, requireCompleteParameterList);
if (returnTokenRequired) {
@@ -13928,7 +13415,7 @@ var ts;
}
}
function parseParameterList(yieldContext, awaitContext, requireCompleteParameterList) {
- if (parseExpected(17)) {
+ if (parseExpected(18)) {
var savedYieldContext = inYieldContext();
var savedAwaitContext = inAwaitContext();
setYieldContext(yieldContext);
@@ -13936,7 +13423,7 @@ var ts;
var result = parseDelimitedList(16, parseParameter);
setYieldContext(savedYieldContext);
setAwaitContext(savedAwaitContext);
- if (!parseExpected(18) && requireCompleteParameterList) {
+ if (!parseExpected(19) && requireCompleteParameterList) {
return undefined;
}
return result;
@@ -13944,29 +13431,29 @@ var ts;
return requireCompleteParameterList ? undefined : createMissingList();
}
function parseTypeMemberSemicolon() {
- if (parseOptional(24)) {
+ if (parseOptional(25)) {
return;
}
parseSemicolon();
}
function parseSignatureMember(kind) {
var node = createNode(kind);
- if (kind === 152) {
- parseExpected(92);
+ if (kind === 153) {
+ parseExpected(93);
}
- fillSignature(54, false, false, false, node);
+ fillSignature(55, false, false, false, node);
parseTypeMemberSemicolon();
return addJSDocComment(finishNode(node));
}
function isIndexSignature() {
- if (token() !== 19) {
+ if (token() !== 20) {
return false;
}
return lookAhead(isUnambiguouslyIndexSignature);
}
function isUnambiguouslyIndexSignature() {
nextToken();
- if (token() === 22 || token() === 20) {
+ if (token() === 23 || token() === 21) {
return true;
}
if (ts.isModifierKind(token())) {
@@ -13981,43 +13468,43 @@ var ts;
else {
nextToken();
}
- if (token() === 54 || token() === 24) {
+ if (token() === 55 || token() === 25) {
return true;
}
- if (token() !== 53) {
+ if (token() !== 54) {
return false;
}
nextToken();
- return token() === 54 || token() === 24 || token() === 20;
+ return token() === 55 || token() === 25 || token() === 21;
}
function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(153, fullStart);
+ var node = createNode(154, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- node.parameters = parseBracketedList(16, parseParameter, 19, 20);
+ node.parameters = parseBracketedList(16, parseParameter, 20, 21);
node.type = parseTypeAnnotation();
parseTypeMemberSemicolon();
return finishNode(node);
}
function parsePropertyOrMethodSignature(fullStart, modifiers) {
var name = parsePropertyName();
- var questionToken = parseOptionalToken(53);
- if (token() === 17 || token() === 25) {
- var method = createNode(146, fullStart);
+ var questionToken = parseOptionalToken(54);
+ if (token() === 18 || token() === 26) {
+ var method = createNode(147, fullStart);
method.modifiers = modifiers;
method.name = name;
method.questionToken = questionToken;
- fillSignature(54, false, false, false, method);
+ fillSignature(55, false, false, false, method);
parseTypeMemberSemicolon();
return addJSDocComment(finishNode(method));
}
else {
- var property = createNode(144, fullStart);
+ var property = createNode(145, fullStart);
property.modifiers = modifiers;
property.name = name;
property.questionToken = questionToken;
property.type = parseTypeAnnotation();
- if (token() === 56) {
+ if (token() === 57) {
property.initializer = parseNonParameterInitializer();
}
parseTypeMemberSemicolon();
@@ -14026,14 +13513,14 @@ var ts;
}
function isTypeMemberStart() {
var idToken;
- if (token() === 17 || token() === 25) {
+ if (token() === 18 || token() === 26) {
return true;
}
while (ts.isModifierKind(token())) {
idToken = token();
nextToken();
}
- if (token() === 19) {
+ if (token() === 20) {
return true;
}
if (isLiteralPropertyName()) {
@@ -14041,22 +13528,22 @@ var ts;
nextToken();
}
if (idToken) {
- return token() === 17 ||
- token() === 25 ||
- token() === 53 ||
+ return token() === 18 ||
+ token() === 26 ||
token() === 54 ||
- token() === 24 ||
+ token() === 55 ||
+ token() === 25 ||
canParseSemicolon();
}
return false;
}
function parseTypeMember() {
- if (token() === 17 || token() === 25) {
- return parseSignatureMember(151);
- }
- if (token() === 92 && lookAhead(isStartOfConstructSignature)) {
+ if (token() === 18 || token() === 26) {
return parseSignatureMember(152);
}
+ if (token() === 93 && lookAhead(isStartOfConstructSignature)) {
+ return parseSignatureMember(153);
+ }
var fullStart = getNodePos();
var modifiers = parseModifiers();
if (isIndexSignature()) {
@@ -14066,18 +13553,18 @@ var ts;
}
function isStartOfConstructSignature() {
nextToken();
- return token() === 17 || token() === 25;
+ return token() === 18 || token() === 26;
}
function parseTypeLiteral() {
- var node = createNode(159);
+ var node = createNode(160);
node.members = parseObjectTypeMembers();
return finishNode(node);
}
function parseObjectTypeMembers() {
var members;
- if (parseExpected(15)) {
+ if (parseExpected(16)) {
members = parseList(4, parseTypeMember);
- parseExpected(16);
+ parseExpected(17);
}
else {
members = createMissingList();
@@ -14085,31 +13572,31 @@ var ts;
return members;
}
function parseTupleType() {
- var node = createNode(161);
- node.elementTypes = parseBracketedList(19, parseType, 19, 20);
+ var node = createNode(162);
+ node.elementTypes = parseBracketedList(19, parseType, 20, 21);
return finishNode(node);
}
function parseParenthesizedType() {
- var node = createNode(164);
- parseExpected(17);
- node.type = parseType();
+ var node = createNode(165);
parseExpected(18);
+ node.type = parseType();
+ parseExpected(19);
return finishNode(node);
}
function parseFunctionOrConstructorType(kind) {
var node = createNode(kind);
- if (kind === 157) {
- parseExpected(92);
+ if (kind === 158) {
+ parseExpected(93);
}
- fillSignature(34, false, false, false, node);
+ fillSignature(35, false, false, false, node);
return finishNode(node);
}
function parseKeywordAndNoDot() {
var node = parseTokenNode();
- return token() === 21 ? undefined : node;
+ return token() === 22 ? undefined : node;
}
function parseLiteralTypeNode() {
- var node = createNode(166);
+ var node = createNode(167);
node.literal = parseSimpleUnaryExpression();
finishNode(node);
return node;
@@ -14119,41 +13606,41 @@ var ts;
}
function parseNonArrayType() {
switch (token()) {
- case 117:
- case 132:
- case 130:
- case 120:
+ case 118:
case 133:
- case 135:
- case 127:
+ case 131:
+ case 121:
+ case 134:
+ case 136:
+ case 128:
var node = tryParse(parseKeywordAndNoDot);
return node || parseTypeReference();
case 9:
case 8:
- case 99:
- case 84:
+ case 100:
+ case 85:
return parseLiteralTypeNode();
- case 36:
+ case 37:
return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode() : parseTypeReference();
- case 103:
- case 93:
+ case 104:
+ case 94:
return parseTokenNode();
- case 97: {
+ case 98: {
var thisKeyword = parseThisTypeNode();
- if (token() === 124 && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 125 && !scanner.hasPrecedingLineBreak()) {
return parseThisTypePredicate(thisKeyword);
}
else {
return thisKeyword;
}
}
- case 101:
+ case 102:
return parseTypeQuery();
- case 15:
+ case 16:
return parseTypeLiteral();
- case 19:
+ case 20:
return parseTupleType();
- case 17:
+ case 18:
return parseParenthesizedType();
default:
return parseTypeReference();
@@ -14161,29 +13648,29 @@ var ts;
}
function isStartOfType() {
switch (token()) {
- case 117:
- case 132:
- case 130:
- case 120:
+ case 118:
case 133:
- case 103:
- case 135:
+ case 131:
+ case 121:
+ case 134:
+ case 104:
+ case 136:
+ case 94:
+ case 98:
+ case 102:
+ case 128:
+ case 16:
+ case 20:
+ case 26:
case 93:
- case 97:
- case 101:
- case 127:
- case 15:
- case 19:
- case 25:
- case 92:
case 9:
case 8:
- case 99:
- case 84:
+ case 100:
+ case 85:
return true;
- case 36:
+ case 37:
return lookAhead(nextTokenIsNumericLiteral);
- case 17:
+ case 18:
return lookAhead(isStartOfParenthesizedOrFunctionType);
default:
return isIdentifier();
@@ -14191,13 +13678,13 @@ var ts;
}
function isStartOfParenthesizedOrFunctionType() {
nextToken();
- return token() === 18 || isStartOfParameter() || isStartOfType();
+ return token() === 19 || isStartOfParameter() || isStartOfType();
}
function parseArrayTypeOrHigher() {
var type = parseNonArrayType();
- while (!scanner.hasPrecedingLineBreak() && parseOptional(19)) {
- parseExpected(20);
- var node = createNode(160, type.pos);
+ while (!scanner.hasPrecedingLineBreak() && parseOptional(20)) {
+ parseExpected(21);
+ var node = createNode(161, type.pos);
node.elementType = type;
type = finishNode(node);
}
@@ -14218,26 +13705,26 @@ var ts;
return type;
}
function parseIntersectionTypeOrHigher() {
- return parseUnionOrIntersectionType(163, parseArrayTypeOrHigher, 46);
+ return parseUnionOrIntersectionType(164, parseArrayTypeOrHigher, 47);
}
function parseUnionTypeOrHigher() {
- return parseUnionOrIntersectionType(162, parseIntersectionTypeOrHigher, 47);
+ return parseUnionOrIntersectionType(163, parseIntersectionTypeOrHigher, 48);
}
function isStartOfFunctionType() {
- if (token() === 25) {
+ if (token() === 26) {
return true;
}
- return token() === 17 && lookAhead(isUnambiguouslyStartOfFunctionType);
+ return token() === 18 && lookAhead(isUnambiguouslyStartOfFunctionType);
}
function skipParameterStart() {
if (ts.isModifierKind(token())) {
parseModifiers();
}
- if (isIdentifier() || token() === 97) {
+ if (isIdentifier() || token() === 98) {
nextToken();
return true;
}
- if (token() === 19 || token() === 15) {
+ if (token() === 20 || token() === 16) {
var previousErrorCount = parseDiagnostics.length;
parseIdentifierOrPattern();
return previousErrorCount === parseDiagnostics.length;
@@ -14246,17 +13733,17 @@ var ts;
}
function isUnambiguouslyStartOfFunctionType() {
nextToken();
- if (token() === 18 || token() === 22) {
+ if (token() === 19 || token() === 23) {
return true;
}
if (skipParameterStart()) {
- if (token() === 54 || token() === 24 ||
- token() === 53 || token() === 56) {
+ if (token() === 55 || token() === 25 ||
+ token() === 54 || token() === 57) {
return true;
}
- if (token() === 18) {
+ if (token() === 19) {
nextToken();
- if (token() === 34) {
+ if (token() === 35) {
return true;
}
}
@@ -14267,7 +13754,7 @@ var ts;
var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix);
var type = parseType();
if (typePredicateVariable) {
- var node = createNode(154, typePredicateVariable.pos);
+ var node = createNode(155, typePredicateVariable.pos);
node.parameterName = typePredicateVariable;
node.type = type;
return finishNode(node);
@@ -14278,7 +13765,7 @@ var ts;
}
function parseTypePredicatePrefix() {
var id = parseIdentifier();
- if (token() === 124 && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 125 && !scanner.hasPrecedingLineBreak()) {
nextToken();
return id;
}
@@ -14288,36 +13775,36 @@ var ts;
}
function parseTypeWorker() {
if (isStartOfFunctionType()) {
- return parseFunctionOrConstructorType(156);
- }
- if (token() === 92) {
return parseFunctionOrConstructorType(157);
}
+ if (token() === 93) {
+ return parseFunctionOrConstructorType(158);
+ }
return parseUnionTypeOrHigher();
}
function parseTypeAnnotation() {
- return parseOptional(54) ? parseType() : undefined;
+ return parseOptional(55) ? parseType() : undefined;
}
function isStartOfLeftHandSideExpression() {
switch (token()) {
- case 97:
- case 95:
- case 93:
- case 99:
- case 84:
+ case 98:
+ case 96:
+ case 94:
+ case 100:
+ case 85:
case 8:
case 9:
- case 11:
case 12:
- case 17:
- case 19:
- case 15:
- case 87:
- case 73:
- case 92:
- case 39:
- case 61:
- case 69:
+ case 13:
+ case 18:
+ case 20:
+ case 16:
+ case 88:
+ case 74:
+ case 93:
+ case 40:
+ case 62:
+ case 70:
return true;
default:
return isIdentifier();
@@ -14328,18 +13815,18 @@ var ts;
return true;
}
switch (token()) {
- case 35:
case 36:
+ case 37:
+ case 51:
case 50:
- case 49:
- case 78:
- case 101:
- case 103:
- case 41:
+ case 79:
+ case 102:
+ case 104:
case 42:
- case 25:
- case 119:
- case 114:
+ case 43:
+ case 26:
+ case 120:
+ case 115:
return true;
default:
if (isBinaryOperator()) {
@@ -14349,10 +13836,10 @@ var ts;
}
}
function isStartOfExpressionStatement() {
- return token() !== 15 &&
- token() !== 87 &&
- token() !== 73 &&
- token() !== 55 &&
+ return token() !== 16 &&
+ token() !== 88 &&
+ token() !== 74 &&
+ token() !== 56 &&
isStartOfExpression();
}
function parseExpression() {
@@ -14362,7 +13849,7 @@ var ts;
}
var expr = parseAssignmentExpressionOrHigher();
var operatorToken;
- while ((operatorToken = parseOptionalToken(24))) {
+ while ((operatorToken = parseOptionalToken(25))) {
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher());
}
if (saveDecoratorContext) {
@@ -14371,12 +13858,12 @@ var ts;
return expr;
}
function parseInitializer(inParameter) {
- if (token() !== 56) {
- if (scanner.hasPrecedingLineBreak() || (inParameter && token() === 15) || !isStartOfExpression()) {
+ if (token() !== 57) {
+ if (scanner.hasPrecedingLineBreak() || (inParameter && token() === 16) || !isStartOfExpression()) {
return undefined;
}
}
- parseExpected(56);
+ parseExpected(57);
return parseAssignmentExpressionOrHigher();
}
function parseAssignmentExpressionOrHigher() {
@@ -14388,7 +13875,7 @@ var ts;
return arrowExpression;
}
var expr = parseBinaryExpressionOrHigher(0);
- if (expr.kind === 69 && token() === 34) {
+ if (expr.kind === 70 && token() === 35) {
return parseSimpleArrowFunctionExpression(expr);
}
if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) {
@@ -14397,7 +13884,7 @@ var ts;
return parseConditionalExpressionRest(expr);
}
function isYieldExpression() {
- if (token() === 114) {
+ if (token() === 115) {
if (inYieldContext()) {
return true;
}
@@ -14410,11 +13897,11 @@ var ts;
return !scanner.hasPrecedingLineBreak() && isIdentifier();
}
function parseYieldExpression() {
- var node = createNode(190);
+ var node = createNode(191);
nextToken();
if (!scanner.hasPrecedingLineBreak() &&
- (token() === 37 || isStartOfExpression())) {
- node.asteriskToken = parseOptionalToken(37);
+ (token() === 38 || isStartOfExpression())) {
+ node.asteriskToken = parseOptionalToken(38);
node.expression = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
@@ -14423,21 +13910,21 @@ var ts;
}
}
function parseSimpleArrowFunctionExpression(identifier, asyncModifier) {
- ts.Debug.assert(token() === 34, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
+ ts.Debug.assert(token() === 35, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
var node;
if (asyncModifier) {
- node = createNode(180, asyncModifier.pos);
+ node = createNode(181, asyncModifier.pos);
node.modifiers = asyncModifier;
}
else {
- node = createNode(180, identifier.pos);
+ node = createNode(181, identifier.pos);
}
- var parameter = createNode(142, identifier.pos);
+ var parameter = createNode(143, identifier.pos);
parameter.name = identifier;
finishNode(parameter);
node.parameters = createNodeArray([parameter], parameter.pos);
node.parameters.end = parameter.end;
- node.equalsGreaterThanToken = parseExpectedToken(34, false, ts.Diagnostics._0_expected, "=>");
+ node.equalsGreaterThanToken = parseExpectedToken(35, false, ts.Diagnostics._0_expected, "=>");
node.body = parseArrowFunctionExpressionBody(!!asyncModifier);
return addJSDocComment(finishNode(node));
}
@@ -14454,78 +13941,78 @@ var ts;
}
var isAsync = !!(ts.getModifierFlags(arrowFunction) & 256);
var lastToken = token();
- arrowFunction.equalsGreaterThanToken = parseExpectedToken(34, false, ts.Diagnostics._0_expected, "=>");
- arrowFunction.body = (lastToken === 34 || lastToken === 15)
+ arrowFunction.equalsGreaterThanToken = parseExpectedToken(35, false, ts.Diagnostics._0_expected, "=>");
+ arrowFunction.body = (lastToken === 35 || lastToken === 16)
? parseArrowFunctionExpressionBody(isAsync)
: parseIdentifier();
return addJSDocComment(finishNode(arrowFunction));
}
function isParenthesizedArrowFunctionExpression() {
- if (token() === 17 || token() === 25 || token() === 118) {
+ if (token() === 18 || token() === 26 || token() === 119) {
return lookAhead(isParenthesizedArrowFunctionExpressionWorker);
}
- if (token() === 34) {
+ if (token() === 35) {
return 1;
}
return 0;
}
function isParenthesizedArrowFunctionExpressionWorker() {
- if (token() === 118) {
+ if (token() === 119) {
nextToken();
if (scanner.hasPrecedingLineBreak()) {
return 0;
}
- if (token() !== 17 && token() !== 25) {
+ if (token() !== 18 && token() !== 26) {
return 0;
}
}
var first = token();
var second = nextToken();
- if (first === 17) {
- if (second === 18) {
+ if (first === 18) {
+ if (second === 19) {
var third = nextToken();
switch (third) {
- case 34:
- case 54:
- case 15:
+ case 35:
+ case 55:
+ case 16:
return 1;
default:
return 0;
}
}
- if (second === 19 || second === 15) {
+ if (second === 20 || second === 16) {
return 2;
}
- if (second === 22) {
+ if (second === 23) {
return 1;
}
if (!isIdentifier()) {
return 0;
}
- if (nextToken() === 54) {
+ if (nextToken() === 55) {
return 1;
}
return 2;
}
else {
- ts.Debug.assert(first === 25);
+ ts.Debug.assert(first === 26);
if (!isIdentifier()) {
return 0;
}
if (sourceFile.languageVariant === 1) {
var isArrowFunctionInJsx = lookAhead(function () {
var third = nextToken();
- if (third === 83) {
+ if (third === 84) {
var fourth = nextToken();
switch (fourth) {
- case 56:
- case 27:
+ case 57:
+ case 28:
return false;
default:
return true;
}
}
- else if (third === 24) {
+ else if (third === 25) {
return true;
}
return false;
@@ -14542,7 +14029,7 @@ var ts;
return parseParenthesizedArrowFunctionExpressionHead(false);
}
function tryParseAsyncSimpleArrowFunctionExpression() {
- if (token() === 118) {
+ if (token() === 119) {
var isUnParenthesizedAsyncArrowFunction = lookAhead(isUnParenthesizedAsyncArrowFunctionWorker);
if (isUnParenthesizedAsyncArrowFunction === 1) {
var asyncModifier = parseModifiersForArrowFunction();
@@ -14553,38 +14040,38 @@ var ts;
return undefined;
}
function isUnParenthesizedAsyncArrowFunctionWorker() {
- if (token() === 118) {
+ if (token() === 119) {
nextToken();
- if (scanner.hasPrecedingLineBreak() || token() === 34) {
+ if (scanner.hasPrecedingLineBreak() || token() === 35) {
return 0;
}
var expr = parseBinaryExpressionOrHigher(0);
- if (!scanner.hasPrecedingLineBreak() && expr.kind === 69 && token() === 34) {
+ if (!scanner.hasPrecedingLineBreak() && expr.kind === 70 && token() === 35) {
return 1;
}
}
return 0;
}
function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) {
- var node = createNode(180);
+ var node = createNode(181);
node.modifiers = parseModifiersForArrowFunction();
var isAsync = !!(ts.getModifierFlags(node) & 256);
- fillSignature(54, false, isAsync, !allowAmbiguity, node);
+ fillSignature(55, false, isAsync, !allowAmbiguity, node);
if (!node.parameters) {
return undefined;
}
- if (!allowAmbiguity && token() !== 34 && token() !== 15) {
+ if (!allowAmbiguity && token() !== 35 && token() !== 16) {
return undefined;
}
return node;
}
function parseArrowFunctionExpressionBody(isAsync) {
- if (token() === 15) {
+ if (token() === 16) {
return parseFunctionBlock(false, isAsync, false);
}
- if (token() !== 23 &&
- token() !== 87 &&
- token() !== 73 &&
+ if (token() !== 24 &&
+ token() !== 88 &&
+ token() !== 74 &&
isStartOfStatement() &&
!isStartOfExpressionStatement()) {
return parseFunctionBlock(false, isAsync, true);
@@ -14594,15 +14081,15 @@ var ts;
: doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
}
function parseConditionalExpressionRest(leftOperand) {
- var questionToken = parseOptionalToken(53);
+ var questionToken = parseOptionalToken(54);
if (!questionToken) {
return leftOperand;
}
- var node = createNode(188, leftOperand.pos);
+ var node = createNode(189, leftOperand.pos);
node.condition = leftOperand;
node.questionToken = questionToken;
node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher);
- node.colonToken = parseExpectedToken(54, false, ts.Diagnostics._0_expected, ts.tokenToString(54));
+ node.colonToken = parseExpectedToken(55, false, ts.Diagnostics._0_expected, ts.tokenToString(55));
node.whenFalse = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
@@ -14611,22 +14098,22 @@ var ts;
return parseBinaryExpressionRest(precedence, leftOperand);
}
function isInOrOfKeyword(t) {
- return t === 90 || t === 138;
+ return t === 91 || t === 139;
}
function parseBinaryExpressionRest(precedence, leftOperand) {
while (true) {
reScanGreaterToken();
var newPrecedence = getBinaryOperatorPrecedence();
- var consumeCurrentOperator = token() === 38 ?
+ var consumeCurrentOperator = token() === 39 ?
newPrecedence >= precedence :
newPrecedence > precedence;
if (!consumeCurrentOperator) {
break;
}
- if (token() === 90 && inDisallowInContext()) {
+ if (token() === 91 && inDisallowInContext()) {
break;
}
- if (token() === 116) {
+ if (token() === 117) {
if (scanner.hasPrecedingLineBreak()) {
break;
}
@@ -14642,92 +14129,92 @@ var ts;
return leftOperand;
}
function isBinaryOperator() {
- if (inDisallowInContext() && token() === 90) {
+ if (inDisallowInContext() && token() === 91) {
return false;
}
return getBinaryOperatorPrecedence() > 0;
}
function getBinaryOperatorPrecedence() {
switch (token()) {
- case 52:
+ case 53:
return 1;
- case 51:
+ case 52:
return 2;
- case 47:
- return 3;
case 48:
+ return 3;
+ case 49:
return 4;
- case 46:
+ case 47:
return 5;
- case 30:
case 31:
case 32:
case 33:
+ case 34:
return 6;
- case 25:
- case 27:
+ case 26:
case 28:
case 29:
+ case 30:
+ case 92:
case 91:
- case 90:
- case 116:
+ case 117:
return 7;
- case 43:
case 44:
case 45:
+ case 46:
return 8;
- case 35:
case 36:
- return 9;
case 37:
- case 39:
- case 40:
- return 10;
+ return 9;
case 38:
+ case 40:
+ case 41:
+ return 10;
+ case 39:
return 11;
}
return -1;
}
function makeBinaryExpression(left, operatorToken, right) {
- var node = createNode(187, left.pos);
+ var node = createNode(188, left.pos);
node.left = left;
node.operatorToken = operatorToken;
node.right = right;
return finishNode(node);
}
function makeAsExpression(left, right) {
- var node = createNode(195, left.pos);
+ var node = createNode(196, left.pos);
node.expression = left;
node.type = right;
return finishNode(node);
}
function parsePrefixUnaryExpression() {
- var node = createNode(185);
+ var node = createNode(186);
node.operator = token();
nextToken();
node.operand = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseDeleteExpression() {
- var node = createNode(181);
- nextToken();
- node.expression = parseSimpleUnaryExpression();
- return finishNode(node);
- }
- function parseTypeOfExpression() {
var node = createNode(182);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
- function parseVoidExpression() {
+ function parseTypeOfExpression() {
var node = createNode(183);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
+ function parseVoidExpression() {
+ var node = createNode(184);
+ nextToken();
+ node.expression = parseSimpleUnaryExpression();
+ return finishNode(node);
+ }
function isAwaitExpression() {
- if (token() === 119) {
+ if (token() === 120) {
if (inAwaitContext()) {
return true;
}
@@ -14736,7 +14223,7 @@ var ts;
return false;
}
function parseAwaitExpression() {
- var node = createNode(184);
+ var node = createNode(185);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
@@ -14744,15 +14231,15 @@ var ts;
function parseUnaryExpressionOrHigher() {
if (isUpdateExpression()) {
var incrementExpression = parseIncrementExpression();
- return token() === 38 ?
+ return token() === 39 ?
parseBinaryExpressionRest(getBinaryOperatorPrecedence(), incrementExpression) :
incrementExpression;
}
var unaryOperator = token();
var simpleUnaryExpression = parseSimpleUnaryExpression();
- if (token() === 38) {
+ if (token() === 39) {
var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos);
- if (simpleUnaryExpression.kind === 177) {
+ if (simpleUnaryExpression.kind === 178) {
parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses);
}
else {
@@ -14763,20 +14250,20 @@ var ts;
}
function parseSimpleUnaryExpression() {
switch (token()) {
- case 35:
case 36:
+ case 37:
+ case 51:
case 50:
- case 49:
return parsePrefixUnaryExpression();
- case 78:
+ case 79:
return parseDeleteExpression();
- case 101:
+ case 102:
return parseTypeOfExpression();
- case 103:
+ case 104:
return parseVoidExpression();
- case 25:
+ case 26:
return parseTypeAssertion();
- case 119:
+ case 120:
if (isAwaitExpression()) {
return parseAwaitExpression();
}
@@ -14786,16 +14273,16 @@ var ts;
}
function isUpdateExpression() {
switch (token()) {
- case 35:
case 36:
+ case 37:
+ case 51:
case 50:
- case 49:
- case 78:
- case 101:
- case 103:
- case 119:
+ case 79:
+ case 102:
+ case 104:
+ case 120:
return false;
- case 25:
+ case 26:
if (sourceFile.languageVariant !== 1) {
return false;
}
@@ -14804,20 +14291,20 @@ var ts;
}
}
function parseIncrementExpression() {
- if (token() === 41 || token() === 42) {
- var node = createNode(185);
+ if (token() === 42 || token() === 43) {
+ var node = createNode(186);
node.operator = token();
nextToken();
node.operand = parseLeftHandSideExpressionOrHigher();
return finishNode(node);
}
- else if (sourceFile.languageVariant === 1 && token() === 25 && lookAhead(nextTokenIsIdentifierOrKeyword)) {
+ else if (sourceFile.languageVariant === 1 && token() === 26 && lookAhead(nextTokenIsIdentifierOrKeyword)) {
return parseJsxElementOrSelfClosingElement(true);
}
var expression = parseLeftHandSideExpressionOrHigher();
ts.Debug.assert(ts.isLeftHandSideExpression(expression));
- if ((token() === 41 || token() === 42) && !scanner.hasPrecedingLineBreak()) {
- var node = createNode(186, expression.pos);
+ if ((token() === 42 || token() === 43) && !scanner.hasPrecedingLineBreak()) {
+ var node = createNode(187, expression.pos);
node.operand = expression;
node.operator = token();
nextToken();
@@ -14826,7 +14313,7 @@ var ts;
return expression;
}
function parseLeftHandSideExpressionOrHigher() {
- var expression = token() === 95
+ var expression = token() === 96
? parseSuperExpression()
: parseMemberExpressionOrHigher();
return parseCallExpressionRest(expression);
@@ -14837,12 +14324,12 @@ var ts;
}
function parseSuperExpression() {
var expression = parseTokenNode();
- if (token() === 17 || token() === 21 || token() === 19) {
+ if (token() === 18 || token() === 22 || token() === 20) {
return expression;
}
- var node = createNode(172, expression.pos);
+ var node = createNode(173, expression.pos);
node.expression = expression;
- parseExpectedToken(21, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
+ parseExpectedToken(22, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
node.name = parseRightSideOfDot(true);
return finishNode(node);
}
@@ -14850,10 +14337,10 @@ var ts;
if (lhs.kind !== rhs.kind) {
return false;
}
- if (lhs.kind === 69) {
+ if (lhs.kind === 70) {
return lhs.text === rhs.text;
}
- if (lhs.kind === 97) {
+ if (lhs.kind === 98) {
return true;
}
return lhs.name.text === rhs.name.text &&
@@ -14862,8 +14349,8 @@ var ts;
function parseJsxElementOrSelfClosingElement(inExpressionContext) {
var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext);
var result;
- if (opening.kind === 243) {
- var node = createNode(241, opening.pos);
+ if (opening.kind === 244) {
+ var node = createNode(242, opening.pos);
node.openingElement = opening;
node.children = parseJsxChildren(node.openingElement.tagName);
node.closingElement = parseJsxClosingElement(inExpressionContext);
@@ -14873,18 +14360,18 @@ var ts;
result = finishNode(node);
}
else {
- ts.Debug.assert(opening.kind === 242);
+ ts.Debug.assert(opening.kind === 243);
result = opening;
}
- if (inExpressionContext && token() === 25) {
+ if (inExpressionContext && token() === 26) {
var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(true); });
if (invalidElement) {
parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element);
- var badNode = createNode(187, result.pos);
+ var badNode = createNode(188, result.pos);
badNode.end = invalidElement.end;
badNode.left = result;
badNode.right = invalidElement;
- badNode.operatorToken = createMissingNode(24, false, undefined);
+ badNode.operatorToken = createMissingNode(25, false, undefined);
badNode.operatorToken.pos = badNode.operatorToken.end = badNode.right.pos;
return badNode;
}
@@ -14892,17 +14379,17 @@ var ts;
return result;
}
function parseJsxText() {
- var node = createNode(244, scanner.getStartPos());
+ var node = createNode(10, scanner.getStartPos());
currentToken = scanner.scanJsxToken();
return finishNode(node);
}
function parseJsxChild() {
switch (token()) {
- case 244:
+ case 10:
return parseJsxText();
- case 15:
+ case 16:
return parseJsxExpression(false);
- case 25:
+ case 26:
return parseJsxElementOrSelfClosingElement(false);
}
ts.Debug.fail("Unknown JSX child kind " + token());
@@ -14913,7 +14400,7 @@ var ts;
parsingContext |= 1 << 14;
while (true) {
currentToken = scanner.reScanJsxToken();
- if (token() === 26) {
+ if (token() === 27) {
break;
}
else if (token() === 1) {
@@ -14928,24 +14415,24 @@ var ts;
}
function parseJsxOpeningOrSelfClosingElement(inExpressionContext) {
var fullStart = scanner.getStartPos();
- parseExpected(25);
+ parseExpected(26);
var tagName = parseJsxElementName();
var attributes = parseList(13, parseJsxAttribute);
var node;
- if (token() === 27) {
- node = createNode(243, fullStart);
+ if (token() === 28) {
+ node = createNode(244, fullStart);
scanJsxText();
}
else {
- parseExpected(39);
+ parseExpected(40);
if (inExpressionContext) {
- parseExpected(27);
+ parseExpected(28);
}
else {
- parseExpected(27, undefined, false);
+ parseExpected(28, undefined, false);
scanJsxText();
}
- node = createNode(242, fullStart);
+ node = createNode(243, fullStart);
}
node.tagName = tagName;
node.attributes = attributes;
@@ -14953,10 +14440,10 @@ var ts;
}
function parseJsxElementName() {
scanJsxIdentifier();
- var expression = token() === 97 ?
+ var expression = token() === 98 ?
parseTokenNode() : parseIdentifierName();
- while (parseOptional(21)) {
- var propertyAccess = createNode(172, expression.pos);
+ while (parseOptional(22)) {
+ var propertyAccess = createNode(173, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(true);
expression = finishNode(propertyAccess);
@@ -14965,27 +14452,27 @@ var ts;
}
function parseJsxExpression(inExpressionContext) {
var node = createNode(248);
- parseExpected(15);
- if (token() !== 16) {
+ parseExpected(16);
+ if (token() !== 17) {
node.expression = parseAssignmentExpressionOrHigher();
}
if (inExpressionContext) {
- parseExpected(16);
+ parseExpected(17);
}
else {
- parseExpected(16, undefined, false);
+ parseExpected(17, undefined, false);
scanJsxText();
}
return finishNode(node);
}
function parseJsxAttribute() {
- if (token() === 15) {
+ if (token() === 16) {
return parseJsxSpreadAttribute();
}
scanJsxIdentifier();
var node = createNode(246);
node.name = parseIdentifierName();
- if (token() === 56) {
+ if (token() === 57) {
switch (scanJsxAttributeValue()) {
case 9:
node.initializer = parseLiteralNode();
@@ -14999,68 +14486,68 @@ var ts;
}
function parseJsxSpreadAttribute() {
var node = createNode(247);
- parseExpected(15);
- parseExpected(22);
- node.expression = parseExpression();
parseExpected(16);
+ parseExpected(23);
+ node.expression = parseExpression();
+ parseExpected(17);
return finishNode(node);
}
function parseJsxClosingElement(inExpressionContext) {
var node = createNode(245);
- parseExpected(26);
+ parseExpected(27);
node.tagName = parseJsxElementName();
if (inExpressionContext) {
- parseExpected(27);
+ parseExpected(28);
}
else {
- parseExpected(27, undefined, false);
+ parseExpected(28, undefined, false);
scanJsxText();
}
return finishNode(node);
}
function parseTypeAssertion() {
- var node = createNode(177);
- parseExpected(25);
+ var node = createNode(178);
+ parseExpected(26);
node.type = parseType();
- parseExpected(27);
+ parseExpected(28);
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseMemberExpressionRest(expression) {
while (true) {
- var dotToken = parseOptionalToken(21);
+ var dotToken = parseOptionalToken(22);
if (dotToken) {
- var propertyAccess = createNode(172, expression.pos);
+ var propertyAccess = createNode(173, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(true);
expression = finishNode(propertyAccess);
continue;
}
- if (token() === 49 && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 50 && !scanner.hasPrecedingLineBreak()) {
nextToken();
- var nonNullExpression = createNode(196, expression.pos);
+ var nonNullExpression = createNode(197, expression.pos);
nonNullExpression.expression = expression;
expression = finishNode(nonNullExpression);
continue;
}
- if (!inDecoratorContext() && parseOptional(19)) {
- var indexedAccess = createNode(173, expression.pos);
+ if (!inDecoratorContext() && parseOptional(20)) {
+ var indexedAccess = createNode(174, expression.pos);
indexedAccess.expression = expression;
- if (token() !== 20) {
+ if (token() !== 21) {
indexedAccess.argumentExpression = allowInAnd(parseExpression);
if (indexedAccess.argumentExpression.kind === 9 || indexedAccess.argumentExpression.kind === 8) {
var literal = indexedAccess.argumentExpression;
literal.text = internIdentifier(literal.text);
}
}
- parseExpected(20);
+ parseExpected(21);
expression = finishNode(indexedAccess);
continue;
}
- if (token() === 11 || token() === 12) {
- var tagExpression = createNode(176, expression.pos);
+ if (token() === 12 || token() === 13) {
+ var tagExpression = createNode(177, expression.pos);
tagExpression.tag = expression;
- tagExpression.template = token() === 11
+ tagExpression.template = token() === 12
? parseLiteralNode()
: parseTemplateExpression();
expression = finishNode(tagExpression);
@@ -15072,20 +14559,20 @@ var ts;
function parseCallExpressionRest(expression) {
while (true) {
expression = parseMemberExpressionRest(expression);
- if (token() === 25) {
+ if (token() === 26) {
var typeArguments = tryParse(parseTypeArgumentsInExpression);
if (!typeArguments) {
return expression;
}
- var callExpr = createNode(174, expression.pos);
+ var callExpr = createNode(175, expression.pos);
callExpr.expression = expression;
callExpr.typeArguments = typeArguments;
callExpr.arguments = parseArgumentList();
expression = finishNode(callExpr);
continue;
}
- else if (token() === 17) {
- var callExpr = createNode(174, expression.pos);
+ else if (token() === 18) {
+ var callExpr = createNode(175, expression.pos);
callExpr.expression = expression;
callExpr.arguments = parseArgumentList();
expression = finishNode(callExpr);
@@ -15095,17 +14582,17 @@ var ts;
}
}
function parseArgumentList() {
- parseExpected(17);
- var result = parseDelimitedList(11, parseArgumentExpression);
parseExpected(18);
+ var result = parseDelimitedList(11, parseArgumentExpression);
+ parseExpected(19);
return result;
}
function parseTypeArgumentsInExpression() {
- if (!parseOptional(25)) {
+ if (!parseOptional(26)) {
return undefined;
}
var typeArguments = parseDelimitedList(18, parseType);
- if (!parseExpected(27)) {
+ if (!parseExpected(28)) {
return undefined;
}
return typeArguments && canFollowTypeArgumentsInExpression()
@@ -15114,27 +14601,27 @@ var ts;
}
function canFollowTypeArgumentsInExpression() {
switch (token()) {
- case 17:
- case 21:
case 18:
- case 20:
+ case 22:
+ case 19:
+ case 21:
+ case 55:
+ case 24:
case 54:
- case 23:
- case 53:
- case 30:
- case 32:
case 31:
case 33:
- case 51:
+ case 32:
+ case 34:
case 52:
- case 48:
- case 46:
+ case 53:
+ case 49:
case 47:
- case 16:
+ case 48:
+ case 17:
case 1:
return true;
- case 24:
- case 15:
+ case 25:
+ case 16:
default:
return false;
}
@@ -15143,80 +14630,80 @@ var ts;
switch (token()) {
case 8:
case 9:
- case 11:
+ case 12:
return parseLiteralNode();
- case 97:
- case 95:
- case 93:
- case 99:
- case 84:
+ case 98:
+ case 96:
+ case 94:
+ case 100:
+ case 85:
return parseTokenNode();
- case 17:
+ case 18:
return parseParenthesizedExpression();
- case 19:
+ case 20:
return parseArrayLiteralExpression();
- case 15:
+ case 16:
return parseObjectLiteralExpression();
- case 118:
+ case 119:
if (!lookAhead(nextTokenIsFunctionKeywordOnSameLine)) {
break;
}
return parseFunctionExpression();
- case 73:
+ case 74:
return parseClassExpression();
- case 87:
+ case 88:
return parseFunctionExpression();
- case 92:
+ case 93:
return parseNewExpression();
- case 39:
- case 61:
- if (reScanSlashToken() === 10) {
+ case 40:
+ case 62:
+ if (reScanSlashToken() === 11) {
return parseLiteralNode();
}
break;
- case 12:
+ case 13:
return parseTemplateExpression();
}
return parseIdentifier(ts.Diagnostics.Expression_expected);
}
function parseParenthesizedExpression() {
- var node = createNode(178);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(179);
parseExpected(18);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
return finishNode(node);
}
function parseSpreadElement() {
- var node = createNode(191);
- parseExpected(22);
+ var node = createNode(192);
+ parseExpected(23);
node.expression = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
function parseArgumentOrArrayLiteralElement() {
- return token() === 22 ? parseSpreadElement() :
- token() === 24 ? createNode(193) :
+ return token() === 23 ? parseSpreadElement() :
+ token() === 25 ? createNode(194) :
parseAssignmentExpressionOrHigher();
}
function parseArgumentExpression() {
return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement);
}
function parseArrayLiteralExpression() {
- var node = createNode(170);
- parseExpected(19);
+ var node = createNode(171);
+ parseExpected(20);
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
}
node.elements = parseDelimitedList(15, parseArgumentOrArrayLiteralElement);
- parseExpected(20);
+ parseExpected(21);
return finishNode(node);
}
function tryParseAccessorDeclaration(fullStart, decorators, modifiers) {
- if (parseContextualModifier(123)) {
- return parseAccessorDeclaration(149, fullStart, decorators, modifiers);
- }
- else if (parseContextualModifier(131)) {
+ if (parseContextualModifier(124)) {
return parseAccessorDeclaration(150, fullStart, decorators, modifiers);
}
+ else if (parseContextualModifier(132)) {
+ return parseAccessorDeclaration(151, fullStart, decorators, modifiers);
+ }
return undefined;
}
function parseObjectLiteralElement() {
@@ -15227,19 +14714,19 @@ var ts;
if (accessor) {
return accessor;
}
- var asteriskToken = parseOptionalToken(37);
+ var asteriskToken = parseOptionalToken(38);
var tokenIsIdentifier = isIdentifier();
var propertyName = parsePropertyName();
- var questionToken = parseOptionalToken(53);
- if (asteriskToken || token() === 17 || token() === 25) {
+ var questionToken = parseOptionalToken(54);
+ if (asteriskToken || token() === 18 || token() === 26) {
return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, propertyName, questionToken);
}
- var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 24 || token() === 16 || token() === 56);
+ var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 25 || token() === 17 || token() === 57);
if (isShorthandPropertyAssignment) {
var shorthandDeclaration = createNode(254, fullStart);
shorthandDeclaration.name = propertyName;
shorthandDeclaration.questionToken = questionToken;
- var equalsToken = parseOptionalToken(56);
+ var equalsToken = parseOptionalToken(57);
if (equalsToken) {
shorthandDeclaration.equalsToken = equalsToken;
shorthandDeclaration.objectAssignmentInitializer = allowInAnd(parseAssignmentExpressionOrHigher);
@@ -15251,19 +14738,19 @@ var ts;
propertyAssignment.modifiers = modifiers;
propertyAssignment.name = propertyName;
propertyAssignment.questionToken = questionToken;
- parseExpected(54);
+ parseExpected(55);
propertyAssignment.initializer = allowInAnd(parseAssignmentExpressionOrHigher);
return addJSDocComment(finishNode(propertyAssignment));
}
}
function parseObjectLiteralExpression() {
- var node = createNode(171);
- parseExpected(15);
+ var node = createNode(172);
+ parseExpected(16);
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
}
node.properties = parseDelimitedList(12, parseObjectLiteralElement, true);
- parseExpected(16);
+ parseExpected(17);
return finishNode(node);
}
function parseFunctionExpression() {
@@ -15271,10 +14758,10 @@ var ts;
if (saveDecoratorContext) {
setDecoratorContext(false);
}
- var node = createNode(179);
+ var node = createNode(180);
node.modifiers = parseModifiers();
- parseExpected(87);
- node.asteriskToken = parseOptionalToken(37);
+ parseExpected(88);
+ node.asteriskToken = parseOptionalToken(38);
var isGenerator = !!node.asteriskToken;
var isAsync = !!(ts.getModifierFlags(node) & 256);
node.name =
@@ -15282,7 +14769,7 @@ var ts;
isGenerator ? doInYieldContext(parseOptionalIdentifier) :
isAsync ? doInAwaitContext(parseOptionalIdentifier) :
parseOptionalIdentifier();
- fillSignature(54, isGenerator, isAsync, false, node);
+ fillSignature(55, isGenerator, isAsync, false, node);
node.body = parseFunctionBlock(isGenerator, isAsync, false);
if (saveDecoratorContext) {
setDecoratorContext(true);
@@ -15293,23 +14780,23 @@ var ts;
return isIdentifier() ? parseIdentifier() : undefined;
}
function parseNewExpression() {
- var node = createNode(175);
- parseExpected(92);
+ var node = createNode(176);
+ parseExpected(93);
node.expression = parseMemberExpressionOrHigher();
node.typeArguments = tryParse(parseTypeArgumentsInExpression);
- if (node.typeArguments || token() === 17) {
+ if (node.typeArguments || token() === 18) {
node.arguments = parseArgumentList();
}
return finishNode(node);
}
function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
- var node = createNode(199);
- if (parseExpected(15, diagnosticMessage) || ignoreMissingOpenBrace) {
+ var node = createNode(200);
+ if (parseExpected(16, diagnosticMessage) || ignoreMissingOpenBrace) {
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
}
node.statements = parseList(1, parseStatement);
- parseExpected(16);
+ parseExpected(17);
}
else {
node.statements = createMissingList();
@@ -15334,47 +14821,47 @@ var ts;
return block;
}
function parseEmptyStatement() {
- var node = createNode(201);
- parseExpected(23);
+ var node = createNode(202);
+ parseExpected(24);
return finishNode(node);
}
function parseIfStatement() {
- var node = createNode(203);
- parseExpected(88);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(204);
+ parseExpected(89);
parseExpected(18);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
node.thenStatement = parseStatement();
- node.elseStatement = parseOptional(80) ? parseStatement() : undefined;
+ node.elseStatement = parseOptional(81) ? parseStatement() : undefined;
return finishNode(node);
}
function parseDoStatement() {
- var node = createNode(204);
- parseExpected(79);
+ var node = createNode(205);
+ parseExpected(80);
node.statement = parseStatement();
- parseExpected(104);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ parseExpected(105);
parseExpected(18);
- parseOptional(23);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
+ parseOptional(24);
return finishNode(node);
}
function parseWhileStatement() {
- var node = createNode(205);
- parseExpected(104);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(206);
+ parseExpected(105);
parseExpected(18);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
node.statement = parseStatement();
return finishNode(node);
}
function parseForOrForInOrForOfStatement() {
var pos = getNodePos();
- parseExpected(86);
- parseExpected(17);
+ parseExpected(87);
+ parseExpected(18);
var initializer = undefined;
- if (token() !== 23) {
- if (token() === 102 || token() === 108 || token() === 74) {
+ if (token() !== 24) {
+ if (token() === 103 || token() === 109 || token() === 75) {
initializer = parseVariableDeclarationList(true);
}
else {
@@ -15382,32 +14869,32 @@ var ts;
}
}
var forOrForInOrForOfStatement;
- if (parseOptional(90)) {
- var forInStatement = createNode(207, pos);
+ if (parseOptional(91)) {
+ var forInStatement = createNode(208, pos);
forInStatement.initializer = initializer;
forInStatement.expression = allowInAnd(parseExpression);
- parseExpected(18);
+ parseExpected(19);
forOrForInOrForOfStatement = forInStatement;
}
- else if (parseOptional(138)) {
- var forOfStatement = createNode(208, pos);
+ else if (parseOptional(139)) {
+ var forOfStatement = createNode(209, pos);
forOfStatement.initializer = initializer;
forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher);
- parseExpected(18);
+ parseExpected(19);
forOrForInOrForOfStatement = forOfStatement;
}
else {
- var forStatement = createNode(206, pos);
+ var forStatement = createNode(207, pos);
forStatement.initializer = initializer;
- parseExpected(23);
- if (token() !== 23 && token() !== 18) {
+ parseExpected(24);
+ if (token() !== 24 && token() !== 19) {
forStatement.condition = allowInAnd(parseExpression);
}
- parseExpected(23);
- if (token() !== 18) {
+ parseExpected(24);
+ if (token() !== 19) {
forStatement.incrementor = allowInAnd(parseExpression);
}
- parseExpected(18);
+ parseExpected(19);
forOrForInOrForOfStatement = forStatement;
}
forOrForInOrForOfStatement.statement = parseStatement();
@@ -15415,7 +14902,7 @@ var ts;
}
function parseBreakOrContinueStatement(kind) {
var node = createNode(kind);
- parseExpected(kind === 210 ? 70 : 75);
+ parseExpected(kind === 211 ? 71 : 76);
if (!canParseSemicolon()) {
node.label = parseIdentifier();
}
@@ -15423,8 +14910,8 @@ var ts;
return finishNode(node);
}
function parseReturnStatement() {
- var node = createNode(211);
- parseExpected(94);
+ var node = createNode(212);
+ parseExpected(95);
if (!canParseSemicolon()) {
node.expression = allowInAnd(parseExpression);
}
@@ -15432,90 +14919,90 @@ var ts;
return finishNode(node);
}
function parseWithStatement() {
- var node = createNode(212);
- parseExpected(105);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(213);
+ parseExpected(106);
parseExpected(18);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
node.statement = parseStatement();
return finishNode(node);
}
function parseCaseClause() {
var node = createNode(249);
- parseExpected(71);
+ parseExpected(72);
node.expression = allowInAnd(parseExpression);
- parseExpected(54);
+ parseExpected(55);
node.statements = parseList(3, parseStatement);
return finishNode(node);
}
function parseDefaultClause() {
var node = createNode(250);
- parseExpected(77);
- parseExpected(54);
+ parseExpected(78);
+ parseExpected(55);
node.statements = parseList(3, parseStatement);
return finishNode(node);
}
function parseCaseOrDefaultClause() {
- return token() === 71 ? parseCaseClause() : parseDefaultClause();
+ return token() === 72 ? parseCaseClause() : parseDefaultClause();
}
function parseSwitchStatement() {
- var node = createNode(213);
- parseExpected(96);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(214);
+ parseExpected(97);
parseExpected(18);
- var caseBlock = createNode(227, scanner.getStartPos());
- parseExpected(15);
- caseBlock.clauses = parseList(2, parseCaseOrDefaultClause);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
+ var caseBlock = createNode(228, scanner.getStartPos());
parseExpected(16);
+ caseBlock.clauses = parseList(2, parseCaseOrDefaultClause);
+ parseExpected(17);
node.caseBlock = finishNode(caseBlock);
return finishNode(node);
}
function parseThrowStatement() {
- var node = createNode(215);
- parseExpected(98);
+ var node = createNode(216);
+ parseExpected(99);
node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression);
parseSemicolon();
return finishNode(node);
}
function parseTryStatement() {
- var node = createNode(216);
- parseExpected(100);
+ var node = createNode(217);
+ parseExpected(101);
node.tryBlock = parseBlock(false);
- node.catchClause = token() === 72 ? parseCatchClause() : undefined;
- if (!node.catchClause || token() === 85) {
- parseExpected(85);
+ node.catchClause = token() === 73 ? parseCatchClause() : undefined;
+ if (!node.catchClause || token() === 86) {
+ parseExpected(86);
node.finallyBlock = parseBlock(false);
}
return finishNode(node);
}
function parseCatchClause() {
var result = createNode(252);
- parseExpected(72);
- if (parseExpected(17)) {
+ parseExpected(73);
+ if (parseExpected(18)) {
result.variableDeclaration = parseVariableDeclaration();
}
- parseExpected(18);
+ parseExpected(19);
result.block = parseBlock(false);
return finishNode(result);
}
function parseDebuggerStatement() {
- var node = createNode(217);
- parseExpected(76);
+ var node = createNode(218);
+ parseExpected(77);
parseSemicolon();
return finishNode(node);
}
function parseExpressionOrLabeledStatement() {
var fullStart = scanner.getStartPos();
var expression = allowInAnd(parseExpression);
- if (expression.kind === 69 && parseOptional(54)) {
- var labeledStatement = createNode(214, fullStart);
+ if (expression.kind === 70 && parseOptional(55)) {
+ var labeledStatement = createNode(215, fullStart);
labeledStatement.label = expression;
labeledStatement.statement = parseStatement();
return addJSDocComment(finishNode(labeledStatement));
}
else {
- var expressionStatement = createNode(202, fullStart);
+ var expressionStatement = createNode(203, fullStart);
expressionStatement.expression = expression;
parseSemicolon();
return addJSDocComment(finishNode(expressionStatement));
@@ -15527,7 +15014,7 @@ var ts;
}
function nextTokenIsFunctionKeywordOnSameLine() {
nextToken();
- return token() === 87 && !scanner.hasPrecedingLineBreak();
+ return token() === 88 && !scanner.hasPrecedingLineBreak();
}
function nextTokenIsIdentifierOrKeywordOrNumberOnSameLine() {
nextToken();
@@ -15536,47 +15023,47 @@ var ts;
function isDeclaration() {
while (true) {
switch (token()) {
- case 102:
- case 108:
+ case 103:
+ case 109:
+ case 75:
+ case 88:
case 74:
- case 87:
- case 73:
- case 81:
+ case 82:
return true;
- case 107:
- case 134:
+ case 108:
+ case 135:
return nextTokenIsIdentifierOnSameLine();
- case 125:
case 126:
+ case 127:
return nextTokenIsIdentifierOrStringLiteralOnSameLine();
- case 115:
- case 118:
- case 122:
- case 110:
+ case 116:
+ case 119:
+ case 123:
case 111:
case 112:
- case 128:
+ case 113:
+ case 129:
nextToken();
if (scanner.hasPrecedingLineBreak()) {
return false;
}
continue;
- case 137:
+ case 138:
nextToken();
- return token() === 15 || token() === 69 || token() === 82;
- case 89:
+ return token() === 16 || token() === 70 || token() === 83;
+ case 90:
nextToken();
- return token() === 9 || token() === 37 ||
- token() === 15 || ts.tokenIsIdentifierOrKeyword(token());
- case 82:
+ return token() === 9 || token() === 38 ||
+ token() === 16 || ts.tokenIsIdentifierOrKeyword(token());
+ case 83:
nextToken();
- if (token() === 56 || token() === 37 ||
- token() === 15 || token() === 77 ||
- token() === 116) {
+ if (token() === 57 || token() === 38 ||
+ token() === 16 || token() === 78 ||
+ token() === 117) {
return true;
}
continue;
- case 113:
+ case 114:
nextToken();
continue;
default:
@@ -15589,46 +15076,46 @@ var ts;
}
function isStartOfStatement() {
switch (token()) {
- case 55:
- case 23:
- case 15:
- case 102:
- case 108:
- case 87:
- case 73:
- case 81:
+ case 56:
+ case 24:
+ case 16:
+ case 103:
+ case 109:
case 88:
- case 79:
- case 104:
- case 86:
- case 75:
- case 70:
- case 94:
- case 105:
- case 96:
- case 98:
- case 100:
- case 76:
- case 72:
- case 85:
- return true;
case 74:
case 82:
case 89:
+ case 80:
+ case 105:
+ case 87:
+ case 76:
+ case 71:
+ case 95:
+ case 106:
+ case 97:
+ case 99:
+ case 101:
+ case 77:
+ case 73:
+ case 86:
+ return true;
+ case 75:
+ case 83:
+ case 90:
return isStartOfDeclaration();
- case 118:
- case 122:
- case 107:
- case 125:
+ case 119:
+ case 123:
+ case 108:
case 126:
- case 134:
- case 137:
+ case 127:
+ case 135:
+ case 138:
return true;
- case 112:
- case 110:
- case 111:
case 113:
- case 128:
+ case 111:
+ case 112:
+ case 114:
+ case 129:
return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);
default:
return isStartOfExpression();
@@ -15636,73 +15123,73 @@ var ts;
}
function nextTokenIsIdentifierOrStartOfDestructuring() {
nextToken();
- return isIdentifier() || token() === 15 || token() === 19;
+ return isIdentifier() || token() === 16 || token() === 20;
}
function isLetDeclaration() {
return lookAhead(nextTokenIsIdentifierOrStartOfDestructuring);
}
function parseStatement() {
switch (token()) {
- case 23:
+ case 24:
return parseEmptyStatement();
- case 15:
+ case 16:
return parseBlock(false);
- case 102:
+ case 103:
return parseVariableStatement(scanner.getStartPos(), undefined, undefined);
- case 108:
+ case 109:
if (isLetDeclaration()) {
return parseVariableStatement(scanner.getStartPos(), undefined, undefined);
}
break;
- case 87:
- return parseFunctionDeclaration(scanner.getStartPos(), undefined, undefined);
- case 73:
- return parseClassDeclaration(scanner.getStartPos(), undefined, undefined);
case 88:
- return parseIfStatement();
- case 79:
- return parseDoStatement();
- case 104:
- return parseWhileStatement();
- case 86:
- return parseForOrForInOrForOfStatement();
- case 75:
- return parseBreakOrContinueStatement(209);
- case 70:
- return parseBreakOrContinueStatement(210);
- case 94:
- return parseReturnStatement();
- case 105:
- return parseWithStatement();
- case 96:
- return parseSwitchStatement();
- case 98:
- return parseThrowStatement();
- case 100:
- case 72:
- case 85:
- return parseTryStatement();
- case 76:
- return parseDebuggerStatement();
- case 55:
- return parseDeclaration();
- case 118:
- case 107:
- case 134:
- case 125:
- case 126:
- case 122:
+ return parseFunctionDeclaration(scanner.getStartPos(), undefined, undefined);
case 74:
- case 81:
- case 82:
+ return parseClassDeclaration(scanner.getStartPos(), undefined, undefined);
case 89:
- case 110:
+ return parseIfStatement();
+ case 80:
+ return parseDoStatement();
+ case 105:
+ return parseWhileStatement();
+ case 87:
+ return parseForOrForInOrForOfStatement();
+ case 76:
+ return parseBreakOrContinueStatement(210);
+ case 71:
+ return parseBreakOrContinueStatement(211);
+ case 95:
+ return parseReturnStatement();
+ case 106:
+ return parseWithStatement();
+ case 97:
+ return parseSwitchStatement();
+ case 99:
+ return parseThrowStatement();
+ case 101:
+ case 73:
+ case 86:
+ return parseTryStatement();
+ case 77:
+ return parseDebuggerStatement();
+ case 56:
+ return parseDeclaration();
+ case 119:
+ case 108:
+ case 135:
+ case 126:
+ case 127:
+ case 123:
+ case 75:
+ case 82:
+ case 83:
+ case 90:
case 111:
case 112:
- case 115:
case 113:
- case 128:
- case 137:
+ case 116:
+ case 114:
+ case 129:
+ case 138:
if (isStartOfDeclaration()) {
return parseDeclaration();
}
@@ -15715,40 +15202,40 @@ var ts;
var decorators = parseDecorators();
var modifiers = parseModifiers();
switch (token()) {
- case 102:
- case 108:
- case 74:
+ case 103:
+ case 109:
+ case 75:
return parseVariableStatement(fullStart, decorators, modifiers);
- case 87:
+ case 88:
return parseFunctionDeclaration(fullStart, decorators, modifiers);
- case 73:
+ case 74:
return parseClassDeclaration(fullStart, decorators, modifiers);
- case 107:
+ case 108:
return parseInterfaceDeclaration(fullStart, decorators, modifiers);
- case 134:
+ case 135:
return parseTypeAliasDeclaration(fullStart, decorators, modifiers);
- case 81:
- return parseEnumDeclaration(fullStart, decorators, modifiers);
- case 137:
- case 125:
- case 126:
- return parseModuleDeclaration(fullStart, decorators, modifiers);
- case 89:
- return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers);
case 82:
+ return parseEnumDeclaration(fullStart, decorators, modifiers);
+ case 138:
+ case 126:
+ case 127:
+ return parseModuleDeclaration(fullStart, decorators, modifiers);
+ case 90:
+ return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers);
+ case 83:
nextToken();
switch (token()) {
- case 77:
- case 56:
+ case 78:
+ case 57:
return parseExportAssignment(fullStart, decorators, modifiers);
- case 116:
+ case 117:
return parseNamespaceExportDeclaration(fullStart, decorators, modifiers);
default:
return parseExportDeclaration(fullStart, decorators, modifiers);
}
default:
if (decorators || modifiers) {
- var node = createMissingNode(239, true, ts.Diagnostics.Declaration_expected);
+ var node = createMissingNode(240, true, ts.Diagnostics.Declaration_expected);
node.pos = fullStart;
node.decorators = decorators;
node.modifiers = modifiers;
@@ -15761,31 +15248,31 @@ var ts;
return !scanner.hasPrecedingLineBreak() && (isIdentifier() || token() === 9);
}
function parseFunctionBlockOrSemicolon(isGenerator, isAsync, diagnosticMessage) {
- if (token() !== 15 && canParseSemicolon()) {
+ if (token() !== 16 && canParseSemicolon()) {
parseSemicolon();
return;
}
return parseFunctionBlock(isGenerator, isAsync, false, diagnosticMessage);
}
function parseArrayBindingElement() {
- if (token() === 24) {
- return createNode(193);
+ if (token() === 25) {
+ return createNode(194);
}
- var node = createNode(169);
- node.dotDotDotToken = parseOptionalToken(22);
+ var node = createNode(170);
+ node.dotDotDotToken = parseOptionalToken(23);
node.name = parseIdentifierOrPattern();
node.initializer = parseBindingElementInitializer(false);
return finishNode(node);
}
function parseObjectBindingElement() {
- var node = createNode(169);
+ var node = createNode(170);
var tokenIsIdentifier = isIdentifier();
var propertyName = parsePropertyName();
- if (tokenIsIdentifier && token() !== 54) {
+ if (tokenIsIdentifier && token() !== 55) {
node.name = propertyName;
}
else {
- parseExpected(54);
+ parseExpected(55);
node.propertyName = propertyName;
node.name = parseIdentifierOrPattern();
}
@@ -15793,33 +15280,33 @@ var ts;
return finishNode(node);
}
function parseObjectBindingPattern() {
- var node = createNode(167);
- parseExpected(15);
- node.elements = parseDelimitedList(9, parseObjectBindingElement);
+ var node = createNode(168);
parseExpected(16);
+ node.elements = parseDelimitedList(9, parseObjectBindingElement);
+ parseExpected(17);
return finishNode(node);
}
function parseArrayBindingPattern() {
- var node = createNode(168);
- parseExpected(19);
- node.elements = parseDelimitedList(10, parseArrayBindingElement);
+ var node = createNode(169);
parseExpected(20);
+ node.elements = parseDelimitedList(10, parseArrayBindingElement);
+ parseExpected(21);
return finishNode(node);
}
function isIdentifierOrPattern() {
- return token() === 15 || token() === 19 || isIdentifier();
+ return token() === 16 || token() === 20 || isIdentifier();
}
function parseIdentifierOrPattern() {
- if (token() === 19) {
+ if (token() === 20) {
return parseArrayBindingPattern();
}
- if (token() === 15) {
+ if (token() === 16) {
return parseObjectBindingPattern();
}
return parseIdentifier();
}
function parseVariableDeclaration() {
- var node = createNode(218);
+ var node = createNode(219);
node.name = parseIdentifierOrPattern();
node.type = parseTypeAnnotation();
if (!isInOrOfKeyword(token())) {
@@ -15828,21 +15315,21 @@ var ts;
return finishNode(node);
}
function parseVariableDeclarationList(inForStatementInitializer) {
- var node = createNode(219);
+ var node = createNode(220);
switch (token()) {
- case 102:
+ case 103:
break;
- case 108:
+ case 109:
node.flags |= 1;
break;
- case 74:
+ case 75:
node.flags |= 2;
break;
default:
ts.Debug.fail();
}
nextToken();
- if (token() === 138 && lookAhead(canFollowContextualOfKeyword)) {
+ if (token() === 139 && lookAhead(canFollowContextualOfKeyword)) {
node.declarations = createMissingList();
}
else {
@@ -15854,10 +15341,10 @@ var ts;
return finishNode(node);
}
function canFollowContextualOfKeyword() {
- return nextTokenIsIdentifier() && nextToken() === 18;
+ return nextTokenIsIdentifier() && nextToken() === 19;
}
function parseVariableStatement(fullStart, decorators, modifiers) {
- var node = createNode(200, fullStart);
+ var node = createNode(201, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
node.declarationList = parseVariableDeclarationList(false);
@@ -15865,29 +15352,29 @@ var ts;
return addJSDocComment(finishNode(node));
}
function parseFunctionDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(220, fullStart);
+ var node = createNode(221, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(87);
- node.asteriskToken = parseOptionalToken(37);
+ parseExpected(88);
+ node.asteriskToken = parseOptionalToken(38);
node.name = ts.hasModifier(node, 512) ? parseOptionalIdentifier() : parseIdentifier();
var isGenerator = !!node.asteriskToken;
var isAsync = ts.hasModifier(node, 256);
- fillSignature(54, isGenerator, isAsync, false, node);
+ fillSignature(55, isGenerator, isAsync, false, node);
node.body = parseFunctionBlockOrSemicolon(isGenerator, isAsync, ts.Diagnostics.or_expected);
return addJSDocComment(finishNode(node));
}
function parseConstructorDeclaration(pos, decorators, modifiers) {
- var node = createNode(148, pos);
+ var node = createNode(149, pos);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(121);
- fillSignature(54, false, false, false, node);
+ parseExpected(122);
+ fillSignature(55, false, false, false, node);
node.body = parseFunctionBlockOrSemicolon(false, false, ts.Diagnostics.or_expected);
return addJSDocComment(finishNode(node));
}
function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) {
- var method = createNode(147, fullStart);
+ var method = createNode(148, fullStart);
method.decorators = decorators;
method.modifiers = modifiers;
method.asteriskToken = asteriskToken;
@@ -15895,12 +15382,12 @@ var ts;
method.questionToken = questionToken;
var isGenerator = !!asteriskToken;
var isAsync = ts.hasModifier(method, 256);
- fillSignature(54, isGenerator, isAsync, false, method);
+ fillSignature(55, isGenerator, isAsync, false, method);
method.body = parseFunctionBlockOrSemicolon(isGenerator, isAsync, diagnosticMessage);
return addJSDocComment(finishNode(method));
}
function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) {
- var property = createNode(145, fullStart);
+ var property = createNode(146, fullStart);
property.decorators = decorators;
property.modifiers = modifiers;
property.name = name;
@@ -15913,10 +15400,10 @@ var ts;
return addJSDocComment(finishNode(property));
}
function parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers) {
- var asteriskToken = parseOptionalToken(37);
+ var asteriskToken = parseOptionalToken(38);
var name = parsePropertyName();
- var questionToken = parseOptionalToken(53);
- if (asteriskToken || token() === 17 || token() === 25) {
+ var questionToken = parseOptionalToken(54);
+ if (asteriskToken || token() === 18 || token() === 26) {
return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, ts.Diagnostics.or_expected);
}
else {
@@ -15931,17 +15418,17 @@ var ts;
node.decorators = decorators;
node.modifiers = modifiers;
node.name = parsePropertyName();
- fillSignature(54, false, false, false, node);
+ fillSignature(55, false, false, false, node);
node.body = parseFunctionBlockOrSemicolon(false, false);
return addJSDocComment(finishNode(node));
}
function isClassMemberModifier(idToken) {
switch (idToken) {
- case 112:
- case 110:
- case 111:
case 113:
- case 128:
+ case 111:
+ case 112:
+ case 114:
+ case 129:
return true;
default:
return false;
@@ -15949,7 +15436,7 @@ var ts;
}
function isClassMemberStart() {
var idToken;
- if (token() === 55) {
+ if (token() === 56) {
return true;
}
while (ts.isModifierKind(token())) {
@@ -15959,26 +15446,26 @@ var ts;
}
nextToken();
}
- if (token() === 37) {
+ if (token() === 38) {
return true;
}
if (isLiteralPropertyName()) {
idToken = token();
nextToken();
}
- if (token() === 19) {
+ if (token() === 20) {
return true;
}
if (idToken !== undefined) {
- if (!ts.isKeyword(idToken) || idToken === 131 || idToken === 123) {
+ if (!ts.isKeyword(idToken) || idToken === 132 || idToken === 124) {
return true;
}
switch (token()) {
- case 17:
- case 25:
+ case 18:
+ case 26:
+ case 55:
+ case 57:
case 54:
- case 56:
- case 53:
return true;
default:
return canParseSemicolon();
@@ -15990,10 +15477,10 @@ var ts;
var decorators;
while (true) {
var decoratorStart = getNodePos();
- if (!parseOptional(55)) {
+ if (!parseOptional(56)) {
break;
}
- var decorator = createNode(143, decoratorStart);
+ var decorator = createNode(144, decoratorStart);
decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher);
finishNode(decorator);
if (!decorators) {
@@ -16013,7 +15500,7 @@ var ts;
while (true) {
var modifierStart = scanner.getStartPos();
var modifierKind = token();
- if (token() === 74 && permitInvalidConstAsModifier) {
+ if (token() === 75 && permitInvalidConstAsModifier) {
if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) {
break;
}
@@ -16038,7 +15525,7 @@ var ts;
}
function parseModifiersForArrowFunction() {
var modifiers;
- if (token() === 118) {
+ if (token() === 119) {
var modifierStart = scanner.getStartPos();
var modifierKind = token();
nextToken();
@@ -16049,8 +15536,8 @@ var ts;
return modifiers;
}
function parseClassElement() {
- if (token() === 23) {
- var result = createNode(198);
+ if (token() === 24) {
+ var result = createNode(199);
nextToken();
return finishNode(result);
}
@@ -16061,7 +15548,7 @@ var ts;
if (accessor) {
return accessor;
}
- if (token() === 121) {
+ if (token() === 122) {
return parseConstructorDeclaration(fullStart, decorators, modifiers);
}
if (isIndexSignature()) {
@@ -16070,33 +15557,33 @@ var ts;
if (ts.tokenIsIdentifierOrKeyword(token()) ||
token() === 9 ||
token() === 8 ||
- token() === 37 ||
- token() === 19) {
+ token() === 38 ||
+ token() === 20) {
return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers);
}
if (decorators || modifiers) {
- var name_13 = createMissingNode(69, true, ts.Diagnostics.Declaration_expected);
- return parsePropertyDeclaration(fullStart, decorators, modifiers, name_13, undefined);
+ var name_10 = createMissingNode(70, true, ts.Diagnostics.Declaration_expected);
+ return parsePropertyDeclaration(fullStart, decorators, modifiers, name_10, undefined);
}
ts.Debug.fail("Should not have attempted to parse class member declaration.");
}
function parseClassExpression() {
- return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 192);
+ return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 193);
}
function parseClassDeclaration(fullStart, decorators, modifiers) {
- return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 221);
+ return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 222);
}
function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) {
var node = createNode(kind, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(73);
+ parseExpected(74);
node.name = parseNameOfClassDeclarationOrExpression();
node.typeParameters = parseTypeParameters();
- node.heritageClauses = parseHeritageClauses(true);
- if (parseExpected(15)) {
+ node.heritageClauses = parseHeritageClauses();
+ if (parseExpected(16)) {
node.members = parseClassMembers();
- parseExpected(16);
+ parseExpected(17);
}
else {
node.members = createMissingList();
@@ -16109,16 +15596,16 @@ var ts;
: undefined;
}
function isImplementsClause() {
- return token() === 106 && lookAhead(nextTokenIsIdentifierOrKeyword);
+ return token() === 107 && lookAhead(nextTokenIsIdentifierOrKeyword);
}
- function parseHeritageClauses(isClassHeritageClause) {
+ function parseHeritageClauses() {
if (isHeritageClause()) {
return parseList(20, parseHeritageClause);
}
return undefined;
}
function parseHeritageClause() {
- if (token() === 83 || token() === 106) {
+ if (token() === 84 || token() === 107) {
var node = createNode(251);
node.token = token();
nextToken();
@@ -16128,38 +15615,38 @@ var ts;
return undefined;
}
function parseExpressionWithTypeArguments() {
- var node = createNode(194);
+ var node = createNode(195);
node.expression = parseLeftHandSideExpressionOrHigher();
- if (token() === 25) {
- node.typeArguments = parseBracketedList(18, parseType, 25, 27);
+ if (token() === 26) {
+ node.typeArguments = parseBracketedList(18, parseType, 26, 28);
}
return finishNode(node);
}
function isHeritageClause() {
- return token() === 83 || token() === 106;
+ return token() === 84 || token() === 107;
}
function parseClassMembers() {
return parseList(5, parseClassElement);
}
function parseInterfaceDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(222, fullStart);
+ var node = createNode(223, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(107);
+ parseExpected(108);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
- node.heritageClauses = parseHeritageClauses(false);
+ node.heritageClauses = parseHeritageClauses();
node.members = parseObjectTypeMembers();
return addJSDocComment(finishNode(node));
}
function parseTypeAliasDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(223, fullStart);
+ var node = createNode(224, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(134);
+ parseExpected(135);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
- parseExpected(56);
+ parseExpected(57);
node.type = parseType();
parseSemicolon();
return addJSDocComment(finishNode(node));
@@ -16171,14 +15658,14 @@ var ts;
return addJSDocComment(finishNode(node));
}
function parseEnumDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(224, fullStart);
+ var node = createNode(225, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(81);
+ parseExpected(82);
node.name = parseIdentifier();
- if (parseExpected(15)) {
+ if (parseExpected(16)) {
node.members = parseDelimitedList(6, parseEnumMember);
- parseExpected(16);
+ parseExpected(17);
}
else {
node.members = createMissingList();
@@ -16186,10 +15673,10 @@ var ts;
return addJSDocComment(finishNode(node));
}
function parseModuleBlock() {
- var node = createNode(226, scanner.getStartPos());
- if (parseExpected(15)) {
+ var node = createNode(227, scanner.getStartPos());
+ if (parseExpected(16)) {
node.statements = parseList(1, parseStatement);
- parseExpected(16);
+ parseExpected(17);
}
else {
node.statements = createMissingList();
@@ -16197,29 +15684,29 @@ var ts;
return finishNode(node);
}
function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) {
- var node = createNode(225, fullStart);
+ var node = createNode(226, fullStart);
var namespaceFlag = flags & 16;
node.decorators = decorators;
node.modifiers = modifiers;
node.flags |= flags;
node.name = parseIdentifier();
- node.body = parseOptional(21)
+ node.body = parseOptional(22)
? parseModuleOrNamespaceDeclaration(getNodePos(), undefined, undefined, 4 | namespaceFlag)
: parseModuleBlock();
return addJSDocComment(finishNode(node));
}
function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(225, fullStart);
+ var node = createNode(226, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- if (token() === 137) {
+ if (token() === 138) {
node.name = parseIdentifier();
node.flags |= 512;
}
else {
node.name = parseLiteralNode(true);
}
- if (token() === 15) {
+ if (token() === 16) {
node.body = parseModuleBlock();
}
else {
@@ -16229,14 +15716,14 @@ var ts;
}
function parseModuleDeclaration(fullStart, decorators, modifiers) {
var flags = 0;
- if (token() === 137) {
+ if (token() === 138) {
return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers);
}
- else if (parseOptional(126)) {
+ else if (parseOptional(127)) {
flags |= 16;
}
else {
- parseExpected(125);
+ parseExpected(126);
if (token() === 9) {
return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers);
}
@@ -16244,63 +15731,63 @@ var ts;
return parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags);
}
function isExternalModuleReference() {
- return token() === 129 &&
+ return token() === 130 &&
lookAhead(nextTokenIsOpenParen);
}
function nextTokenIsOpenParen() {
- return nextToken() === 17;
+ return nextToken() === 18;
}
function nextTokenIsSlash() {
- return nextToken() === 39;
+ return nextToken() === 40;
}
function parseNamespaceExportDeclaration(fullStart, decorators, modifiers) {
- var exportDeclaration = createNode(228, fullStart);
+ var exportDeclaration = createNode(229, fullStart);
exportDeclaration.decorators = decorators;
exportDeclaration.modifiers = modifiers;
- parseExpected(116);
- parseExpected(126);
+ parseExpected(117);
+ parseExpected(127);
exportDeclaration.name = parseIdentifier();
- parseExpected(23);
+ parseExpected(24);
return finishNode(exportDeclaration);
}
function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) {
- parseExpected(89);
+ parseExpected(90);
var afterImportPos = scanner.getStartPos();
var identifier;
if (isIdentifier()) {
identifier = parseIdentifier();
- if (token() !== 24 && token() !== 136) {
- var importEqualsDeclaration = createNode(229, fullStart);
+ if (token() !== 25 && token() !== 137) {
+ var importEqualsDeclaration = createNode(230, fullStart);
importEqualsDeclaration.decorators = decorators;
importEqualsDeclaration.modifiers = modifiers;
importEqualsDeclaration.name = identifier;
- parseExpected(56);
+ parseExpected(57);
importEqualsDeclaration.moduleReference = parseModuleReference();
parseSemicolon();
return addJSDocComment(finishNode(importEqualsDeclaration));
}
}
- var importDeclaration = createNode(230, fullStart);
+ var importDeclaration = createNode(231, fullStart);
importDeclaration.decorators = decorators;
importDeclaration.modifiers = modifiers;
if (identifier ||
- token() === 37 ||
- token() === 15) {
+ token() === 38 ||
+ token() === 16) {
importDeclaration.importClause = parseImportClause(identifier, afterImportPos);
- parseExpected(136);
+ parseExpected(137);
}
importDeclaration.moduleSpecifier = parseModuleSpecifier();
parseSemicolon();
return finishNode(importDeclaration);
}
function parseImportClause(identifier, fullStart) {
- var importClause = createNode(231, fullStart);
+ var importClause = createNode(232, fullStart);
if (identifier) {
importClause.name = identifier;
}
if (!importClause.name ||
- parseOptional(24)) {
- importClause.namedBindings = token() === 37 ? parseNamespaceImport() : parseNamedImportsOrExports(233);
+ parseOptional(25)) {
+ importClause.namedBindings = token() === 38 ? parseNamespaceImport() : parseNamedImportsOrExports(234);
}
return finishNode(importClause);
}
@@ -16310,11 +15797,11 @@ var ts;
: parseEntityName(false);
}
function parseExternalModuleReference() {
- var node = createNode(240);
- parseExpected(129);
- parseExpected(17);
- node.expression = parseModuleSpecifier();
+ var node = createNode(241);
+ parseExpected(130);
parseExpected(18);
+ node.expression = parseModuleSpecifier();
+ parseExpected(19);
return finishNode(node);
}
function parseModuleSpecifier() {
@@ -16328,22 +15815,22 @@ var ts;
}
}
function parseNamespaceImport() {
- var namespaceImport = createNode(232);
- parseExpected(37);
- parseExpected(116);
+ var namespaceImport = createNode(233);
+ parseExpected(38);
+ parseExpected(117);
namespaceImport.name = parseIdentifier();
return finishNode(namespaceImport);
}
function parseNamedImportsOrExports(kind) {
var node = createNode(kind);
- node.elements = parseBracketedList(21, kind === 233 ? parseImportSpecifier : parseExportSpecifier, 15, 16);
+ node.elements = parseBracketedList(21, kind === 234 ? parseImportSpecifier : parseExportSpecifier, 16, 17);
return finishNode(node);
}
function parseExportSpecifier() {
- return parseImportOrExportSpecifier(238);
+ return parseImportOrExportSpecifier(239);
}
function parseImportSpecifier() {
- return parseImportOrExportSpecifier(234);
+ return parseImportOrExportSpecifier(235);
}
function parseImportOrExportSpecifier(kind) {
var node = createNode(kind);
@@ -16351,9 +15838,9 @@ var ts;
var checkIdentifierStart = scanner.getTokenPos();
var checkIdentifierEnd = scanner.getTextPos();
var identifierName = parseIdentifierName();
- if (token() === 116) {
+ if (token() === 117) {
node.propertyName = identifierName;
- parseExpected(116);
+ parseExpected(117);
checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();
checkIdentifierStart = scanner.getTokenPos();
checkIdentifierEnd = scanner.getTextPos();
@@ -16362,23 +15849,23 @@ var ts;
else {
node.name = identifierName;
}
- if (kind === 234 && checkIdentifierIsKeyword) {
+ if (kind === 235 && checkIdentifierIsKeyword) {
parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected);
}
return finishNode(node);
}
function parseExportDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(236, fullStart);
+ var node = createNode(237, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- if (parseOptional(37)) {
- parseExpected(136);
+ if (parseOptional(38)) {
+ parseExpected(137);
node.moduleSpecifier = parseModuleSpecifier();
}
else {
- node.exportClause = parseNamedImportsOrExports(237);
- if (token() === 136 || (token() === 9 && !scanner.hasPrecedingLineBreak())) {
- parseExpected(136);
+ node.exportClause = parseNamedImportsOrExports(238);
+ if (token() === 137 || (token() === 9 && !scanner.hasPrecedingLineBreak())) {
+ parseExpected(137);
node.moduleSpecifier = parseModuleSpecifier();
}
}
@@ -16386,14 +15873,14 @@ var ts;
return finishNode(node);
}
function parseExportAssignment(fullStart, decorators, modifiers) {
- var node = createNode(235, fullStart);
+ var node = createNode(236, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- if (parseOptional(56)) {
+ if (parseOptional(57)) {
node.isExportEquals = true;
}
else {
- parseExpected(77);
+ parseExpected(78);
}
node.expression = parseAssignmentExpressionOrHigher();
parseSemicolon();
@@ -16465,36 +15952,72 @@ var ts;
function setExternalModuleIndicator(sourceFile) {
sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) {
return ts.hasModifier(node, 1)
- || node.kind === 229 && node.moduleReference.kind === 240
- || node.kind === 230
- || node.kind === 235
+ || node.kind === 230 && node.moduleReference.kind === 241
+ || node.kind === 231
|| node.kind === 236
+ || node.kind === 237
? node
: undefined;
});
}
+ var ParsingContext;
+ (function (ParsingContext) {
+ ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements";
+ ParsingContext[ParsingContext["BlockStatements"] = 1] = "BlockStatements";
+ ParsingContext[ParsingContext["SwitchClauses"] = 2] = "SwitchClauses";
+ ParsingContext[ParsingContext["SwitchClauseStatements"] = 3] = "SwitchClauseStatements";
+ ParsingContext[ParsingContext["TypeMembers"] = 4] = "TypeMembers";
+ ParsingContext[ParsingContext["ClassMembers"] = 5] = "ClassMembers";
+ ParsingContext[ParsingContext["EnumMembers"] = 6] = "EnumMembers";
+ ParsingContext[ParsingContext["HeritageClauseElement"] = 7] = "HeritageClauseElement";
+ ParsingContext[ParsingContext["VariableDeclarations"] = 8] = "VariableDeclarations";
+ ParsingContext[ParsingContext["ObjectBindingElements"] = 9] = "ObjectBindingElements";
+ ParsingContext[ParsingContext["ArrayBindingElements"] = 10] = "ArrayBindingElements";
+ ParsingContext[ParsingContext["ArgumentExpressions"] = 11] = "ArgumentExpressions";
+ ParsingContext[ParsingContext["ObjectLiteralMembers"] = 12] = "ObjectLiteralMembers";
+ ParsingContext[ParsingContext["JsxAttributes"] = 13] = "JsxAttributes";
+ ParsingContext[ParsingContext["JsxChildren"] = 14] = "JsxChildren";
+ ParsingContext[ParsingContext["ArrayLiteralMembers"] = 15] = "ArrayLiteralMembers";
+ ParsingContext[ParsingContext["Parameters"] = 16] = "Parameters";
+ ParsingContext[ParsingContext["TypeParameters"] = 17] = "TypeParameters";
+ ParsingContext[ParsingContext["TypeArguments"] = 18] = "TypeArguments";
+ ParsingContext[ParsingContext["TupleElementTypes"] = 19] = "TupleElementTypes";
+ ParsingContext[ParsingContext["HeritageClauses"] = 20] = "HeritageClauses";
+ ParsingContext[ParsingContext["ImportOrExportSpecifiers"] = 21] = "ImportOrExportSpecifiers";
+ ParsingContext[ParsingContext["JSDocFunctionParameters"] = 22] = "JSDocFunctionParameters";
+ ParsingContext[ParsingContext["JSDocTypeArguments"] = 23] = "JSDocTypeArguments";
+ ParsingContext[ParsingContext["JSDocRecordMembers"] = 24] = "JSDocRecordMembers";
+ ParsingContext[ParsingContext["JSDocTupleTypes"] = 25] = "JSDocTupleTypes";
+ ParsingContext[ParsingContext["Count"] = 26] = "Count";
+ })(ParsingContext || (ParsingContext = {}));
+ var Tristate;
+ (function (Tristate) {
+ Tristate[Tristate["False"] = 0] = "False";
+ Tristate[Tristate["True"] = 1] = "True";
+ Tristate[Tristate["Unknown"] = 2] = "Unknown";
+ })(Tristate || (Tristate = {}));
var JSDocParser;
(function (JSDocParser) {
function isJSDocType() {
switch (token()) {
- case 37:
- case 53:
- case 17:
- case 19:
- case 49:
- case 15:
- case 87:
- case 22:
- case 92:
- case 97:
+ case 38:
+ case 54:
+ case 18:
+ case 20:
+ case 50:
+ case 16:
+ case 88:
+ case 23:
+ case 93:
+ case 98:
return true;
}
return ts.tokenIsIdentifierOrKeyword(token());
}
JSDocParser.isJSDocType = isJSDocType;
function parseJSDocTypeExpressionForTests(content, start, length) {
- initializeState("file.js", content, 2, undefined, 1);
- sourceFile = createSourceFile("file.js", 2, 1);
+ initializeState(content, 4, undefined, 1);
+ sourceFile = createSourceFile("file.js", 4, 1);
scanner.setText(content, start, length);
currentToken = scanner.scan();
var jsDocTypeExpression = parseJSDocTypeExpression();
@@ -16505,21 +16028,21 @@ var ts;
JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests;
function parseJSDocTypeExpression() {
var result = createNode(257, scanner.getTokenPos());
- parseExpected(15);
- result.type = parseJSDocTopLevelType();
parseExpected(16);
+ result.type = parseJSDocTopLevelType();
+ parseExpected(17);
fixupParentReferences(result);
return finishNode(result);
}
JSDocParser.parseJSDocTypeExpression = parseJSDocTypeExpression;
function parseJSDocTopLevelType() {
var type = parseJSDocType();
- if (token() === 47) {
+ if (token() === 48) {
var unionType = createNode(261, type.pos);
unionType.types = parseJSDocTypeList(type);
type = finishNode(unionType);
}
- if (token() === 56) {
+ if (token() === 57) {
var optionalType = createNode(268, type.pos);
nextToken();
optionalType.type = type;
@@ -16530,20 +16053,20 @@ var ts;
function parseJSDocType() {
var type = parseBasicTypeExpression();
while (true) {
- if (token() === 19) {
+ if (token() === 20) {
var arrayType = createNode(260, type.pos);
arrayType.elementType = type;
nextToken();
- parseExpected(20);
+ parseExpected(21);
type = finishNode(arrayType);
}
- else if (token() === 53) {
+ else if (token() === 54) {
var nullableType = createNode(263, type.pos);
nullableType.type = type;
nextToken();
type = finishNode(nullableType);
}
- else if (token() === 49) {
+ else if (token() === 50) {
var nonNullableType = createNode(264, type.pos);
nonNullableType.type = type;
nextToken();
@@ -16557,40 +16080,40 @@ var ts;
}
function parseBasicTypeExpression() {
switch (token()) {
- case 37:
+ case 38:
return parseJSDocAllType();
- case 53:
+ case 54:
return parseJSDocUnknownOrNullableType();
- case 17:
+ case 18:
return parseJSDocUnionType();
- case 19:
+ case 20:
return parseJSDocTupleType();
- case 49:
+ case 50:
return parseJSDocNonNullableType();
- case 15:
+ case 16:
return parseJSDocRecordType();
- case 87:
+ case 88:
return parseJSDocFunctionType();
- case 22:
+ case 23:
return parseJSDocVariadicType();
- case 92:
- return parseJSDocConstructorType();
- case 97:
- return parseJSDocThisType();
- case 117:
- case 132:
- case 130:
- case 120:
- case 133:
- case 103:
case 93:
- case 135:
- case 127:
+ return parseJSDocConstructorType();
+ case 98:
+ return parseJSDocThisType();
+ case 118:
+ case 133:
+ case 131:
+ case 121:
+ case 134:
+ case 104:
+ case 94:
+ case 136:
+ case 128:
return parseTokenNode();
case 9:
case 8:
- case 99:
- case 84:
+ case 100:
+ case 85:
return parseJSDocLiteralType();
}
return parseJSDocTypeReference();
@@ -16598,14 +16121,14 @@ var ts;
function parseJSDocThisType() {
var result = createNode(272);
nextToken();
- parseExpected(54);
+ parseExpected(55);
result.type = parseJSDocType();
return finishNode(result);
}
function parseJSDocConstructorType() {
var result = createNode(271);
nextToken();
- parseExpected(54);
+ parseExpected(55);
result.type = parseJSDocType();
return finishNode(result);
}
@@ -16618,33 +16141,33 @@ var ts;
function parseJSDocFunctionType() {
var result = createNode(269);
nextToken();
- parseExpected(17);
+ parseExpected(18);
result.parameters = parseDelimitedList(22, parseJSDocParameter);
checkForTrailingComma(result.parameters);
- parseExpected(18);
- if (token() === 54) {
+ parseExpected(19);
+ if (token() === 55) {
nextToken();
result.type = parseJSDocType();
}
return finishNode(result);
}
function parseJSDocParameter() {
- var parameter = createNode(142);
+ var parameter = createNode(143);
parameter.type = parseJSDocType();
- if (parseOptional(56)) {
- parameter.questionToken = createNode(56);
+ if (parseOptional(57)) {
+ parameter.questionToken = createNode(57);
}
return finishNode(parameter);
}
function parseJSDocTypeReference() {
var result = createNode(267);
result.name = parseSimplePropertyName();
- if (token() === 25) {
+ if (token() === 26) {
result.typeArguments = parseTypeArguments();
}
else {
- while (parseOptional(21)) {
- if (token() === 25) {
+ while (parseOptional(22)) {
+ if (token() === 26) {
result.typeArguments = parseTypeArguments();
break;
}
@@ -16660,7 +16183,7 @@ var ts;
var typeArguments = parseDelimitedList(23, parseJSDocType);
checkForTrailingComma(typeArguments);
checkForEmptyTypeArgumentList(typeArguments);
- parseExpected(27);
+ parseExpected(28);
return typeArguments;
}
function checkForEmptyTypeArgumentList(typeArguments) {
@@ -16671,7 +16194,7 @@ var ts;
}
}
function parseQualifiedName(left) {
- var result = createNode(139, left.pos);
+ var result = createNode(140, left.pos);
result.left = left;
result.right = parseIdentifierName();
return finishNode(result);
@@ -16692,7 +16215,7 @@ var ts;
nextToken();
result.types = parseDelimitedList(25, parseJSDocType);
checkForTrailingComma(result.types);
- parseExpected(20);
+ parseExpected(21);
return finishNode(result);
}
function checkForTrailingComma(list) {
@@ -16705,13 +16228,13 @@ var ts;
var result = createNode(261);
nextToken();
result.types = parseJSDocTypeList(parseJSDocType());
- parseExpected(18);
+ parseExpected(19);
return finishNode(result);
}
function parseJSDocTypeList(firstType) {
ts.Debug.assert(!!firstType);
var types = createNodeArray([firstType], firstType.pos);
- while (parseOptional(47)) {
+ while (parseOptional(48)) {
types.push(parseJSDocType());
}
types.end = scanner.getStartPos();
@@ -16730,12 +16253,12 @@ var ts;
function parseJSDocUnknownOrNullableType() {
var pos = scanner.getStartPos();
nextToken();
- if (token() === 24 ||
- token() === 16 ||
- token() === 18 ||
- token() === 27 ||
- token() === 56 ||
- token() === 47) {
+ if (token() === 25 ||
+ token() === 17 ||
+ token() === 19 ||
+ token() === 28 ||
+ token() === 57 ||
+ token() === 48) {
var result = createNode(259, pos);
return finishNode(result);
}
@@ -16746,7 +16269,7 @@ var ts;
}
}
function parseIsolatedJSDocComment(content, start, length) {
- initializeState("file.js", content, 2, undefined, 1);
+ initializeState(content, 4, undefined, 1);
sourceFile = { languageVariant: 0, text: content };
var jsDoc = parseJSDocCommentWorker(start, length);
var diagnostics = parseDiagnostics;
@@ -16768,6 +16291,12 @@ var ts;
return comment;
}
JSDocParser.parseJSDocComment = parseJSDocComment;
+ var JSDocState;
+ (function (JSDocState) {
+ JSDocState[JSDocState["BeginningOfLine"] = 0] = "BeginningOfLine";
+ JSDocState[JSDocState["SawAsterisk"] = 1] = "SawAsterisk";
+ JSDocState[JSDocState["SavingComments"] = 2] = "SavingComments";
+ })(JSDocState || (JSDocState = {}));
function parseJSDocCommentWorker(start, length) {
var content = sourceText;
start = start || 0;
@@ -16804,7 +16333,7 @@ var ts;
}
while (token() !== 1) {
switch (token()) {
- case 55:
+ case 56:
if (state === 0 || state === 1) {
removeTrailingNewlines(comments);
parseTag(indent);
@@ -16822,7 +16351,7 @@ var ts;
state = 0;
indent = 0;
break;
- case 37:
+ case 38:
var asterisk = scanner.getTokenText();
if (state === 1) {
state = 2;
@@ -16833,7 +16362,7 @@ var ts;
indent += asterisk.length;
}
break;
- case 69:
+ case 70:
pushComment(scanner.getTokenText());
state = 2;
break;
@@ -16890,8 +16419,8 @@ var ts;
}
}
function parseTag(indent) {
- ts.Debug.assert(token() === 55);
- var atToken = createNode(55, scanner.getTokenPos());
+ ts.Debug.assert(token() === 56);
+ var atToken = createNode(56, scanner.getTokenPos());
atToken.end = scanner.getTextPos();
nextJSDocToken();
var tagName = parseJSDocIdentifierName();
@@ -16942,7 +16471,7 @@ var ts;
comments.push(text);
indent += text.length;
}
- while (token() !== 55 && token() !== 1) {
+ while (token() !== 56 && token() !== 1) {
switch (token()) {
case 4:
if (state >= 1) {
@@ -16951,7 +16480,7 @@ var ts;
}
indent = 0;
break;
- case 55:
+ case 56:
break;
case 5:
if (state === 2) {
@@ -16965,7 +16494,7 @@ var ts;
indent += whitespace.length;
}
break;
- case 37:
+ case 38:
if (state === 0) {
state = 1;
indent += scanner.getTokenText().length;
@@ -16976,7 +16505,7 @@ var ts;
pushComment(scanner.getTokenText());
break;
}
- if (token() === 55) {
+ if (token() === 56) {
break;
}
nextJSDocToken();
@@ -17004,7 +16533,7 @@ var ts;
function tryParseTypeExpression() {
return tryParse(function () {
skipWhitespace();
- if (token() !== 15) {
+ if (token() !== 16) {
return undefined;
}
return parseJSDocTypeExpression();
@@ -17015,14 +16544,14 @@ var ts;
skipWhitespace();
var name;
var isBracketed;
- if (parseOptionalToken(19)) {
+ if (parseOptionalToken(20)) {
name = parseJSDocIdentifierName();
skipWhitespace();
isBracketed = true;
- if (parseOptionalToken(56)) {
+ if (parseOptionalToken(57)) {
parseExpression();
}
- parseExpected(20);
+ parseExpected(21);
}
else if (ts.tokenIsIdentifierOrKeyword(token())) {
name = parseJSDocIdentifierName();
@@ -17099,9 +16628,9 @@ var ts;
if (typeExpression) {
if (typeExpression.type.kind === 267) {
var jsDocTypeReference = typeExpression.type;
- if (jsDocTypeReference.name.kind === 69) {
- var name_14 = jsDocTypeReference.name;
- if (name_14.text === "Object") {
+ if (jsDocTypeReference.name.kind === 70) {
+ var name_11 = jsDocTypeReference.name;
+ if (name_11.text === "Object") {
typedefTag.jsDocTypeLiteral = scanChildTags();
}
}
@@ -17123,7 +16652,7 @@ var ts;
while (token() !== 1 && !parentTagTerminated) {
nextJSDocToken();
switch (token()) {
- case 55:
+ case 56:
if (canParseTag) {
parentTagTerminated = !tryParseChildTag(jsDocTypeLiteral);
if (!parentTagTerminated) {
@@ -17137,13 +16666,13 @@ var ts;
canParseTag = true;
seenAsterisk = false;
break;
- case 37:
+ case 38:
if (seenAsterisk) {
canParseTag = false;
}
seenAsterisk = true;
break;
- case 69:
+ case 70:
canParseTag = false;
case 1:
break;
@@ -17154,8 +16683,8 @@ var ts;
}
}
function tryParseChildTag(parentTag) {
- ts.Debug.assert(token() === 55);
- var atToken = createNode(55, scanner.getStartPos());
+ ts.Debug.assert(token() === 56);
+ var atToken = createNode(56, scanner.getStartPos());
atToken.end = scanner.getTextPos();
nextJSDocToken();
var tagName = parseJSDocIdentifierName();
@@ -17187,17 +16716,17 @@ var ts;
}
var typeParameters = createNodeArray();
while (true) {
- var name_15 = parseJSDocIdentifierName();
+ var name_12 = parseJSDocIdentifierName();
skipWhitespace();
- if (!name_15) {
+ if (!name_12) {
parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected);
return undefined;
}
- var typeParameter = createNode(141, name_15.pos);
- typeParameter.name = name_15;
+ var typeParameter = createNode(142, name_12.pos);
+ typeParameter.name = name_12;
finishNode(typeParameter);
typeParameters.push(typeParameter);
- if (token() === 24) {
+ if (token() === 25) {
nextJSDocToken();
skipWhitespace();
}
@@ -17226,7 +16755,7 @@ var ts;
}
var pos = scanner.getTokenPos();
var end = scanner.getTextPos();
- var result = createNode(69, pos);
+ var result = createNode(70, pos);
result.text = content.substring(pos, end);
finishNode(result, end);
nextJSDocToken();
@@ -17297,8 +16826,8 @@ var ts;
array._children = undefined;
array.pos += delta;
array.end += delta;
- for (var _i = 0, array_8 = array; _i < array_8.length; _i++) {
- var node = array_8[_i];
+ for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {
+ var node = array_9[_i];
visitNode(node);
}
}
@@ -17307,7 +16836,7 @@ var ts;
switch (node.kind) {
case 9:
case 8:
- case 69:
+ case 70:
return true;
}
return false;
@@ -17370,8 +16899,8 @@ var ts;
array.intersectsChange = true;
array._children = undefined;
adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
- for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {
- var node = array_9[_i];
+ for (var _i = 0, array_10 = array; _i < array_10.length; _i++) {
+ var node = array_10[_i];
visitNode(node);
}
return;
@@ -17519,21 +17048,31 @@ var ts;
}
}
}
+ var InvalidPosition;
+ (function (InvalidPosition) {
+ InvalidPosition[InvalidPosition["Value"] = -1] = "Value";
+ })(InvalidPosition || (InvalidPosition = {}));
})(IncrementalParser || (IncrementalParser = {}));
})(ts || (ts = {}));
var ts;
(function (ts) {
+ (function (ModuleInstanceState) {
+ ModuleInstanceState[ModuleInstanceState["NonInstantiated"] = 0] = "NonInstantiated";
+ ModuleInstanceState[ModuleInstanceState["Instantiated"] = 1] = "Instantiated";
+ ModuleInstanceState[ModuleInstanceState["ConstEnumOnly"] = 2] = "ConstEnumOnly";
+ })(ts.ModuleInstanceState || (ts.ModuleInstanceState = {}));
+ var ModuleInstanceState = ts.ModuleInstanceState;
function getModuleInstanceState(node) {
- if (node.kind === 222 || node.kind === 223) {
+ if (node.kind === 223 || node.kind === 224) {
return 0;
}
else if (ts.isConstEnumDeclaration(node)) {
return 2;
}
- else if ((node.kind === 230 || node.kind === 229) && !(ts.hasModifier(node, 1))) {
+ else if ((node.kind === 231 || node.kind === 230) && !(ts.hasModifier(node, 1))) {
return 0;
}
- else if (node.kind === 226) {
+ else if (node.kind === 227) {
var state_1 = 0;
ts.forEachChild(node, function (n) {
switch (getModuleInstanceState(n)) {
@@ -17549,7 +17088,7 @@ var ts;
});
return state_1;
}
- else if (node.kind === 225) {
+ else if (node.kind === 226) {
var body = node.body;
return body ? getModuleInstanceState(body) : 1;
}
@@ -17558,6 +17097,18 @@ var ts;
}
}
ts.getModuleInstanceState = getModuleInstanceState;
+ var ContainerFlags;
+ (function (ContainerFlags) {
+ ContainerFlags[ContainerFlags["None"] = 0] = "None";
+ ContainerFlags[ContainerFlags["IsContainer"] = 1] = "IsContainer";
+ ContainerFlags[ContainerFlags["IsBlockScopedContainer"] = 2] = "IsBlockScopedContainer";
+ ContainerFlags[ContainerFlags["IsControlFlowContainer"] = 4] = "IsControlFlowContainer";
+ ContainerFlags[ContainerFlags["IsFunctionLike"] = 8] = "IsFunctionLike";
+ ContainerFlags[ContainerFlags["IsFunctionExpression"] = 16] = "IsFunctionExpression";
+ ContainerFlags[ContainerFlags["HasLocals"] = 32] = "HasLocals";
+ ContainerFlags[ContainerFlags["IsInterface"] = 64] = "IsInterface";
+ ContainerFlags[ContainerFlags["IsObjectLiteralOrClassExpressionMethod"] = 128] = "IsObjectLiteralOrClassExpressionMethod";
+ })(ContainerFlags || (ContainerFlags = {}));
var binder = createBinder();
function bindSourceFile(file, options) {
ts.performance.mark("beforeBind");
@@ -17655,7 +17206,7 @@ var ts;
if (symbolFlags & 107455) {
var valueDeclaration = symbol.valueDeclaration;
if (!valueDeclaration ||
- (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 225)) {
+ (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 226)) {
symbol.valueDeclaration = node;
}
}
@@ -17665,7 +17216,7 @@ var ts;
if (ts.isAmbientModule(node)) {
return ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + node.name.text + "\"";
}
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
var nameExpression = node.name.expression;
if (ts.isStringOrNumericLiteral(nameExpression.kind)) {
return nameExpression.text;
@@ -17676,21 +17227,21 @@ var ts;
return node.name.text;
}
switch (node.kind) {
- case 148:
+ case 149:
return "__constructor";
- case 156:
- case 151:
- return "__call";
case 157:
case 152:
- return "__new";
+ return "__call";
+ case 158:
case 153:
+ return "__new";
+ case 154:
return "__index";
- case 236:
+ case 237:
return "__export";
- case 235:
+ case 236:
return node.isExportEquals ? "export=" : "default";
- case 187:
+ case 188:
switch (ts.getSpecialPropertyAssignmentKind(node)) {
case 2:
return "export=";
@@ -17702,12 +17253,12 @@ var ts;
}
ts.Debug.fail("Unknown binary declaration kind");
break;
- case 220:
case 221:
+ case 222:
return ts.hasModifier(node, 512) ? "default" : undefined;
case 269:
return ts.isJSDocConstructSignature(node) ? "__new" : "__call";
- case 142:
+ case 143:
ts.Debug.assert(node.parent.kind === 269);
var functionType = node.parent;
var index = ts.indexOf(functionType.parameters, node);
@@ -17715,10 +17266,10 @@ var ts;
case 279:
var parentNode = node.parent && node.parent.parent;
var nameFromParentNode = void 0;
- if (parentNode && parentNode.kind === 200) {
+ if (parentNode && parentNode.kind === 201) {
if (parentNode.declarationList.declarations.length > 0) {
var nameIdentifier = parentNode.declarationList.declarations[0].name;
- if (nameIdentifier.kind === 69) {
+ if (nameIdentifier.kind === 70) {
nameFromParentNode = nameIdentifier.text;
}
}
@@ -17759,7 +17310,7 @@ var ts;
}
else {
if (symbol.declarations && symbol.declarations.length &&
- (isDefaultExport || (node.kind === 235 && !node.isExportEquals))) {
+ (isDefaultExport || (node.kind === 236 && !node.isExportEquals))) {
message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports;
}
}
@@ -17779,7 +17330,7 @@ var ts;
function declareModuleMember(node, symbolFlags, symbolExcludes) {
var hasExportModifier = ts.getCombinedModifierFlags(node) & 1;
if (symbolFlags & 8388608) {
- if (node.kind === 238 || (node.kind === 229 && hasExportModifier)) {
+ if (node.kind === 239 || (node.kind === 230 && hasExportModifier)) {
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
}
else {
@@ -17896,64 +17447,64 @@ var ts;
return;
}
switch (node.kind) {
- case 205:
+ case 206:
bindWhileStatement(node);
break;
- case 204:
+ case 205:
bindDoStatement(node);
break;
- case 206:
+ case 207:
bindForStatement(node);
break;
- case 207:
case 208:
+ case 209:
bindForInOrForOfStatement(node);
break;
- case 203:
+ case 204:
bindIfStatement(node);
break;
- case 211:
- case 215:
+ case 212:
+ case 216:
bindReturnOrThrow(node);
break;
+ case 211:
case 210:
- case 209:
bindBreakOrContinueStatement(node);
break;
- case 216:
+ case 217:
bindTryStatement(node);
break;
- case 213:
+ case 214:
bindSwitchStatement(node);
break;
- case 227:
+ case 228:
bindCaseBlock(node);
break;
case 249:
bindCaseClause(node);
break;
- case 214:
+ case 215:
bindLabeledStatement(node);
break;
- case 185:
+ case 186:
bindPrefixUnaryExpressionFlow(node);
break;
- case 186:
+ case 187:
bindPostfixUnaryExpressionFlow(node);
break;
- case 187:
+ case 188:
bindBinaryExpressionFlow(node);
break;
- case 181:
+ case 182:
bindDeleteExpressionFlow(node);
break;
- case 188:
+ case 189:
bindConditionalExpressionFlow(node);
break;
- case 218:
+ case 219:
bindVariableDeclarationFlow(node);
break;
- case 174:
+ case 175:
bindCallExpressionFlow(node);
break;
default:
@@ -17963,25 +17514,25 @@ var ts;
}
function isNarrowingExpression(expr) {
switch (expr.kind) {
- case 69:
- case 97:
- case 172:
+ case 70:
+ case 98:
+ case 173:
return isNarrowableReference(expr);
- case 174:
+ case 175:
return hasNarrowableArgument(expr);
- case 178:
+ case 179:
return isNarrowingExpression(expr.expression);
- case 187:
+ case 188:
return isNarrowingBinaryExpression(expr);
- case 185:
- return expr.operator === 49 && isNarrowingExpression(expr.operand);
+ case 186:
+ return expr.operator === 50 && isNarrowingExpression(expr.operand);
}
return false;
}
function isNarrowableReference(expr) {
- return expr.kind === 69 ||
- expr.kind === 97 ||
- expr.kind === 172 && isNarrowableReference(expr.expression);
+ return expr.kind === 70 ||
+ expr.kind === 98 ||
+ expr.kind === 173 && isNarrowableReference(expr.expression);
}
function hasNarrowableArgument(expr) {
if (expr.arguments) {
@@ -17992,41 +17543,41 @@ var ts;
}
}
}
- if (expr.expression.kind === 172 &&
+ if (expr.expression.kind === 173 &&
isNarrowableReference(expr.expression.expression)) {
return true;
}
return false;
}
function isNarrowingTypeofOperands(expr1, expr2) {
- return expr1.kind === 182 && isNarrowableOperand(expr1.expression) && expr2.kind === 9;
+ return expr1.kind === 183 && isNarrowableOperand(expr1.expression) && expr2.kind === 9;
}
function isNarrowingBinaryExpression(expr) {
switch (expr.operatorToken.kind) {
- case 56:
+ case 57:
return isNarrowableReference(expr.left);
- case 30:
case 31:
case 32:
case 33:
+ case 34:
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) ||
isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right);
- case 91:
+ case 92:
return isNarrowableOperand(expr.left);
- case 24:
+ case 25:
return isNarrowingExpression(expr.right);
}
return false;
}
function isNarrowableOperand(expr) {
switch (expr.kind) {
- case 178:
+ case 179:
return isNarrowableOperand(expr.expression);
- case 187:
+ case 188:
switch (expr.operatorToken.kind) {
- case 56:
+ case 57:
return isNarrowableOperand(expr.left);
- case 24:
+ case 25:
return isNarrowableOperand(expr.right);
}
}
@@ -18045,7 +17596,7 @@ var ts;
};
}
function setFlowNodeReferenced(flow) {
- flow.flags |= flow.flags & 256 ? 512 : 256;
+ flow.flags |= flow.flags & 512 ? 1024 : 512;
}
function addAntecedent(label, antecedent) {
if (!(antecedent.flags & 1) && !ts.contains(label.antecedents, antecedent)) {
@@ -18060,8 +17611,8 @@ var ts;
if (!expression) {
return flags & 32 ? antecedent : unreachableFlow;
}
- if (expression.kind === 99 && flags & 64 ||
- expression.kind === 84 && flags & 32) {
+ if (expression.kind === 100 && flags & 64 ||
+ expression.kind === 85 && flags & 32) {
return unreachableFlow;
}
if (!isNarrowingExpression(expression)) {
@@ -18095,6 +17646,14 @@ var ts;
node: node
};
}
+ function createFlowArrayMutation(antecedent, node) {
+ setFlowNodeReferenced(antecedent);
+ return {
+ flags: 256,
+ antecedent: antecedent,
+ node: node
+ };
+ }
function finishFlowLabel(flow) {
var antecedents = flow.antecedents;
if (!antecedents) {
@@ -18108,34 +17667,34 @@ var ts;
function isStatementCondition(node) {
var parent = node.parent;
switch (parent.kind) {
- case 203:
- case 205:
case 204:
- return parent.expression === node;
case 206:
- case 188:
+ case 205:
+ return parent.expression === node;
+ case 207:
+ case 189:
return parent.condition === node;
}
return false;
}
function isLogicalExpression(node) {
while (true) {
- if (node.kind === 178) {
+ if (node.kind === 179) {
node = node.expression;
}
- else if (node.kind === 185 && node.operator === 49) {
+ else if (node.kind === 186 && node.operator === 50) {
node = node.operand;
}
else {
- return node.kind === 187 && (node.operatorToken.kind === 51 ||
- node.operatorToken.kind === 52);
+ return node.kind === 188 && (node.operatorToken.kind === 52 ||
+ node.operatorToken.kind === 53);
}
}
}
function isTopLevelLogicalExpression(node) {
- while (node.parent.kind === 178 ||
- node.parent.kind === 185 &&
- node.parent.operator === 49) {
+ while (node.parent.kind === 179 ||
+ node.parent.kind === 186 &&
+ node.parent.operator === 50) {
node = node.parent;
}
return !isStatementCondition(node) && !isLogicalExpression(node.parent);
@@ -18208,7 +17767,7 @@ var ts;
bind(node.expression);
addAntecedent(postLoopLabel, currentFlow);
bind(node.initializer);
- if (node.initializer.kind !== 219) {
+ if (node.initializer.kind !== 220) {
bindAssignmentTargetFlow(node.initializer);
}
bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
@@ -18230,7 +17789,7 @@ var ts;
}
function bindReturnOrThrow(node) {
bind(node.expression);
- if (node.kind === 211) {
+ if (node.kind === 212) {
hasExplicitReturn = true;
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
@@ -18250,7 +17809,7 @@ var ts;
return undefined;
}
function bindbreakOrContinueFlow(node, breakTarget, continueTarget) {
- var flowLabel = node.kind === 210 ? breakTarget : continueTarget;
+ var flowLabel = node.kind === 211 ? breakTarget : continueTarget;
if (flowLabel) {
addAntecedent(flowLabel, currentFlow);
currentFlow = unreachableFlow;
@@ -18270,21 +17829,32 @@ var ts;
}
}
function bindTryStatement(node) {
- var postFinallyLabel = createBranchLabel();
+ var preFinallyLabel = createBranchLabel();
var preTryFlow = currentFlow;
bind(node.tryBlock);
- addAntecedent(postFinallyLabel, currentFlow);
+ addAntecedent(preFinallyLabel, currentFlow);
+ var flowAfterTry = currentFlow;
+ var flowAfterCatch = unreachableFlow;
if (node.catchClause) {
currentFlow = preTryFlow;
bind(node.catchClause);
- addAntecedent(postFinallyLabel, currentFlow);
+ addAntecedent(preFinallyLabel, currentFlow);
+ flowAfterCatch = currentFlow;
}
if (node.finallyBlock) {
- currentFlow = preTryFlow;
+ addAntecedent(preFinallyLabel, preTryFlow);
+ currentFlow = finishFlowLabel(preFinallyLabel);
bind(node.finallyBlock);
+ if (!(currentFlow.flags & 1)) {
+ if ((flowAfterTry.flags & 1) && (flowAfterCatch.flags & 1)) {
+ currentFlow = flowAfterTry === reportedUnreachableFlow || flowAfterCatch === reportedUnreachableFlow
+ ? reportedUnreachableFlow
+ : unreachableFlow;
+ }
+ }
}
- if (!node.finallyBlock || !(currentFlow.flags & 1)) {
- currentFlow = finishFlowLabel(postFinallyLabel);
+ else {
+ currentFlow = finishFlowLabel(preFinallyLabel);
}
}
function bindSwitchStatement(node) {
@@ -18361,7 +17931,7 @@ var ts;
currentFlow = finishFlowLabel(postStatementLabel);
}
function bindDestructuringTargetFlow(node) {
- if (node.kind === 187 && node.operatorToken.kind === 56) {
+ if (node.kind === 188 && node.operatorToken.kind === 57) {
bindAssignmentTargetFlow(node.left);
}
else {
@@ -18372,10 +17942,10 @@ var ts;
if (isNarrowableReference(node)) {
currentFlow = createFlowAssignment(currentFlow, node);
}
- else if (node.kind === 170) {
+ else if (node.kind === 171) {
for (var _i = 0, _a = node.elements; _i < _a.length; _i++) {
var e = _a[_i];
- if (e.kind === 191) {
+ if (e.kind === 192) {
bindAssignmentTargetFlow(e.expression);
}
else {
@@ -18383,7 +17953,7 @@ var ts;
}
}
}
- else if (node.kind === 171) {
+ else if (node.kind === 172) {
for (var _b = 0, _c = node.properties; _b < _c.length; _b++) {
var p = _c[_b];
if (p.kind === 253) {
@@ -18397,7 +17967,7 @@ var ts;
}
function bindLogicalExpression(node, trueTarget, falseTarget) {
var preRightLabel = createBranchLabel();
- if (node.operatorToken.kind === 51) {
+ if (node.operatorToken.kind === 52) {
bindCondition(node.left, preRightLabel, falseTarget);
}
else {
@@ -18408,7 +17978,7 @@ var ts;
bindCondition(node.right, trueTarget, falseTarget);
}
function bindPrefixUnaryExpressionFlow(node) {
- if (node.operator === 49) {
+ if (node.operator === 50) {
var saveTrueTarget = currentTrueTarget;
currentTrueTarget = currentFalseTarget;
currentFalseTarget = saveTrueTarget;
@@ -18418,20 +17988,20 @@ var ts;
}
else {
ts.forEachChild(node, bind);
- if (node.operator === 41 || node.operator === 42) {
+ if (node.operator === 42 || node.operator === 43) {
bindAssignmentTargetFlow(node.operand);
}
}
}
function bindPostfixUnaryExpressionFlow(node) {
ts.forEachChild(node, bind);
- if (node.operator === 41 || node.operator === 42) {
+ if (node.operator === 42 || node.operator === 43) {
bindAssignmentTargetFlow(node.operand);
}
}
function bindBinaryExpressionFlow(node) {
var operator = node.operatorToken.kind;
- if (operator === 51 || operator === 52) {
+ if (operator === 52 || operator === 53) {
if (isTopLevelLogicalExpression(node)) {
var postExpressionLabel = createBranchLabel();
bindLogicalExpression(node, postExpressionLabel, postExpressionLabel);
@@ -18443,14 +18013,20 @@ var ts;
}
else {
ts.forEachChild(node, bind);
- if (operator === 56 && !ts.isAssignmentTarget(node)) {
+ if (operator === 57 && !ts.isAssignmentTarget(node)) {
bindAssignmentTargetFlow(node.left);
+ if (node.left.kind === 174) {
+ var elementAccess = node.left;
+ if (isNarrowableOperand(elementAccess.expression)) {
+ currentFlow = createFlowArrayMutation(currentFlow, node);
+ }
+ }
}
}
}
function bindDeleteExpressionFlow(node) {
ts.forEachChild(node, bind);
- if (node.expression.kind === 172) {
+ if (node.expression.kind === 173) {
bindAssignmentTargetFlow(node.expression);
}
}
@@ -18481,16 +18057,16 @@ var ts;
}
function bindVariableDeclarationFlow(node) {
ts.forEachChild(node, bind);
- if (node.initializer || node.parent.parent.kind === 207 || node.parent.parent.kind === 208) {
+ if (node.initializer || node.parent.parent.kind === 208 || node.parent.parent.kind === 209) {
bindInitializedVariableFlow(node);
}
}
function bindCallExpressionFlow(node) {
var expr = node.expression;
- while (expr.kind === 178) {
+ while (expr.kind === 179) {
expr = expr.expression;
}
- if (expr.kind === 179 || expr.kind === 180) {
+ if (expr.kind === 180 || expr.kind === 181) {
ts.forEach(node.typeArguments, bind);
ts.forEach(node.arguments, bind);
bind(node.expression);
@@ -18498,54 +18074,60 @@ var ts;
else {
ts.forEachChild(node, bind);
}
+ if (node.expression.kind === 173) {
+ var propertyAccess = node.expression;
+ if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) {
+ currentFlow = createFlowArrayMutation(currentFlow, node);
+ }
+ }
}
function getContainerFlags(node) {
switch (node.kind) {
- case 192:
- case 221:
- case 224:
- case 171:
- case 159:
+ case 193:
+ case 222:
+ case 225:
+ case 172:
+ case 160:
case 281:
case 265:
return 1;
- case 222:
+ case 223:
return 1 | 64;
case 269:
- case 225:
- case 223:
+ case 226:
+ case 224:
return 1 | 32;
case 256:
return 1 | 4 | 32;
- case 147:
+ case 148:
if (ts.isObjectLiteralOrClassExpressionMethod(node)) {
return 1 | 4 | 32 | 8 | 128;
}
- case 148:
- case 220:
- case 146:
case 149:
+ case 221:
+ case 147:
case 150:
case 151:
case 152:
case 153:
- case 156:
+ case 154:
case 157:
+ case 158:
return 1 | 4 | 32 | 8;
- case 179:
case 180:
+ case 181:
return 1 | 4 | 32 | 8 | 16;
- case 226:
+ case 227:
return 4;
- case 145:
+ case 146:
return node.initializer ? 4 : 0;
case 252:
- case 206:
case 207:
case 208:
- case 227:
+ case 209:
+ case 228:
return 2;
- case 199:
+ case 200:
return ts.isFunctionLike(node.parent) ? 0 : 2;
}
return 0;
@@ -18561,36 +18143,36 @@ var ts;
}
function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) {
switch (container.kind) {
- case 225:
+ case 226:
return declareModuleMember(node, symbolFlags, symbolExcludes);
case 256:
return declareSourceFileMember(node, symbolFlags, symbolExcludes);
- case 192:
- case 221:
- return declareClassMember(node, symbolFlags, symbolExcludes);
- case 224:
- return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
- case 159:
- case 171:
+ case 193:
case 222:
+ return declareClassMember(node, symbolFlags, symbolExcludes);
+ case 225:
+ return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
+ case 160:
+ case 172:
+ case 223:
case 265:
case 281:
return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
- case 156:
case 157:
- case 151:
+ case 158:
case 152:
case 153:
- case 147:
- case 146:
+ case 154:
case 148:
+ case 147:
case 149:
case 150:
- case 220:
- case 179:
+ case 151:
+ case 221:
case 180:
+ case 181:
case 269:
- case 223:
+ case 224:
return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes);
}
}
@@ -18606,10 +18188,10 @@ var ts;
}
function hasExportDeclarations(node) {
var body = node.kind === 256 ? node : node.body;
- if (body && (body.kind === 256 || body.kind === 226)) {
+ if (body && (body.kind === 256 || body.kind === 227)) {
for (var _i = 0, _a = body.statements; _i < _a.length; _i++) {
var stat = _a[_i];
- if (stat.kind === 236 || stat.kind === 235) {
+ if (stat.kind === 237 || stat.kind === 236) {
return true;
}
}
@@ -18681,15 +18263,20 @@ var ts;
typeLiteralSymbol.members[symbol.name] = symbol;
}
function bindObjectLiteralExpression(node) {
+ var ElementKind;
+ (function (ElementKind) {
+ ElementKind[ElementKind["Property"] = 1] = "Property";
+ ElementKind[ElementKind["Accessor"] = 2] = "Accessor";
+ })(ElementKind || (ElementKind = {}));
if (inStrictMode) {
var seen = ts.createMap();
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var prop = _a[_i];
- if (prop.name.kind !== 69) {
+ if (prop.name.kind !== 70) {
continue;
}
var identifier = prop.name;
- var currentKind = prop.kind === 253 || prop.kind === 254 || prop.kind === 147
+ var currentKind = prop.kind === 253 || prop.kind === 254 || prop.kind === 148
? 1
: 2;
var existingKind = seen[identifier.text];
@@ -18711,7 +18298,7 @@ var ts;
}
function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) {
switch (blockScopeContainer.kind) {
- case 225:
+ case 226:
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
case 256:
@@ -18732,8 +18319,8 @@ var ts;
}
function checkStrictModeIdentifier(node) {
if (inStrictMode &&
- node.originalKeywordKind >= 106 &&
- node.originalKeywordKind <= 114 &&
+ node.originalKeywordKind >= 107 &&
+ node.originalKeywordKind <= 115 &&
!ts.isIdentifierName(node) &&
!ts.isInAmbientContext(node)) {
if (!file.parseDiagnostics.length) {
@@ -18761,17 +18348,17 @@ var ts;
}
}
function checkStrictModeDeleteExpression(node) {
- if (inStrictMode && node.expression.kind === 69) {
+ if (inStrictMode && node.expression.kind === 70) {
var span_2 = ts.getErrorSpanForNode(file, node.expression);
file.bindDiagnostics.push(ts.createFileDiagnostic(file, span_2.start, span_2.length, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode));
}
}
function isEvalOrArgumentsIdentifier(node) {
- return node.kind === 69 &&
+ return node.kind === 70 &&
(node.text === "eval" || node.text === "arguments");
}
function checkStrictModeEvalOrArguments(contextNode, name) {
- if (name && name.kind === 69) {
+ if (name && name.kind === 70) {
var identifier = name;
if (isEvalOrArgumentsIdentifier(identifier)) {
var span_3 = ts.getErrorSpanForNode(file, name);
@@ -18805,7 +18392,7 @@ var ts;
function checkStrictModeFunctionDeclaration(node) {
if (languageVersion < 2) {
if (blockScopeContainer.kind !== 256 &&
- blockScopeContainer.kind !== 225 &&
+ blockScopeContainer.kind !== 226 &&
!ts.isFunctionLike(blockScopeContainer)) {
var errorSpan = ts.getErrorSpanForNode(file, node);
file.bindDiagnostics.push(ts.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node)));
@@ -18824,7 +18411,7 @@ var ts;
}
function checkStrictModePrefixUnaryExpression(node) {
if (inStrictMode) {
- if (node.operator === 41 || node.operator === 42) {
+ if (node.operator === 42 || node.operator === 43) {
checkStrictModeEvalOrArguments(node, node.operand);
}
}
@@ -18848,7 +18435,7 @@ var ts;
node.parent = parent;
var saveInStrictMode = inStrictMode;
bindWorker(node);
- if (node.kind > 138) {
+ if (node.kind > 139) {
var saveParent = parent;
parent = node;
var containerFlags = getContainerFlags(node);
@@ -18885,18 +18472,18 @@ var ts;
}
function bindWorker(node) {
switch (node.kind) {
- case 69:
- case 97:
+ case 70:
+ case 98:
if (currentFlow && (ts.isExpression(node) || parent.kind === 254)) {
node.flowNode = currentFlow;
}
return checkStrictModeIdentifier(node);
- case 172:
+ case 173:
if (currentFlow && isNarrowableReference(node)) {
node.flowNode = currentFlow;
}
break;
- case 187:
+ case 188:
if (ts.isInJavaScriptFile(node)) {
var specialKind = ts.getSpecialPropertyAssignmentKind(node);
switch (specialKind) {
@@ -18921,30 +18508,30 @@ var ts;
return checkStrictModeBinaryExpression(node);
case 252:
return checkStrictModeCatchClause(node);
- case 181:
+ case 182:
return checkStrictModeDeleteExpression(node);
case 8:
return checkStrictModeNumericLiteral(node);
- case 186:
+ case 187:
return checkStrictModePostfixUnaryExpression(node);
- case 185:
+ case 186:
return checkStrictModePrefixUnaryExpression(node);
- case 212:
+ case 213:
return checkStrictModeWithStatement(node);
- case 165:
+ case 166:
seenThisKeyword = true;
return;
- case 154:
+ case 155:
return checkTypePredicate(node);
- case 141:
- return declareSymbolAndAddToSymbolTable(node, 262144, 530920);
case 142:
+ return declareSymbolAndAddToSymbolTable(node, 262144, 530920);
+ case 143:
return bindParameter(node);
- case 218:
- case 169:
+ case 219:
+ case 170:
return bindVariableDeclarationOrBindingElement(node);
+ case 146:
case 145:
- case 144:
case 266:
return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 0);
case 280:
@@ -18957,82 +18544,82 @@ var ts;
case 247:
emitFlags |= 16384;
return;
- case 151:
case 152:
case 153:
+ case 154:
return declareSymbolAndAddToSymbolTable(node, 131072, 0);
- case 147:
- case 146:
- return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263);
- case 220:
- return bindFunctionDeclaration(node);
case 148:
- return declareSymbolAndAddToSymbolTable(node, 16384, 0);
+ case 147:
+ return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263);
+ case 221:
+ return bindFunctionDeclaration(node);
case 149:
- return bindPropertyOrMethodOrAccessor(node, 32768, 41919);
+ return declareSymbolAndAddToSymbolTable(node, 16384, 0);
case 150:
+ return bindPropertyOrMethodOrAccessor(node, 32768, 41919);
+ case 151:
return bindPropertyOrMethodOrAccessor(node, 65536, 74687);
- case 156:
case 157:
+ case 158:
case 269:
return bindFunctionOrConstructorType(node);
- case 159:
+ case 160:
case 281:
case 265:
return bindAnonymousDeclaration(node, 2048, "__type");
- case 171:
+ case 172:
return bindObjectLiteralExpression(node);
- case 179:
case 180:
+ case 181:
return bindFunctionExpression(node);
- case 174:
+ case 175:
if (ts.isInJavaScriptFile(node)) {
bindCallExpression(node);
}
break;
- case 192:
- case 221:
+ case 193:
+ case 222:
inStrictMode = true;
return bindClassLikeDeclaration(node);
- case 222:
+ case 223:
return bindBlockScopedDeclaration(node, 64, 792968);
case 279:
- case 223:
- return bindBlockScopedDeclaration(node, 524288, 793064);
case 224:
- return bindEnumDeclaration(node);
+ return bindBlockScopedDeclaration(node, 524288, 793064);
case 225:
+ return bindEnumDeclaration(node);
+ case 226:
return bindModuleDeclaration(node);
- case 229:
- case 232:
- case 234:
- case 238:
- return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608);
- case 228:
- return bindNamespaceExportDeclaration(node);
- case 231:
- return bindImportClause(node);
- case 236:
- return bindExportDeclaration(node);
+ case 230:
+ case 233:
case 235:
+ case 239:
+ return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608);
+ case 229:
+ return bindNamespaceExportDeclaration(node);
+ case 232:
+ return bindImportClause(node);
+ case 237:
+ return bindExportDeclaration(node);
+ case 236:
return bindExportAssignment(node);
case 256:
updateStrictModeStatementList(node.statements);
return bindSourceFileIfExternalModule();
- case 199:
+ case 200:
if (!ts.isFunctionLike(node.parent)) {
return;
}
- case 226:
+ case 227:
return updateStrictModeStatementList(node.statements);
}
}
function checkTypePredicate(node) {
var parameterName = node.parameterName, type = node.type;
- if (parameterName && parameterName.kind === 69) {
+ if (parameterName && parameterName.kind === 70) {
checkStrictModeIdentifier(parameterName);
}
- if (parameterName && parameterName.kind === 165) {
+ if (parameterName && parameterName.kind === 166) {
seenThisKeyword = true;
}
bind(type);
@@ -19051,7 +18638,7 @@ var ts;
bindAnonymousDeclaration(node, 8388608, getDeclarationName(node));
}
else {
- var flags = node.kind === 235 && ts.exportAssignmentIsAlias(node)
+ var flags = node.kind === 236 && ts.exportAssignmentIsAlias(node)
? 8388608
: 4;
declareSymbol(container.symbol.exports, container.symbol, node, flags, 4 | 8388608 | 32 | 16);
@@ -19095,7 +18682,9 @@ var ts;
function setCommonJsModuleIndicator(node) {
if (!file.commonJsModuleIndicator) {
file.commonJsModuleIndicator = node;
- bindSourceFileAsExternalModule();
+ if (!file.externalModuleIndicator) {
+ bindSourceFileAsExternalModule();
+ }
}
}
function bindExportsPropertyAssignment(node) {
@@ -19108,11 +18697,11 @@ var ts;
}
function bindThisPropertyAssignment(node) {
ts.Debug.assert(ts.isInJavaScriptFile(node));
- if (container.kind === 220 || container.kind === 179) {
+ if (container.kind === 221 || container.kind === 180) {
container.symbol.members = container.symbol.members || ts.createMap();
declareSymbol(container.symbol.members, container.symbol, node, 4, 0 & ~4);
}
- else if (container.kind === 148) {
+ else if (container.kind === 149) {
var saveContainer = container;
container = container.parent;
var symbol = bindPropertyOrMethodOrAccessor(node, 4, 0);
@@ -19152,7 +18741,7 @@ var ts;
emitFlags |= 2048;
}
}
- if (node.kind === 221) {
+ if (node.kind === 222) {
bindBlockScopedDeclaration(node, 32, 899519);
}
else {
@@ -19270,15 +18859,15 @@ var ts;
return false;
}
if (currentFlow === unreachableFlow) {
- var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 201) ||
- node.kind === 221 ||
- (node.kind === 225 && shouldReportErrorOnModuleDeclaration(node)) ||
- (node.kind === 224 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums));
+ var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 202) ||
+ node.kind === 222 ||
+ (node.kind === 226 && shouldReportErrorOnModuleDeclaration(node)) ||
+ (node.kind === 225 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums));
if (reportError) {
currentFlow = reportedUnreachableFlow;
var reportUnreachableCode = !options.allowUnreachableCode &&
!ts.isInAmbientContext(node) &&
- (node.kind !== 200 ||
+ (node.kind !== 201 ||
ts.getCombinedNodeFlags(node.declarationList) & 3 ||
ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; }));
if (reportUnreachableCode) {
@@ -19292,52 +18881,54 @@ var ts;
function computeTransformFlagsForNode(node, subtreeFlags) {
var kind = node.kind;
switch (kind) {
- case 174:
+ case 175:
return computeCallExpression(node, subtreeFlags);
- case 225:
+ case 176:
+ return computeNewExpression(node, subtreeFlags);
+ case 226:
return computeModuleDeclaration(node, subtreeFlags);
- case 178:
- return computeParenthesizedExpression(node, subtreeFlags);
- case 187:
- return computeBinaryExpression(node, subtreeFlags);
- case 202:
- return computeExpressionStatement(node, subtreeFlags);
- case 142:
- return computeParameter(node, subtreeFlags);
- case 180:
- return computeArrowFunction(node, subtreeFlags);
case 179:
+ return computeParenthesizedExpression(node, subtreeFlags);
+ case 188:
+ return computeBinaryExpression(node, subtreeFlags);
+ case 203:
+ return computeExpressionStatement(node, subtreeFlags);
+ case 143:
+ return computeParameter(node, subtreeFlags);
+ case 181:
+ return computeArrowFunction(node, subtreeFlags);
+ case 180:
return computeFunctionExpression(node, subtreeFlags);
- case 220:
- return computeFunctionDeclaration(node, subtreeFlags);
- case 218:
- return computeVariableDeclaration(node, subtreeFlags);
- case 219:
- return computeVariableDeclarationList(node, subtreeFlags);
- case 200:
- return computeVariableStatement(node, subtreeFlags);
- case 214:
- return computeLabeledStatement(node, subtreeFlags);
case 221:
+ return computeFunctionDeclaration(node, subtreeFlags);
+ case 219:
+ return computeVariableDeclaration(node, subtreeFlags);
+ case 220:
+ return computeVariableDeclarationList(node, subtreeFlags);
+ case 201:
+ return computeVariableStatement(node, subtreeFlags);
+ case 215:
+ return computeLabeledStatement(node, subtreeFlags);
+ case 222:
return computeClassDeclaration(node, subtreeFlags);
- case 192:
+ case 193:
return computeClassExpression(node, subtreeFlags);
case 251:
return computeHeritageClause(node, subtreeFlags);
- case 194:
+ case 195:
return computeExpressionWithTypeArguments(node, subtreeFlags);
- case 148:
- return computeConstructor(node, subtreeFlags);
- case 145:
- return computePropertyDeclaration(node, subtreeFlags);
- case 147:
- return computeMethod(node, subtreeFlags);
case 149:
+ return computeConstructor(node, subtreeFlags);
+ case 146:
+ return computePropertyDeclaration(node, subtreeFlags);
+ case 148:
+ return computeMethod(node, subtreeFlags);
case 150:
+ case 151:
return computeAccessor(node, subtreeFlags);
- case 229:
+ case 230:
return computeImportEquals(node, subtreeFlags);
- case 172:
+ case 173:
return computePropertyAccess(node, subtreeFlags);
default:
return computeOther(node, kind, subtreeFlags);
@@ -19348,40 +18939,54 @@ var ts;
var transformFlags = subtreeFlags;
var expression = node.expression;
var expressionKind = expression.kind;
- if (subtreeFlags & 262144
+ if (node.typeArguments) {
+ transformFlags |= 3;
+ }
+ if (subtreeFlags & 1048576
|| isSuperOrSuperProperty(expression, expressionKind)) {
- transformFlags |= 192;
+ transformFlags |= 768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~537133909;
+ return transformFlags & ~537922901;
}
function isSuperOrSuperProperty(node, kind) {
switch (kind) {
- case 95:
+ case 96:
return true;
- case 172:
case 173:
+ case 174:
var expression = node.expression;
var expressionKind = expression.kind;
- return expressionKind === 95;
+ return expressionKind === 96;
}
return false;
}
+ function computeNewExpression(node, subtreeFlags) {
+ var transformFlags = subtreeFlags;
+ if (node.typeArguments) {
+ transformFlags |= 3;
+ }
+ if (subtreeFlags & 1048576) {
+ transformFlags |= 768;
+ }
+ node.transformFlags = transformFlags | 536870912;
+ return transformFlags & ~537922901;
+ }
function computeBinaryExpression(node, subtreeFlags) {
var transformFlags = subtreeFlags;
var operatorTokenKind = node.operatorToken.kind;
var leftKind = node.left.kind;
- if (operatorTokenKind === 56
- && (leftKind === 171
- || leftKind === 170)) {
- transformFlags |= 192 | 256;
+ if (operatorTokenKind === 57
+ && (leftKind === 172
+ || leftKind === 171)) {
+ transformFlags |= 768 | 1024;
}
- else if (operatorTokenKind === 38
- || operatorTokenKind === 60) {
- transformFlags |= 48;
+ else if (operatorTokenKind === 39
+ || operatorTokenKind === 61) {
+ transformFlags |= 192;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeParameter(node, subtreeFlags) {
var transformFlags = subtreeFlags;
@@ -19389,35 +18994,35 @@ var ts;
var name = node.name;
var initializer = node.initializer;
var dotDotDotToken = node.dotDotDotToken;
- if (node.questionToken) {
- transformFlags |= 3;
- }
- if (subtreeFlags & 2048 || ts.isThisIdentifier(name)) {
+ if (node.questionToken
+ || node.type
+ || subtreeFlags & 8192
+ || ts.isThisIdentifier(name)) {
transformFlags |= 3;
}
if (modifierFlags & 92) {
- transformFlags |= 3 | 131072;
+ transformFlags |= 3 | 524288;
}
- if (subtreeFlags & 2097152 || initializer || dotDotDotToken) {
- transformFlags |= 192 | 65536;
+ if (subtreeFlags & 8388608 || initializer || dotDotDotToken) {
+ transformFlags |= 768 | 262144;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~538968917;
+ return transformFlags & ~545262933;
}
function computeParenthesizedExpression(node, subtreeFlags) {
var transformFlags = subtreeFlags;
var expression = node.expression;
var expressionKind = expression.kind;
var expressionTransformFlags = expression.transformFlags;
- if (expressionKind === 195
- || expressionKind === 177) {
+ if (expressionKind === 196
+ || expressionKind === 178) {
transformFlags |= 3;
}
- if (expressionTransformFlags & 256) {
- transformFlags |= 256;
+ if (expressionTransformFlags & 1024) {
+ transformFlags |= 1024;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeClassDeclaration(node, subtreeFlags) {
var transformFlags;
@@ -19426,36 +19031,38 @@ var ts;
transformFlags = 3;
}
else {
- transformFlags = subtreeFlags | 192;
- if ((subtreeFlags & 137216)
- || (modifierFlags & 1)) {
+ transformFlags = subtreeFlags | 768;
+ if ((subtreeFlags & 548864)
+ || (modifierFlags & 1)
+ || node.typeParameters) {
transformFlags |= 3;
}
- if (subtreeFlags & 32768) {
- transformFlags |= 8192;
+ if (subtreeFlags & 131072) {
+ transformFlags |= 32768;
}
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~537590613;
+ return transformFlags & ~539749717;
}
function computeClassExpression(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
- if (subtreeFlags & 137216) {
+ var transformFlags = subtreeFlags | 768;
+ if (subtreeFlags & 548864
+ || node.typeParameters) {
transformFlags |= 3;
}
- if (subtreeFlags & 32768) {
- transformFlags |= 8192;
+ if (subtreeFlags & 131072) {
+ transformFlags |= 32768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~537590613;
+ return transformFlags & ~539749717;
}
function computeHeritageClause(node, subtreeFlags) {
var transformFlags = subtreeFlags;
switch (node.token) {
- case 83:
- transformFlags |= 192;
+ case 84:
+ transformFlags |= 768;
break;
- case 106:
+ case 107:
transformFlags |= 3;
break;
default:
@@ -19463,135 +19070,148 @@ var ts;
break;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeExpressionWithTypeArguments(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
+ var transformFlags = subtreeFlags | 768;
if (node.typeArguments) {
transformFlags |= 3;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeConstructor(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- var body = node.body;
- if (body === undefined) {
+ if (ts.hasModifier(node, 2270)
+ || !node.body) {
transformFlags |= 3;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550593365;
+ return transformFlags & ~591760725;
}
function computeMethod(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
- var modifierFlags = ts.getModifierFlags(node);
- var body = node.body;
- var typeParameters = node.typeParameters;
- var asteriskToken = node.asteriskToken;
- if (!body
- || typeParameters
- || (modifierFlags & (256 | 128))
- || (subtreeFlags & 2048)) {
+ var transformFlags = subtreeFlags | 768;
+ if (node.decorators
+ || ts.hasModifier(node, 2270)
+ || node.typeParameters
+ || node.type
+ || !node.body) {
transformFlags |= 3;
}
- if (asteriskToken && ts.getEmitFlags(node) & 2097152) {
- transformFlags |= 1536;
+ if (ts.hasModifier(node, 256)) {
+ transformFlags |= 48;
+ }
+ if (node.asteriskToken && ts.getEmitFlags(node) & 2097152) {
+ transformFlags |= 6144;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550593365;
+ return transformFlags & ~591760725;
}
function computeAccessor(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- var modifierFlags = ts.getModifierFlags(node);
- var body = node.body;
- if (!body
- || (modifierFlags & (256 | 128))
- || (subtreeFlags & 2048)) {
+ if (node.decorators
+ || ts.hasModifier(node, 2270)
+ || node.type
+ || !node.body) {
transformFlags |= 3;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550593365;
+ return transformFlags & ~591760725;
}
function computePropertyDeclaration(node, subtreeFlags) {
var transformFlags = subtreeFlags | 3;
if (node.initializer) {
- transformFlags |= 4096;
+ transformFlags |= 16384;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeFunctionDeclaration(node, subtreeFlags) {
var transformFlags;
var modifierFlags = ts.getModifierFlags(node);
var body = node.body;
- var asteriskToken = node.asteriskToken;
if (!body || (modifierFlags & 2)) {
transformFlags = 3;
}
else {
- transformFlags = subtreeFlags | 8388608;
+ transformFlags = subtreeFlags | 33554432;
if (modifierFlags & 1) {
- transformFlags |= 3 | 192;
+ transformFlags |= 3 | 768;
}
- if (modifierFlags & 256) {
+ if (modifierFlags & 2270
+ || node.typeParameters
+ || node.type) {
transformFlags |= 3;
}
- if (subtreeFlags & 81920) {
- transformFlags |= 192;
+ if (modifierFlags & 256) {
+ transformFlags |= 48;
}
- if (asteriskToken && ts.getEmitFlags(node) & 2097152) {
- transformFlags |= 1536;
+ if (subtreeFlags & 327680) {
+ transformFlags |= 768;
+ }
+ if (node.asteriskToken && ts.getEmitFlags(node) & 2097152) {
+ transformFlags |= 6144;
}
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550726485;
+ return transformFlags & ~592293205;
}
function computeFunctionExpression(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- var modifierFlags = ts.getModifierFlags(node);
- var asteriskToken = node.asteriskToken;
- if (modifierFlags & 256) {
+ if (ts.hasModifier(node, 2270)
+ || node.typeParameters
+ || node.type) {
transformFlags |= 3;
}
- if (subtreeFlags & 81920) {
- transformFlags |= 192;
+ if (ts.hasModifier(node, 256)) {
+ transformFlags |= 48;
}
- if (asteriskToken && ts.getEmitFlags(node) & 2097152) {
- transformFlags |= 1536;
+ if (subtreeFlags & 327680) {
+ transformFlags |= 768;
+ }
+ if (node.asteriskToken && ts.getEmitFlags(node) & 2097152) {
+ transformFlags |= 6144;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550726485;
+ return transformFlags & ~592293205;
}
function computeArrowFunction(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
- var modifierFlags = ts.getModifierFlags(node);
- if (modifierFlags & 256) {
+ var transformFlags = subtreeFlags | 768;
+ if (ts.hasModifier(node, 2270)
+ || node.typeParameters
+ || node.type) {
transformFlags |= 3;
}
- if (subtreeFlags & 8192) {
- transformFlags |= 16384;
+ if (ts.hasModifier(node, 256)) {
+ transformFlags |= 48;
+ }
+ if (subtreeFlags & 32768) {
+ transformFlags |= 65536;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550710101;
+ return transformFlags & ~592227669;
}
function computePropertyAccess(node, subtreeFlags) {
var transformFlags = subtreeFlags;
var expression = node.expression;
var expressionKind = expression.kind;
- if (expressionKind === 95) {
- transformFlags |= 8192;
+ if (expressionKind === 96) {
+ transformFlags |= 32768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeVariableDeclaration(node, subtreeFlags) {
var transformFlags = subtreeFlags;
var nameKind = node.name.kind;
- if (nameKind === 167 || nameKind === 168) {
- transformFlags |= 192 | 2097152;
+ if (nameKind === 168 || nameKind === 169) {
+ transformFlags |= 768 | 8388608;
+ }
+ if (node.type) {
+ transformFlags |= 3;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeVariableStatement(node, subtreeFlags) {
var transformFlags;
@@ -19603,23 +19223,23 @@ var ts;
else {
transformFlags = subtreeFlags;
if (modifierFlags & 1) {
- transformFlags |= 192 | 3;
+ transformFlags |= 768 | 3;
}
- if (declarationListTransformFlags & 2097152) {
- transformFlags |= 192;
+ if (declarationListTransformFlags & 8388608) {
+ transformFlags |= 768;
}
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeLabeledStatement(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- if (subtreeFlags & 1048576
+ if (subtreeFlags & 4194304
&& ts.isIterationStatement(node, true)) {
- transformFlags |= 192;
+ transformFlags |= 768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeImportEquals(node, subtreeFlags) {
var transformFlags = subtreeFlags;
@@ -19627,15 +19247,15 @@ var ts;
transformFlags |= 3;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeExpressionStatement(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- if (node.expression.transformFlags & 256) {
- transformFlags |= 192;
+ if (node.expression.transformFlags & 1024) {
+ transformFlags |= 768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeModuleDeclaration(node, subtreeFlags) {
var transformFlags = 3;
@@ -19644,77 +19264,78 @@ var ts;
transformFlags |= subtreeFlags;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~546335573;
+ return transformFlags & ~574729557;
}
function computeVariableDeclarationList(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 8388608;
- if (subtreeFlags & 2097152) {
- transformFlags |= 192;
+ var transformFlags = subtreeFlags | 33554432;
+ if (subtreeFlags & 8388608) {
+ transformFlags |= 768;
}
if (node.flags & 3) {
- transformFlags |= 192 | 1048576;
+ transformFlags |= 768 | 4194304;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~538968917;
+ return transformFlags & ~545262933;
}
function computeOther(node, kind, subtreeFlags) {
var transformFlags = subtreeFlags;
- var excludeFlags = 536871765;
+ var excludeFlags = 536874325;
switch (kind) {
- case 112:
- case 110:
+ case 119:
+ case 185:
+ transformFlags |= 48;
+ break;
+ case 113:
case 111:
- case 115:
- case 122:
- case 118:
- case 74:
- case 184:
- case 224:
+ case 112:
+ case 116:
+ case 123:
+ case 75:
+ case 225:
case 255:
- case 177:
- case 195:
+ case 178:
case 196:
- case 128:
+ case 197:
+ case 129:
transformFlags |= 3;
break;
- case 241:
case 242:
case 243:
case 244:
+ case 10:
case 245:
case 246:
case 247:
case 248:
transformFlags |= 12;
break;
- case 82:
- transformFlags |= 192 | 3;
+ case 83:
+ transformFlags |= 768 | 3;
break;
- case 77:
- case 11:
+ case 78:
case 12:
case 13:
case 14:
- case 189:
- case 176:
- case 254:
- case 208:
- transformFlags |= 192;
- break;
+ case 15:
case 190:
- transformFlags |= 192 | 4194304;
+ case 177:
+ case 254:
+ case 209:
+ transformFlags |= 768;
break;
- case 117:
- case 130:
- case 127:
- case 132:
- case 120:
+ case 191:
+ transformFlags |= 768 | 16777216;
+ break;
+ case 118:
+ case 131:
+ case 128:
case 133:
- case 103:
- case 141:
- case 144:
- case 146:
- case 151:
+ case 121:
+ case 134:
+ case 104:
+ case 142:
+ case 145:
+ case 147:
case 152:
case 153:
case 154:
@@ -19728,68 +19349,69 @@ var ts;
case 162:
case 163:
case 164:
- case 222:
- case 223:
case 165:
+ case 223:
+ case 224:
case 166:
+ case 167:
transformFlags = 3;
excludeFlags = -3;
break;
- case 140:
- transformFlags |= 524288;
- if (subtreeFlags & 8192) {
+ case 141:
+ transformFlags |= 2097152;
+ if (subtreeFlags & 32768) {
+ transformFlags |= 131072;
+ }
+ break;
+ case 192:
+ transformFlags |= 1048576;
+ break;
+ case 96:
+ transformFlags |= 768;
+ break;
+ case 98:
+ transformFlags |= 32768;
+ break;
+ case 168:
+ case 169:
+ transformFlags |= 768 | 8388608;
+ break;
+ case 144:
+ transformFlags |= 3 | 8192;
+ break;
+ case 172:
+ excludeFlags = 539110741;
+ if (subtreeFlags & 2097152) {
+ transformFlags |= 768;
+ }
+ if (subtreeFlags & 131072) {
transformFlags |= 32768;
}
break;
- case 191:
- transformFlags |= 262144;
- break;
- case 95:
- transformFlags |= 192;
- break;
- case 97:
- transformFlags |= 8192;
- break;
- case 167:
- case 168:
- transformFlags |= 192 | 2097152;
- break;
- case 143:
- transformFlags |= 3 | 2048;
- break;
case 171:
- excludeFlags = 537430869;
- if (subtreeFlags & 524288) {
- transformFlags |= 192;
- }
- if (subtreeFlags & 32768) {
- transformFlags |= 8192;
+ case 176:
+ excludeFlags = 537922901;
+ if (subtreeFlags & 1048576) {
+ transformFlags |= 768;
}
break;
- case 170:
- case 175:
- excludeFlags = 537133909;
- if (subtreeFlags & 262144) {
- transformFlags |= 192;
- }
- break;
- case 204:
case 205:
case 206:
case 207:
- if (subtreeFlags & 1048576) {
- transformFlags |= 192;
+ case 208:
+ if (subtreeFlags & 4194304) {
+ transformFlags |= 768;
}
break;
case 256:
- if (subtreeFlags & 16384) {
- transformFlags |= 192;
+ if (subtreeFlags & 65536) {
+ transformFlags |= 768;
}
break;
- case 211:
- case 209:
+ case 212:
case 210:
- transformFlags |= 8388608;
+ case 211:
+ transformFlags |= 33554432;
break;
}
node.transformFlags = transformFlags | 536870912;
@@ -19889,6 +19511,7 @@ var ts;
var intersectionTypes = ts.createMap();
var stringLiteralTypes = ts.createMap();
var numericLiteralTypes = ts.createMap();
+ var evolvingArrayTypes = [];
var unknownSymbol = createSymbol(4 | 67108864, "unknown");
var resolvingSymbol = createSymbol(67108864, "__resolving__");
var anyType = createIntrinsicType(1, "any");
@@ -19932,6 +19555,7 @@ var ts;
var globalBooleanType;
var globalRegExpType;
var anyArrayType;
+ var autoArrayType;
var anyReadonlyArrayType;
var getGlobalTemplateStringsArrayType;
var getGlobalESSymbolType;
@@ -19972,6 +19596,66 @@ var ts;
var potentialThisCollisions = [];
var awaitedTypeStack = [];
var diagnostics = ts.createDiagnosticCollection();
+ var TypeFacts;
+ (function (TypeFacts) {
+ TypeFacts[TypeFacts["None"] = 0] = "None";
+ TypeFacts[TypeFacts["TypeofEQString"] = 1] = "TypeofEQString";
+ TypeFacts[TypeFacts["TypeofEQNumber"] = 2] = "TypeofEQNumber";
+ TypeFacts[TypeFacts["TypeofEQBoolean"] = 4] = "TypeofEQBoolean";
+ TypeFacts[TypeFacts["TypeofEQSymbol"] = 8] = "TypeofEQSymbol";
+ TypeFacts[TypeFacts["TypeofEQObject"] = 16] = "TypeofEQObject";
+ TypeFacts[TypeFacts["TypeofEQFunction"] = 32] = "TypeofEQFunction";
+ TypeFacts[TypeFacts["TypeofEQHostObject"] = 64] = "TypeofEQHostObject";
+ TypeFacts[TypeFacts["TypeofNEString"] = 128] = "TypeofNEString";
+ TypeFacts[TypeFacts["TypeofNENumber"] = 256] = "TypeofNENumber";
+ TypeFacts[TypeFacts["TypeofNEBoolean"] = 512] = "TypeofNEBoolean";
+ TypeFacts[TypeFacts["TypeofNESymbol"] = 1024] = "TypeofNESymbol";
+ TypeFacts[TypeFacts["TypeofNEObject"] = 2048] = "TypeofNEObject";
+ TypeFacts[TypeFacts["TypeofNEFunction"] = 4096] = "TypeofNEFunction";
+ TypeFacts[TypeFacts["TypeofNEHostObject"] = 8192] = "TypeofNEHostObject";
+ TypeFacts[TypeFacts["EQUndefined"] = 16384] = "EQUndefined";
+ TypeFacts[TypeFacts["EQNull"] = 32768] = "EQNull";
+ TypeFacts[TypeFacts["EQUndefinedOrNull"] = 65536] = "EQUndefinedOrNull";
+ TypeFacts[TypeFacts["NEUndefined"] = 131072] = "NEUndefined";
+ TypeFacts[TypeFacts["NENull"] = 262144] = "NENull";
+ TypeFacts[TypeFacts["NEUndefinedOrNull"] = 524288] = "NEUndefinedOrNull";
+ TypeFacts[TypeFacts["Truthy"] = 1048576] = "Truthy";
+ TypeFacts[TypeFacts["Falsy"] = 2097152] = "Falsy";
+ TypeFacts[TypeFacts["Discriminatable"] = 4194304] = "Discriminatable";
+ TypeFacts[TypeFacts["All"] = 8388607] = "All";
+ TypeFacts[TypeFacts["BaseStringStrictFacts"] = 933633] = "BaseStringStrictFacts";
+ TypeFacts[TypeFacts["BaseStringFacts"] = 3145473] = "BaseStringFacts";
+ TypeFacts[TypeFacts["StringStrictFacts"] = 4079361] = "StringStrictFacts";
+ TypeFacts[TypeFacts["StringFacts"] = 4194049] = "StringFacts";
+ TypeFacts[TypeFacts["EmptyStringStrictFacts"] = 3030785] = "EmptyStringStrictFacts";
+ TypeFacts[TypeFacts["EmptyStringFacts"] = 3145473] = "EmptyStringFacts";
+ TypeFacts[TypeFacts["NonEmptyStringStrictFacts"] = 1982209] = "NonEmptyStringStrictFacts";
+ TypeFacts[TypeFacts["NonEmptyStringFacts"] = 4194049] = "NonEmptyStringFacts";
+ TypeFacts[TypeFacts["BaseNumberStrictFacts"] = 933506] = "BaseNumberStrictFacts";
+ TypeFacts[TypeFacts["BaseNumberFacts"] = 3145346] = "BaseNumberFacts";
+ TypeFacts[TypeFacts["NumberStrictFacts"] = 4079234] = "NumberStrictFacts";
+ TypeFacts[TypeFacts["NumberFacts"] = 4193922] = "NumberFacts";
+ TypeFacts[TypeFacts["ZeroStrictFacts"] = 3030658] = "ZeroStrictFacts";
+ TypeFacts[TypeFacts["ZeroFacts"] = 3145346] = "ZeroFacts";
+ TypeFacts[TypeFacts["NonZeroStrictFacts"] = 1982082] = "NonZeroStrictFacts";
+ TypeFacts[TypeFacts["NonZeroFacts"] = 4193922] = "NonZeroFacts";
+ TypeFacts[TypeFacts["BaseBooleanStrictFacts"] = 933252] = "BaseBooleanStrictFacts";
+ TypeFacts[TypeFacts["BaseBooleanFacts"] = 3145092] = "BaseBooleanFacts";
+ TypeFacts[TypeFacts["BooleanStrictFacts"] = 4078980] = "BooleanStrictFacts";
+ TypeFacts[TypeFacts["BooleanFacts"] = 4193668] = "BooleanFacts";
+ TypeFacts[TypeFacts["FalseStrictFacts"] = 3030404] = "FalseStrictFacts";
+ TypeFacts[TypeFacts["FalseFacts"] = 3145092] = "FalseFacts";
+ TypeFacts[TypeFacts["TrueStrictFacts"] = 1981828] = "TrueStrictFacts";
+ TypeFacts[TypeFacts["TrueFacts"] = 4193668] = "TrueFacts";
+ TypeFacts[TypeFacts["SymbolStrictFacts"] = 1981320] = "SymbolStrictFacts";
+ TypeFacts[TypeFacts["SymbolFacts"] = 4193160] = "SymbolFacts";
+ TypeFacts[TypeFacts["ObjectStrictFacts"] = 6166480] = "ObjectStrictFacts";
+ TypeFacts[TypeFacts["ObjectFacts"] = 8378320] = "ObjectFacts";
+ TypeFacts[TypeFacts["FunctionStrictFacts"] = 6164448] = "FunctionStrictFacts";
+ TypeFacts[TypeFacts["FunctionFacts"] = 8376288] = "FunctionFacts";
+ TypeFacts[TypeFacts["UndefinedFacts"] = 2457472] = "UndefinedFacts";
+ TypeFacts[TypeFacts["NullFacts"] = 2340752] = "NullFacts";
+ })(TypeFacts || (TypeFacts = {}));
var typeofEQFacts = ts.createMap({
"string": 1,
"number": 2,
@@ -20014,6 +19698,13 @@ var ts;
var identityRelation = ts.createMap();
var enumRelation = ts.createMap();
var _displayBuilder;
+ var TypeSystemPropertyName;
+ (function (TypeSystemPropertyName) {
+ TypeSystemPropertyName[TypeSystemPropertyName["Type"] = 0] = "Type";
+ TypeSystemPropertyName[TypeSystemPropertyName["ResolvedBaseConstructorType"] = 1] = "ResolvedBaseConstructorType";
+ TypeSystemPropertyName[TypeSystemPropertyName["DeclaredType"] = 2] = "DeclaredType";
+ TypeSystemPropertyName[TypeSystemPropertyName["ResolvedReturnType"] = 3] = "ResolvedReturnType";
+ })(TypeSystemPropertyName || (TypeSystemPropertyName = {}));
var builtinGlobals = ts.createMap();
builtinGlobals[undefinedSymbol.name] = undefinedSymbol;
initializeTypeChecker();
@@ -20098,7 +19789,7 @@ var ts;
target.flags |= source.flags;
if (source.valueDeclaration &&
(!target.valueDeclaration ||
- (target.valueDeclaration.kind === 225 && source.valueDeclaration.kind !== 225))) {
+ (target.valueDeclaration.kind === 226 && source.valueDeclaration.kind !== 226))) {
target.valueDeclaration = source.valueDeclaration;
}
ts.forEach(source.declarations, function (node) {
@@ -20233,24 +19924,24 @@ var ts;
return ts.indexOf(sourceFiles, declarationFile) <= ts.indexOf(sourceFiles, useFile);
}
if (declaration.pos <= usage.pos) {
- return declaration.kind !== 218 ||
+ return declaration.kind !== 219 ||
!isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
}
return isUsedInFunctionOrNonStaticProperty(declaration, usage);
function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) {
var container = ts.getEnclosingBlockScopeContainer(declaration);
switch (declaration.parent.parent.kind) {
- case 200:
- case 206:
- case 208:
+ case 201:
+ case 207:
+ case 209:
if (isSameScopeDescendentOf(usage, declaration, container)) {
return true;
}
break;
}
switch (declaration.parent.parent.kind) {
- case 207:
case 208:
+ case 209:
if (isSameScopeDescendentOf(usage, declaration.parent.parent.expression, container)) {
return true;
}
@@ -20268,7 +19959,7 @@ var ts;
return true;
}
var initializerOfNonStaticProperty = current.parent &&
- current.parent.kind === 145 &&
+ current.parent.kind === 146 &&
(ts.getModifierFlags(current.parent) & 32) === 0 &&
current.parent.initializer === current;
if (initializerOfNonStaticProperty) {
@@ -20294,15 +19985,15 @@ var ts;
if (meaning & result.flags & 793064 && lastLocation.kind !== 273) {
useResult = result.flags & 262144
? lastLocation === location.type ||
- lastLocation.kind === 142 ||
- lastLocation.kind === 141
+ lastLocation.kind === 143 ||
+ lastLocation.kind === 142
: false;
}
if (meaning & 107455 && result.flags & 1) {
useResult =
- lastLocation.kind === 142 ||
+ lastLocation.kind === 143 ||
(lastLocation === location.type &&
- result.valueDeclaration.kind === 142);
+ result.valueDeclaration.kind === 143);
}
}
if (useResult) {
@@ -20318,7 +20009,7 @@ var ts;
if (!ts.isExternalOrCommonJsModule(location))
break;
isInExternalModule = true;
- case 225:
+ case 226:
var moduleExports = getSymbolOfNode(location).exports;
if (location.kind === 256 || ts.isAmbientModule(location)) {
if (result = moduleExports["default"]) {
@@ -20330,7 +20021,7 @@ var ts;
}
if (moduleExports[name] &&
moduleExports[name].flags === 8388608 &&
- ts.getDeclarationOfKind(moduleExports[name], 238)) {
+ ts.getDeclarationOfKind(moduleExports[name], 239)) {
break;
}
}
@@ -20338,13 +20029,13 @@ var ts;
break loop;
}
break;
- case 224:
+ case 225:
if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) {
break loop;
}
break;
+ case 146:
case 145:
- case 144:
if (ts.isClassLike(location.parent) && !(ts.getModifierFlags(location) & 32)) {
var ctor = findConstructorDeclaration(location.parent);
if (ctor && ctor.locals) {
@@ -20354,9 +20045,9 @@ var ts;
}
}
break;
- case 221:
- case 192:
case 222:
+ case 193:
+ case 223:
if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793064)) {
if (lastLocation && ts.getModifierFlags(lastLocation) & 32) {
error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters);
@@ -20364,7 +20055,7 @@ var ts;
}
break loop;
}
- if (location.kind === 192 && meaning & 32) {
+ if (location.kind === 193 && meaning & 32) {
var className = location.name;
if (className && name === className.text) {
result = location.symbol;
@@ -20372,28 +20063,28 @@ var ts;
}
}
break;
- case 140:
+ case 141:
grandparent = location.parent.parent;
- if (ts.isClassLike(grandparent) || grandparent.kind === 222) {
+ if (ts.isClassLike(grandparent) || grandparent.kind === 223) {
if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793064)) {
error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
return undefined;
}
}
break;
- case 147:
- case 146:
case 148:
+ case 147:
case 149:
case 150:
- case 220:
- case 180:
+ case 151:
+ case 221:
+ case 181:
if (meaning & 3 && name === "arguments") {
result = argumentsSymbol;
break loop;
}
break;
- case 179:
+ case 180:
if (meaning & 3 && name === "arguments") {
result = argumentsSymbol;
break loop;
@@ -20406,8 +20097,8 @@ var ts;
}
}
break;
- case 143:
- if (location.parent && location.parent.kind === 142) {
+ case 144:
+ if (location.parent && location.parent.kind === 143) {
location = location.parent;
}
if (location.parent && ts.isClassElement(location.parent)) {
@@ -20449,7 +20140,7 @@ var ts;
}
if (result && isInExternalModule && (meaning & 107455) === 107455) {
var decls = result.declarations;
- if (decls && decls.length === 1 && decls[0].kind === 228) {
+ if (decls && decls.length === 1 && decls[0].kind === 229) {
error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, name);
}
}
@@ -20457,7 +20148,7 @@ var ts;
return result;
}
function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) {
- if ((errorLocation.kind === 69 && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) {
+ if ((errorLocation.kind === 70 && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) {
return false;
}
var container = ts.getThisContainer(errorLocation, true);
@@ -20495,10 +20186,10 @@ var ts;
}
function getEntityNameForExtendingInterface(node) {
switch (node.kind) {
- case 69:
- case 172:
+ case 70:
+ case 173:
return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined;
- case 194:
+ case 195:
ts.Debug.assert(ts.isEntityNameExpression(node.expression));
return node.expression;
default:
@@ -20519,7 +20210,7 @@ var ts;
ts.Debug.assert((result.flags & 2) !== 0);
var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; });
ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined");
- if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 218), errorLocation)) {
+ if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 219), errorLocation)) {
error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name));
}
}
@@ -20536,10 +20227,10 @@ var ts;
}
function getAnyImportSyntax(node) {
if (ts.isAliasSymbolDeclaration(node)) {
- if (node.kind === 229) {
+ if (node.kind === 230) {
return node;
}
- while (node && node.kind !== 230) {
+ while (node && node.kind !== 231) {
node = node.parent;
}
return node;
@@ -20549,10 +20240,10 @@ var ts;
return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; });
}
function getTargetOfImportEqualsDeclaration(node) {
- if (node.moduleReference.kind === 240) {
+ if (node.moduleReference.kind === 241) {
return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)));
}
- return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node);
+ return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference);
}
function getTargetOfImportClause(node) {
var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
@@ -20610,28 +20301,28 @@ var ts;
var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier);
var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier);
if (targetSymbol) {
- var name_16 = specifier.propertyName || specifier.name;
- if (name_16.text) {
+ var name_13 = specifier.propertyName || specifier.name;
+ if (name_13.text) {
if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
return moduleSymbol;
}
var symbolFromVariable = void 0;
if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports["export="]) {
- symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name_16.text);
+ symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name_13.text);
}
else {
- symbolFromVariable = getPropertyOfVariable(targetSymbol, name_16.text);
+ symbolFromVariable = getPropertyOfVariable(targetSymbol, name_13.text);
}
symbolFromVariable = resolveSymbol(symbolFromVariable);
- var symbolFromModule = getExportOfModule(targetSymbol, name_16.text);
- if (!symbolFromModule && allowSyntheticDefaultImports && name_16.text === "default") {
+ var symbolFromModule = getExportOfModule(targetSymbol, name_13.text);
+ if (!symbolFromModule && allowSyntheticDefaultImports && name_13.text === "default") {
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol);
}
var symbol = symbolFromModule && symbolFromVariable ?
combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) :
symbolFromModule || symbolFromVariable;
if (!symbol) {
- error(name_16, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_16));
+ error(name_13, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_13));
}
return symbol;
}
@@ -20653,19 +20344,19 @@ var ts;
}
function getTargetOfAliasDeclaration(node) {
switch (node.kind) {
- case 229:
+ case 230:
return getTargetOfImportEqualsDeclaration(node);
- case 231:
- return getTargetOfImportClause(node);
case 232:
+ return getTargetOfImportClause(node);
+ case 233:
return getTargetOfNamespaceImport(node);
- case 234:
- return getTargetOfImportSpecifier(node);
- case 238:
- return getTargetOfExportSpecifier(node);
case 235:
+ return getTargetOfImportSpecifier(node);
+ case 239:
+ return getTargetOfExportSpecifier(node);
+ case 236:
return getTargetOfExportAssignment(node);
- case 228:
+ case 229:
return getTargetOfNamespaceExportDeclaration(node);
}
}
@@ -20709,10 +20400,10 @@ var ts;
links.referenced = true;
var node = getDeclarationOfAliasSymbol(symbol);
ts.Debug.assert(!!node);
- if (node.kind === 235) {
+ if (node.kind === 236) {
checkExpressionCached(node.expression);
}
- else if (node.kind === 238) {
+ else if (node.kind === 239) {
checkExpressionCached(node.propertyName || node.name);
}
else if (ts.isInternalModuleImportEqualsDeclaration(node)) {
@@ -20720,15 +20411,15 @@ var ts;
}
}
}
- function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration, dontResolveAlias) {
- if (entityName.kind === 69 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
+ function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, dontResolveAlias) {
+ if (entityName.kind === 70 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
entityName = entityName.parent;
}
- if (entityName.kind === 69 || entityName.parent.kind === 139) {
+ if (entityName.kind === 70 || entityName.parent.kind === 140) {
return resolveEntityName(entityName, 1920, false, dontResolveAlias);
}
else {
- ts.Debug.assert(entityName.parent.kind === 229);
+ ts.Debug.assert(entityName.parent.kind === 230);
return resolveEntityName(entityName, 107455 | 793064 | 1920, false, dontResolveAlias);
}
}
@@ -20740,16 +20431,16 @@ var ts;
return undefined;
}
var symbol;
- if (name.kind === 69) {
+ if (name.kind === 70) {
var message = meaning === 1920 ? ts.Diagnostics.Cannot_find_namespace_0 : ts.Diagnostics.Cannot_find_name_0;
symbol = resolveName(location || name, name.text, meaning, ignoreErrors ? undefined : message, name);
if (!symbol) {
return undefined;
}
}
- else if (name.kind === 139 || name.kind === 172) {
- var left = name.kind === 139 ? name.left : name.expression;
- var right = name.kind === 139 ? name.right : name.name;
+ else if (name.kind === 140 || name.kind === 173) {
+ var left = name.kind === 140 ? name.left : name.expression;
+ var right = name.kind === 140 ? name.right : name.name;
var namespace = resolveEntityName(left, 1920, ignoreErrors, false, location);
if (!namespace || ts.nodeIsMissing(right)) {
return undefined;
@@ -20932,7 +20623,7 @@ var ts;
var members = node.members;
for (var _i = 0, members_1 = members; _i < members_1.length; _i++) {
var member = members_1[_i];
- if (member.kind === 148 && ts.nodeIsPresent(member.body)) {
+ if (member.kind === 149 && ts.nodeIsPresent(member.body)) {
return member;
}
}
@@ -21006,7 +20697,7 @@ var ts;
if (!ts.isExternalOrCommonJsModule(location_1)) {
break;
}
- case 225:
+ case 226:
if (result = callback(getSymbolOfNode(location_1).exports)) {
return result;
}
@@ -21039,7 +20730,7 @@ var ts;
return ts.forEachProperty(symbols, function (symbolFromSymbolTable) {
if (symbolFromSymbolTable.flags & 8388608
&& symbolFromSymbolTable.name !== "export="
- && !ts.getDeclarationOfKind(symbolFromSymbolTable, 238)) {
+ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 239)) {
if (!useOnlyExternalAliasing ||
ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) {
var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
@@ -21070,7 +20761,7 @@ var ts;
if (symbolFromSymbolTable === symbol) {
return true;
}
- symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 238)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
+ symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 239)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
if (symbolFromSymbolTable.flags & meaning) {
qualify = true;
return true;
@@ -21084,10 +20775,10 @@ var ts;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
switch (declaration.kind) {
- case 145:
- case 147:
- case 149:
+ case 146:
+ case 148:
case 150:
+ case 151:
continue;
default:
return false;
@@ -21109,7 +20800,7 @@ var ts;
return {
accessibility: 1,
errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning),
- errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1920) : undefined
+ errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1920) : undefined,
};
}
return hasAccessibleDeclarations;
@@ -21130,7 +20821,7 @@ var ts;
}
return {
accessibility: 1,
- errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning)
+ errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning),
};
}
return { accessibility: 0 };
@@ -21177,11 +20868,11 @@ var ts;
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
var meaning;
- if (entityName.parent.kind === 158 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) {
+ if (entityName.parent.kind === 159 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) {
meaning = 107455 | 1048576;
}
- else if (entityName.kind === 139 || entityName.kind === 172 ||
- entityName.parent.kind === 229) {
+ else if (entityName.kind === 140 || entityName.kind === 173 ||
+ entityName.parent.kind === 230) {
meaning = 1920;
}
else {
@@ -21273,10 +20964,10 @@ var ts;
function getTypeAliasForTypeLiteral(type) {
if (type.symbol && type.symbol.flags & 2048) {
var node = type.symbol.declarations[0].parent;
- while (node.kind === 164) {
+ while (node.kind === 165) {
node = node.parent;
}
- if (node.kind === 223) {
+ if (node.kind === 224) {
return getSymbolOfNode(node);
}
}
@@ -21284,7 +20975,7 @@ var ts;
}
function isTopLevelInExternalModuleAugmentation(node) {
return node && node.parent &&
- node.parent.kind === 226 &&
+ node.parent.kind === 227 &&
ts.isExternalModuleAugmentation(node.parent.parent);
}
function literalTypeToString(type) {
@@ -21298,10 +20989,10 @@ var ts;
return ts.declarationNameToString(declaration.name);
}
switch (declaration.kind) {
- case 192:
+ case 193:
return "(Anonymous class)";
- case 179:
case 180:
+ case 181:
return "(Anonymous function)";
}
}
@@ -21315,17 +21006,17 @@ var ts;
var firstChar = symbolName.charCodeAt(0);
var needsElementAccess = !ts.isIdentifierStart(firstChar, languageVersion);
if (needsElementAccess) {
- writePunctuation(writer, 19);
+ writePunctuation(writer, 20);
if (ts.isSingleOrDoubleQuote(firstChar)) {
writer.writeStringLiteral(symbolName);
}
else {
writer.writeSymbol(symbolName, symbol);
}
- writePunctuation(writer, 20);
+ writePunctuation(writer, 21);
}
else {
- writePunctuation(writer, 21);
+ writePunctuation(writer, 22);
writer.writeSymbol(symbolName, symbol);
}
}
@@ -21401,7 +21092,7 @@ var ts;
}
else if (type.flags & 256) {
buildSymbolDisplay(getParentOfSymbol(type.symbol), writer, enclosingDeclaration, 793064, 0, nextFlags);
- writePunctuation(writer, 21);
+ writePunctuation(writer, 22);
appendSymbolNameOnly(type.symbol, writer);
}
else if (type.flags & (32768 | 65536 | 16 | 16384)) {
@@ -21422,23 +21113,23 @@ var ts;
writer.writeStringLiteral(literalTypeToString(type));
}
else {
- writePunctuation(writer, 15);
- writeSpace(writer);
- writePunctuation(writer, 22);
- writeSpace(writer);
writePunctuation(writer, 16);
+ writeSpace(writer);
+ writePunctuation(writer, 23);
+ writeSpace(writer);
+ writePunctuation(writer, 17);
}
}
function writeTypeList(types, delimiter) {
for (var i = 0; i < types.length; i++) {
if (i > 0) {
- if (delimiter !== 24) {
+ if (delimiter !== 25) {
writeSpace(writer);
}
writePunctuation(writer, delimiter);
writeSpace(writer);
}
- writeType(types[i], delimiter === 24 ? 0 : 64);
+ writeType(types[i], delimiter === 25 ? 0 : 64);
}
}
function writeSymbolTypeReference(symbol, typeArguments, pos, end, flags) {
@@ -21446,29 +21137,29 @@ var ts;
buildSymbolDisplay(symbol, writer, enclosingDeclaration, 793064, 0, flags);
}
if (pos < end) {
- writePunctuation(writer, 25);
+ writePunctuation(writer, 26);
writeType(typeArguments[pos], 256);
pos++;
while (pos < end) {
- writePunctuation(writer, 24);
+ writePunctuation(writer, 25);
writeSpace(writer);
writeType(typeArguments[pos], 0);
pos++;
}
- writePunctuation(writer, 27);
+ writePunctuation(writer, 28);
}
}
function writeTypeReference(type, flags) {
var typeArguments = type.typeArguments || emptyArray;
if (type.target === globalArrayType && !(flags & 1)) {
writeType(typeArguments[0], 64);
- writePunctuation(writer, 19);
writePunctuation(writer, 20);
+ writePunctuation(writer, 21);
}
else if (type.target.flags & 262144) {
- writePunctuation(writer, 19);
- writeTypeList(type.typeArguments.slice(0, getTypeReferenceArity(type)), 24);
writePunctuation(writer, 20);
+ writeTypeList(type.typeArguments.slice(0, getTypeReferenceArity(type)), 25);
+ writePunctuation(writer, 21);
}
else {
var outerTypeParameters = type.target.outerTypeParameters;
@@ -21483,7 +21174,7 @@ var ts;
} while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent_9);
if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) {
writeSymbolTypeReference(parent_9, typeArguments, start, i, flags);
- writePunctuation(writer, 21);
+ writePunctuation(writer, 22);
}
}
}
@@ -21493,16 +21184,16 @@ var ts;
}
function writeUnionOrIntersectionType(type, flags) {
if (flags & 64) {
- writePunctuation(writer, 17);
+ writePunctuation(writer, 18);
}
if (type.flags & 524288) {
- writeTypeList(formatUnionTypes(type.types), 47);
+ writeTypeList(formatUnionTypes(type.types), 48);
}
else {
- writeTypeList(type.types, 46);
+ writeTypeList(type.types, 47);
}
if (flags & 64) {
- writePunctuation(writer, 18);
+ writePunctuation(writer, 19);
}
}
function writeAnonymousType(type, flags) {
@@ -21520,7 +21211,7 @@ var ts;
buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793064, 0, flags);
}
else {
- writeKeyword(writer, 117);
+ writeKeyword(writer, 118);
}
}
else {
@@ -21541,7 +21232,7 @@ var ts;
var isNonLocalFunctionSymbol = !!(symbol.flags & 16) &&
(symbol.parent ||
ts.forEach(symbol.declarations, function (declaration) {
- return declaration.parent.kind === 256 || declaration.parent.kind === 226;
+ return declaration.parent.kind === 256 || declaration.parent.kind === 227;
}));
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
return !!(flags & 2) ||
@@ -21550,37 +21241,37 @@ var ts;
}
}
function writeTypeOfSymbol(type, typeFormatFlags) {
- writeKeyword(writer, 101);
+ writeKeyword(writer, 102);
writeSpace(writer);
buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455, 0, typeFormatFlags);
}
function writeIndexSignature(info, keyword) {
if (info) {
if (info.isReadonly) {
- writeKeyword(writer, 128);
+ writeKeyword(writer, 129);
writeSpace(writer);
}
- writePunctuation(writer, 19);
+ writePunctuation(writer, 20);
writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x");
- writePunctuation(writer, 54);
+ writePunctuation(writer, 55);
writeSpace(writer);
writeKeyword(writer, keyword);
- writePunctuation(writer, 20);
- writePunctuation(writer, 54);
+ writePunctuation(writer, 21);
+ writePunctuation(writer, 55);
writeSpace(writer);
writeType(info.type, 0);
- writePunctuation(writer, 23);
+ writePunctuation(writer, 24);
writer.writeLine();
}
}
function writePropertyWithModifiers(prop) {
if (isReadonlySymbol(prop)) {
- writeKeyword(writer, 128);
+ writeKeyword(writer, 129);
writeSpace(writer);
}
buildSymbolDisplay(prop, writer);
if (prop.flags & 536870912) {
- writePunctuation(writer, 53);
+ writePunctuation(writer, 54);
}
}
function shouldAddParenthesisAroundFunctionType(callSignature, flags) {
@@ -21598,53 +21289,53 @@ var ts;
var resolved = resolveStructuredTypeMembers(type);
if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) {
if (!resolved.callSignatures.length && !resolved.constructSignatures.length) {
- writePunctuation(writer, 15);
writePunctuation(writer, 16);
+ writePunctuation(writer, 17);
return;
}
if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) {
var parenthesizeSignature = shouldAddParenthesisAroundFunctionType(resolved.callSignatures[0], flags);
if (parenthesizeSignature) {
- writePunctuation(writer, 17);
+ writePunctuation(writer, 18);
}
buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, undefined, symbolStack);
if (parenthesizeSignature) {
- writePunctuation(writer, 18);
+ writePunctuation(writer, 19);
}
return;
}
if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) {
if (flags & 64) {
- writePunctuation(writer, 17);
+ writePunctuation(writer, 18);
}
- writeKeyword(writer, 92);
+ writeKeyword(writer, 93);
writeSpace(writer);
buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, undefined, symbolStack);
if (flags & 64) {
- writePunctuation(writer, 18);
+ writePunctuation(writer, 19);
}
return;
}
}
var saveInObjectTypeLiteral = inObjectTypeLiteral;
inObjectTypeLiteral = true;
- writePunctuation(writer, 15);
+ writePunctuation(writer, 16);
writer.writeLine();
writer.increaseIndent();
for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) {
var signature = _a[_i];
buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack);
- writePunctuation(writer, 23);
+ writePunctuation(writer, 24);
writer.writeLine();
}
for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) {
var signature = _c[_b];
buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, 1, symbolStack);
- writePunctuation(writer, 23);
+ writePunctuation(writer, 24);
writer.writeLine();
}
- writeIndexSignature(resolved.stringIndexInfo, 132);
- writeIndexSignature(resolved.numberIndexInfo, 130);
+ writeIndexSignature(resolved.stringIndexInfo, 133);
+ writeIndexSignature(resolved.numberIndexInfo, 131);
for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) {
var p = _e[_d];
var t = getTypeOfSymbol(p);
@@ -21654,21 +21345,21 @@ var ts;
var signature = signatures_1[_f];
writePropertyWithModifiers(p);
buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack);
- writePunctuation(writer, 23);
+ writePunctuation(writer, 24);
writer.writeLine();
}
}
else {
writePropertyWithModifiers(p);
- writePunctuation(writer, 54);
+ writePunctuation(writer, 55);
writeSpace(writer);
writeType(t, 0);
- writePunctuation(writer, 23);
+ writePunctuation(writer, 24);
writer.writeLine();
}
}
writer.decreaseIndent();
- writePunctuation(writer, 16);
+ writePunctuation(writer, 17);
inObjectTypeLiteral = saveInObjectTypeLiteral;
}
}
@@ -21683,7 +21374,7 @@ var ts;
var constraint = getConstraintOfTypeParameter(tp);
if (constraint) {
writeSpace(writer);
- writeKeyword(writer, 83);
+ writeKeyword(writer, 84);
writeSpace(writer);
buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, symbolStack);
}
@@ -21691,7 +21382,7 @@ var ts;
function buildParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack) {
var parameterNode = p.valueDeclaration;
if (ts.isRestParameter(parameterNode)) {
- writePunctuation(writer, 22);
+ writePunctuation(writer, 23);
}
if (ts.isBindingPattern(parameterNode.name)) {
buildBindingPatternDisplay(parameterNode.name, writer, enclosingDeclaration, flags, symbolStack);
@@ -21700,36 +21391,36 @@ var ts;
appendSymbolNameOnly(p, writer);
}
if (isOptionalParameter(parameterNode)) {
- writePunctuation(writer, 53);
+ writePunctuation(writer, 54);
}
- writePunctuation(writer, 54);
+ writePunctuation(writer, 55);
writeSpace(writer);
buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, symbolStack);
}
function buildBindingPatternDisplay(bindingPattern, writer, enclosingDeclaration, flags, symbolStack) {
- if (bindingPattern.kind === 167) {
- writePunctuation(writer, 15);
- buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); });
+ if (bindingPattern.kind === 168) {
writePunctuation(writer, 16);
+ buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); });
+ writePunctuation(writer, 17);
}
- else if (bindingPattern.kind === 168) {
- writePunctuation(writer, 19);
+ else if (bindingPattern.kind === 169) {
+ writePunctuation(writer, 20);
var elements = bindingPattern.elements;
buildDisplayForCommaSeparatedList(elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); });
if (elements && elements.hasTrailingComma) {
- writePunctuation(writer, 24);
+ writePunctuation(writer, 25);
}
- writePunctuation(writer, 20);
+ writePunctuation(writer, 21);
}
}
function buildBindingElementDisplay(bindingElement, writer, enclosingDeclaration, flags, symbolStack) {
if (ts.isOmittedExpression(bindingElement)) {
return;
}
- ts.Debug.assert(bindingElement.kind === 169);
+ ts.Debug.assert(bindingElement.kind === 170);
if (bindingElement.propertyName) {
writer.writeSymbol(ts.getTextOfNode(bindingElement.propertyName), bindingElement.symbol);
- writePunctuation(writer, 54);
+ writePunctuation(writer, 55);
writeSpace(writer);
}
if (ts.isBindingPattern(bindingElement.name)) {
@@ -21737,75 +21428,75 @@ var ts;
}
else {
if (bindingElement.dotDotDotToken) {
- writePunctuation(writer, 22);
+ writePunctuation(writer, 23);
}
appendSymbolNameOnly(bindingElement.symbol, writer);
}
}
function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, symbolStack) {
if (typeParameters && typeParameters.length) {
- writePunctuation(writer, 25);
+ writePunctuation(writer, 26);
buildDisplayForCommaSeparatedList(typeParameters, writer, function (p) { return buildTypeParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack); });
- writePunctuation(writer, 27);
+ writePunctuation(writer, 28);
}
}
function buildDisplayForCommaSeparatedList(list, writer, action) {
for (var i = 0; i < list.length; i++) {
if (i > 0) {
- writePunctuation(writer, 24);
+ writePunctuation(writer, 25);
writeSpace(writer);
}
action(list[i]);
}
}
- function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration, flags, symbolStack) {
+ function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration) {
if (typeParameters && typeParameters.length) {
- writePunctuation(writer, 25);
- var flags_1 = 256;
+ writePunctuation(writer, 26);
+ var flags = 256;
for (var i = 0; i < typeParameters.length; i++) {
if (i > 0) {
- writePunctuation(writer, 24);
+ writePunctuation(writer, 25);
writeSpace(writer);
- flags_1 = 0;
+ flags = 0;
}
- buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, flags_1);
+ buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, flags);
}
- writePunctuation(writer, 27);
+ writePunctuation(writer, 28);
}
}
function buildDisplayForParametersAndDelimiters(thisParameter, parameters, writer, enclosingDeclaration, flags, symbolStack) {
- writePunctuation(writer, 17);
+ writePunctuation(writer, 18);
if (thisParameter) {
buildParameterDisplay(thisParameter, writer, enclosingDeclaration, flags, symbolStack);
}
for (var i = 0; i < parameters.length; i++) {
if (i > 0 || thisParameter) {
- writePunctuation(writer, 24);
+ writePunctuation(writer, 25);
writeSpace(writer);
}
buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, symbolStack);
}
- writePunctuation(writer, 18);
+ writePunctuation(writer, 19);
}
function buildTypePredicateDisplay(predicate, writer, enclosingDeclaration, flags, symbolStack) {
if (ts.isIdentifierTypePredicate(predicate)) {
writer.writeParameter(predicate.parameterName);
}
else {
- writeKeyword(writer, 97);
+ writeKeyword(writer, 98);
}
writeSpace(writer);
- writeKeyword(writer, 124);
+ writeKeyword(writer, 125);
writeSpace(writer);
buildTypeDisplay(predicate.type, writer, enclosingDeclaration, flags, symbolStack);
}
function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) {
if (flags & 8) {
writeSpace(writer);
- writePunctuation(writer, 34);
+ writePunctuation(writer, 35);
}
else {
- writePunctuation(writer, 54);
+ writePunctuation(writer, 55);
}
writeSpace(writer);
if (signature.typePredicate) {
@@ -21818,7 +21509,7 @@ var ts;
}
function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind, symbolStack) {
if (kind === 1) {
- writeKeyword(writer, 92);
+ writeKeyword(writer, 93);
writeSpace(writer);
}
if (signature.target && (flags & 32)) {
@@ -21854,64 +21545,64 @@ var ts;
return false;
function determineIfDeclarationIsVisible() {
switch (node.kind) {
- case 169:
+ case 170:
return isDeclarationVisible(node.parent.parent);
- case 218:
+ case 219:
if (ts.isBindingPattern(node.name) &&
!node.name.elements.length) {
return false;
}
- case 225:
- case 221:
+ case 226:
case 222:
case 223:
- case 220:
case 224:
- case 229:
+ case 221:
+ case 225:
+ case 230:
if (ts.isExternalModuleAugmentation(node)) {
return true;
}
var parent_10 = getDeclarationContainer(node);
if (!(ts.getCombinedModifierFlags(node) & 1) &&
- !(node.kind !== 229 && parent_10.kind !== 256 && ts.isInAmbientContext(parent_10))) {
+ !(node.kind !== 230 && parent_10.kind !== 256 && ts.isInAmbientContext(parent_10))) {
return isGlobalSourceFile(parent_10);
}
return isDeclarationVisible(parent_10);
- case 145:
- case 144:
- case 149:
- case 150:
- case 147:
case 146:
+ case 145:
+ case 150:
+ case 151:
+ case 148:
+ case 147:
if (ts.getModifierFlags(node) & (8 | 16)) {
return false;
}
- case 148:
- case 152:
- case 151:
+ case 149:
case 153:
- case 142:
- case 226:
- case 156:
+ case 152:
+ case 154:
+ case 143:
+ case 227:
case 157:
- case 159:
- case 155:
+ case 158:
case 160:
+ case 156:
case 161:
case 162:
case 163:
case 164:
+ case 165:
return isDeclarationVisible(node.parent);
- case 231:
case 232:
- case 234:
- return false;
- case 141:
- case 256:
- case 228:
- return true;
+ case 233:
case 235:
return false;
+ case 142:
+ case 256:
+ case 229:
+ return true;
+ case 236:
+ return false;
default:
return false;
}
@@ -21919,10 +21610,10 @@ var ts;
}
function collectLinkedAliases(node) {
var exportSymbol;
- if (node.parent && node.parent.kind === 235) {
+ if (node.parent && node.parent.kind === 236) {
exportSymbol = resolveName(node.parent, node.text, 107455 | 793064 | 1920 | 8388608, ts.Diagnostics.Cannot_find_name_0, node);
}
- else if (node.parent.kind === 238) {
+ else if (node.parent.kind === 239) {
var exportSpecifier = node.parent;
exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ?
getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) :
@@ -22001,12 +21692,12 @@ var ts;
node = ts.getRootDeclaration(node);
while (node) {
switch (node.kind) {
- case 218:
case 219:
+ case 220:
+ case 235:
case 234:
case 233:
case 232:
- case 231:
node = node.parent;
break;
default:
@@ -22034,12 +21725,12 @@ var ts;
}
function getTextOfPropertyName(name) {
switch (name.kind) {
- case 69:
+ case 70:
return name.text;
case 9:
case 8:
return name.text;
- case 140:
+ case 141:
if (ts.isStringOrNumericLiteral(name.expression.kind)) {
return name.expression.text;
}
@@ -22047,7 +21738,7 @@ var ts;
return undefined;
}
function isComputedNonLiteralName(name) {
- return name.kind === 140 && !ts.isStringOrNumericLiteral(name.expression.kind);
+ return name.kind === 141 && !ts.isStringOrNumericLiteral(name.expression.kind);
}
function getTypeForBindingElement(declaration) {
var pattern = declaration.parent;
@@ -22062,20 +21753,20 @@ var ts;
return parentType;
}
var type;
- if (pattern.kind === 167) {
- var name_17 = declaration.propertyName || declaration.name;
- if (isComputedNonLiteralName(name_17)) {
+ if (pattern.kind === 168) {
+ var name_14 = declaration.propertyName || declaration.name;
+ if (isComputedNonLiteralName(name_14)) {
return anyType;
}
if (declaration.initializer) {
getContextualType(declaration.initializer);
}
- var text = getTextOfPropertyName(name_17);
+ var text = getTextOfPropertyName(name_14);
type = getTypeOfPropertyOfType(parentType, text) ||
isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1) ||
getIndexTypeOfType(parentType, 0);
if (!type) {
- error(name_17, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_17));
+ error(name_14, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_14));
return unknownType;
}
}
@@ -22118,15 +21809,15 @@ var ts;
if (typeTag && typeTag.typeExpression) {
return typeTag.typeExpression.type;
}
- if (declaration.kind === 218 &&
- declaration.parent.kind === 219 &&
- declaration.parent.parent.kind === 200) {
+ if (declaration.kind === 219 &&
+ declaration.parent.kind === 220 &&
+ declaration.parent.parent.kind === 201) {
var annotation = ts.getJSDocTypeTag(declaration.parent.parent);
if (annotation && annotation.typeExpression) {
return annotation.typeExpression.type;
}
}
- else if (declaration.kind === 142) {
+ else if (declaration.kind === 143) {
var paramTag = ts.getCorrespondingJSDocParameterTag(declaration);
if (paramTag && paramTag.typeExpression) {
return paramTag.typeExpression.type;
@@ -22134,9 +21825,13 @@ var ts;
}
return undefined;
}
- function isAutoVariableInitializer(initializer) {
- var expr = initializer && ts.skipParentheses(initializer);
- return !expr || expr.kind === 93 || expr.kind === 69 && getResolvedSymbol(expr) === undefinedSymbol;
+ function isNullOrUndefined(node) {
+ var expr = ts.skipParentheses(node);
+ return expr.kind === 94 || expr.kind === 70 && getResolvedSymbol(expr) === undefinedSymbol;
+ }
+ function isEmptyArrayLiteral(node) {
+ var expr = ts.skipParentheses(node);
+ return expr.kind === 171 && expr.elements.length === 0;
}
function addOptionality(type, optional) {
return strictNullChecks && optional ? includeFalsyTypes(type, 2048) : type;
@@ -22148,10 +21843,10 @@ var ts;
return type;
}
}
- if (declaration.parent.parent.kind === 207) {
+ if (declaration.parent.parent.kind === 208) {
return stringType;
}
- if (declaration.parent.parent.kind === 208) {
+ if (declaration.parent.parent.kind === 209) {
return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType;
}
if (ts.isBindingPattern(declaration.parent)) {
@@ -22160,15 +21855,19 @@ var ts;
if (declaration.type) {
return addOptionality(getTypeFromTypeNode(declaration.type), declaration.questionToken && includeOptionality);
}
- if (declaration.kind === 218 && !ts.isBindingPattern(declaration.name) &&
- !(ts.getCombinedNodeFlags(declaration) & 2) && !(ts.getCombinedModifierFlags(declaration) & 1) &&
- !ts.isInAmbientContext(declaration) && isAutoVariableInitializer(declaration.initializer)) {
- return autoType;
+ if (declaration.kind === 219 && !ts.isBindingPattern(declaration.name) &&
+ !(ts.getCombinedModifierFlags(declaration) & 1) && !ts.isInAmbientContext(declaration)) {
+ if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) {
+ return autoType;
+ }
+ if (declaration.initializer && isEmptyArrayLiteral(declaration.initializer)) {
+ return autoArrayType;
+ }
}
- if (declaration.kind === 142) {
+ if (declaration.kind === 143) {
var func = declaration.parent;
- if (func.kind === 150 && !ts.hasDynamicName(func)) {
- var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 149);
+ if (func.kind === 151 && !ts.hasDynamicName(func)) {
+ var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 150);
if (getter) {
var getterSignature = getSignatureFromDeclaration(getter);
var thisParameter = getAccessorThisParameter(func);
@@ -22181,8 +21880,7 @@ var ts;
}
var type = void 0;
if (declaration.symbol.name === "this") {
- var thisParameter = getContextualThisParameter(func);
- type = thisParameter ? getTypeOfSymbol(thisParameter) : undefined;
+ type = getContextualThisParameterType(func);
}
else {
type = getContextuallyTypedParameterType(declaration);
@@ -22255,7 +21953,7 @@ var ts;
return result;
}
function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) {
- return pattern.kind === 167
+ return pattern.kind === 168
? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors)
: getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors);
}
@@ -22280,7 +21978,7 @@ var ts;
}
function declarationBelongsToPrivateAmbientMember(declaration) {
var root = ts.getRootDeclaration(declaration);
- var memberDeclaration = root.kind === 142 ? root.parent : root;
+ var memberDeclaration = root.kind === 143 ? root.parent : root;
return isPrivateWithinAmbient(memberDeclaration);
}
function getTypeOfVariableOrParameterOrProperty(symbol) {
@@ -22293,7 +21991,7 @@ var ts;
if (declaration.parent.kind === 252) {
return links.type = anyType;
}
- if (declaration.kind === 235) {
+ if (declaration.kind === 236) {
return links.type = checkExpression(declaration.expression);
}
if (declaration.flags & 1048576 && declaration.kind === 280 && declaration.typeExpression) {
@@ -22303,15 +22001,15 @@ var ts;
return unknownType;
}
var type = void 0;
- if (declaration.kind === 187 ||
- declaration.kind === 172 && declaration.parent.kind === 187) {
+ if (declaration.kind === 188 ||
+ declaration.kind === 173 && declaration.parent.kind === 188) {
if (declaration.flags & 1048576) {
var typeTag = ts.getJSDocTypeTag(declaration.parent);
if (typeTag && typeTag.typeExpression) {
return links.type = getTypeFromTypeNode(typeTag.typeExpression.type);
}
}
- var declaredTypes = ts.map(symbol.declarations, function (decl) { return decl.kind === 187 ?
+ var declaredTypes = ts.map(symbol.declarations, function (decl) { return decl.kind === 188 ?
checkExpressionCached(decl.right) :
checkExpressionCached(decl.parent.right); });
type = getUnionType(declaredTypes, true);
@@ -22337,7 +22035,7 @@ var ts;
}
function getAnnotatedAccessorType(accessor) {
if (accessor) {
- if (accessor.kind === 149) {
+ if (accessor.kind === 150) {
return accessor.type && getTypeFromTypeNode(accessor.type);
}
else {
@@ -22357,8 +22055,8 @@ var ts;
function getTypeOfAccessors(symbol) {
var links = getSymbolLinks(symbol);
if (!links.type) {
- var getter = ts.getDeclarationOfKind(symbol, 149);
- var setter = ts.getDeclarationOfKind(symbol, 150);
+ var getter = ts.getDeclarationOfKind(symbol, 150);
+ var setter = ts.getDeclarationOfKind(symbol, 151);
if (getter && getter.flags & 1048576) {
var jsDocType = getTypeForVariableLikeDeclarationFromJSDocComment(getter);
if (jsDocType) {
@@ -22399,7 +22097,7 @@ var ts;
if (!popTypeResolution()) {
type = anyType;
if (compilerOptions.noImplicitAny) {
- var getter_1 = ts.getDeclarationOfKind(symbol, 149);
+ var getter_1 = ts.getDeclarationOfKind(symbol, 150);
error(getter_1, ts.Diagnostics._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, symbolToString(symbol));
}
}
@@ -22410,7 +22108,7 @@ var ts;
function getTypeOfFuncClassEnumModule(symbol) {
var links = getSymbolLinks(symbol);
if (!links.type) {
- if (symbol.valueDeclaration.kind === 225 && ts.isShorthandAmbientModuleSymbol(symbol)) {
+ if (symbol.valueDeclaration.kind === 226 && ts.isShorthandAmbientModuleSymbol(symbol)) {
links.type = anyType;
}
else {
@@ -22495,9 +22193,9 @@ var ts;
if (!node) {
return typeParameters;
}
- if (node.kind === 221 || node.kind === 192 ||
- node.kind === 220 || node.kind === 179 ||
- node.kind === 147 || node.kind === 180) {
+ if (node.kind === 222 || node.kind === 193 ||
+ node.kind === 221 || node.kind === 180 ||
+ node.kind === 148 || node.kind === 181) {
var declarations = node.typeParameters;
if (declarations) {
return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations);
@@ -22506,15 +22204,15 @@ var ts;
}
}
function getOuterTypeParametersOfClassOrInterface(symbol) {
- var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 222);
+ var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 223);
return appendOuterTypeParameters(undefined, declaration);
}
function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) {
var result;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var node = _a[_i];
- if (node.kind === 222 || node.kind === 221 ||
- node.kind === 192 || node.kind === 223) {
+ if (node.kind === 223 || node.kind === 222 ||
+ node.kind === 193 || node.kind === 224) {
var declaration = node;
if (declaration.typeParameters) {
result = appendTypeParameters(result, declaration.typeParameters);
@@ -22640,7 +22338,7 @@ var ts;
type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray;
for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 222 && ts.getInterfaceBaseTypeNodes(declaration)) {
+ if (declaration.kind === 223 && ts.getInterfaceBaseTypeNodes(declaration)) {
for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) {
var node = _c[_b];
var baseType = getTypeFromTypeNode(node);
@@ -22669,7 +22367,7 @@ var ts;
function isIndependentInterface(symbol) {
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 222) {
+ if (declaration.kind === 223) {
if (declaration.flags & 64) {
return false;
}
@@ -22731,7 +22429,7 @@ var ts;
}
}
else {
- declaration = ts.getDeclarationOfKind(symbol, 223);
+ declaration = ts.getDeclarationOfKind(symbol, 224);
type = getTypeFromTypeNode(declaration.type, symbol, typeParameters);
}
if (popTypeResolution()) {
@@ -22755,14 +22453,14 @@ var ts;
return !ts.isInAmbientContext(member);
}
return expr.kind === 8 ||
- expr.kind === 185 && expr.operator === 36 &&
+ expr.kind === 186 && expr.operator === 37 &&
expr.operand.kind === 8 ||
- expr.kind === 69 && !!symbol.exports[expr.text];
+ expr.kind === 70 && !!symbol.exports[expr.text];
}
function enumHasLiteralMembers(symbol) {
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 224) {
+ if (declaration.kind === 225) {
for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
var member = _c[_b];
if (!isLiteralEnumMember(symbol, member)) {
@@ -22790,7 +22488,7 @@ var ts;
var memberTypes = ts.createMap();
for (var _i = 0, _a = enumType.symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 224) {
+ if (declaration.kind === 225) {
computeEnumMemberValues(declaration);
for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
var member = _c[_b];
@@ -22828,7 +22526,7 @@ var ts;
if (!links.declaredType) {
var type = createType(16384);
type.symbol = symbol;
- if (!ts.getDeclarationOfKind(symbol, 141).constraint) {
+ if (!ts.getDeclarationOfKind(symbol, 142).constraint) {
type.constraint = noConstraintType;
}
links.declaredType = type;
@@ -22877,20 +22575,20 @@ var ts;
}
function isIndependentType(node) {
switch (node.kind) {
- case 117:
- case 132:
- case 130:
- case 120:
+ case 118:
case 133:
- case 103:
- case 135:
- case 93:
- case 127:
- case 166:
+ case 131:
+ case 121:
+ case 134:
+ case 104:
+ case 136:
+ case 94:
+ case 128:
+ case 167:
return true;
- case 160:
+ case 161:
return isIndependentType(node.elementType);
- case 155:
+ case 156:
return isIndependentTypeReference(node);
}
return false;
@@ -22899,7 +22597,7 @@ var ts;
return node.type && isIndependentType(node.type) || !node.type && !node.initializer;
}
function isIndependentFunctionLikeDeclaration(node) {
- if (node.kind !== 148 && (!node.type || !isIndependentType(node.type))) {
+ if (node.kind !== 149 && (!node.type || !isIndependentType(node.type))) {
return false;
}
for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
@@ -22915,12 +22613,12 @@ var ts;
var declaration = symbol.declarations[0];
if (declaration) {
switch (declaration.kind) {
- case 145:
- case 144:
- return isIndependentVariableLikeDeclaration(declaration);
- case 147:
case 146:
+ case 145:
+ return isIndependentVariableLikeDeclaration(declaration);
case 148:
+ case 147:
+ case 149:
return isIndependentFunctionLikeDeclaration(declaration);
}
}
@@ -23486,7 +23184,7 @@ var ts;
return false;
}
function createTypePredicateFromTypePredicateNode(node) {
- if (node.parameterName.kind === 69) {
+ if (node.parameterName.kind === 70) {
var parameterName = node.parameterName;
return {
kind: 1,
@@ -23525,7 +23223,7 @@ var ts;
else {
parameters.push(paramSymbol);
}
- if (param.type && param.type.kind === 166) {
+ if (param.type && param.type.kind === 167) {
hasLiteralTypes = true;
}
if (param.initializer || param.questionToken || param.dotDotDotToken || isJSDocOptionalParameter(param)) {
@@ -23537,10 +23235,10 @@ var ts;
minArgumentCount = -1;
}
}
- if ((declaration.kind === 149 || declaration.kind === 150) &&
+ if ((declaration.kind === 150 || declaration.kind === 151) &&
!ts.hasDynamicName(declaration) &&
(!hasThisParameter || !thisParameter)) {
- var otherKind = declaration.kind === 149 ? 150 : 149;
+ var otherKind = declaration.kind === 150 ? 151 : 150;
var other = ts.getDeclarationOfKind(declaration.symbol, otherKind);
if (other) {
thisParameter = getAnnotatedAccessorThisParameter(other);
@@ -23552,24 +23250,21 @@ var ts;
if (isJSConstructSignature) {
minArgumentCount--;
}
- if (!thisParameter && ts.isObjectLiteralMethod(declaration)) {
- thisParameter = getContextualThisParameter(declaration);
- }
- var classType = declaration.kind === 148 ?
+ var classType = declaration.kind === 149 ?
getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol))
: undefined;
var typeParameters = classType ? classType.localTypeParameters :
declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) :
getTypeParametersFromJSDocTemplate(declaration);
- var returnType = getSignatureReturnTypeFromDeclaration(declaration, minArgumentCount, isJSConstructSignature, classType);
- var typePredicate = declaration.type && declaration.type.kind === 154 ?
+ var returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType);
+ var typePredicate = declaration.type && declaration.type.kind === 155 ?
createTypePredicateFromTypePredicateNode(declaration.type) :
undefined;
links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, ts.hasRestParameter(declaration), hasLiteralTypes);
}
return links.resolvedSignature;
}
- function getSignatureReturnTypeFromDeclaration(declaration, minArgumentCount, isJSConstructSignature, classType) {
+ function getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType) {
if (isJSConstructSignature) {
return getTypeFromTypeNode(declaration.parameters[0].type);
}
@@ -23585,8 +23280,8 @@ var ts;
return type;
}
}
- if (declaration.kind === 149 && !ts.hasDynamicName(declaration)) {
- var setter = ts.getDeclarationOfKind(declaration.symbol, 150);
+ if (declaration.kind === 150 && !ts.hasDynamicName(declaration)) {
+ var setter = ts.getDeclarationOfKind(declaration.symbol, 151);
return getAnnotatedAccessorType(setter);
}
if (ts.nodeIsMissing(declaration.body)) {
@@ -23600,19 +23295,19 @@ var ts;
for (var i = 0, len = symbol.declarations.length; i < len; i++) {
var node = symbol.declarations[i];
switch (node.kind) {
- case 156:
case 157:
- case 220:
- case 147:
- case 146:
+ case 158:
+ case 221:
case 148:
- case 151:
+ case 147:
+ case 149:
case 152:
case 153:
- case 149:
+ case 154:
case 150:
- case 179:
+ case 151:
case 180:
+ case 181:
case 269:
if (i > 0 && node.body) {
var previous = symbol.declarations[i - 1];
@@ -23693,7 +23388,7 @@ var ts;
}
function getOrCreateTypeFromSignature(signature) {
if (!signature.isolatedSignatureType) {
- var isConstructor = signature.declaration.kind === 148 || signature.declaration.kind === 152;
+ var isConstructor = signature.declaration.kind === 149 || signature.declaration.kind === 153;
var type = createObjectType(2097152);
type.members = emptySymbols;
type.properties = emptyArray;
@@ -23707,7 +23402,7 @@ var ts;
return symbol.members["__index"];
}
function getIndexDeclarationOfSymbol(symbol, kind) {
- var syntaxKind = kind === 1 ? 130 : 132;
+ var syntaxKind = kind === 1 ? 131 : 133;
var indexSymbol = getIndexSymbol(symbol);
if (indexSymbol) {
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
@@ -23734,7 +23429,7 @@ var ts;
return undefined;
}
function getConstraintDeclaration(type) {
- return ts.getDeclarationOfKind(type.symbol, 141).constraint;
+ return ts.getDeclarationOfKind(type.symbol, 142).constraint;
}
function hasConstraintReferenceTo(type, target) {
var checked;
@@ -23767,7 +23462,7 @@ var ts;
return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint;
}
function getParentSymbolOfTypeParameter(typeParameter) {
- return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 141).parent);
+ return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 142).parent);
}
function getTypeListId(types) {
var result = "";
@@ -23867,11 +23562,11 @@ var ts;
}
function getTypeReferenceName(node) {
switch (node.kind) {
- case 155:
+ case 156:
return node.typeName;
case 267:
return node.name;
- case 194:
+ case 195:
var expr = node.expression;
if (ts.isEntityNameExpression(expr)) {
return expr;
@@ -23879,7 +23574,7 @@ var ts;
}
return undefined;
}
- function resolveTypeReferenceName(node, typeReferenceName) {
+ function resolveTypeReferenceName(typeReferenceName) {
if (!typeReferenceName) {
return unknownSymbol;
}
@@ -23907,11 +23602,11 @@ var ts;
var type = void 0;
if (node.kind === 267) {
var typeReferenceName = getTypeReferenceName(node);
- symbol = resolveTypeReferenceName(node, typeReferenceName);
+ symbol = resolveTypeReferenceName(typeReferenceName);
type = getTypeReferenceType(node, symbol);
}
else {
- var typeNameOrExpression = node.kind === 155
+ var typeNameOrExpression = node.kind === 156
? node.typeName
: ts.isEntityNameExpression(node.expression)
? node.expression
@@ -23940,9 +23635,9 @@ var ts;
for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) {
var declaration = declarations_3[_i];
switch (declaration.kind) {
- case 221:
case 222:
- case 224:
+ case 223:
+ case 225:
return declaration;
}
}
@@ -24317,9 +24012,9 @@ var ts;
function getThisType(node) {
var container = ts.getThisContainer(node, false);
var parent = container && container.parent;
- if (parent && (ts.isClassLike(parent) || parent.kind === 222)) {
+ if (parent && (ts.isClassLike(parent) || parent.kind === 223)) {
if (!(ts.getModifierFlags(container) & 32) &&
- (container.kind !== 148 || ts.isNodeDescendantOf(node, container.body))) {
+ (container.kind !== 149 || ts.isNodeDescendantOf(node, container.body))) {
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType;
}
}
@@ -24338,25 +24033,25 @@ var ts;
}
function getTypeFromTypeNode(node, aliasSymbol, aliasTypeArguments) {
switch (node.kind) {
- case 117:
+ case 118:
case 258:
case 259:
return anyType;
- case 132:
- return stringType;
- case 130:
- return numberType;
- case 120:
- return booleanType;
case 133:
+ return stringType;
+ case 131:
+ return numberType;
+ case 121:
+ return booleanType;
+ case 134:
return esSymbolType;
- case 103:
+ case 104:
return voidType;
- case 135:
+ case 136:
return undefinedType;
- case 93:
+ case 94:
return nullType;
- case 127:
+ case 128:
return neverType;
case 283:
return nullType;
@@ -24364,33 +24059,33 @@ var ts;
return undefinedType;
case 285:
return neverType;
- case 165:
- case 97:
- return getTypeFromThisTypeNode(node);
case 166:
+ case 98:
+ return getTypeFromThisTypeNode(node);
+ case 167:
return getTypeFromLiteralTypeNode(node);
case 282:
return getTypeFromLiteralTypeNode(node.literal);
- case 155:
+ case 156:
case 267:
return getTypeFromTypeReference(node);
- case 154:
+ case 155:
return booleanType;
- case 194:
+ case 195:
return getTypeFromTypeReference(node);
- case 158:
+ case 159:
return getTypeFromTypeQueryNode(node);
- case 160:
+ case 161:
case 260:
return getTypeFromArrayTypeNode(node);
- case 161:
- return getTypeFromTupleTypeNode(node);
case 162:
+ return getTypeFromTupleTypeNode(node);
+ case 163:
case 261:
return getTypeFromUnionTypeNode(node, aliasSymbol, aliasTypeArguments);
- case 163:
- return getTypeFromIntersectionTypeNode(node, aliasSymbol, aliasTypeArguments);
case 164:
+ return getTypeFromIntersectionTypeNode(node, aliasSymbol, aliasTypeArguments);
+ case 165:
case 263:
case 264:
case 271:
@@ -24399,14 +24094,14 @@ var ts;
return getTypeFromTypeNode(node.type);
case 265:
return getTypeFromTypeNode(node.literal);
- case 156:
case 157:
- case 159:
+ case 158:
+ case 160:
case 281:
case 269:
return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node, aliasSymbol, aliasTypeArguments);
- case 69:
- case 139:
+ case 70:
+ case 140:
var symbol = getSymbolAtLocation(node);
return symbol && getDeclaredTypeOfSymbol(symbol);
case 262:
@@ -24562,23 +24257,23 @@ var ts;
var node = symbol.declarations[0].parent;
while (node) {
switch (node.kind) {
- case 156:
case 157:
- case 220:
- case 147:
- case 146:
+ case 158:
+ case 221:
case 148:
- case 151:
+ case 147:
+ case 149:
case 152:
case 153:
- case 149:
+ case 154:
case 150:
- case 179:
+ case 151:
case 180:
- case 221:
- case 192:
+ case 181:
case 222:
+ case 193:
case 223:
+ case 224:
var declaration = node;
if (declaration.typeParameters) {
for (var _i = 0, _a = declaration.typeParameters; _i < _a.length; _i++) {
@@ -24588,14 +24283,14 @@ var ts;
}
}
}
- if (ts.isClassLike(node) || node.kind === 222) {
+ if (ts.isClassLike(node) || node.kind === 223) {
var thisType = getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
if (thisType && ts.contains(mappedTypes, thisType)) {
return true;
}
}
break;
- case 225:
+ case 226:
case 256:
return false;
}
@@ -24630,35 +24325,43 @@ var ts;
return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration);
}
function isContextSensitive(node) {
- ts.Debug.assert(node.kind !== 147 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 148 || ts.isObjectLiteralMethod(node));
switch (node.kind) {
- case 179:
case 180:
+ case 181:
return isContextSensitiveFunctionLikeDeclaration(node);
- case 171:
+ case 172:
return ts.forEach(node.properties, isContextSensitive);
- case 170:
+ case 171:
return ts.forEach(node.elements, isContextSensitive);
- case 188:
+ case 189:
return isContextSensitive(node.whenTrue) ||
isContextSensitive(node.whenFalse);
- case 187:
- return node.operatorToken.kind === 52 &&
+ case 188:
+ return node.operatorToken.kind === 53 &&
(isContextSensitive(node.left) || isContextSensitive(node.right));
case 253:
return isContextSensitive(node.initializer);
+ case 148:
case 147:
- case 146:
return isContextSensitiveFunctionLikeDeclaration(node);
- case 178:
+ case 179:
return isContextSensitive(node.expression);
}
return false;
}
function isContextSensitiveFunctionLikeDeclaration(node) {
- var areAllParametersUntyped = !ts.forEach(node.parameters, function (p) { return p.type; });
- var isNullaryArrow = node.kind === 180 && !node.parameters.length;
- return !node.typeParameters && areAllParametersUntyped && !isNullaryArrow;
+ if (node.typeParameters) {
+ return false;
+ }
+ if (ts.forEach(node.parameters, function (p) { return !p.type; })) {
+ return true;
+ }
+ if (node.kind === 181) {
+ return false;
+ }
+ var parameter = ts.firstOrUndefined(node.parameters);
+ return !(parameter && ts.parameterIsThisKeyword(parameter));
}
function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
return (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func);
@@ -25078,8 +24781,8 @@ var ts;
}
if (source.flags & 524288 && target.flags & 524288 ||
source.flags & 1048576 && target.flags & 1048576) {
- if (result = eachTypeRelatedToSomeType(source, target, false)) {
- if (result &= eachTypeRelatedToSomeType(target, source, false)) {
+ if (result = eachTypeRelatedToSomeType(source, target)) {
+ if (result &= eachTypeRelatedToSomeType(target, source)) {
return result;
}
}
@@ -25130,7 +24833,7 @@ var ts;
}
return false;
}
- function eachTypeRelatedToSomeType(source, target, reportErrors) {
+ function eachTypeRelatedToSomeType(source, target) {
var result = -1;
var sourceTypes = source.types;
for (var _i = 0, sourceTypes_1 = sourceTypes; _i < sourceTypes_1.length; _i++) {
@@ -25727,7 +25430,7 @@ var ts;
type.flags & 64 ? numberType :
type.flags & 128 ? booleanType :
type.flags & 256 ? type.baseType :
- type.flags & 524288 && !(type.flags & 16) ? getUnionType(ts.map(type.types, getBaseTypeOfLiteralType)) :
+ type.flags & 524288 && !(type.flags & 16) ? getUnionType(ts.sameMap(type.types, getBaseTypeOfLiteralType)) :
type;
}
function getWidenedLiteralType(type) {
@@ -25735,7 +25438,7 @@ var ts;
type.flags & 64 && type.flags & 16777216 ? numberType :
type.flags & 128 ? booleanType :
type.flags & 256 ? type.baseType :
- type.flags & 524288 && !(type.flags & 16) ? getUnionType(ts.map(type.types, getWidenedLiteralType)) :
+ type.flags & 524288 && !(type.flags & 16) ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) :
type;
}
function isTupleType(type) {
@@ -25846,10 +25549,10 @@ var ts;
return getWidenedTypeOfObjectLiteral(type);
}
if (type.flags & 524288) {
- return getUnionType(ts.map(type.types, getWidenedConstituentType));
+ return getUnionType(ts.sameMap(type.types, getWidenedConstituentType));
}
if (isArrayType(type) || isTupleType(type)) {
- return createTypeReference(type.target, ts.map(type.typeArguments, getWidenedType));
+ return createTypeReference(type.target, ts.sameMap(type.typeArguments, getWidenedType));
}
}
return type;
@@ -25890,25 +25593,25 @@ var ts;
var typeAsString = typeToString(getWidenedType(type));
var diagnostic;
switch (declaration.kind) {
+ case 146:
case 145:
- case 144:
diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type;
break;
- case 142:
+ case 143:
diagnostic = declaration.dotDotDotToken ?
ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type :
ts.Diagnostics.Parameter_0_implicitly_has_an_1_type;
break;
- case 169:
+ case 170:
diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type;
break;
- case 220:
+ case 221:
+ case 148:
case 147:
- case 146:
- case 149:
case 150:
- case 179:
+ case 151:
case 180:
+ case 181:
if (!declaration.name) {
error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
return;
@@ -25953,7 +25656,7 @@ var ts;
signature: signature,
inferUnionTypes: inferUnionTypes,
inferences: inferences,
- inferredTypes: new Array(signature.typeParameters.length)
+ inferredTypes: new Array(signature.typeParameters.length),
};
}
function createTypeInferencesObject() {
@@ -25961,7 +25664,7 @@ var ts;
primary: undefined,
secondary: undefined,
topLevel: true,
- isFixed: false
+ isFixed: false,
};
}
function couldContainTypeParameters(type) {
@@ -26202,7 +25905,7 @@ var ts;
var widenLiteralTypes = context.inferences[index].topLevel &&
!hasPrimitiveConstraint(signature.typeParameters[index]) &&
(context.inferences[index].isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), signature.typeParameters[index]));
- var baseInferences = widenLiteralTypes ? ts.map(inferences, getWidenedLiteralType) : inferences;
+ var baseInferences = widenLiteralTypes ? ts.sameMap(inferences, getWidenedLiteralType) : inferences;
var unionOrSuperType = context.inferUnionTypes ? getUnionType(baseInferences, true) : getCommonSupertype(baseInferences);
inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : unknownType;
inferenceSucceeded = !!unionOrSuperType;
@@ -26243,10 +25946,10 @@ var ts;
function isInTypeQuery(node) {
while (node) {
switch (node.kind) {
- case 158:
+ case 159:
return true;
- case 69:
- case 139:
+ case 70:
+ case 140:
node = node.parent;
continue;
default:
@@ -26256,14 +25959,14 @@ var ts;
ts.Debug.fail("should not get here");
}
function getFlowCacheKey(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
var symbol = getResolvedSymbol(node);
return symbol !== unknownSymbol ? "" + getSymbolId(symbol) : undefined;
}
- if (node.kind === 97) {
+ if (node.kind === 98) {
return "0";
}
- if (node.kind === 172) {
+ if (node.kind === 173) {
var key = getFlowCacheKey(node.expression);
return key && key + "." + node.name.text;
}
@@ -26271,31 +25974,31 @@ var ts;
}
function getLeftmostIdentifierOrThis(node) {
switch (node.kind) {
- case 69:
- case 97:
+ case 70:
+ case 98:
return node;
- case 172:
+ case 173:
return getLeftmostIdentifierOrThis(node.expression);
}
return undefined;
}
function isMatchingReference(source, target) {
switch (source.kind) {
- case 69:
- return target.kind === 69 && getResolvedSymbol(source) === getResolvedSymbol(target) ||
- (target.kind === 218 || target.kind === 169) &&
+ case 70:
+ return target.kind === 70 && getResolvedSymbol(source) === getResolvedSymbol(target) ||
+ (target.kind === 219 || target.kind === 170) &&
getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
- case 97:
- return target.kind === 97;
- case 172:
- return target.kind === 172 &&
+ case 98:
+ return target.kind === 98;
+ case 173:
+ return target.kind === 173 &&
source.name.text === target.name.text &&
isMatchingReference(source.expression, target.expression);
}
return false;
}
function containsMatchingReference(source, target) {
- while (source.kind === 172) {
+ while (source.kind === 173) {
source = source.expression;
if (isMatchingReference(source, target)) {
return true;
@@ -26304,15 +26007,15 @@ var ts;
return false;
}
function containsMatchingReferenceDiscriminant(source, target) {
- return target.kind === 172 &&
+ return target.kind === 173 &&
containsMatchingReference(source, target.expression) &&
isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.text);
}
function getDeclaredTypeOfReference(expr) {
- if (expr.kind === 69) {
+ if (expr.kind === 70) {
return getTypeOfSymbol(getResolvedSymbol(expr));
}
- if (expr.kind === 172) {
+ if (expr.kind === 173) {
var type = getDeclaredTypeOfReference(expr.expression);
return type && getTypeOfPropertyOfType(type, expr.name.text);
}
@@ -26342,7 +26045,7 @@ var ts;
}
}
}
- if (callExpression.expression.kind === 172 &&
+ if (callExpression.expression.kind === 173 &&
isOrContainsMatchingReference(reference, callExpression.expression.expression)) {
return true;
}
@@ -26468,7 +26171,7 @@ var ts;
return createArrayType(checkIteratedTypeOrElementType(type, undefined, false) || unknownType);
}
function getAssignedTypeOfBinaryExpression(node) {
- return node.parent.kind === 170 || node.parent.kind === 253 ?
+ return node.parent.kind === 171 || node.parent.kind === 253 ?
getTypeWithDefault(getAssignedType(node), node.right) :
checkExpression(node.right);
}
@@ -26487,17 +26190,17 @@ var ts;
function getAssignedType(node) {
var parent = node.parent;
switch (parent.kind) {
- case 207:
- return stringType;
case 208:
+ return stringType;
+ case 209:
return checkRightHandSideOfForOf(parent.expression) || unknownType;
- case 187:
+ case 188:
return getAssignedTypeOfBinaryExpression(parent);
- case 181:
+ case 182:
return undefinedType;
- case 170:
+ case 171:
return getAssignedTypeOfArrayLiteralElement(parent, node);
- case 191:
+ case 192:
return getAssignedTypeOfSpreadElement(parent);
case 253:
return getAssignedTypeOfPropertyAssignment(parent);
@@ -26509,7 +26212,7 @@ var ts;
function getInitialTypeOfBindingElement(node) {
var pattern = node.parent;
var parentType = getInitialType(pattern.parent);
- var type = pattern.kind === 167 ?
+ var type = pattern.kind === 168 ?
getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) :
!node.dotDotDotToken ?
getTypeOfDestructuredArrayElement(parentType, ts.indexOf(pattern.elements, node)) :
@@ -26524,38 +26227,51 @@ var ts;
if (node.initializer) {
return getTypeOfInitializer(node.initializer);
}
- if (node.parent.parent.kind === 207) {
+ if (node.parent.parent.kind === 208) {
return stringType;
}
- if (node.parent.parent.kind === 208) {
+ if (node.parent.parent.kind === 209) {
return checkRightHandSideOfForOf(node.parent.parent.expression) || unknownType;
}
return unknownType;
}
function getInitialType(node) {
- return node.kind === 218 ?
+ return node.kind === 219 ?
getInitialTypeOfVariableDeclaration(node) :
getInitialTypeOfBindingElement(node);
}
function getInitialOrAssignedType(node) {
- return node.kind === 218 || node.kind === 169 ?
+ return node.kind === 219 || node.kind === 170 ?
getInitialType(node) :
getAssignedType(node);
}
+ function isEmptyArrayAssignment(node) {
+ return node.kind === 219 && node.initializer &&
+ isEmptyArrayLiteral(node.initializer) ||
+ node.kind !== 170 && node.parent.kind === 188 &&
+ isEmptyArrayLiteral(node.parent.right);
+ }
function getReferenceCandidate(node) {
switch (node.kind) {
- case 178:
+ case 179:
return getReferenceCandidate(node.expression);
- case 187:
+ case 188:
switch (node.operatorToken.kind) {
- case 56:
+ case 57:
return getReferenceCandidate(node.left);
- case 24:
+ case 25:
return getReferenceCandidate(node.right);
}
}
return node;
}
+ function getReferenceRoot(node) {
+ var parent = node.parent;
+ return parent.kind === 179 ||
+ parent.kind === 188 && parent.operatorToken.kind === 57 && parent.left === node ||
+ parent.kind === 188 && parent.operatorToken.kind === 25 && parent.right === node ?
+ getReferenceRoot(parent) : node;
+ }
function getTypeOfSwitchClause(clause) {
if (clause.kind === 249) {
var caseType = getRegularTypeOfLiteralType(checkExpression(clause.expression));
@@ -26626,24 +26342,88 @@ var ts;
function createFlowType(type, incomplete) {
return incomplete ? { flags: 0, type: type } : type;
}
+ function createEvolvingArrayType(elementType) {
+ var result = createObjectType(2097152);
+ result.elementType = elementType;
+ return result;
+ }
+ function getEvolvingArrayType(elementType) {
+ return evolvingArrayTypes[elementType.id] || (evolvingArrayTypes[elementType.id] = createEvolvingArrayType(elementType));
+ }
+ function addEvolvingArrayElementType(evolvingArrayType, node) {
+ var elementType = getBaseTypeOfLiteralType(checkExpression(node));
+ return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType]));
+ }
+ function isEvolvingArrayType(type) {
+ return !!(type.flags & 2097152 && type.elementType);
+ }
+ function createFinalArrayType(elementType) {
+ return elementType.flags & 8192 ?
+ autoArrayType :
+ createArrayType(elementType.flags & 524288 ?
+ getUnionType(elementType.types, true) :
+ elementType);
+ }
+ function getFinalArrayType(evolvingArrayType) {
+ return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType));
+ }
+ function finalizeEvolvingArrayType(type) {
+ return isEvolvingArrayType(type) ? getFinalArrayType(type) : type;
+ }
+ function getElementTypeOfEvolvingArrayType(type) {
+ return isEvolvingArrayType(type) ? type.elementType : neverType;
+ }
+ function isEvolvingArrayTypeList(types) {
+ var hasEvolvingArrayType = false;
+ for (var _i = 0, types_12 = types; _i < types_12.length; _i++) {
+ var t = types_12[_i];
+ if (!(t.flags & 8192)) {
+ if (!isEvolvingArrayType(t)) {
+ return false;
+ }
+ hasEvolvingArrayType = true;
+ }
+ }
+ return hasEvolvingArrayType;
+ }
+ function getUnionOrEvolvingArrayType(types, subtypeReduction) {
+ return isEvolvingArrayTypeList(types) ?
+ getEvolvingArrayType(getUnionType(ts.map(types, getElementTypeOfEvolvingArrayType))) :
+ getUnionType(ts.sameMap(types, finalizeEvolvingArrayType), subtypeReduction);
+ }
+ function isEvolvingArrayOperationTarget(node) {
+ var root = getReferenceRoot(node);
+ var parent = root.parent;
+ var isLengthPushOrUnshift = parent.kind === 173 && (parent.name.text === "length" ||
+ parent.parent.kind === 175 && ts.isPushOrUnshiftIdentifier(parent.name));
+ var isElementAssignment = parent.kind === 174 &&
+ parent.expression === root &&
+ parent.parent.kind === 188 &&
+ parent.parent.operatorToken.kind === 57 &&
+ parent.parent.left === parent &&
+ !ts.isAssignmentTarget(parent.parent) &&
+ isTypeAnyOrAllConstituentTypesHaveKind(checkExpression(parent.argumentExpression), 340 | 2048);
+ return isLengthPushOrUnshift || isElementAssignment;
+ }
function getFlowTypeOfReference(reference, declaredType, assumeInitialized, flowContainer) {
var key;
if (!reference.flowNode || assumeInitialized && !(declaredType.flags & 4178943)) {
return declaredType;
}
var initialType = assumeInitialized ? declaredType :
- declaredType === autoType ? undefinedType :
+ declaredType === autoType || declaredType === autoArrayType ? undefinedType :
includeFalsyTypes(declaredType, 2048);
var visitedFlowStart = visitedFlowCount;
- var result = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode));
+ var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode));
visitedFlowCount = visitedFlowStart;
- if (reference.parent.kind === 196 && getTypeWithFacts(result, 524288).flags & 8192) {
+ var resultType = isEvolvingArrayType(evolvedType) && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType);
+ if (reference.parent.kind === 197 && getTypeWithFacts(resultType, 524288).flags & 8192) {
return declaredType;
}
- return result;
+ return resultType;
function getTypeAtFlowNode(flow) {
while (true) {
- if (flow.flags & 512) {
+ if (flow.flags & 1024) {
for (var i = visitedFlowStart; i < visitedFlowCount; i++) {
if (visitedFlowNodes[i] === flow) {
return visitedFlowTypes[i];
@@ -26673,18 +26453,25 @@ var ts;
getTypeAtFlowBranchLabel(flow) :
getTypeAtFlowLoopLabel(flow);
}
+ else if (flow.flags & 256) {
+ type = getTypeAtFlowArrayMutation(flow);
+ if (!type) {
+ flow = flow.antecedent;
+ continue;
+ }
+ }
else if (flow.flags & 2) {
var container = flow.container;
- if (container && container !== flowContainer && reference.kind !== 172) {
+ if (container && container !== flowContainer && reference.kind !== 173) {
flow = container.flowNode;
continue;
}
type = initialType;
}
else {
- type = declaredType;
+ type = convertAutoToAny(declaredType);
}
- if (flow.flags & 512) {
+ if (flow.flags & 1024) {
visitedFlowNodes[visitedFlowCount] = flow;
visitedFlowTypes[visitedFlowCount] = type;
visitedFlowCount++;
@@ -26695,30 +26482,70 @@ var ts;
function getTypeAtFlowAssignment(flow) {
var node = flow.node;
if (isMatchingReference(reference, node)) {
- if (node.parent.kind === 185 || node.parent.kind === 186) {
+ if (node.parent.kind === 186 || node.parent.kind === 187) {
var flowType = getTypeAtFlowNode(flow.antecedent);
return createFlowType(getBaseTypeOfLiteralType(getTypeFromFlowType(flowType)), isIncomplete(flowType));
}
- return declaredType === autoType ? getBaseTypeOfLiteralType(getInitialOrAssignedType(node)) :
- declaredType.flags & 524288 ? getAssignmentReducedType(declaredType, getInitialOrAssignedType(node)) :
- declaredType;
+ if (declaredType === autoType || declaredType === autoArrayType) {
+ if (isEmptyArrayAssignment(node)) {
+ return getEvolvingArrayType(neverType);
+ }
+ var assignedType = getBaseTypeOfLiteralType(getInitialOrAssignedType(node));
+ return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
+ }
+ if (declaredType.flags & 524288) {
+ return getAssignmentReducedType(declaredType, getInitialOrAssignedType(node));
+ }
+ return declaredType;
}
if (containsMatchingReference(reference, node)) {
return declaredType;
}
return undefined;
}
+ function getTypeAtFlowArrayMutation(flow) {
+ var node = flow.node;
+ var expr = node.kind === 175 ?
+ node.expression.expression :
+ node.left.expression;
+ if (isMatchingReference(reference, getReferenceCandidate(expr))) {
+ var flowType = getTypeAtFlowNode(flow.antecedent);
+ var type = getTypeFromFlowType(flowType);
+ if (isEvolvingArrayType(type)) {
+ var evolvedType_1 = type;
+ if (node.kind === 175) {
+ for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) {
+ var arg = _a[_i];
+ evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg);
+ }
+ }
+ else {
+ var indexType = checkExpression(node.left.argumentExpression);
+ if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 340 | 2048)) {
+ evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, node.right);
+ }
+ }
+ return evolvedType_1 === type ? flowType : createFlowType(evolvedType_1, isIncomplete(flowType));
+ }
+ return flowType;
+ }
+ return undefined;
+ }
function getTypeAtFlowCondition(flow) {
var flowType = getTypeAtFlowNode(flow.antecedent);
var type = getTypeFromFlowType(flowType);
- if (!(type.flags & 8192)) {
- var assumeTrue = (flow.flags & 32) !== 0;
- type = narrowType(type, flow.expression, assumeTrue);
- if (type.flags & 8192 && isIncomplete(flowType)) {
- type = silentNeverType;
- }
+ if (type.flags & 8192) {
+ return flowType;
}
- return createFlowType(type, isIncomplete(flowType));
+ var assumeTrue = (flow.flags & 32) !== 0;
+ var nonEvolvingType = finalizeEvolvingArrayType(type);
+ var narrowedType = narrowType(nonEvolvingType, flow.expression, assumeTrue);
+ if (narrowedType === nonEvolvingType) {
+ return flowType;
+ }
+ var incomplete = isIncomplete(flowType);
+ var resultType = incomplete && narrowedType.flags & 8192 ? silentNeverType : narrowedType;
+ return createFlowType(resultType, incomplete);
}
function getTypeAtSwitchClause(flow) {
var flowType = getTypeAtFlowNode(flow.antecedent);
@@ -26753,7 +26580,7 @@ var ts;
seenIncomplete = true;
}
}
- return createFlowType(getUnionType(antecedentTypes, subtypeReduction), seenIncomplete);
+ return createFlowType(getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction), seenIncomplete);
}
function getTypeAtFlowLoopLabel(flow) {
var id = getFlowNodeId(flow);
@@ -26765,8 +26592,8 @@ var ts;
return cache[key];
}
for (var i = flowLoopStart; i < flowLoopCount; i++) {
- if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key) {
- return createFlowType(getUnionType(flowLoopTypes[i]), true);
+ if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key && flowLoopTypes[i].length) {
+ return createFlowType(getUnionOrEvolvingArrayType(flowLoopTypes[i], false), true);
}
}
var antecedentTypes = [];
@@ -26797,14 +26624,14 @@ var ts;
break;
}
}
- var result = getUnionType(antecedentTypes, subtypeReduction);
+ var result = getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction);
if (isIncomplete(firstAntecedentType)) {
return createFlowType(result, true);
}
return cache[key] = result;
}
function isMatchingReferenceDiscriminant(expr) {
- return expr.kind === 172 &&
+ return expr.kind === 173 &&
declaredType.flags & 524288 &&
isMatchingReference(reference, expr.expression) &&
isDiscriminantProperty(declaredType, expr.name.text);
@@ -26829,19 +26656,19 @@ var ts;
}
function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
switch (expr.operatorToken.kind) {
- case 56:
+ case 57:
return narrowTypeByTruthiness(type, expr.left, assumeTrue);
- case 30:
case 31:
case 32:
case 33:
+ case 34:
var operator_1 = expr.operatorToken.kind;
var left_1 = getReferenceCandidate(expr.left);
var right_1 = getReferenceCandidate(expr.right);
- if (left_1.kind === 182 && right_1.kind === 9) {
+ if (left_1.kind === 183 && right_1.kind === 9) {
return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue);
}
- if (right_1.kind === 182 && left_1.kind === 9) {
+ if (right_1.kind === 183 && left_1.kind === 9) {
return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue);
}
if (isMatchingReference(reference, left_1)) {
@@ -26860,9 +26687,9 @@ var ts;
return declaredType;
}
break;
- case 91:
+ case 92:
return narrowTypeByInstanceof(type, expr, assumeTrue);
- case 24:
+ case 25:
return narrowType(type, expr.right, assumeTrue);
}
return type;
@@ -26871,7 +26698,7 @@ var ts;
if (type.flags & 1) {
return type;
}
- if (operator === 31 || operator === 33) {
+ if (operator === 32 || operator === 34) {
assumeTrue = !assumeTrue;
}
var valueType = checkExpression(value);
@@ -26879,10 +26706,10 @@ var ts;
if (!strictNullChecks) {
return type;
}
- var doubleEquals = operator === 30 || operator === 31;
+ var doubleEquals = operator === 31 || operator === 32;
var facts = doubleEquals ?
assumeTrue ? 65536 : 524288 :
- value.kind === 93 ?
+ value.kind === 94 ?
assumeTrue ? 32768 : 262144 :
assumeTrue ? 16384 : 131072;
return getTypeWithFacts(type, facts);
@@ -26908,7 +26735,7 @@ var ts;
}
return type;
}
- if (operator === 31 || operator === 33) {
+ if (operator === 32 || operator === 34) {
assumeTrue = !assumeTrue;
}
if (assumeTrue && !(type.flags & 524288)) {
@@ -27019,7 +26846,7 @@ var ts;
}
else {
var invokedExpression = skipParenthesizedNodes(callExpression.expression);
- if (invokedExpression.kind === 173 || invokedExpression.kind === 172) {
+ if (invokedExpression.kind === 174 || invokedExpression.kind === 173) {
var accessExpression = invokedExpression;
var possibleReference = skipParenthesizedNodes(accessExpression.expression);
if (isMatchingReference(reference, possibleReference)) {
@@ -27034,18 +26861,18 @@ var ts;
}
function narrowType(type, expr, assumeTrue) {
switch (expr.kind) {
- case 69:
- case 97:
- case 172:
+ case 70:
+ case 98:
+ case 173:
return narrowTypeByTruthiness(type, expr, assumeTrue);
- case 174:
+ case 175:
return narrowTypeByTypePredicate(type, expr, assumeTrue);
- case 178:
+ case 179:
return narrowType(type, expr.expression, assumeTrue);
- case 187:
+ case 188:
return narrowTypeByBinaryExpression(type, expr, assumeTrue);
- case 185:
- if (expr.operator === 49) {
+ case 186:
+ if (expr.operator === 50) {
return narrowType(type, expr.operand, !assumeTrue);
}
break;
@@ -27054,7 +26881,7 @@ var ts;
}
}
function getTypeOfSymbolAtLocation(symbol, location) {
- if (location.kind === 69) {
+ if (location.kind === 70) {
if (ts.isRightSideOfQualifiedNameOrPropertyAccess(location)) {
location = location.parent;
}
@@ -27068,7 +26895,7 @@ var ts;
return getTypeOfSymbol(symbol);
}
function skipParenthesizedNodes(expression) {
- while (expression.kind === 178) {
+ while (expression.kind === 179) {
expression = expression.expression;
}
return expression;
@@ -27077,9 +26904,9 @@ var ts;
while (true) {
node = node.parent;
if (ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) ||
- node.kind === 226 ||
+ node.kind === 227 ||
node.kind === 256 ||
- node.kind === 145) {
+ node.kind === 146) {
return node;
}
}
@@ -27107,10 +26934,10 @@ var ts;
}
}
function markParameterAssignments(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
if (ts.isAssignmentTarget(node)) {
var symbol = getResolvedSymbol(node);
- if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 142) {
+ if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 143) {
symbol.isAssigned = true;
}
}
@@ -27119,12 +26946,15 @@ var ts;
ts.forEachChild(node, markParameterAssignments);
}
}
+ function isConstVariable(symbol) {
+ return symbol.flags & 3 && (getDeclarationNodeFlagsFromSymbol(symbol) & 2) !== 0 && getTypeOfSymbol(symbol) !== autoArrayType;
+ }
function checkIdentifier(node) {
var symbol = getResolvedSymbol(node);
if (symbol === argumentsSymbol) {
var container = ts.getContainingFunction(node);
if (languageVersion < 2) {
- if (container.kind === 180) {
+ if (container.kind === 181) {
error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
}
else if (ts.hasModifier(container, 256)) {
@@ -27142,7 +26972,7 @@ var ts;
if (localOrExportSymbol.flags & 32) {
var declaration_1 = localOrExportSymbol.valueDeclaration;
if (languageVersion === 2
- && declaration_1.kind === 221
+ && declaration_1.kind === 222
&& ts.nodeIsDecorated(declaration_1)) {
var container = ts.getContainingClass(node);
while (container !== undefined) {
@@ -27154,11 +26984,11 @@ var ts;
container = ts.getContainingClass(container);
}
}
- else if (declaration_1.kind === 192) {
+ else if (declaration_1.kind === 193) {
var container = ts.getThisContainer(node, false);
while (container !== undefined) {
if (container.parent === declaration_1) {
- if (container.kind === 145 && ts.hasModifier(container, 32)) {
+ if (container.kind === 146 && ts.hasModifier(container, 32)) {
getNodeLinks(declaration_1).flags |= 8388608;
getNodeLinks(node).flags |= 16777216;
}
@@ -27176,28 +27006,26 @@ var ts;
if (!(localOrExportSymbol.flags & 3) || ts.isAssignmentTarget(node) || !declaration) {
return type;
}
- var isParameter = ts.getRootDeclaration(declaration).kind === 142;
+ var isParameter = ts.getRootDeclaration(declaration).kind === 143;
var declarationContainer = getControlFlowContainer(declaration);
var flowContainer = getControlFlowContainer(node);
var isOuterVariable = flowContainer !== declarationContainer;
- while (flowContainer !== declarationContainer &&
- (flowContainer.kind === 179 ||
- flowContainer.kind === 180 ||
- ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) &&
- (isReadonlySymbol(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) {
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 180 ||
+ flowContainer.kind === 181 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) &&
+ (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) {
flowContainer = getControlFlowContainer(flowContainer);
}
var assumeInitialized = isParameter || isOuterVariable ||
- type !== autoType && (!strictNullChecks || (type.flags & 1) !== 0) ||
+ type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1) !== 0) ||
ts.isInAmbientContext(declaration);
var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer);
- if (type === autoType) {
- if (flowType === autoType) {
+ if (type === autoType || type === autoArrayType) {
+ if (flowType === autoType || flowType === autoArrayType) {
if (compilerOptions.noImplicitAny) {
- error(declaration.name, ts.Diagnostics.Variable_0_implicitly_has_type_any_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol));
- error(node, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(anyType));
+ error(declaration.name, ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType));
+ error(node, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType));
}
- return anyType;
+ return convertAutoToAny(flowType);
}
}
else if (!assumeInitialized && !(getFalsyFlags(type) & 2048) && getFalsyFlags(flowType) & 2048) {
@@ -27237,8 +27065,8 @@ var ts;
if (usedInFunction) {
getNodeLinks(current).flags |= 65536;
}
- if (container.kind === 206 &&
- ts.getAncestor(symbol.valueDeclaration, 219).parent === container &&
+ if (container.kind === 207 &&
+ ts.getAncestor(symbol.valueDeclaration, 220).parent === container &&
isAssignedInBodyOfForStatement(node, container)) {
getNodeLinks(symbol.valueDeclaration).flags |= 2097152;
}
@@ -27250,16 +27078,16 @@ var ts;
}
function isAssignedInBodyOfForStatement(node, container) {
var current = node;
- while (current.parent.kind === 178) {
+ while (current.parent.kind === 179) {
current = current.parent;
}
var isAssigned = false;
if (ts.isAssignmentTarget(current)) {
isAssigned = true;
}
- else if ((current.parent.kind === 185 || current.parent.kind === 186)) {
+ else if ((current.parent.kind === 186 || current.parent.kind === 187)) {
var expr = current.parent;
- isAssigned = expr.operator === 41 || expr.operator === 42;
+ isAssigned = expr.operator === 42 || expr.operator === 43;
}
if (!isAssigned) {
return false;
@@ -27276,7 +27104,7 @@ var ts;
}
function captureLexicalThis(node, container) {
getNodeLinks(node).flags |= 2;
- if (container.kind === 145 || container.kind === 148) {
+ if (container.kind === 146 || container.kind === 149) {
var classNode = container.parent;
getNodeLinks(classNode).flags |= 4;
}
@@ -27310,7 +27138,7 @@ var ts;
function checkThisExpression(node) {
var container = ts.getThisContainer(node, true);
var needToCaptureLexicalThis = false;
- if (container.kind === 148) {
+ if (container.kind === 149) {
var containingClassDecl = container.parent;
var baseTypeNode = ts.getClassExtendsHeritageClauseElement(containingClassDecl);
if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) {
@@ -27320,29 +27148,29 @@ var ts;
}
}
}
- if (container.kind === 180) {
+ if (container.kind === 181) {
container = ts.getThisContainer(container, false);
needToCaptureLexicalThis = (languageVersion < 2);
}
switch (container.kind) {
- case 225:
+ case 226:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);
break;
- case 224:
+ case 225:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location);
break;
- case 148:
+ case 149:
if (isInConstructorArgumentInitializer(node, container)) {
error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments);
}
break;
+ case 146:
case 145:
- case 144:
if (ts.getModifierFlags(container) & 32) {
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer);
}
break;
- case 140:
+ case 141:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name);
break;
}
@@ -27351,7 +27179,7 @@ var ts;
}
if (ts.isFunctionLike(container) &&
(!isInParameterInitializerBeforeContainingFunction(node) || ts.getThisParameter(container))) {
- if (container.kind === 179 &&
+ if (container.kind === 180 &&
ts.isInJavaScriptFile(container.parent) &&
ts.getSpecialPropertyAssignmentKind(container.parent) === 3) {
var className = container.parent
@@ -27363,7 +27191,7 @@ var ts;
return getInferredClassType(classSymbol);
}
}
- var thisType = getThisTypeOfDeclaration(container);
+ var thisType = getThisTypeOfDeclaration(container) || getContextualThisParameterType(container);
if (thisType) {
return thisType;
}
@@ -27395,18 +27223,18 @@ var ts;
}
function isInConstructorArgumentInitializer(node, constructorDecl) {
for (var n = node; n && n !== constructorDecl; n = n.parent) {
- if (n.kind === 142) {
+ if (n.kind === 143) {
return true;
}
}
return false;
}
function checkSuperExpression(node) {
- var isCallExpression = node.parent.kind === 174 && node.parent.expression === node;
+ var isCallExpression = node.parent.kind === 175 && node.parent.expression === node;
var container = ts.getSuperContainer(node, true);
var needToCaptureLexicalThis = false;
if (!isCallExpression) {
- while (container && container.kind === 180) {
+ while (container && container.kind === 181) {
container = ts.getSuperContainer(container, true);
needToCaptureLexicalThis = languageVersion < 2;
}
@@ -27415,16 +27243,16 @@ var ts;
var nodeCheckFlag = 0;
if (!canUseSuperExpression) {
var current = node;
- while (current && current !== container && current.kind !== 140) {
+ while (current && current !== container && current.kind !== 141) {
current = current.parent;
}
- if (current && current.kind === 140) {
+ if (current && current.kind === 141) {
error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name);
}
else if (isCallExpression) {
error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors);
}
- else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 171)) {
+ else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 172)) {
error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions);
}
else {
@@ -27439,7 +27267,7 @@ var ts;
nodeCheckFlag = 256;
}
getNodeLinks(node).flags |= nodeCheckFlag;
- if (container.kind === 147 && ts.getModifierFlags(container) & 256) {
+ if (container.kind === 148 && ts.getModifierFlags(container) & 256) {
if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) {
getNodeLinks(container).flags |= 4096;
}
@@ -27450,7 +27278,7 @@ var ts;
if (needToCaptureLexicalThis) {
captureLexicalThis(node.parent, container);
}
- if (container.parent.kind === 171) {
+ if (container.parent.kind === 172) {
if (languageVersion < 2) {
error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher);
return unknownType;
@@ -27468,7 +27296,7 @@ var ts;
}
return unknownType;
}
- if (container.kind === 148 && isInConstructorArgumentInitializer(node, container)) {
+ if (container.kind === 149 && isInConstructorArgumentInitializer(node, container)) {
error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
return unknownType;
}
@@ -27480,35 +27308,38 @@ var ts;
return false;
}
if (isCallExpression) {
- return container.kind === 148;
+ return container.kind === 149;
}
else {
- if (ts.isClassLike(container.parent) || container.parent.kind === 171) {
+ if (ts.isClassLike(container.parent) || container.parent.kind === 172) {
if (ts.getModifierFlags(container) & 32) {
- return container.kind === 147 ||
- container.kind === 146 ||
- container.kind === 149 ||
- container.kind === 150;
+ return container.kind === 148 ||
+ container.kind === 147 ||
+ container.kind === 150 ||
+ container.kind === 151;
}
else {
- return container.kind === 147 ||
- container.kind === 146 ||
- container.kind === 149 ||
+ return container.kind === 148 ||
+ container.kind === 147 ||
container.kind === 150 ||
+ container.kind === 151 ||
+ container.kind === 146 ||
container.kind === 145 ||
- container.kind === 144 ||
- container.kind === 148;
+ container.kind === 149;
}
}
}
return false;
}
}
- function getContextualThisParameter(func) {
- if (isContextSensitiveFunctionOrObjectLiteralMethod(func) && func.kind !== 180) {
+ function getContextualThisParameterType(func) {
+ if (isContextSensitiveFunctionOrObjectLiteralMethod(func) && func.kind !== 181) {
var contextualSignature = getContextualSignature(func);
if (contextualSignature) {
- return contextualSignature.thisParameter;
+ var thisParameter = contextualSignature.thisParameter;
+ if (thisParameter) {
+ return getTypeOfSymbol(thisParameter);
+ }
}
}
return undefined;
@@ -27558,7 +27389,7 @@ var ts;
if (declaration.type) {
return getTypeFromTypeNode(declaration.type);
}
- if (declaration.kind === 142) {
+ if (declaration.kind === 143) {
var type = getContextuallyTypedParameterType(declaration);
if (type) {
return type;
@@ -27569,11 +27400,11 @@ var ts;
}
if (ts.isBindingPattern(declaration.parent)) {
var parentDeclaration = declaration.parent.parent;
- var name_18 = declaration.propertyName || declaration.name;
+ var name_15 = declaration.propertyName || declaration.name;
if (ts.isVariableLike(parentDeclaration) &&
parentDeclaration.type &&
- !ts.isBindingPattern(name_18)) {
- var text = getTextOfPropertyName(name_18);
+ !ts.isBindingPattern(name_15)) {
+ var text = getTextOfPropertyName(name_15);
if (text) {
return getTypeOfPropertyOfType(getTypeFromTypeNode(parentDeclaration.type), text);
}
@@ -27610,7 +27441,7 @@ var ts;
}
function isInParameterInitializerBeforeContainingFunction(node) {
while (node.parent && !ts.isFunctionLike(node.parent)) {
- if (node.parent.kind === 142 && node.parent.initializer === node) {
+ if (node.parent.kind === 143 && node.parent.initializer === node) {
return true;
}
node = node.parent;
@@ -27619,8 +27450,8 @@ var ts;
}
function getContextualReturnType(functionDecl) {
if (functionDecl.type ||
- functionDecl.kind === 148 ||
- functionDecl.kind === 149 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 150))) {
+ functionDecl.kind === 149 ||
+ functionDecl.kind === 150 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 151))) {
return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl));
}
var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl);
@@ -27639,7 +27470,7 @@ var ts;
return undefined;
}
function getContextualTypeForSubstitutionExpression(template, substitutionExpression) {
- if (template.parent.kind === 176) {
+ if (template.parent.kind === 177) {
return getContextualTypeForArgument(template.parent, substitutionExpression);
}
return undefined;
@@ -27647,7 +27478,7 @@ var ts;
function getContextualTypeForBinaryOperand(node) {
var binaryExpression = node.parent;
var operator = binaryExpression.operatorToken.kind;
- if (operator >= 56 && operator <= 68) {
+ if (operator >= 57 && operator <= 69) {
if (ts.getSpecialPropertyAssignmentKind(binaryExpression) !== 0) {
return undefined;
}
@@ -27655,14 +27486,14 @@ var ts;
return checkExpression(binaryExpression.left);
}
}
- else if (operator === 52) {
+ else if (operator === 53) {
var type = getContextualType(binaryExpression);
if (!type && node === binaryExpression.right) {
type = checkExpression(binaryExpression.left);
}
return type;
}
- else if (operator === 51 || operator === 24) {
+ else if (operator === 52 || operator === 25) {
if (node === binaryExpression.right) {
return getContextualType(binaryExpression);
}
@@ -27676,8 +27507,8 @@ var ts;
var types = type.types;
var mappedType;
var mappedTypes;
- for (var _i = 0, types_12 = types; _i < types_12.length; _i++) {
- var current = types_12[_i];
+ for (var _i = 0, types_13 = types; _i < types_13.length; _i++) {
+ var current = types_13[_i];
var t = mapper(current);
if (t) {
if (!mappedType) {
@@ -27771,36 +27602,36 @@ var ts;
}
var parent = node.parent;
switch (parent.kind) {
- case 218:
- case 142:
+ case 219:
+ case 143:
+ case 146:
case 145:
- case 144:
- case 169:
+ case 170:
return getContextualTypeForInitializerExpression(node);
- case 180:
- case 211:
+ case 181:
+ case 212:
return getContextualTypeForReturnExpression(node);
- case 190:
+ case 191:
return getContextualTypeForYieldOperand(parent);
- case 174:
case 175:
+ case 176:
return getContextualTypeForArgument(parent, node);
- case 177:
- case 195:
+ case 178:
+ case 196:
return getTypeFromTypeNode(parent.type);
- case 187:
+ case 188:
return getContextualTypeForBinaryOperand(node);
case 253:
case 254:
return getContextualTypeForObjectLiteralElement(parent);
- case 170:
+ case 171:
return getContextualTypeForElementExpression(node);
- case 188:
+ case 189:
return getContextualTypeForConditionalOperand(node);
- case 197:
- ts.Debug.assert(parent.parent.kind === 189);
+ case 198:
+ ts.Debug.assert(parent.parent.kind === 190);
return getContextualTypeForSubstitutionExpression(parent.parent, node);
- case 178:
+ case 179:
return getContextualType(parent);
case 248:
return getContextualType(parent);
@@ -27820,7 +27651,7 @@ var ts;
}
}
function isFunctionExpressionOrArrowFunction(node) {
- return node.kind === 179 || node.kind === 180;
+ return node.kind === 180 || node.kind === 181;
}
function getContextualSignatureForFunctionLikeDeclaration(node) {
return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node)
@@ -27833,7 +27664,7 @@ var ts;
getApparentTypeOfContextualType(node);
}
function getContextualSignature(node) {
- ts.Debug.assert(node.kind !== 147 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 148 || ts.isObjectLiteralMethod(node));
var type = getContextualTypeForFunctionLikeDeclaration(node);
if (!type) {
return undefined;
@@ -27843,8 +27674,8 @@ var ts;
}
var signatureList;
var types = type.types;
- for (var _i = 0, types_13 = types; _i < types_13.length; _i++) {
- var current = types_13[_i];
+ for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
+ var current = types_14[_i];
var signature = getNonGenericSignature(current);
if (signature) {
if (!signatureList) {
@@ -27874,8 +27705,8 @@ var ts;
return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false);
}
function hasDefaultValue(node) {
- return (node.kind === 169 && !!node.initializer) ||
- (node.kind === 187 && node.operatorToken.kind === 56);
+ return (node.kind === 170 && !!node.initializer) ||
+ (node.kind === 188 && node.operatorToken.kind === 57);
}
function checkArrayLiteral(node, contextualMapper) {
var elements = node.elements;
@@ -27884,7 +27715,7 @@ var ts;
var inDestructuringPattern = ts.isAssignmentTarget(node);
for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {
var e = elements_1[_i];
- if (inDestructuringPattern && e.kind === 191) {
+ if (inDestructuringPattern && e.kind === 192) {
var restArrayType = checkExpression(e.expression, contextualMapper);
var restElementType = getIndexTypeOfType(restArrayType, 1) ||
(languageVersion >= 2 ? getElementTypeOfIterable(restArrayType, undefined) : undefined);
@@ -27896,7 +27727,7 @@ var ts;
var type = checkExpressionForMutableLocation(e, contextualMapper);
elementTypes.push(type);
}
- hasSpreadElement = hasSpreadElement || e.kind === 191;
+ hasSpreadElement = hasSpreadElement || e.kind === 192;
}
if (!hasSpreadElement) {
if (inDestructuringPattern && elementTypes.length) {
@@ -27907,7 +27738,7 @@ var ts;
var contextualType = getApparentTypeOfContextualType(node);
if (contextualType && contextualTypeIsTupleLikeType(contextualType)) {
var pattern = contextualType.pattern;
- if (pattern && (pattern.kind === 168 || pattern.kind === 170)) {
+ if (pattern && (pattern.kind === 169 || pattern.kind === 171)) {
var patternElements = pattern.elements;
for (var i = elementTypes.length; i < patternElements.length; i++) {
var patternElement = patternElements[i];
@@ -27915,7 +27746,7 @@ var ts;
elementTypes.push(contextualType.typeArguments[i]);
}
else {
- if (patternElement.kind !== 193) {
+ if (patternElement.kind !== 194) {
error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value);
}
elementTypes.push(unknownType);
@@ -27932,7 +27763,7 @@ var ts;
strictNullChecks ? neverType : undefinedWideningType);
}
function isNumericName(name) {
- return name.kind === 140 ? isNumericComputedName(name) : isNumericLiteralName(name.text);
+ return name.kind === 141 ? isNumericComputedName(name) : isNumericLiteralName(name.text);
}
function isNumericComputedName(name) {
return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), 340);
@@ -27976,7 +27807,7 @@ var ts;
var propertiesArray = [];
var contextualType = getApparentTypeOfContextualType(node);
var contextualTypeHasPattern = contextualType && contextualType.pattern &&
- (contextualType.pattern.kind === 167 || contextualType.pattern.kind === 171);
+ (contextualType.pattern.kind === 168 || contextualType.pattern.kind === 172);
var typeFlags = 0;
var patternWithComputedProperties = false;
var hasComputedStringProperty = false;
@@ -27991,7 +27822,7 @@ var ts;
if (memberDecl.kind === 253) {
type = checkPropertyAssignment(memberDecl, contextualMapper);
}
- else if (memberDecl.kind === 147) {
+ else if (memberDecl.kind === 148) {
type = checkObjectLiteralMethod(memberDecl, contextualMapper);
}
else {
@@ -28030,7 +27861,7 @@ var ts;
member = prop;
}
else {
- ts.Debug.assert(memberDecl.kind === 149 || memberDecl.kind === 150);
+ ts.Debug.assert(memberDecl.kind === 150 || memberDecl.kind === 151);
checkAccessorDeclaration(memberDecl);
}
if (ts.hasDynamicName(memberDecl)) {
@@ -28089,10 +27920,10 @@ var ts;
case 248:
checkJsxExpression(child);
break;
- case 241:
+ case 242:
checkJsxElement(child);
break;
- case 242:
+ case 243:
checkJsxSelfClosingElement(child);
break;
}
@@ -28103,7 +27934,7 @@ var ts;
return name.indexOf("-") < 0;
}
function isJsxIntrinsicIdentifier(tagName) {
- if (tagName.kind === 172 || tagName.kind === 97) {
+ if (tagName.kind === 173 || tagName.kind === 98) {
return false;
}
else {
@@ -28206,7 +28037,7 @@ var ts;
return unknownType;
}
}
- return getUnionType(signatures.map(getReturnTypeOfSignature), true);
+ return getUnionType(ts.map(signatures, getReturnTypeOfSignature), true);
}
function getJsxElementPropertiesName() {
var jsxNamespace = getGlobalSymbol(JsxNames.JSX, 1920, undefined);
@@ -28235,7 +28066,7 @@ var ts;
}
if (elemType.flags & 524288) {
var types = elemType.types;
- return getUnionType(types.map(function (type) {
+ return getUnionType(ts.map(types, function (type) {
return getResolvedJsxType(node, type, elemClassType);
}), true);
}
@@ -28411,7 +28242,7 @@ var ts;
}
}
function getDeclarationKindFromSymbol(s) {
- return s.valueDeclaration ? s.valueDeclaration.kind : 145;
+ return s.valueDeclaration ? s.valueDeclaration.kind : 146;
}
function getDeclarationModifierFlagsFromSymbol(s) {
return s.valueDeclaration ? ts.getCombinedModifierFlags(s.valueDeclaration) : s.flags & 134217728 ? 4 | 32 : 0;
@@ -28422,11 +28253,11 @@ var ts;
function checkClassPropertyAccess(node, left, type, prop) {
var flags = getDeclarationModifierFlagsFromSymbol(prop);
var declaringClass = getDeclaredTypeOfSymbol(getParentOfSymbol(prop));
- var errorNode = node.kind === 172 || node.kind === 218 ?
+ var errorNode = node.kind === 173 || node.kind === 219 ?
node.name :
node.right;
- if (left.kind === 95) {
- if (languageVersion < 2 && getDeclarationKindFromSymbol(prop) !== 147) {
+ if (left.kind === 96) {
+ if (languageVersion < 2 && getDeclarationKindFromSymbol(prop) !== 148) {
error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword);
return false;
}
@@ -28446,7 +28277,7 @@ var ts;
}
return true;
}
- if (left.kind === 95) {
+ if (left.kind === 96) {
return true;
}
var enclosingClass = forEachEnclosingClass(node, function (enclosingDeclaration) {
@@ -28520,7 +28351,7 @@ var ts;
checkClassPropertyAccess(node, left, apparentType, prop);
}
var propType = getTypeOfSymbol(prop);
- if (node.kind !== 172 || ts.isAssignmentTarget(node) ||
+ if (node.kind !== 173 || ts.isAssignmentTarget(node) ||
!(prop.flags & (3 | 4 | 98304)) &&
!(prop.flags & 8192 && propType.flags & 524288)) {
return propType;
@@ -28542,7 +28373,7 @@ var ts;
}
}
function isValidPropertyAccess(node, propertyName) {
- var left = node.kind === 172
+ var left = node.kind === 173
? node.expression
: node.left;
var type = checkExpression(left);
@@ -28556,13 +28387,13 @@ var ts;
}
function getForInVariableSymbol(node) {
var initializer = node.initializer;
- if (initializer.kind === 219) {
+ if (initializer.kind === 220) {
var variable = initializer.declarations[0];
if (variable && !ts.isBindingPattern(variable.name)) {
return getSymbolOfNode(variable);
}
}
- else if (initializer.kind === 69) {
+ else if (initializer.kind === 70) {
return getResolvedSymbol(initializer);
}
return undefined;
@@ -28572,13 +28403,13 @@ var ts;
}
function isForInVariableForNumericPropertyNames(expr) {
var e = skipParenthesizedNodes(expr);
- if (e.kind === 69) {
+ if (e.kind === 70) {
var symbol = getResolvedSymbol(e);
if (symbol.flags & 3) {
var child = expr;
var node = expr.parent;
while (node) {
- if (node.kind === 207 &&
+ if (node.kind === 208 &&
child === node.statement &&
getForInVariableSymbol(node) === symbol &&
hasNumericPropertyNames(checkExpression(node.expression))) {
@@ -28594,7 +28425,7 @@ var ts;
function checkIndexedAccess(node) {
if (!node.argumentExpression) {
var sourceFile = ts.getSourceFileOfNode(node);
- if (node.parent.kind === 175 && node.parent.expression === node) {
+ if (node.parent.kind === 176 && node.parent.expression === node) {
var start = ts.skipTrivia(sourceFile.text, node.expression.end);
var end = node.end;
grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead);
@@ -28617,15 +28448,15 @@ var ts;
return unknownType;
}
if (node.argumentExpression) {
- var name_19 = getPropertyNameForIndexedAccess(node.argumentExpression, indexType);
- if (name_19 !== undefined) {
- var prop = getPropertyOfType(objectType, name_19);
+ var name_16 = getPropertyNameForIndexedAccess(node.argumentExpression, indexType);
+ if (name_16 !== undefined) {
+ var prop = getPropertyOfType(objectType, name_16);
if (prop) {
getNodeLinks(node).resolvedSymbol = prop;
return getTypeOfSymbol(prop);
}
else if (isConstEnum) {
- error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, name_19, symbolToString(objectType.symbol));
+ error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, name_16, symbolToString(objectType.symbol));
return unknownType;
}
}
@@ -28658,7 +28489,7 @@ var ts;
if (indexArgumentExpression.kind === 9 || indexArgumentExpression.kind === 8) {
return indexArgumentExpression.text;
}
- if (indexArgumentExpression.kind === 173 || indexArgumentExpression.kind === 172) {
+ if (indexArgumentExpression.kind === 174 || indexArgumentExpression.kind === 173) {
var value = getConstantValue(indexArgumentExpression);
if (value !== undefined) {
return value.toString();
@@ -28701,10 +28532,10 @@ var ts;
return true;
}
function resolveUntypedCall(node) {
- if (node.kind === 176) {
+ if (node.kind === 177) {
checkExpression(node.template);
}
- else if (node.kind !== 143) {
+ else if (node.kind !== 144) {
ts.forEach(node.arguments, function (argument) {
checkExpression(argument);
});
@@ -28755,7 +28586,7 @@ var ts;
function getSpreadArgumentIndex(args) {
for (var i = 0; i < args.length; i++) {
var arg = args[i];
- if (arg && arg.kind === 191) {
+ if (arg && arg.kind === 192) {
return i;
}
}
@@ -28768,11 +28599,11 @@ var ts;
var callIsIncomplete;
var isDecorator;
var spreadArgIndex = -1;
- if (node.kind === 176) {
+ if (node.kind === 177) {
var tagExpression = node;
argCount = args.length;
typeArguments = undefined;
- if (tagExpression.template.kind === 189) {
+ if (tagExpression.template.kind === 190) {
var templateExpression = tagExpression.template;
var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans);
ts.Debug.assert(lastSpan !== undefined);
@@ -28780,11 +28611,11 @@ var ts;
}
else {
var templateLiteral = tagExpression.template;
- ts.Debug.assert(templateLiteral.kind === 11);
+ ts.Debug.assert(templateLiteral.kind === 12);
callIsIncomplete = !!templateLiteral.isUnterminated;
}
}
- else if (node.kind === 143) {
+ else if (node.kind === 144) {
isDecorator = true;
typeArguments = undefined;
argCount = getEffectiveArgumentCount(node, undefined, signature);
@@ -28792,7 +28623,7 @@ var ts;
else {
var callExpression = node;
if (!callExpression.arguments) {
- ts.Debug.assert(callExpression.kind === 175);
+ ts.Debug.assert(callExpression.kind === 176);
return signature.minArgumentCount === 0;
}
argCount = signatureHelpTrailingComma ? args.length + 1 : args.length;
@@ -28851,9 +28682,9 @@ var ts;
var argCount = getEffectiveArgumentCount(node, args, signature);
for (var i = 0; i < argCount; i++) {
var arg = getEffectiveArgument(node, args, i);
- if (arg === undefined || arg.kind !== 193) {
+ if (arg === undefined || arg.kind !== 194) {
var paramType = getTypeAtPosition(signature, i);
- var argType = getEffectiveArgumentType(node, i, arg);
+ var argType = getEffectiveArgumentType(node, i);
if (argType === undefined) {
var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper;
argType = checkExpressionWithContextualType(arg, paramType, mapper);
@@ -28898,7 +28729,7 @@ var ts;
}
function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) {
var thisType = getThisTypeOfSignature(signature);
- if (thisType && thisType !== voidType && node.kind !== 175) {
+ if (thisType && thisType !== voidType && node.kind !== 176) {
var thisArgumentNode = getThisArgumentOfCall(node);
var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType;
var errorNode = reportErrors ? (thisArgumentNode || node) : undefined;
@@ -28911,9 +28742,9 @@ var ts;
var argCount = getEffectiveArgumentCount(node, args, signature);
for (var i = 0; i < argCount; i++) {
var arg = getEffectiveArgument(node, args, i);
- if (arg === undefined || arg.kind !== 193) {
+ if (arg === undefined || arg.kind !== 194) {
var paramType = getTypeAtPosition(signature, i);
- var argType = getEffectiveArgumentType(node, i, arg);
+ var argType = getEffectiveArgumentType(node, i);
if (argType === undefined) {
argType = checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined);
}
@@ -28926,28 +28757,28 @@ var ts;
return true;
}
function getThisArgumentOfCall(node) {
- if (node.kind === 174) {
+ if (node.kind === 175) {
var callee = node.expression;
- if (callee.kind === 172) {
+ if (callee.kind === 173) {
return callee.expression;
}
- else if (callee.kind === 173) {
+ else if (callee.kind === 174) {
return callee.expression;
}
}
}
function getEffectiveCallArguments(node) {
var args;
- if (node.kind === 176) {
+ if (node.kind === 177) {
var template = node.template;
args = [undefined];
- if (template.kind === 189) {
+ if (template.kind === 190) {
ts.forEach(template.templateSpans, function (span) {
args.push(span.expression);
});
}
}
- else if (node.kind === 143) {
+ else if (node.kind === 144) {
return undefined;
}
else {
@@ -28956,21 +28787,21 @@ var ts;
return args;
}
function getEffectiveArgumentCount(node, args, signature) {
- if (node.kind === 143) {
+ if (node.kind === 144) {
switch (node.parent.kind) {
- case 221:
- case 192:
+ case 222:
+ case 193:
return 1;
- case 145:
+ case 146:
return 2;
- case 147:
- case 149:
+ case 148:
case 150:
+ case 151:
if (languageVersion === 0) {
return 2;
}
return signature.parameters.length >= 3 ? 3 : 2;
- case 142:
+ case 143:
return 3;
}
}
@@ -28979,48 +28810,48 @@ var ts;
}
}
function getEffectiveDecoratorFirstArgumentType(node) {
- if (node.kind === 221) {
+ if (node.kind === 222) {
var classSymbol = getSymbolOfNode(node);
return getTypeOfSymbol(classSymbol);
}
- if (node.kind === 142) {
+ if (node.kind === 143) {
node = node.parent;
- if (node.kind === 148) {
+ if (node.kind === 149) {
var classSymbol = getSymbolOfNode(node);
return getTypeOfSymbol(classSymbol);
}
}
- if (node.kind === 145 ||
- node.kind === 147 ||
- node.kind === 149 ||
- node.kind === 150) {
+ if (node.kind === 146 ||
+ node.kind === 148 ||
+ node.kind === 150 ||
+ node.kind === 151) {
return getParentTypeOfClassElement(node);
}
ts.Debug.fail("Unsupported decorator target.");
return unknownType;
}
function getEffectiveDecoratorSecondArgumentType(node) {
- if (node.kind === 221) {
+ if (node.kind === 222) {
ts.Debug.fail("Class decorators should not have a second synthetic argument.");
return unknownType;
}
- if (node.kind === 142) {
+ if (node.kind === 143) {
node = node.parent;
- if (node.kind === 148) {
+ if (node.kind === 149) {
return anyType;
}
}
- if (node.kind === 145 ||
- node.kind === 147 ||
- node.kind === 149 ||
- node.kind === 150) {
+ if (node.kind === 146 ||
+ node.kind === 148 ||
+ node.kind === 150 ||
+ node.kind === 151) {
var element = node;
switch (element.name.kind) {
- case 69:
+ case 70:
case 8:
case 9:
return getLiteralTypeForText(32, element.name.text);
- case 140:
+ case 141:
var nameType = checkComputedPropertyName(element.name);
if (isTypeOfKind(nameType, 512)) {
return nameType;
@@ -29037,20 +28868,20 @@ var ts;
return unknownType;
}
function getEffectiveDecoratorThirdArgumentType(node) {
- if (node.kind === 221) {
+ if (node.kind === 222) {
ts.Debug.fail("Class decorators should not have a third synthetic argument.");
return unknownType;
}
- if (node.kind === 142) {
+ if (node.kind === 143) {
return numberType;
}
- if (node.kind === 145) {
+ if (node.kind === 146) {
ts.Debug.fail("Property decorators should not have a third synthetic argument.");
return unknownType;
}
- if (node.kind === 147 ||
- node.kind === 149 ||
- node.kind === 150) {
+ if (node.kind === 148 ||
+ node.kind === 150 ||
+ node.kind === 151) {
var propertyType = getTypeOfNode(node);
return createTypedPropertyDescriptorType(propertyType);
}
@@ -29070,27 +28901,27 @@ var ts;
ts.Debug.fail("Decorators should not have a fourth synthetic argument.");
return unknownType;
}
- function getEffectiveArgumentType(node, argIndex, arg) {
- if (node.kind === 143) {
+ function getEffectiveArgumentType(node, argIndex) {
+ if (node.kind === 144) {
return getEffectiveDecoratorArgumentType(node, argIndex);
}
- else if (argIndex === 0 && node.kind === 176) {
+ else if (argIndex === 0 && node.kind === 177) {
return getGlobalTemplateStringsArrayType();
}
return undefined;
}
function getEffectiveArgument(node, args, argIndex) {
- if (node.kind === 143 ||
- (argIndex === 0 && node.kind === 176)) {
+ if (node.kind === 144 ||
+ (argIndex === 0 && node.kind === 177)) {
return undefined;
}
return args[argIndex];
}
function getEffectiveArgumentErrorNode(node, argIndex, arg) {
- if (node.kind === 143) {
+ if (node.kind === 144) {
return node.expression;
}
- else if (argIndex === 0 && node.kind === 176) {
+ else if (argIndex === 0 && node.kind === 177) {
return node.template;
}
else {
@@ -29098,12 +28929,12 @@ var ts;
}
}
function resolveCall(node, signatures, candidatesOutArray, headMessage) {
- var isTaggedTemplate = node.kind === 176;
- var isDecorator = node.kind === 143;
+ var isTaggedTemplate = node.kind === 177;
+ var isDecorator = node.kind === 144;
var typeArguments;
if (!isTaggedTemplate && !isDecorator) {
typeArguments = node.typeArguments;
- if (node.expression.kind !== 95) {
+ if (node.expression.kind !== 96) {
ts.forEach(typeArguments, checkSourceElement);
}
}
@@ -29129,7 +28960,7 @@ var ts;
var candidateForTypeArgumentError;
var resultOfFailedInference;
var result;
- var signatureHelpTrailingComma = candidatesOutArray && node.kind === 174 && node.arguments.hasTrailingComma;
+ var signatureHelpTrailingComma = candidatesOutArray && node.kind === 175 && node.arguments.hasTrailingComma;
if (candidates.length > 1) {
result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma);
}
@@ -29244,7 +29075,7 @@ var ts;
}
}
function resolveCallExpression(node, candidatesOutArray) {
- if (node.expression.kind === 95) {
+ if (node.expression.kind === 96) {
var superType = checkSuperExpression(node.expression);
if (superType !== unknownType) {
var baseTypeNode = ts.getClassExtendsHeritageClauseElement(ts.getContainingClass(node));
@@ -29397,16 +29228,16 @@ var ts;
}
function getDiagnosticHeadMessageForDecoratorResolution(node) {
switch (node.parent.kind) {
- case 221:
- case 192:
+ case 222:
+ case 193:
return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;
- case 142:
+ case 143:
return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;
- case 145:
+ case 146:
return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;
- case 147:
- case 149:
+ case 148:
case 150:
+ case 151:
return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;
}
}
@@ -29433,13 +29264,13 @@ var ts;
}
function resolveSignature(node, candidatesOutArray) {
switch (node.kind) {
- case 174:
- return resolveCallExpression(node, candidatesOutArray);
case 175:
- return resolveNewExpression(node, candidatesOutArray);
+ return resolveCallExpression(node, candidatesOutArray);
case 176:
+ return resolveNewExpression(node, candidatesOutArray);
+ case 177:
return resolveTaggedTemplateExpression(node, candidatesOutArray);
- case 143:
+ case 144:
return resolveDecorator(node, candidatesOutArray);
}
ts.Debug.fail("Branch in 'resolveSignature' should be unreachable.");
@@ -29468,17 +29299,17 @@ var ts;
function checkCallExpression(node) {
checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments);
var signature = getResolvedSignature(node);
- if (node.expression.kind === 95) {
+ if (node.expression.kind === 96) {
return voidType;
}
- if (node.kind === 175) {
+ if (node.kind === 176) {
var declaration = signature.declaration;
if (declaration &&
- declaration.kind !== 148 &&
- declaration.kind !== 152 &&
- declaration.kind !== 157 &&
+ declaration.kind !== 149 &&
+ declaration.kind !== 153 &&
+ declaration.kind !== 158 &&
!ts.isJSDocConstructSignature(declaration)) {
- var funcSymbol = node.expression.kind === 69 ?
+ var funcSymbol = node.expression.kind === 70 ?
getResolvedSymbol(node.expression) :
checkExpression(node.expression).symbol;
if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16 || ts.isDeclarationOfFunctionExpression(funcSymbol))) {
@@ -29490,7 +29321,9 @@ var ts;
return anyType;
}
}
- if (ts.isInJavaScriptFile(node) && ts.isRequireCall(node, true)) {
+ if (ts.isInJavaScriptFile(node) &&
+ ts.isRequireCall(node, true) &&
+ !resolveName(node.expression, node.expression.text, 107455, undefined, undefined)) {
return resolveExternalModuleTypeByLiteral(node.arguments[0]);
}
return getReturnTypeOfSignature(signature);
@@ -29530,21 +29363,36 @@ var ts;
}
function assignContextualParameterTypes(signature, context, mapper) {
var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0);
+ if (isInferentialContext(mapper)) {
+ for (var i = 0; i < len; i++) {
+ var declaration = signature.parameters[i].valueDeclaration;
+ if (declaration.type) {
+ inferTypes(mapper.context, getTypeFromTypeNode(declaration.type), getTypeAtPosition(context, i));
+ }
+ }
+ }
if (context.thisParameter) {
- if (!signature.thisParameter) {
- signature.thisParameter = createTransientSymbol(context.thisParameter, undefined);
+ var parameter = signature.thisParameter;
+ if (!parameter || parameter.valueDeclaration && !parameter.valueDeclaration.type) {
+ if (!parameter) {
+ signature.thisParameter = createTransientSymbol(context.thisParameter, undefined);
+ }
+ assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper);
}
- assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper);
}
for (var i = 0; i < len; i++) {
var parameter = signature.parameters[i];
- var contextualParameterType = getTypeAtPosition(context, i);
- assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper);
+ if (!parameter.valueDeclaration.type) {
+ var contextualParameterType = getTypeAtPosition(context, i);
+ assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper);
+ }
}
if (signature.hasRestParameter && isRestParameterIndex(context, signature.parameters.length - 1)) {
var parameter = ts.lastOrUndefined(signature.parameters);
- var contextualParameterType = getTypeOfSymbol(ts.lastOrUndefined(context.parameters));
- assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper);
+ if (!parameter.valueDeclaration.type) {
+ var contextualParameterType = getTypeOfSymbol(ts.lastOrUndefined(context.parameters));
+ assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper);
+ }
}
}
function assignBindingElementTypes(node) {
@@ -29552,7 +29400,7 @@ var ts;
for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) {
var element = _a[_i];
if (!ts.isOmittedExpression(element)) {
- if (element.name.kind === 69) {
+ if (element.name.kind === 70) {
getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
}
assignBindingElementTypes(element);
@@ -29565,8 +29413,8 @@ var ts;
if (!links.type) {
links.type = instantiateType(contextualType, mapper);
if (links.type === emptyObjectType &&
- (parameter.valueDeclaration.name.kind === 167 ||
- parameter.valueDeclaration.name.kind === 168)) {
+ (parameter.valueDeclaration.name.kind === 168 ||
+ parameter.valueDeclaration.name.kind === 169)) {
links.type = getTypeFromBindingPattern(parameter.valueDeclaration.name);
}
assignBindingElementTypes(parameter.valueDeclaration);
@@ -29605,7 +29453,7 @@ var ts;
}
var isAsync = ts.isAsyncFunctionLike(func);
var type;
- if (func.body.kind !== 199) {
+ if (func.body.kind !== 200) {
type = checkExpressionCached(func.body, contextualMapper);
if (isAsync) {
type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member);
@@ -29684,7 +29532,7 @@ var ts;
return false;
}
var lastStatement = ts.lastOrUndefined(func.body.statements);
- if (lastStatement && lastStatement.kind === 213 && isExhaustiveSwitchStatement(lastStatement)) {
+ if (lastStatement && lastStatement.kind === 214 && isExhaustiveSwitchStatement(lastStatement)) {
return false;
}
return true;
@@ -29713,7 +29561,7 @@ var ts;
}
});
if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever ||
- func.kind === 179 || func.kind === 180)) {
+ func.kind === 180 || func.kind === 181)) {
return undefined;
}
if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) {
@@ -29730,7 +29578,7 @@ var ts;
if (returnType && maybeTypeOfKind(returnType, 1 | 1024)) {
return;
}
- if (ts.nodeIsMissing(func.body) || func.body.kind !== 199 || !functionHasImplicitReturn(func)) {
+ if (ts.nodeIsMissing(func.body) || func.body.kind !== 200 || !functionHasImplicitReturn(func)) {
return;
}
var hasExplicitReturn = func.flags & 256;
@@ -29757,9 +29605,9 @@ var ts;
}
}
function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) {
- ts.Debug.assert(node.kind !== 147 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 148 || ts.isObjectLiteralMethod(node));
var hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
- if (!hasGrammarError && node.kind === 179) {
+ if (!hasGrammarError && node.kind === 180) {
checkGrammarForGenerator(node);
}
if (contextualMapper === identityMapper && isContextSensitive(node)) {
@@ -29793,14 +29641,14 @@ var ts;
}
}
}
- if (produceDiagnostics && node.kind !== 147) {
+ if (produceDiagnostics && node.kind !== 148) {
checkCollisionWithCapturedSuperVariable(node, node.name);
checkCollisionWithCapturedThisVariable(node, node.name);
}
return type;
}
function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) {
- ts.Debug.assert(node.kind !== 147 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 148 || ts.isObjectLiteralMethod(node));
var isAsync = ts.isAsyncFunctionLike(node);
var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type));
if (!node.asteriskToken) {
@@ -29810,7 +29658,7 @@ var ts;
if (!node.type) {
getReturnTypeOfSignature(getSignatureFromDeclaration(node));
}
- if (node.body.kind === 199) {
+ if (node.body.kind === 200) {
checkSourceElement(node.body);
}
else {
@@ -29845,10 +29693,10 @@ var ts;
function isReferenceToReadonlyEntity(expr, symbol) {
if (isReadonlySymbol(symbol)) {
if (symbol.flags & 4 &&
- (expr.kind === 172 || expr.kind === 173) &&
- expr.expression.kind === 97) {
+ (expr.kind === 173 || expr.kind === 174) &&
+ expr.expression.kind === 98) {
var func = ts.getContainingFunction(expr);
- if (!(func && func.kind === 148))
+ if (!(func && func.kind === 149))
return true;
return !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent);
}
@@ -29857,13 +29705,13 @@ var ts;
return false;
}
function isReferenceThroughNamespaceImport(expr) {
- if (expr.kind === 172 || expr.kind === 173) {
+ if (expr.kind === 173 || expr.kind === 174) {
var node = skipParenthesizedNodes(expr.expression);
- if (node.kind === 69) {
+ if (node.kind === 70) {
var symbol = getNodeLinks(node).resolvedSymbol;
if (symbol.flags & 8388608) {
var declaration = getDeclarationOfAliasSymbol(symbol);
- return declaration && declaration.kind === 232;
+ return declaration && declaration.kind === 233;
}
}
}
@@ -29871,7 +29719,7 @@ var ts;
}
function checkReferenceExpression(expr, invalidReferenceMessage, constantVariableMessage) {
var node = skipParenthesizedNodes(expr);
- if (node.kind !== 69 && node.kind !== 172 && node.kind !== 173) {
+ if (node.kind !== 70 && node.kind !== 173 && node.kind !== 174) {
error(expr, invalidReferenceMessage);
return false;
}
@@ -29879,7 +29727,7 @@ var ts;
var symbol = getExportSymbolOfValueSymbolIfExported(links.resolvedSymbol);
if (symbol) {
if (symbol !== unknownSymbol && symbol !== argumentsSymbol) {
- if (node.kind === 69 && !(symbol.flags & 3)) {
+ if (node.kind === 70 && !(symbol.flags & 3)) {
error(expr, invalidReferenceMessage);
return false;
}
@@ -29889,7 +29737,7 @@ var ts;
}
}
}
- else if (node.kind === 173) {
+ else if (node.kind === 174) {
if (links.resolvedIndexInfo && links.resolvedIndexInfo.isReadonly) {
error(expr, constantVariableMessage);
return false;
@@ -29926,24 +29774,24 @@ var ts;
if (operandType === silentNeverType) {
return silentNeverType;
}
- if (node.operator === 36 && node.operand.kind === 8) {
+ if (node.operator === 37 && node.operand.kind === 8) {
return getFreshTypeOfLiteralType(getLiteralTypeForText(64, "" + -node.operand.text));
}
switch (node.operator) {
- case 35:
case 36:
- case 50:
+ case 37:
+ case 51:
if (maybeTypeOfKind(operandType, 512)) {
error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator));
}
return numberType;
- case 49:
+ case 50:
var facts = getTypeFacts(operandType) & (1048576 | 2097152);
return facts === 1048576 ? falseType :
facts === 2097152 ? trueType :
booleanType;
- case 41:
case 42:
+ case 43:
var ok = checkArithmeticOperandType(node.operand, getNonNullableType(operandType), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type);
if (ok) {
checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant_or_a_read_only_property);
@@ -29969,8 +29817,8 @@ var ts;
}
if (type.flags & 1572864) {
var types = type.types;
- for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
- var t = types_14[_i];
+ for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
+ var t = types_15[_i];
if (maybeTypeOfKind(t, kind)) {
return true;
}
@@ -29984,8 +29832,8 @@ var ts;
}
if (type.flags & 524288) {
var types = type.types;
- for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
- var t = types_15[_i];
+ for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
+ var t = types_16[_i];
if (!isTypeOfKind(t, kind)) {
return false;
}
@@ -29994,8 +29842,8 @@ var ts;
}
if (type.flags & 1048576) {
var types = type.types;
- for (var _a = 0, types_16 = types; _a < types_16.length; _a++) {
- var t = types_16[_a];
+ for (var _a = 0, types_17 = types; _a < types_17.length; _a++) {
+ var t = types_17[_a];
if (isTypeOfKind(t, kind)) {
return true;
}
@@ -30033,24 +29881,24 @@ var ts;
}
return booleanType;
}
- function checkObjectLiteralAssignment(node, sourceType, contextualMapper) {
+ function checkObjectLiteralAssignment(node, sourceType) {
var properties = node.properties;
for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) {
var p = properties_4[_i];
- checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, contextualMapper);
+ checkObjectLiteralDestructuringPropertyAssignment(sourceType, p);
}
return sourceType;
}
- function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, contextualMapper) {
+ function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property) {
if (property.kind === 253 || property.kind === 254) {
- var name_20 = property.name;
- if (name_20.kind === 140) {
- checkComputedPropertyName(name_20);
+ var name_17 = property.name;
+ if (name_17.kind === 141) {
+ checkComputedPropertyName(name_17);
}
- if (isComputedNonLiteralName(name_20)) {
+ if (isComputedNonLiteralName(name_17)) {
return undefined;
}
- var text = getTextOfPropertyName(name_20);
+ var text = getTextOfPropertyName(name_17);
var type = isTypeAny(objectLiteralType)
? objectLiteralType
: getTypeOfPropertyOfType(objectLiteralType, text) ||
@@ -30065,7 +29913,7 @@ var ts;
}
}
else {
- error(name_20, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name_20));
+ error(name_17, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name_17));
}
}
else {
@@ -30083,8 +29931,8 @@ var ts;
function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, contextualMapper) {
var elements = node.elements;
var element = elements[elementIndex];
- if (element.kind !== 193) {
- if (element.kind !== 191) {
+ if (element.kind !== 194) {
+ if (element.kind !== 192) {
var propName = "" + elementIndex;
var type = isTypeAny(sourceType)
? sourceType
@@ -30110,7 +29958,7 @@ var ts;
}
else {
var restExpression = element.expression;
- if (restExpression.kind === 187 && restExpression.operatorToken.kind === 56) {
+ if (restExpression.kind === 188 && restExpression.operatorToken.kind === 57) {
error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer);
}
else {
@@ -30137,14 +29985,14 @@ var ts;
else {
target = exprOrAssignment;
}
- if (target.kind === 187 && target.operatorToken.kind === 56) {
+ if (target.kind === 188 && target.operatorToken.kind === 57) {
checkBinaryExpression(target, contextualMapper);
target = target.left;
}
- if (target.kind === 171) {
- return checkObjectLiteralAssignment(target, sourceType, contextualMapper);
+ if (target.kind === 172) {
+ return checkObjectLiteralAssignment(target, sourceType);
}
- if (target.kind === 170) {
+ if (target.kind === 171) {
return checkArrayLiteralAssignment(target, sourceType, contextualMapper);
}
return checkReferenceAssignment(target, sourceType, contextualMapper);
@@ -30159,49 +30007,49 @@ var ts;
function isSideEffectFree(node) {
node = ts.skipParentheses(node);
switch (node.kind) {
- case 69:
+ case 70:
case 9:
- case 10:
- case 176:
- case 189:
case 11:
+ case 177:
+ case 190:
+ case 12:
case 8:
- case 99:
- case 84:
- case 93:
- case 135:
- case 179:
- case 192:
+ case 100:
+ case 85:
+ case 94:
+ case 136:
case 180:
- case 170:
+ case 193:
+ case 181:
case 171:
- case 182:
- case 196:
+ case 172:
+ case 183:
+ case 197:
+ case 243:
case 242:
- case 241:
return true;
- case 188:
+ case 189:
return isSideEffectFree(node.whenTrue) &&
isSideEffectFree(node.whenFalse);
- case 187:
+ case 188:
if (ts.isAssignmentOperator(node.operatorToken.kind)) {
return false;
}
return isSideEffectFree(node.left) &&
isSideEffectFree(node.right);
- case 185:
case 186:
+ case 187:
switch (node.operator) {
- case 49:
- case 35:
- case 36:
case 50:
+ case 36:
+ case 37:
+ case 51:
return true;
}
return false;
- case 183:
- case 177:
- case 195:
+ case 184:
+ case 178:
+ case 196:
default:
return false;
}
@@ -30221,34 +30069,34 @@ var ts;
}
function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) {
var operator = operatorToken.kind;
- if (operator === 56 && (left.kind === 171 || left.kind === 170)) {
+ if (operator === 57 && (left.kind === 172 || left.kind === 171)) {
return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper);
}
var leftType = checkExpression(left, contextualMapper);
var rightType = checkExpression(right, contextualMapper);
switch (operator) {
- case 37:
case 38:
- case 59:
- case 60:
case 39:
+ case 60:
case 61:
case 40:
case 62:
- case 36:
- case 58:
- case 43:
+ case 41:
case 63:
+ case 37:
+ case 59:
case 44:
case 64:
case 45:
case 65:
- case 47:
- case 67:
- case 48:
- case 68:
case 46:
case 66:
+ case 48:
+ case 68:
+ case 49:
+ case 69:
+ case 47:
+ case 67:
if (leftType === silentNeverType || rightType === silentNeverType) {
return silentNeverType;
}
@@ -30272,8 +30120,8 @@ var ts;
}
}
return numberType;
- case 35:
- case 57:
+ case 36:
+ case 58:
if (leftType === silentNeverType || rightType === silentNeverType) {
return silentNeverType;
}
@@ -30302,24 +30150,24 @@ var ts;
reportOperatorError();
return anyType;
}
- if (operator === 57) {
+ if (operator === 58) {
checkAssignmentOperator(resultType);
}
return resultType;
- case 25:
- case 27:
+ case 26:
case 28:
case 29:
+ case 30:
if (checkForDisallowedESSymbolOperand(operator)) {
if (!isTypeComparableTo(leftType, rightType) && !isTypeComparableTo(rightType, leftType)) {
reportOperatorError();
}
}
return booleanType;
- case 30:
case 31:
case 32:
case 33:
+ case 34:
var leftIsLiteral = isLiteralType(leftType);
var rightIsLiteral = isLiteralType(rightType);
if (!leftIsLiteral || !rightIsLiteral) {
@@ -30330,22 +30178,22 @@ var ts;
reportOperatorError();
}
return booleanType;
- case 91:
+ case 92:
return checkInstanceOfExpression(left, right, leftType, rightType);
- case 90:
+ case 91:
return checkInExpression(left, right, leftType, rightType);
- case 51:
+ case 52:
return getTypeFacts(leftType) & 1048576 ?
includeFalsyTypes(rightType, getFalsyFlags(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType))) :
leftType;
- case 52:
+ case 53:
return getTypeFacts(leftType) & 2097152 ?
getBestChoiceType(removeDefinitelyFalsyTypes(leftType), rightType) :
leftType;
- case 56:
+ case 57:
checkAssignmentOperator(rightType);
return getRegularTypeOfObjectLiteral(rightType);
- case 24:
+ case 25:
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left)) {
error(left, ts.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);
}
@@ -30363,21 +30211,21 @@ var ts;
}
function getSuggestedBooleanOperator(operator) {
switch (operator) {
+ case 48:
+ case 68:
+ return 53;
+ case 49:
+ case 69:
+ return 34;
case 47:
case 67:
return 52;
- case 48:
- case 68:
- return 33;
- case 46:
- case 66:
- return 51;
default:
return undefined;
}
}
function checkAssignmentOperator(valueType) {
- if (produceDiagnostics && operator >= 56 && operator <= 68) {
+ if (produceDiagnostics && operator >= 57 && operator <= 69) {
var ok = checkReferenceExpression(left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant_or_a_read_only_property);
if (ok) {
checkTypeAssignableTo(valueType, leftType, left, undefined);
@@ -30449,9 +30297,9 @@ var ts;
return getFreshTypeOfLiteralType(getLiteralTypeForText(32, node.text));
case 8:
return getFreshTypeOfLiteralType(getLiteralTypeForText(64, node.text));
- case 99:
+ case 100:
return trueType;
- case 84:
+ case 85:
return falseType;
}
}
@@ -30480,7 +30328,7 @@ var ts;
}
function isTypeAssertion(node) {
node = skipParenthesizedNodes(node);
- return node.kind === 177 || node.kind === 195;
+ return node.kind === 178 || node.kind === 196;
}
function checkDeclarationInitializer(declaration) {
var type = checkExpressionCached(declaration.initializer);
@@ -30506,14 +30354,14 @@ var ts;
return isTypeAssertion(node) || isLiteralContextualType(getContextualType(node)) ? type : getWidenedLiteralType(type);
}
function checkPropertyAssignment(node, contextualMapper) {
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
checkComputedPropertyName(node.name);
}
return checkExpressionForMutableLocation(node.initializer, contextualMapper);
}
function checkObjectLiteralMethod(node, contextualMapper) {
checkGrammarMethod(node);
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
checkComputedPropertyName(node.name);
}
var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper);
@@ -30536,7 +30384,7 @@ var ts;
}
function checkExpression(node, contextualMapper) {
var type;
- if (node.kind === 139) {
+ if (node.kind === 140) {
type = checkQualifiedName(node);
}
else {
@@ -30544,9 +30392,9 @@ var ts;
type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper);
}
if (isConstEnumObjectType(type)) {
- var ok = (node.parent.kind === 172 && node.parent.expression === node) ||
- (node.parent.kind === 173 && node.parent.expression === node) ||
- ((node.kind === 69 || node.kind === 139) && isInRightSideOfImportOrExportAssignment(node));
+ var ok = (node.parent.kind === 173 && node.parent.expression === node) ||
+ (node.parent.kind === 174 && node.parent.expression === node) ||
+ ((node.kind === 70 || node.kind === 140) && isInRightSideOfImportOrExportAssignment(node));
if (!ok) {
error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment);
}
@@ -30555,79 +30403,79 @@ var ts;
}
function checkExpressionWorker(node, contextualMapper) {
switch (node.kind) {
- case 69:
+ case 70:
return checkIdentifier(node);
- case 97:
+ case 98:
return checkThisExpression(node);
- case 95:
+ case 96:
return checkSuperExpression(node);
- case 93:
+ case 94:
return nullWideningType;
case 9:
case 8:
- case 99:
- case 84:
+ case 100:
+ case 85:
return checkLiteralExpression(node);
- case 189:
- return checkTemplateExpression(node);
- case 11:
- return stringType;
- case 10:
- return globalRegExpType;
- case 170:
- return checkArrayLiteral(node, contextualMapper);
- case 171:
- return checkObjectLiteral(node, contextualMapper);
- case 172:
- return checkPropertyAccessExpression(node);
- case 173:
- return checkIndexedAccess(node);
- case 174:
- case 175:
- return checkCallExpression(node);
- case 176:
- return checkTaggedTemplateExpression(node);
- case 178:
- return checkExpression(node.expression, contextualMapper);
- case 192:
- return checkClassExpression(node);
- case 179:
- case 180:
- return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper);
- case 182:
- return checkTypeOfExpression(node);
- case 177:
- case 195:
- return checkAssertion(node);
- case 196:
- return checkNonNullAssertion(node);
- case 181:
- return checkDeleteExpression(node);
- case 183:
- return checkVoidExpression(node);
- case 184:
- return checkAwaitExpression(node);
- case 185:
- return checkPrefixUnaryExpression(node);
- case 186:
- return checkPostfixUnaryExpression(node);
- case 187:
- return checkBinaryExpression(node, contextualMapper);
- case 188:
- return checkConditionalExpression(node, contextualMapper);
- case 191:
- return checkSpreadElementExpression(node, contextualMapper);
- case 193:
- return undefinedWideningType;
case 190:
+ return checkTemplateExpression(node);
+ case 12:
+ return stringType;
+ case 11:
+ return globalRegExpType;
+ case 171:
+ return checkArrayLiteral(node, contextualMapper);
+ case 172:
+ return checkObjectLiteral(node, contextualMapper);
+ case 173:
+ return checkPropertyAccessExpression(node);
+ case 174:
+ return checkIndexedAccess(node);
+ case 175:
+ case 176:
+ return checkCallExpression(node);
+ case 177:
+ return checkTaggedTemplateExpression(node);
+ case 179:
+ return checkExpression(node.expression, contextualMapper);
+ case 193:
+ return checkClassExpression(node);
+ case 180:
+ case 181:
+ return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper);
+ case 183:
+ return checkTypeOfExpression(node);
+ case 178:
+ case 196:
+ return checkAssertion(node);
+ case 197:
+ return checkNonNullAssertion(node);
+ case 182:
+ return checkDeleteExpression(node);
+ case 184:
+ return checkVoidExpression(node);
+ case 185:
+ return checkAwaitExpression(node);
+ case 186:
+ return checkPrefixUnaryExpression(node);
+ case 187:
+ return checkPostfixUnaryExpression(node);
+ case 188:
+ return checkBinaryExpression(node, contextualMapper);
+ case 189:
+ return checkConditionalExpression(node, contextualMapper);
+ case 192:
+ return checkSpreadElementExpression(node, contextualMapper);
+ case 194:
+ return undefinedWideningType;
+ case 191:
return checkYieldExpression(node);
case 248:
return checkJsxExpression(node);
- case 241:
- return checkJsxElement(node);
case 242:
- return checkJsxSelfClosingElement(node);
+ return checkJsxElement(node);
case 243:
+ return checkJsxSelfClosingElement(node);
+ case 244:
ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement");
}
return unknownType;
@@ -30648,7 +30496,7 @@ var ts;
var func = ts.getContainingFunction(node);
if (ts.getModifierFlags(node) & 92) {
func = ts.getContainingFunction(node);
- if (!(func.kind === 148 && ts.nodeIsPresent(func.body))) {
+ if (!(func.kind === 149 && ts.nodeIsPresent(func.body))) {
error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
}
}
@@ -30659,7 +30507,7 @@ var ts;
if (ts.indexOf(func.parameters, node) !== 0) {
error(node, ts.Diagnostics.A_this_parameter_must_be_the_first_parameter);
}
- if (func.kind === 148 || func.kind === 152 || func.kind === 157) {
+ if (func.kind === 149 || func.kind === 153 || func.kind === 158) {
error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter);
}
}
@@ -30671,15 +30519,15 @@ var ts;
if (!node.asteriskToken || !node.body) {
return false;
}
- return node.kind === 147 ||
- node.kind === 220 ||
- node.kind === 179;
+ return node.kind === 148 ||
+ node.kind === 221 ||
+ node.kind === 180;
}
function getTypePredicateParameterIndex(parameterList, parameter) {
if (parameterList) {
for (var i = 0; i < parameterList.length; i++) {
var param = parameterList[i];
- if (param.name.kind === 69 &&
+ if (param.name.kind === 70 &&
param.name.text === parameter.text) {
return i;
}
@@ -30714,9 +30562,9 @@ var ts;
else if (parameterName) {
var hasReportedError = false;
for (var _i = 0, _a = parent.parameters; _i < _a.length; _i++) {
- var name_21 = _a[_i].name;
- if (ts.isBindingPattern(name_21) &&
- checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_21, parameterName, typePredicate.parameterName)) {
+ var name_18 = _a[_i].name;
+ if (ts.isBindingPattern(name_18) &&
+ checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_18, parameterName, typePredicate.parameterName)) {
hasReportedError = true;
break;
}
@@ -30729,13 +30577,13 @@ var ts;
}
function getTypePredicateParent(node) {
switch (node.parent.kind) {
+ case 181:
+ case 152:
+ case 221:
case 180:
- case 151:
- case 220:
- case 179:
- case 156:
+ case 157:
+ case 148:
case 147:
- case 146:
var parent_12 = node.parent;
if (node === parent_12.type) {
return parent_12;
@@ -30748,27 +30596,27 @@ var ts;
if (ts.isOmittedExpression(element)) {
continue;
}
- var name_22 = element.name;
- if (name_22.kind === 69 &&
- name_22.text === predicateVariableName) {
+ var name_19 = element.name;
+ if (name_19.kind === 70 &&
+ name_19.text === predicateVariableName) {
error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName);
return true;
}
- else if (name_22.kind === 168 ||
- name_22.kind === 167) {
- if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_22, predicateVariableNode, predicateVariableName)) {
+ else if (name_19.kind === 169 ||
+ name_19.kind === 168) {
+ if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_19, predicateVariableNode, predicateVariableName)) {
return true;
}
}
}
}
function checkSignatureDeclaration(node) {
- if (node.kind === 153) {
+ if (node.kind === 154) {
checkGrammarIndexSignature(node);
}
- else if (node.kind === 156 || node.kind === 220 || node.kind === 157 ||
- node.kind === 151 || node.kind === 148 ||
- node.kind === 152) {
+ else if (node.kind === 157 || node.kind === 221 || node.kind === 158 ||
+ node.kind === 152 || node.kind === 149 ||
+ node.kind === 153) {
checkGrammarFunctionLikeDeclaration(node);
}
checkTypeParameters(node.typeParameters);
@@ -30780,10 +30628,10 @@ var ts;
checkCollisionWithArgumentsInGeneratedCode(node);
if (compilerOptions.noImplicitAny && !node.type) {
switch (node.kind) {
- case 152:
+ case 153:
error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
- case 151:
+ case 152:
error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
}
@@ -30810,11 +30658,17 @@ var ts;
}
}
function checkClassForDuplicateDeclarations(node) {
+ var Accessor;
+ (function (Accessor) {
+ Accessor[Accessor["Getter"] = 1] = "Getter";
+ Accessor[Accessor["Setter"] = 2] = "Setter";
+ Accessor[Accessor["Property"] = 3] = "Property";
+ })(Accessor || (Accessor = {}));
var instanceNames = ts.createMap();
var staticNames = ts.createMap();
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind === 148) {
+ if (member.kind === 149) {
for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
var param = _c[_b];
if (ts.isParameterPropertyDeclaration(param)) {
@@ -30823,18 +30677,18 @@ var ts;
}
}
else {
- var isStatic = ts.forEach(member.modifiers, function (m) { return m.kind === 113; });
+ var isStatic = ts.forEach(member.modifiers, function (m) { return m.kind === 114; });
var names = isStatic ? staticNames : instanceNames;
var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name);
if (memberName) {
switch (member.kind) {
- case 149:
+ case 150:
addName(names, member.name, memberName, 1);
break;
- case 150:
+ case 151:
addName(names, member.name, memberName, 2);
break;
- case 145:
+ case 146:
addName(names, member.name, memberName, 3);
break;
}
@@ -30860,12 +30714,12 @@ var ts;
var names = ts.createMap();
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind == 144) {
+ if (member.kind == 145) {
var memberName = void 0;
switch (member.name.kind) {
case 9:
case 8:
- case 69:
+ case 70:
memberName = member.name.text;
break;
default:
@@ -30882,7 +30736,7 @@ var ts;
}
}
function checkTypeForDuplicateIndexSignatures(node) {
- if (node.kind === 222) {
+ if (node.kind === 223) {
var nodeSymbol = getSymbolOfNode(node);
if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) {
return;
@@ -30897,7 +30751,7 @@ var ts;
var declaration = decl;
if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
switch (declaration.parameters[0].type.kind) {
- case 132:
+ case 133:
if (!seenStringIndexer) {
seenStringIndexer = true;
}
@@ -30905,7 +30759,7 @@ var ts;
error(declaration, ts.Diagnostics.Duplicate_string_index_signature);
}
break;
- case 130:
+ case 131:
if (!seenNumericIndexer) {
seenNumericIndexer = true;
}
@@ -30961,15 +30815,15 @@ var ts;
return ts.forEachChild(n, containsSuperCall);
}
function markThisReferencesAsErrors(n) {
- if (n.kind === 97) {
+ if (n.kind === 98) {
error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location);
}
- else if (n.kind !== 179 && n.kind !== 220) {
+ else if (n.kind !== 180 && n.kind !== 221) {
ts.forEachChild(n, markThisReferencesAsErrors);
}
}
function isInstancePropertyWithInitializer(n) {
- return n.kind === 145 &&
+ return n.kind === 146 &&
!(ts.getModifierFlags(n) & 32) &&
!!n.initializer;
}
@@ -30989,7 +30843,7 @@ var ts;
var superCallStatement = void 0;
for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) {
var statement = statements_2[_i];
- if (statement.kind === 202 && ts.isSuperCall(statement.expression)) {
+ if (statement.kind === 203 && ts.isSuperCall(statement.expression)) {
superCallStatement = statement;
break;
}
@@ -31012,18 +30866,18 @@ var ts;
checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name);
checkDecorators(node);
checkSignatureDeclaration(node);
- if (node.kind === 149) {
+ if (node.kind === 150) {
if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 128)) {
if (!(node.flags & 256)) {
error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value);
}
}
}
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
checkComputedPropertyName(node.name);
}
if (!ts.hasDynamicName(node)) {
- var otherKind = node.kind === 149 ? 150 : 149;
+ var otherKind = node.kind === 150 ? 151 : 150;
var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind);
if (otherAccessor) {
if ((ts.getModifierFlags(node) & 28) !== (ts.getModifierFlags(otherAccessor) & 28)) {
@@ -31037,11 +30891,11 @@ var ts;
}
}
var returnType = getTypeOfAccessors(getSymbolOfNode(node));
- if (node.kind === 149) {
+ if (node.kind === 150) {
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
}
}
- if (node.parent.kind !== 171) {
+ if (node.parent.kind !== 172) {
checkSourceElement(node.body);
registerForUnusedIdentifiersCheck(node);
}
@@ -31127,9 +30981,9 @@ var ts;
}
function getEffectiveDeclarationFlags(n, flagsToCheck) {
var flags = ts.getCombinedModifierFlags(n);
- if (n.parent.kind !== 222 &&
- n.parent.kind !== 221 &&
- n.parent.kind !== 192 &&
+ if (n.parent.kind !== 223 &&
+ n.parent.kind !== 222 &&
+ n.parent.kind !== 193 &&
ts.isInAmbientContext(n)) {
if (!(flags & 2)) {
flags |= 1;
@@ -31206,7 +31060,7 @@ var ts;
if (subsequentNode.kind === node.kind) {
var errorNode_1 = subsequentNode.name || subsequentNode;
if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) {
- var reportError = (node.kind === 147 || node.kind === 146) &&
+ var reportError = (node.kind === 148 || node.kind === 147) &&
(ts.getModifierFlags(node) & 32) !== (ts.getModifierFlags(subsequentNode) & 32);
if (reportError) {
var diagnostic = ts.getModifierFlags(node) & 32 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
@@ -31239,11 +31093,11 @@ var ts;
var current = declarations_4[_i];
var node = current;
var inAmbientContext = ts.isInAmbientContext(node);
- var inAmbientContextOrInterface = node.parent.kind === 222 || node.parent.kind === 159 || inAmbientContext;
+ var inAmbientContextOrInterface = node.parent.kind === 223 || node.parent.kind === 160 || inAmbientContext;
if (inAmbientContextOrInterface) {
previousDeclaration = undefined;
}
- if (node.kind === 220 || node.kind === 147 || node.kind === 146 || node.kind === 148) {
+ if (node.kind === 221 || node.kind === 148 || node.kind === 147 || node.kind === 149) {
var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck);
someNodeFlags |= currentNodeFlags;
allNodeFlags &= currentNodeFlags;
@@ -31354,16 +31208,16 @@ var ts;
}
function getDeclarationSpaces(d) {
switch (d.kind) {
- case 222:
+ case 223:
return 2097152;
- case 225:
+ case 226:
return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0
? 4194304 | 1048576
: 4194304;
- case 221:
- case 224:
+ case 222:
+ case 225:
return 2097152 | 1048576;
- case 229:
+ case 230:
var result_2 = 0;
var target = resolveAlias(getSymbolOfNode(d));
ts.forEach(target.declarations, function (d) { result_2 |= getDeclarationSpaces(d); });
@@ -31511,22 +31365,22 @@ var ts;
var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
var errorInfo;
switch (node.parent.kind) {
- case 221:
+ case 222:
var classSymbol = getSymbolOfNode(node.parent);
var classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 142:
+ case 143:
expectedReturnType = voidType;
errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
break;
- case 145:
+ case 146:
expectedReturnType = voidType;
errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
break;
- case 147:
- case 149:
+ case 148:
case 150:
+ case 151:
var methodType = getTypeOfNode(node.parent);
var descriptorType = createTypedPropertyDescriptorType(methodType);
expectedReturnType = getUnionType([descriptorType, voidType]);
@@ -31535,9 +31389,9 @@ var ts;
checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, errorInfo);
}
function checkTypeNodeAsExpression(node) {
- if (node && node.kind === 155) {
+ if (node && node.kind === 156) {
var root = getFirstIdentifier(node.typeName);
- var meaning = root.parent.kind === 155 ? 793064 : 1920;
+ var meaning = root.parent.kind === 156 ? 793064 : 1920;
var rootSymbol = resolveName(root, root.text, meaning | 8388608, undefined, undefined);
if (rootSymbol && rootSymbol.flags & 8388608) {
var aliasTarget = resolveAlias(rootSymbol);
@@ -31571,20 +31425,20 @@ var ts;
}
if (compilerOptions.emitDecoratorMetadata) {
switch (node.kind) {
- case 221:
+ case 222:
var constructor = ts.getFirstConstructorWithBody(node);
if (constructor) {
checkParameterTypeAnnotationsAsExpressions(constructor);
}
break;
- case 147:
- case 149:
+ case 148:
case 150:
+ case 151:
checkParameterTypeAnnotationsAsExpressions(node);
checkReturnTypeAnnotationAsExpression(node);
break;
- case 145:
- case 142:
+ case 146:
+ case 143:
checkTypeAnnotationAsExpression(node);
break;
}
@@ -31604,7 +31458,7 @@ var ts;
checkDecorators(node);
checkSignatureDeclaration(node);
var isAsync = ts.isAsyncFunctionLike(node);
- if (node.name && node.name.kind === 140) {
+ if (node.name && node.name.kind === 141) {
checkComputedPropertyName(node.name);
}
if (!ts.hasDynamicName(node)) {
@@ -31647,42 +31501,42 @@ var ts;
var node = deferredUnusedIdentifierNodes_1[_i];
switch (node.kind) {
case 256:
- case 225:
+ case 226:
checkUnusedModuleMembers(node);
break;
- case 221:
- case 192:
+ case 222:
+ case 193:
checkUnusedClassMembers(node);
checkUnusedTypeParameters(node);
break;
- case 222:
+ case 223:
checkUnusedTypeParameters(node);
break;
- case 199:
- case 227:
- case 206:
+ case 200:
+ case 228:
case 207:
case 208:
+ case 209:
checkUnusedLocalsAndParameters(node);
break;
- case 148:
- case 179:
- case 220:
- case 180:
- case 147:
case 149:
+ case 180:
+ case 221:
+ case 181:
+ case 148:
case 150:
+ case 151:
if (node.body) {
checkUnusedLocalsAndParameters(node);
}
checkUnusedTypeParameters(node);
break;
- case 146:
- case 151:
+ case 147:
case 152:
case 153:
- case 156:
+ case 154:
case 157:
+ case 158:
checkUnusedTypeParameters(node);
break;
}
@@ -31691,11 +31545,11 @@ var ts;
}
}
function checkUnusedLocalsAndParameters(node) {
- if (node.parent.kind !== 222 && noUnusedIdentifiers && !ts.isInAmbientContext(node)) {
+ if (node.parent.kind !== 223 && noUnusedIdentifiers && !ts.isInAmbientContext(node)) {
var _loop_1 = function (key) {
var local = node.locals[key];
if (!local.isReferenced) {
- if (local.valueDeclaration && local.valueDeclaration.kind === 142) {
+ if (local.valueDeclaration && local.valueDeclaration.kind === 143) {
var parameter = local.valueDeclaration;
if (compilerOptions.noUnusedParameters &&
!ts.isParameterPropertyDeclaration(parameter) &&
@@ -31715,19 +31569,19 @@ var ts;
}
}
function parameterNameStartsWithUnderscore(parameter) {
- return parameter.name && parameter.name.kind === 69 && parameter.name.text.charCodeAt(0) === 95;
+ return parameter.name && parameter.name.kind === 70 && parameter.name.text.charCodeAt(0) === 95;
}
function checkUnusedClassMembers(node) {
if (compilerOptions.noUnusedLocals && !ts.isInAmbientContext(node)) {
if (node.members) {
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind === 147 || member.kind === 145) {
+ if (member.kind === 148 || member.kind === 146) {
if (!member.symbol.isReferenced && ts.getModifierFlags(member) & 8) {
error(member.name, ts.Diagnostics._0_is_declared_but_never_used, member.symbol.name);
}
}
- else if (member.kind === 148) {
+ else if (member.kind === 149) {
for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
var parameter = _c[_b];
if (!parameter.symbol.isReferenced && ts.getModifierFlags(parameter) & 8) {
@@ -31772,7 +31626,7 @@ var ts;
}
}
function checkBlock(node) {
- if (node.kind === 199) {
+ if (node.kind === 200) {
checkGrammarStatementInAmbientContext(node);
}
ts.forEach(node.statements, checkSourceElement);
@@ -31794,19 +31648,19 @@ var ts;
if (!(identifier && identifier.text === name)) {
return false;
}
- if (node.kind === 145 ||
- node.kind === 144 ||
+ if (node.kind === 146 ||
+ node.kind === 145 ||
+ node.kind === 148 ||
node.kind === 147 ||
- node.kind === 146 ||
- node.kind === 149 ||
- node.kind === 150) {
+ node.kind === 150 ||
+ node.kind === 151) {
return false;
}
if (ts.isInAmbientContext(node)) {
return false;
}
var root = ts.getRootDeclaration(node);
- if (root.kind === 142 && ts.nodeIsMissing(root.parent.body)) {
+ if (root.kind === 143 && ts.nodeIsMissing(root.parent.body)) {
return false;
}
return true;
@@ -31820,7 +31674,7 @@ var ts;
var current = node;
while (current) {
if (getNodeCheckFlags(current) & 4) {
- var isDeclaration_1 = node.kind !== 69;
+ var isDeclaration_1 = node.kind !== 70;
if (isDeclaration_1) {
error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference);
}
@@ -31841,7 +31695,7 @@ var ts;
return;
}
if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) {
- var isDeclaration_2 = node.kind !== 69;
+ var isDeclaration_2 = node.kind !== 70;
if (isDeclaration_2) {
error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference);
}
@@ -31851,13 +31705,13 @@ var ts;
}
}
function checkCollisionWithRequireExportsInGeneratedCode(node, name) {
- if (modulekind >= ts.ModuleKind.ES6) {
+ if (modulekind >= ts.ModuleKind.ES2015) {
return;
}
if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) {
return;
}
- if (node.kind === 225 && ts.getModuleInstanceState(node) !== 1) {
+ if (node.kind === 226 && ts.getModuleInstanceState(node) !== 1) {
return;
}
var parent = getDeclarationContainer(node);
@@ -31869,7 +31723,7 @@ var ts;
if (!needCollisionCheckForIdentifier(node, name, "Promise")) {
return;
}
- if (node.kind === 225 && ts.getModuleInstanceState(node) !== 1) {
+ if (node.kind === 226 && ts.getModuleInstanceState(node) !== 1) {
return;
}
var parent = getDeclarationContainer(node);
@@ -31881,7 +31735,7 @@ var ts;
if ((ts.getCombinedNodeFlags(node) & 3) !== 0 || ts.isParameterDeclaration(node)) {
return;
}
- if (node.kind === 218 && !node.initializer) {
+ if (node.kind === 219 && !node.initializer) {
return;
}
var symbol = getSymbolOfNode(node);
@@ -31891,25 +31745,25 @@ var ts;
localDeclarationSymbol !== symbol &&
localDeclarationSymbol.flags & 2) {
if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3) {
- var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 219);
- var container = varDeclList.parent.kind === 200 && varDeclList.parent.parent
+ var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 220);
+ var container = varDeclList.parent.kind === 201 && varDeclList.parent.parent
? varDeclList.parent.parent
: undefined;
var namesShareScope = container &&
- (container.kind === 199 && ts.isFunctionLike(container.parent) ||
+ (container.kind === 200 && ts.isFunctionLike(container.parent) ||
+ container.kind === 227 ||
container.kind === 226 ||
- container.kind === 225 ||
container.kind === 256);
if (!namesShareScope) {
- var name_23 = symbolToString(localDeclarationSymbol);
- error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_23, name_23);
+ var name_20 = symbolToString(localDeclarationSymbol);
+ error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_20, name_20);
}
}
}
}
}
function checkParameterInitializer(node) {
- if (ts.getRootDeclaration(node).kind !== 142) {
+ if (ts.getRootDeclaration(node).kind !== 143) {
return;
}
var func = ts.getContainingFunction(node);
@@ -31918,10 +31772,10 @@ var ts;
if (ts.isTypeNode(n) || ts.isDeclarationName(n)) {
return;
}
- if (n.kind === 172) {
+ if (n.kind === 173) {
return visit(n.expression);
}
- else if (n.kind === 69) {
+ else if (n.kind === 70) {
var symbol = resolveName(n, n.text, 107455 | 8388608, undefined, undefined);
if (!symbol || symbol === unknownSymbol || !symbol.valueDeclaration) {
return;
@@ -31932,7 +31786,7 @@ var ts;
}
var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);
if (enclosingContainer === func) {
- if (symbol.valueDeclaration.kind === 142) {
+ if (symbol.valueDeclaration.kind === 143) {
if (symbol.valueDeclaration.pos < node.pos) {
return;
}
@@ -31941,7 +31795,7 @@ var ts;
if (ts.isFunctionLike(current.parent)) {
return;
}
- if (current.parent.kind === 145 &&
+ if (current.parent.kind === 146 &&
!(ts.hasModifier(current.parent, 32)) &&
ts.isClassLike(current.parent.parent)) {
return;
@@ -31958,25 +31812,25 @@ var ts;
}
}
function convertAutoToAny(type) {
- return type === autoType ? anyType : type;
+ return type === autoType ? anyType : type === autoArrayType ? anyArrayType : type;
}
function checkVariableLikeDeclaration(node) {
checkDecorators(node);
checkSourceElement(node.type);
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
checkComputedPropertyName(node.name);
if (node.initializer) {
checkExpressionCached(node.initializer);
}
}
- if (node.kind === 169) {
- if (node.propertyName && node.propertyName.kind === 140) {
+ if (node.kind === 170) {
+ if (node.propertyName && node.propertyName.kind === 141) {
checkComputedPropertyName(node.propertyName);
}
var parent_13 = node.parent.parent;
var parentType = getTypeForBindingElementParent(parent_13);
- var name_24 = node.propertyName || node.name;
- var property = getPropertyOfType(parentType, getTextOfPropertyName(name_24));
+ var name_21 = node.propertyName || node.name;
+ var property = getPropertyOfType(parentType, getTextOfPropertyName(name_21));
if (parent_13.initializer && property && getParentOfSymbol(property)) {
checkClassPropertyAccess(parent_13, parent_13.initializer, parentType, property);
}
@@ -31984,12 +31838,12 @@ var ts;
if (ts.isBindingPattern(node.name)) {
ts.forEach(node.name.elements, checkSourceElement);
}
- if (node.initializer && ts.getRootDeclaration(node).kind === 142 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) {
+ if (node.initializer && ts.getRootDeclaration(node).kind === 143 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) {
error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation);
return;
}
if (ts.isBindingPattern(node.name)) {
- if (node.initializer && node.parent.parent.kind !== 207) {
+ if (node.initializer && node.parent.parent.kind !== 208) {
checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, undefined);
checkParameterInitializer(node);
}
@@ -31998,7 +31852,7 @@ var ts;
var symbol = getSymbolOfNode(node);
var type = convertAutoToAny(getTypeOfVariableOrParameterOrProperty(symbol));
if (node === symbol.valueDeclaration) {
- if (node.initializer && node.parent.parent.kind !== 207) {
+ if (node.initializer && node.parent.parent.kind !== 208) {
checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, undefined);
checkParameterInitializer(node);
}
@@ -32016,9 +31870,9 @@ var ts;
error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
}
}
- if (node.kind !== 145 && node.kind !== 144) {
+ if (node.kind !== 146 && node.kind !== 145) {
checkExportsOnMergedDeclarations(node);
- if (node.kind === 218 || node.kind === 169) {
+ if (node.kind === 219 || node.kind === 170) {
checkVarDeclaredNamesNotShadowed(node);
}
checkCollisionWithCapturedSuperVariable(node, node.name);
@@ -32028,8 +31882,8 @@ var ts;
}
}
function areDeclarationFlagsIdentical(left, right) {
- if ((left.kind === 142 && right.kind === 218) ||
- (left.kind === 218 && right.kind === 142)) {
+ if ((left.kind === 143 && right.kind === 219) ||
+ (left.kind === 219 && right.kind === 143)) {
return true;
}
if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) {
@@ -32056,7 +31910,7 @@ var ts;
ts.forEach(node.declarationList.declarations, checkSourceElement);
}
function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) {
- if (node.modifiers && node.parent.kind === 171) {
+ if (node.modifiers && node.parent.kind === 172) {
if (ts.isAsyncFunctionLike(node)) {
if (node.modifiers.length > 1) {
return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here);
@@ -32075,7 +31929,7 @@ var ts;
checkGrammarStatementInAmbientContext(node);
checkExpression(node.expression);
checkSourceElement(node.thenStatement);
- if (node.thenStatement.kind === 201) {
+ if (node.thenStatement.kind === 202) {
error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
}
checkSourceElement(node.elseStatement);
@@ -32092,12 +31946,12 @@ var ts;
}
function checkForStatement(node) {
if (!checkGrammarStatementInAmbientContext(node)) {
- if (node.initializer && node.initializer.kind === 219) {
+ if (node.initializer && node.initializer.kind === 220) {
checkGrammarVariableDeclarationList(node.initializer);
}
}
if (node.initializer) {
- if (node.initializer.kind === 219) {
+ if (node.initializer.kind === 220) {
ts.forEach(node.initializer.declarations, checkVariableDeclaration);
}
else {
@@ -32115,13 +31969,13 @@ var ts;
}
function checkForOfStatement(node) {
checkGrammarForInOrForOfStatement(node);
- if (node.initializer.kind === 219) {
+ if (node.initializer.kind === 220) {
checkForInOrForOfVariableDeclaration(node);
}
else {
var varExpr = node.initializer;
var iteratedType = checkRightHandSideOfForOf(node.expression);
- if (varExpr.kind === 170 || varExpr.kind === 171) {
+ if (varExpr.kind === 171 || varExpr.kind === 172) {
checkDestructuringAssignment(varExpr, iteratedType || unknownType);
}
else {
@@ -32139,7 +31993,7 @@ var ts;
}
function checkForInStatement(node) {
checkGrammarForInOrForOfStatement(node);
- if (node.initializer.kind === 219) {
+ if (node.initializer.kind === 220) {
var variable = node.initializer.declarations[0];
if (variable && ts.isBindingPattern(variable.name)) {
error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
@@ -32149,7 +32003,7 @@ var ts;
else {
var varExpr = node.initializer;
var leftType = checkExpression(varExpr);
- if (varExpr.kind === 170 || varExpr.kind === 171) {
+ if (varExpr.kind === 171 || varExpr.kind === 172) {
error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
}
else if (!isTypeAnyOrAllConstituentTypesHaveKind(leftType, 34)) {
@@ -32322,7 +32176,7 @@ var ts;
checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node);
}
function isGetAccessorWithAnnotatedSetAccessor(node) {
- return !!(node.kind === 149 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 150)));
+ return !!(node.kind === 150 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 151)));
}
function isUnwrappedReturnTypeVoidOrAny(func, returnType) {
var unwrappedReturnType = ts.isAsyncFunctionLike(func) ? getPromisedType(returnType) : returnType;
@@ -32344,12 +32198,12 @@ var ts;
if (func.asteriskToken) {
return;
}
- if (func.kind === 150) {
+ if (func.kind === 151) {
if (node.expression) {
error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value);
}
}
- else if (func.kind === 148) {
+ else if (func.kind === 149) {
if (node.expression && !checkTypeAssignableTo(exprType, returnType, node.expression)) {
error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
}
@@ -32367,7 +32221,7 @@ var ts;
}
}
}
- else if (func.kind !== 148 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) {
+ else if (func.kind !== 149 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) {
error(node, ts.Diagnostics.Not_all_code_paths_return_a_value);
}
}
@@ -32424,7 +32278,7 @@ var ts;
if (ts.isFunctionLike(current)) {
break;
}
- if (current.kind === 214 && current.label.text === node.label.text) {
+ if (current.kind === 215 && current.label.text === node.label.text) {
var sourceFile = ts.getSourceFileOfNode(node);
grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label));
break;
@@ -32450,7 +32304,7 @@ var ts;
var catchClause = node.catchClause;
if (catchClause) {
if (catchClause.variableDeclaration) {
- if (catchClause.variableDeclaration.name.kind !== 69) {
+ if (catchClause.variableDeclaration.name.kind !== 70) {
grammarErrorOnFirstToken(catchClause.variableDeclaration.name, ts.Diagnostics.Catch_clause_variable_name_must_be_an_identifier);
}
else if (catchClause.variableDeclaration.type) {
@@ -32518,7 +32372,7 @@ var ts;
return;
}
var errorNode;
- if (prop.valueDeclaration.name.kind === 140 || prop.parent === containingType.symbol) {
+ if (prop.valueDeclaration.name.kind === 141 || prop.parent === containingType.symbol) {
errorNode = prop.valueDeclaration;
}
else if (indexDeclaration) {
@@ -32569,7 +32423,7 @@ var ts;
var firstDecl;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 221 || declaration.kind === 222) {
+ if (declaration.kind === 222 || declaration.kind === 223) {
if (!firstDecl) {
firstDecl = declaration;
}
@@ -32706,7 +32560,7 @@ var ts;
if (derived === base) {
var derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol);
if (baseDeclarationFlags & 128 && (!derivedClassDecl || !(ts.getModifierFlags(derivedClassDecl) & 128))) {
- if (derivedClassDecl.kind === 192) {
+ if (derivedClassDecl.kind === 193) {
error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType));
}
else {
@@ -32750,7 +32604,7 @@ var ts;
}
}
function isAccessor(kind) {
- return kind === 149 || kind === 150;
+ return kind === 150 || kind === 151;
}
function areTypeParametersIdentical(list1, list2) {
if (!list1 && !list2) {
@@ -32817,7 +32671,7 @@ var ts;
checkExportsOnMergedDeclarations(node);
var symbol = getSymbolOfNode(node);
checkTypeParameterListsIdentical(node, symbol);
- var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 222);
+ var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 223);
if (node === firstInterfaceDecl) {
var type = getDeclaredTypeOfSymbol(symbol);
var typeWithThis = getTypeWithThisArgument(type);
@@ -32912,18 +32766,18 @@ var ts;
return value;
function evalConstant(e) {
switch (e.kind) {
- case 185:
+ case 186:
var value_1 = evalConstant(e.operand);
if (value_1 === undefined) {
return undefined;
}
switch (e.operator) {
- case 35: return value_1;
- case 36: return -value_1;
- case 50: return ~value_1;
+ case 36: return value_1;
+ case 37: return -value_1;
+ case 51: return ~value_1;
}
return undefined;
- case 187:
+ case 188:
var left = evalConstant(e.left);
if (left === undefined) {
return undefined;
@@ -32933,37 +32787,37 @@ var ts;
return undefined;
}
switch (e.operatorToken.kind) {
- case 47: return left | right;
- case 46: return left & right;
- case 44: return left >> right;
- case 45: return left >>> right;
- case 43: return left << right;
- case 48: return left ^ right;
- case 37: return left * right;
- case 39: return left / right;
- case 35: return left + right;
- case 36: return left - right;
- case 40: return left % right;
+ case 48: return left | right;
+ case 47: return left & right;
+ case 45: return left >> right;
+ case 46: return left >>> right;
+ case 44: return left << right;
+ case 49: return left ^ right;
+ case 38: return left * right;
+ case 40: return left / right;
+ case 36: return left + right;
+ case 37: return left - right;
+ case 41: return left % right;
}
return undefined;
case 8:
return +e.text;
- case 178:
+ case 179:
return evalConstant(e.expression);
- case 69:
+ case 70:
+ case 174:
case 173:
- case 172:
var member = initializer.parent;
var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent));
var enumType_1;
var propertyName = void 0;
- if (e.kind === 69) {
+ if (e.kind === 70) {
enumType_1 = currentType;
propertyName = e.text;
}
else {
var expression = void 0;
- if (e.kind === 173) {
+ if (e.kind === 174) {
if (e.argumentExpression === undefined ||
e.argumentExpression.kind !== 9) {
return undefined;
@@ -32977,10 +32831,10 @@ var ts;
}
var current = expression;
while (current) {
- if (current.kind === 69) {
+ if (current.kind === 70) {
break;
}
- else if (current.kind === 172) {
+ else if (current.kind === 173) {
current = current.expression;
}
else {
@@ -33040,7 +32894,7 @@ var ts;
}
var seenEnumMissingInitialInitializer_1 = false;
ts.forEach(enumSymbol.declarations, function (declaration) {
- if (declaration.kind !== 224) {
+ if (declaration.kind !== 225) {
return false;
}
var enumDeclaration = declaration;
@@ -33063,8 +32917,8 @@ var ts;
var declarations = symbol.declarations;
for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
var declaration = declarations_5[_i];
- if ((declaration.kind === 221 ||
- (declaration.kind === 220 && ts.nodeIsPresent(declaration.body))) &&
+ if ((declaration.kind === 222 ||
+ (declaration.kind === 221 && ts.nodeIsPresent(declaration.body))) &&
!ts.isInAmbientContext(declaration)) {
return declaration;
}
@@ -33123,7 +32977,7 @@ var ts;
error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged);
}
}
- var mergedClass = ts.getDeclarationOfKind(symbol, 221);
+ var mergedClass = ts.getDeclarationOfKind(symbol, 222);
if (mergedClass &&
inSameLexicalScope(node, mergedClass)) {
getNodeLinks(node).flags |= 32768;
@@ -33166,36 +33020,36 @@ var ts;
}
function checkModuleAugmentationElement(node, isGlobalAugmentation) {
switch (node.kind) {
- case 200:
+ case 201:
for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
var decl = _a[_i];
checkModuleAugmentationElement(decl, isGlobalAugmentation);
}
break;
- case 235:
case 236:
+ case 237:
grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);
break;
- case 229:
case 230:
+ case 231:
grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
break;
- case 169:
- case 218:
- var name_25 = node.name;
- if (ts.isBindingPattern(name_25)) {
- for (var _b = 0, _c = name_25.elements; _b < _c.length; _b++) {
+ case 170:
+ case 219:
+ var name_22 = node.name;
+ if (ts.isBindingPattern(name_22)) {
+ for (var _b = 0, _c = name_22.elements; _b < _c.length; _b++) {
var el = _c[_b];
checkModuleAugmentationElement(el, isGlobalAugmentation);
}
break;
}
- case 221:
- case 224:
- case 220:
case 222:
case 225:
+ case 221:
case 223:
+ case 226:
+ case 224:
if (isGlobalAugmentation) {
return;
}
@@ -33211,17 +33065,17 @@ var ts;
}
function getFirstIdentifier(node) {
switch (node.kind) {
- case 69:
+ case 70:
return node;
- case 139:
+ case 140:
do {
node = node.left;
- } while (node.kind !== 69);
+ } while (node.kind !== 70);
return node;
- case 172:
+ case 173:
do {
node = node.expression;
- } while (node.kind !== 69);
+ } while (node.kind !== 70);
return node;
}
}
@@ -33231,9 +33085,9 @@ var ts;
error(moduleName, ts.Diagnostics.String_literal_expected);
return false;
}
- var inAmbientExternalModule = node.parent.kind === 226 && ts.isAmbientModule(node.parent.parent);
+ var inAmbientExternalModule = node.parent.kind === 227 && ts.isAmbientModule(node.parent.parent);
if (node.parent.kind !== 256 && !inAmbientExternalModule) {
- error(moduleName, node.kind === 236 ?
+ error(moduleName, node.kind === 237 ?
ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace :
ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
return false;
@@ -33254,7 +33108,7 @@ var ts;
(symbol.flags & 793064 ? 793064 : 0) |
(symbol.flags & 1920 ? 1920 : 0);
if (target.flags & excludedMeanings) {
- var message = node.kind === 238 ?
+ var message = node.kind === 239 ?
ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 :
ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
error(node, message, symbolToString(symbol));
@@ -33281,7 +33135,7 @@ var ts;
checkImportBinding(importClause);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 232) {
+ if (importClause.namedBindings.kind === 233) {
checkImportBinding(importClause.namedBindings);
}
else {
@@ -33316,7 +33170,7 @@ var ts;
}
}
else {
- if (modulekind === ts.ModuleKind.ES6 && !ts.isInAmbientContext(node)) {
+ if (modulekind === ts.ModuleKind.ES2015 && !ts.isInAmbientContext(node)) {
grammarErrorOnNode(node, ts.Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_2015_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
}
}
@@ -33332,7 +33186,7 @@ var ts;
if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
if (node.exportClause) {
ts.forEach(node.exportClause.elements, checkExportSpecifier);
- var inAmbientExternalModule = node.parent.kind === 226 && ts.isAmbientModule(node.parent.parent);
+ var inAmbientExternalModule = node.parent.kind === 227 && ts.isAmbientModule(node.parent.parent);
if (node.parent.kind !== 256 && !inAmbientExternalModule) {
error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
}
@@ -33346,7 +33200,7 @@ var ts;
}
}
function checkGrammarModuleElementContext(node, errorMessage) {
- var isInAppropriateContext = node.parent.kind === 256 || node.parent.kind === 226 || node.parent.kind === 225;
+ var isInAppropriateContext = node.parent.kind === 256 || node.parent.kind === 227 || node.parent.kind === 226;
if (!isInAppropriateContext) {
grammarErrorOnFirstToken(node, errorMessage);
}
@@ -33370,14 +33224,14 @@ var ts;
return;
}
var container = node.parent.kind === 256 ? node.parent : node.parent.parent;
- if (container.kind === 225 && !ts.isAmbientModule(container)) {
+ if (container.kind === 226 && !ts.isAmbientModule(container)) {
error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);
return;
}
if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) {
grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers);
}
- if (node.expression.kind === 69) {
+ if (node.expression.kind === 70) {
markExportAsReferenced(node);
}
else {
@@ -33385,7 +33239,7 @@ var ts;
}
checkExternalModuleExports(container);
if (node.isExportEquals && !ts.isInAmbientContext(node)) {
- if (modulekind === ts.ModuleKind.ES6) {
+ if (modulekind === ts.ModuleKind.ES2015) {
grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_2015_modules_Consider_using_export_default_or_another_module_format_instead);
}
else if (modulekind === ts.ModuleKind.System) {
@@ -33437,7 +33291,7 @@ var ts;
links.exportsChecked = true;
}
function isNotOverload(declaration) {
- return (declaration.kind !== 220 && declaration.kind !== 147) ||
+ return (declaration.kind !== 221 && declaration.kind !== 148) ||
!!declaration.body;
}
}
@@ -33448,118 +33302,118 @@ var ts;
var kind = node.kind;
if (cancellationToken) {
switch (kind) {
- case 225:
- case 221:
+ case 226:
case 222:
- case 220:
+ case 223:
+ case 221:
cancellationToken.throwIfCancellationRequested();
}
}
switch (kind) {
- case 141:
- return checkTypeParameter(node);
case 142:
+ return checkTypeParameter(node);
+ case 143:
return checkParameter(node);
+ case 146:
case 145:
- case 144:
return checkPropertyDeclaration(node);
- case 156:
case 157:
- case 151:
+ case 158:
case 152:
- return checkSignatureDeclaration(node);
case 153:
return checkSignatureDeclaration(node);
- case 147:
- case 146:
- return checkMethodDeclaration(node);
- case 148:
- return checkConstructorDeclaration(node);
- case 149:
- case 150:
- return checkAccessorDeclaration(node);
- case 155:
- return checkTypeReferenceNode(node);
case 154:
+ return checkSignatureDeclaration(node);
+ case 148:
+ case 147:
+ return checkMethodDeclaration(node);
+ case 149:
+ return checkConstructorDeclaration(node);
+ case 150:
+ case 151:
+ return checkAccessorDeclaration(node);
+ case 156:
+ return checkTypeReferenceNode(node);
+ case 155:
return checkTypePredicate(node);
- case 158:
- return checkTypeQuery(node);
case 159:
- return checkTypeLiteral(node);
+ return checkTypeQuery(node);
case 160:
- return checkArrayType(node);
+ return checkTypeLiteral(node);
case 161:
- return checkTupleType(node);
+ return checkArrayType(node);
case 162:
+ return checkTupleType(node);
case 163:
- return checkUnionOrIntersectionType(node);
case 164:
+ return checkUnionOrIntersectionType(node);
+ case 165:
return checkSourceElement(node.type);
- case 220:
- return checkFunctionDeclaration(node);
- case 199:
- case 226:
- return checkBlock(node);
- case 200:
- return checkVariableStatement(node);
- case 202:
- return checkExpressionStatement(node);
- case 203:
- return checkIfStatement(node);
- case 204:
- return checkDoStatement(node);
- case 205:
- return checkWhileStatement(node);
- case 206:
- return checkForStatement(node);
- case 207:
- return checkForInStatement(node);
- case 208:
- return checkForOfStatement(node);
- case 209:
- case 210:
- return checkBreakOrContinueStatement(node);
- case 211:
- return checkReturnStatement(node);
- case 212:
- return checkWithStatement(node);
- case 213:
- return checkSwitchStatement(node);
- case 214:
- return checkLabeledStatement(node);
- case 215:
- return checkThrowStatement(node);
- case 216:
- return checkTryStatement(node);
- case 218:
- return checkVariableDeclaration(node);
- case 169:
- return checkBindingElement(node);
case 221:
- return checkClassDeclaration(node);
- case 222:
- return checkInterfaceDeclaration(node);
- case 223:
- return checkTypeAliasDeclaration(node);
- case 224:
- return checkEnumDeclaration(node);
- case 225:
- return checkModuleDeclaration(node);
- case 230:
- return checkImportDeclaration(node);
- case 229:
- return checkImportEqualsDeclaration(node);
- case 236:
- return checkExportDeclaration(node);
- case 235:
- return checkExportAssignment(node);
+ return checkFunctionDeclaration(node);
+ case 200:
+ case 227:
+ return checkBlock(node);
case 201:
- checkGrammarStatementInAmbientContext(node);
- return;
+ return checkVariableStatement(node);
+ case 203:
+ return checkExpressionStatement(node);
+ case 204:
+ return checkIfStatement(node);
+ case 205:
+ return checkDoStatement(node);
+ case 206:
+ return checkWhileStatement(node);
+ case 207:
+ return checkForStatement(node);
+ case 208:
+ return checkForInStatement(node);
+ case 209:
+ return checkForOfStatement(node);
+ case 210:
+ case 211:
+ return checkBreakOrContinueStatement(node);
+ case 212:
+ return checkReturnStatement(node);
+ case 213:
+ return checkWithStatement(node);
+ case 214:
+ return checkSwitchStatement(node);
+ case 215:
+ return checkLabeledStatement(node);
+ case 216:
+ return checkThrowStatement(node);
case 217:
+ return checkTryStatement(node);
+ case 219:
+ return checkVariableDeclaration(node);
+ case 170:
+ return checkBindingElement(node);
+ case 222:
+ return checkClassDeclaration(node);
+ case 223:
+ return checkInterfaceDeclaration(node);
+ case 224:
+ return checkTypeAliasDeclaration(node);
+ case 225:
+ return checkEnumDeclaration(node);
+ case 226:
+ return checkModuleDeclaration(node);
+ case 231:
+ return checkImportDeclaration(node);
+ case 230:
+ return checkImportEqualsDeclaration(node);
+ case 237:
+ return checkExportDeclaration(node);
+ case 236:
+ return checkExportAssignment(node);
+ case 202:
checkGrammarStatementInAmbientContext(node);
return;
- case 239:
+ case 218:
+ checkGrammarStatementInAmbientContext(node);
+ return;
+ case 240:
return checkMissingDeclaration(node);
}
}
@@ -33572,17 +33426,17 @@ var ts;
for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) {
var node = deferredNodes_1[_i];
switch (node.kind) {
- case 179:
case 180:
+ case 181:
+ case 148:
case 147:
- case 146:
checkFunctionExpressionOrObjectLiteralMethodDeferred(node);
break;
- case 149:
case 150:
+ case 151:
checkAccessorDeferred(node);
break;
- case 192:
+ case 193:
checkClassExpressionDeferred(node);
break;
}
@@ -33654,7 +33508,7 @@ var ts;
function isInsideWithStatementBody(node) {
if (node) {
while (node.parent) {
- if (node.parent.kind === 212 && node.parent.statement === node) {
+ if (node.parent.kind === 213 && node.parent.statement === node) {
return true;
}
node = node.parent;
@@ -33680,24 +33534,24 @@ var ts;
if (!ts.isExternalOrCommonJsModule(location)) {
break;
}
- case 225:
+ case 226:
copySymbols(getSymbolOfNode(location).exports, meaning & 8914931);
break;
- case 224:
+ case 225:
copySymbols(getSymbolOfNode(location).exports, meaning & 8);
break;
- case 192:
+ case 193:
var className = location.name;
if (className) {
copySymbol(location.symbol, meaning);
}
- case 221:
case 222:
+ case 223:
if (!(memberFlags & 32)) {
copySymbols(getSymbolOfNode(location).members, meaning & 793064);
}
break;
- case 179:
+ case 180:
var funcName = location.name;
if (funcName) {
copySymbol(location.symbol, meaning);
@@ -33730,33 +33584,33 @@ var ts;
}
}
function isTypeDeclarationName(name) {
- return name.kind === 69 &&
+ return name.kind === 70 &&
isTypeDeclaration(name.parent) &&
name.parent.name === name;
}
function isTypeDeclaration(node) {
switch (node.kind) {
- case 141:
- case 221:
+ case 142:
case 222:
case 223:
case 224:
+ case 225:
return true;
}
}
function isTypeReferenceIdentifier(entityName) {
var node = entityName;
- while (node.parent && node.parent.kind === 139) {
+ while (node.parent && node.parent.kind === 140) {
node = node.parent;
}
- return node.parent && (node.parent.kind === 155 || node.parent.kind === 267);
+ return node.parent && (node.parent.kind === 156 || node.parent.kind === 267);
}
function isHeritageClauseElementIdentifier(entityName) {
var node = entityName;
- while (node.parent && node.parent.kind === 172) {
+ while (node.parent && node.parent.kind === 173) {
node = node.parent;
}
- return node.parent && node.parent.kind === 194;
+ return node.parent && node.parent.kind === 195;
}
function forEachEnclosingClass(node, callback) {
var result;
@@ -33773,13 +33627,13 @@ var ts;
return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; });
}
function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) {
- while (nodeOnRightSide.parent.kind === 139) {
+ while (nodeOnRightSide.parent.kind === 140) {
nodeOnRightSide = nodeOnRightSide.parent;
}
- if (nodeOnRightSide.parent.kind === 229) {
+ if (nodeOnRightSide.parent.kind === 230) {
return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent;
}
- if (nodeOnRightSide.parent.kind === 235) {
+ if (nodeOnRightSide.parent.kind === 236) {
return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent;
}
return undefined;
@@ -33791,7 +33645,7 @@ var ts;
if (ts.isDeclarationName(entityName)) {
return getSymbolOfNode(entityName.parent);
}
- if (ts.isInJavaScriptFile(entityName) && entityName.parent.kind === 172) {
+ if (ts.isInJavaScriptFile(entityName) && entityName.parent.kind === 173) {
var specialPropertyAssignmentKind = ts.getSpecialPropertyAssignmentKind(entityName.parent.parent);
switch (specialPropertyAssignmentKind) {
case 1:
@@ -33803,20 +33657,20 @@ var ts;
default:
}
}
- if (entityName.parent.kind === 235 && ts.isEntityNameExpression(entityName)) {
+ if (entityName.parent.kind === 236 && ts.isEntityNameExpression(entityName)) {
return resolveEntityName(entityName, 107455 | 793064 | 1920 | 8388608);
}
- if (entityName.kind !== 172 && isInRightSideOfImportOrExportAssignment(entityName)) {
- var importEqualsDeclaration = ts.getAncestor(entityName, 229);
+ if (entityName.kind !== 173 && isInRightSideOfImportOrExportAssignment(entityName)) {
+ var importEqualsDeclaration = ts.getAncestor(entityName, 230);
ts.Debug.assert(importEqualsDeclaration !== undefined);
- return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importEqualsDeclaration, true);
+ return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, true);
}
if (ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
entityName = entityName.parent;
}
if (isHeritageClauseElementIdentifier(entityName)) {
var meaning = 0;
- if (entityName.parent.kind === 194) {
+ if (entityName.parent.kind === 195) {
meaning = 793064;
if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) {
meaning |= 107455;
@@ -33832,20 +33686,20 @@ var ts;
if (ts.nodeIsMissing(entityName)) {
return undefined;
}
- if (entityName.kind === 69) {
+ if (entityName.kind === 70) {
if (ts.isJSXTagName(entityName) && isJsxIntrinsicIdentifier(entityName)) {
return getIntrinsicTagSymbol(entityName.parent);
}
return resolveEntityName(entityName, 107455, false, true);
}
- else if (entityName.kind === 172) {
+ else if (entityName.kind === 173) {
var symbol = getNodeLinks(entityName).resolvedSymbol;
if (!symbol) {
checkPropertyAccessExpression(entityName);
}
return getNodeLinks(entityName).resolvedSymbol;
}
- else if (entityName.kind === 139) {
+ else if (entityName.kind === 140) {
var symbol = getNodeLinks(entityName).resolvedSymbol;
if (!symbol) {
checkQualifiedName(entityName);
@@ -33854,13 +33708,13 @@ var ts;
}
}
else if (isTypeReferenceIdentifier(entityName)) {
- var meaning = (entityName.parent.kind === 155 || entityName.parent.kind === 267) ? 793064 : 1920;
+ var meaning = (entityName.parent.kind === 156 || entityName.parent.kind === 267) ? 793064 : 1920;
return resolveEntityName(entityName, meaning, false, true);
}
else if (entityName.parent.kind === 246) {
return getJsxAttributePropertySymbol(entityName.parent);
}
- if (entityName.parent.kind === 154) {
+ if (entityName.parent.kind === 155) {
return resolveEntityName(entityName, 1);
}
return undefined;
@@ -33878,12 +33732,12 @@ var ts;
else if (ts.isLiteralComputedPropertyDeclarationName(node)) {
return getSymbolOfNode(node.parent.parent);
}
- if (node.kind === 69) {
+ if (node.kind === 70) {
if (isInRightSideOfImportOrExportAssignment(node)) {
return getSymbolOfEntityNameOrPropertyAccessExpression(node);
}
- else if (node.parent.kind === 169 &&
- node.parent.parent.kind === 167 &&
+ else if (node.parent.kind === 170 &&
+ node.parent.parent.kind === 168 &&
node === node.parent.propertyName) {
var typeOfPattern = getTypeOfNode(node.parent.parent);
var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text);
@@ -33893,11 +33747,11 @@ var ts;
}
}
switch (node.kind) {
- case 69:
- case 172:
- case 139:
+ case 70:
+ case 173:
+ case 140:
return getSymbolOfEntityNameOrPropertyAccessExpression(node);
- case 97:
+ case 98:
var container = ts.getThisContainer(node, false);
if (ts.isFunctionLike(container)) {
var sig = getSignatureFromDeclaration(container);
@@ -33905,21 +33759,21 @@ var ts;
return sig.thisParameter;
}
}
- case 95:
+ case 96:
var type = ts.isPartOfExpression(node) ? checkExpression(node) : getTypeFromTypeNode(node);
return type.symbol;
- case 165:
+ case 166:
return getTypeFromTypeNode(node).symbol;
- case 121:
+ case 122:
var constructorDeclaration = node.parent;
- if (constructorDeclaration && constructorDeclaration.kind === 148) {
+ if (constructorDeclaration && constructorDeclaration.kind === 149) {
return constructorDeclaration.parent.symbol;
}
return undefined;
case 9:
if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) &&
ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||
- ((node.parent.kind === 230 || node.parent.kind === 236) &&
+ ((node.parent.kind === 231 || node.parent.kind === 237) &&
node.parent.moduleSpecifier === node)) {
return resolveExternalModuleName(node, node);
}
@@ -33927,7 +33781,7 @@ var ts;
return resolveExternalModuleName(node, node);
}
case 8:
- if (node.parent.kind === 173 && node.parent.argumentExpression === node) {
+ if (node.parent.kind === 174 && node.parent.argumentExpression === node) {
var objectType = checkExpression(node.parent.expression);
if (objectType === unknownType)
return undefined;
@@ -33991,12 +33845,12 @@ var ts;
return unknownType;
}
function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) {
- ts.Debug.assert(expr.kind === 171 || expr.kind === 170);
- if (expr.parent.kind === 208) {
+ ts.Debug.assert(expr.kind === 172 || expr.kind === 171);
+ if (expr.parent.kind === 209) {
var iteratedType = checkRightHandSideOfForOf(expr.parent.expression);
return checkDestructuringAssignment(expr, iteratedType || unknownType);
}
- if (expr.parent.kind === 187) {
+ if (expr.parent.kind === 188) {
var iteratedType = checkExpression(expr.parent.right);
return checkDestructuringAssignment(expr, iteratedType || unknownType);
}
@@ -34004,7 +33858,7 @@ var ts;
var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent);
return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent);
}
- ts.Debug.assert(expr.parent.kind === 170);
+ ts.Debug.assert(expr.parent.kind === 171);
var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent);
var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, false) || unknownType;
return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, ts.indexOf(expr.parent.elements, expr), elementType || unknownType);
@@ -34040,9 +33894,9 @@ var ts;
function getRootSymbols(symbol) {
if (symbol.flags & 268435456) {
var symbols_3 = [];
- var name_26 = symbol.name;
+ var name_23 = symbol.name;
ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) {
- var symbol = getPropertyOfType(t, name_26);
+ var symbol = getPropertyOfType(t, name_23);
if (symbol) {
symbols_3.push(symbol);
}
@@ -34145,7 +33999,7 @@ var ts;
else if (nodeLinks_1.flags & 131072) {
var isDeclaredInLoop = nodeLinks_1.flags & 262144;
var inLoopInitializer = ts.isIterationStatement(container, false);
- var inLoopBodyBlock = container.kind === 199 && ts.isIterationStatement(container.parent, false);
+ var inLoopBodyBlock = container.kind === 200 && ts.isIterationStatement(container.parent, false);
links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock));
}
else {
@@ -34185,18 +34039,18 @@ var ts;
return true;
}
switch (node.kind) {
- case 229:
- case 231:
+ case 230:
case 232:
- case 234:
- case 238:
+ case 233:
+ case 235:
+ case 239:
return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol);
- case 236:
+ case 237:
var exportClause = node.exportClause;
return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration);
- case 235:
+ case 236:
return node.expression
- && node.expression.kind === 69
+ && node.expression.kind === 70
? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol)
: true;
}
@@ -34428,7 +34282,7 @@ var ts;
if (!fileToDirective) {
return undefined;
}
- var meaning = (node.kind === 172) || (node.kind === 69 && isInTypeQuery(node))
+ var meaning = (node.kind === 173) || (node.kind === 70 && isInTypeQuery(node))
? 107455 | 1048576
: 793064 | 1920;
var symbol = resolveEntityName(node, meaning, true);
@@ -34575,6 +34429,7 @@ var ts;
getGlobalIterableIteratorType = ts.memoize(function () { return emptyGenericType; });
}
anyArrayType = createArrayType(anyType);
+ autoArrayType = createArrayType(autoType);
var symbol = getGlobalSymbol("ReadonlyArray", 793064, undefined);
globalReadonlyArrayType = symbol && getTypeOfGlobalSymbol(symbol, 1);
anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType;
@@ -34634,14 +34489,14 @@ var ts;
return false;
}
if (!ts.nodeCanBeDecorated(node)) {
- if (node.kind === 147 && !ts.nodeIsPresent(node.body)) {
+ if (node.kind === 148 && !ts.nodeIsPresent(node.body)) {
return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload);
}
else {
return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here);
}
}
- else if (node.kind === 149 || node.kind === 150) {
+ else if (node.kind === 150 || node.kind === 151) {
var accessors = ts.getAllAccessorDeclarations(node.parent.members, node);
if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) {
return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
@@ -34658,28 +34513,28 @@ var ts;
var flags = 0;
for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) {
var modifier = _a[_i];
- if (modifier.kind !== 128) {
- if (node.kind === 144 || node.kind === 146) {
+ if (modifier.kind !== 129) {
+ if (node.kind === 145 || node.kind === 147) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind));
}
- if (node.kind === 153) {
+ if (node.kind === 154) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind));
}
}
switch (modifier.kind) {
- case 74:
- if (node.kind !== 224 && node.parent.kind === 221) {
- return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(74));
+ case 75:
+ if (node.kind !== 225 && node.parent.kind === 222) {
+ return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(75));
}
break;
+ case 113:
case 112:
case 111:
- case 110:
var text = visibilityToString(ts.modifierToFlag(modifier.kind));
- if (modifier.kind === 111) {
+ if (modifier.kind === 112) {
lastProtected = modifier;
}
- else if (modifier.kind === 110) {
+ else if (modifier.kind === 111) {
lastPrivate = modifier;
}
if (flags & 28) {
@@ -34694,11 +34549,11 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async");
}
- else if (node.parent.kind === 226 || node.parent.kind === 256) {
+ else if (node.parent.kind === 227 || node.parent.kind === 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
}
else if (flags & 128) {
- if (modifier.kind === 110) {
+ if (modifier.kind === 111) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract");
}
else {
@@ -34707,7 +34562,7 @@ var ts;
}
flags |= ts.modifierToFlag(modifier.kind);
break;
- case 113:
+ case 114:
if (flags & 32) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static");
}
@@ -34717,10 +34572,10 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async");
}
- else if (node.parent.kind === 226 || node.parent.kind === 256) {
+ else if (node.parent.kind === 227 || node.parent.kind === 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
}
- else if (node.kind === 142) {
+ else if (node.kind === 143) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static");
}
else if (flags & 128) {
@@ -34729,17 +34584,17 @@ var ts;
flags |= 32;
lastStatic = modifier;
break;
- case 128:
+ case 129:
if (flags & 64) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly");
}
- else if (node.kind !== 145 && node.kind !== 144 && node.kind !== 153 && node.kind !== 142) {
+ else if (node.kind !== 146 && node.kind !== 145 && node.kind !== 154 && node.kind !== 143) {
return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
}
flags |= 64;
lastReadonly = modifier;
break;
- case 82:
+ case 83:
if (flags & 1) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export");
}
@@ -34752,45 +34607,45 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async");
}
- else if (node.parent.kind === 221) {
+ else if (node.parent.kind === 222) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export");
}
- else if (node.kind === 142) {
+ else if (node.kind === 143) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export");
}
flags |= 1;
break;
- case 122:
+ case 123:
if (flags & 2) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare");
}
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
}
- else if (node.parent.kind === 221) {
+ else if (node.parent.kind === 222) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare");
}
- else if (node.kind === 142) {
+ else if (node.kind === 143) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare");
}
- else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 226) {
+ else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 227) {
return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
}
flags |= 2;
lastDeclare = modifier;
break;
- case 115:
+ case 116:
if (flags & 128) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract");
}
- if (node.kind !== 221) {
- if (node.kind !== 147 &&
- node.kind !== 145 &&
- node.kind !== 149 &&
- node.kind !== 150) {
+ if (node.kind !== 222) {
+ if (node.kind !== 148 &&
+ node.kind !== 146 &&
+ node.kind !== 150 &&
+ node.kind !== 151) {
return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
}
- if (!(node.parent.kind === 221 && ts.getModifierFlags(node.parent) & 128)) {
+ if (!(node.parent.kind === 222 && ts.getModifierFlags(node.parent) & 128)) {
return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);
}
if (flags & 32) {
@@ -34802,14 +34657,14 @@ var ts;
}
flags |= 128;
break;
- case 118:
+ case 119:
if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "async");
}
else if (flags & 2 || ts.isInAmbientContext(node.parent)) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
}
- else if (node.kind === 142) {
+ else if (node.kind === 143) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async");
}
flags |= 256;
@@ -34817,7 +34672,7 @@ var ts;
break;
}
}
- if (node.kind === 148) {
+ if (node.kind === 149) {
if (flags & 32) {
return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
}
@@ -34832,13 +34687,13 @@ var ts;
}
return;
}
- else if ((node.kind === 230 || node.kind === 229) && flags & 2) {
+ else if ((node.kind === 231 || node.kind === 230) && flags & 2) {
return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
}
- else if (node.kind === 142 && (flags & 92) && ts.isBindingPattern(node.name)) {
+ else if (node.kind === 143 && (flags & 92) && ts.isBindingPattern(node.name)) {
return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern);
}
- else if (node.kind === 142 && (flags & 92) && node.dotDotDotToken) {
+ else if (node.kind === 143 && (flags & 92) && node.dotDotDotToken) {
return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
}
if (flags & 256) {
@@ -34854,38 +34709,38 @@ var ts;
}
function shouldReportBadModifier(node) {
switch (node.kind) {
- case 149:
case 150:
- case 148:
- case 145:
- case 144:
- case 147:
+ case 151:
+ case 149:
case 146:
- case 153:
- case 225:
+ case 145:
+ case 148:
+ case 147:
+ case 154:
+ case 226:
+ case 231:
case 230:
- case 229:
+ case 237:
case 236:
- case 235:
- case 179:
case 180:
- case 142:
+ case 181:
+ case 143:
return false;
default:
- if (node.parent.kind === 226 || node.parent.kind === 256) {
+ if (node.parent.kind === 227 || node.parent.kind === 256) {
return false;
}
switch (node.kind) {
- case 220:
- return nodeHasAnyModifiersExcept(node, 118);
case 221:
- return nodeHasAnyModifiersExcept(node, 115);
+ return nodeHasAnyModifiersExcept(node, 119);
case 222:
- case 200:
+ return nodeHasAnyModifiersExcept(node, 116);
case 223:
- return true;
+ case 201:
case 224:
- return nodeHasAnyModifiersExcept(node, 74);
+ return true;
+ case 225:
+ return nodeHasAnyModifiersExcept(node, 75);
default:
ts.Debug.fail();
return false;
@@ -34897,10 +34752,10 @@ var ts;
}
function checkGrammarAsyncModifier(node, asyncModifier) {
switch (node.kind) {
- case 147:
- case 220:
- case 179:
+ case 148:
+ case 221:
case 180:
+ case 181:
if (!node.asteriskToken) {
return false;
}
@@ -34916,7 +34771,7 @@ var ts;
return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Trailing_comma_not_allowed);
}
}
- function checkGrammarTypeParameterList(node, typeParameters, file) {
+ function checkGrammarTypeParameterList(typeParameters, file) {
if (checkGrammarForDisallowedTrailingComma(typeParameters)) {
return true;
}
@@ -34958,11 +34813,11 @@ var ts;
}
function checkGrammarFunctionLikeDeclaration(node) {
var file = ts.getSourceFileOfNode(node);
- return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node.typeParameters, file) ||
+ return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) ||
checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file);
}
function checkGrammarArrowFunction(node, file) {
- if (node.kind === 180) {
+ if (node.kind === 181) {
var arrowFunction = node;
var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line;
var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line;
@@ -34997,7 +34852,7 @@ var ts;
if (!parameter.type) {
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation);
}
- if (parameter.type.kind !== 132 && parameter.type.kind !== 130) {
+ if (parameter.type.kind !== 133 && parameter.type.kind !== 131) {
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number);
}
if (!node.type) {
@@ -35024,7 +34879,7 @@ var ts;
var sourceFile = ts.getSourceFileOfNode(node);
for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
var arg = args_4[_i];
- if (arg.kind === 193) {
+ if (arg.kind === 194) {
return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
}
}
@@ -35050,7 +34905,7 @@ var ts;
if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && node.heritageClauses) {
for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) {
var heritageClause = _a[_i];
- if (heritageClause.token === 83) {
+ if (heritageClause.token === 84) {
if (seenExtendsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen);
}
@@ -35063,7 +34918,7 @@ var ts;
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 106);
+ ts.Debug.assert(heritageClause.token === 107);
if (seenImplementsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen);
}
@@ -35078,14 +34933,14 @@ var ts;
if (node.heritageClauses) {
for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) {
var heritageClause = _a[_i];
- if (heritageClause.token === 83) {
+ if (heritageClause.token === 84) {
if (seenExtendsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen);
}
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 106);
+ ts.Debug.assert(heritageClause.token === 107);
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause);
}
checkGrammarHeritageClause(heritageClause);
@@ -35094,19 +34949,19 @@ var ts;
return false;
}
function checkGrammarComputedPropertyName(node) {
- if (node.kind !== 140) {
+ if (node.kind !== 141) {
return false;
}
var computedPropertyName = node;
- if (computedPropertyName.expression.kind === 187 && computedPropertyName.expression.operatorToken.kind === 24) {
+ if (computedPropertyName.expression.kind === 188 && computedPropertyName.expression.operatorToken.kind === 25) {
return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name);
}
}
function checkGrammarForGenerator(node) {
if (node.asteriskToken) {
- ts.Debug.assert(node.kind === 220 ||
- node.kind === 179 ||
- node.kind === 147);
+ ts.Debug.assert(node.kind === 221 ||
+ node.kind === 180 ||
+ node.kind === 148);
if (ts.isInAmbientContext(node)) {
return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);
}
@@ -35118,7 +34973,7 @@ var ts;
}
}
}
- function checkGrammarForInvalidQuestionMark(node, questionToken, message) {
+ function checkGrammarForInvalidQuestionMark(questionToken, message) {
if (questionToken) {
return grammarErrorOnNode(questionToken, message);
}
@@ -35131,9 +34986,9 @@ var ts;
var GetOrSetAccessor = GetAccessor | SetAccessor;
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var prop = _a[_i];
- var name_27 = prop.name;
- if (name_27.kind === 140) {
- checkGrammarComputedPropertyName(name_27);
+ var name_24 = prop.name;
+ if (name_24.kind === 141) {
+ checkGrammarComputedPropertyName(name_24);
}
if (prop.kind === 254 && !inDestructuring && prop.objectAssignmentInitializer) {
return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment);
@@ -35141,32 +34996,32 @@ var ts;
if (prop.modifiers) {
for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) {
var mod = _c[_b];
- if (mod.kind !== 118 || prop.kind !== 147) {
+ if (mod.kind !== 119 || prop.kind !== 148) {
grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod));
}
}
}
var currentKind = void 0;
if (prop.kind === 253 || prop.kind === 254) {
- checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
- if (name_27.kind === 8) {
- checkGrammarNumericLiteral(name_27);
+ checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
+ if (name_24.kind === 8) {
+ checkGrammarNumericLiteral(name_24);
}
currentKind = Property;
}
- else if (prop.kind === 147) {
+ else if (prop.kind === 148) {
currentKind = Property;
}
- else if (prop.kind === 149) {
+ else if (prop.kind === 150) {
currentKind = GetAccessor;
}
- else if (prop.kind === 150) {
+ else if (prop.kind === 151) {
currentKind = SetAccessor;
}
else {
ts.Debug.fail("Unexpected syntax kind:" + prop.kind);
}
- var effectiveName = ts.getPropertyNameForPropertyNameNode(name_27);
+ var effectiveName = ts.getPropertyNameForPropertyNameNode(name_24);
if (effectiveName === undefined) {
continue;
}
@@ -35176,18 +35031,18 @@ var ts;
else {
var existingKind = seen[effectiveName];
if (currentKind === Property && existingKind === Property) {
- grammarErrorOnNode(name_27, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name_27));
+ grammarErrorOnNode(name_24, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name_24));
}
else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) {
if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) {
seen[effectiveName] = currentKind | existingKind;
}
else {
- return grammarErrorOnNode(name_27, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);
+ return grammarErrorOnNode(name_24, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);
}
}
else {
- return grammarErrorOnNode(name_27, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);
+ return grammarErrorOnNode(name_24, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);
}
}
}
@@ -35200,12 +35055,12 @@ var ts;
continue;
}
var jsxAttr = attr;
- var name_28 = jsxAttr.name;
- if (!seen[name_28.text]) {
- seen[name_28.text] = true;
+ var name_25 = jsxAttr.name;
+ if (!seen[name_25.text]) {
+ seen[name_25.text] = true;
}
else {
- return grammarErrorOnNode(name_28, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);
+ return grammarErrorOnNode(name_25, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);
}
var initializer = jsxAttr.initializer;
if (initializer && initializer.kind === 248 && !initializer.expression) {
@@ -35217,7 +35072,7 @@ var ts;
if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) {
return true;
}
- if (forInOrOfStatement.initializer.kind === 219) {
+ if (forInOrOfStatement.initializer.kind === 220) {
var variableList = forInOrOfStatement.initializer;
if (!checkGrammarVariableDeclarationList(variableList)) {
var declarations = variableList.declarations;
@@ -35225,20 +35080,20 @@ var ts;
return false;
}
if (declarations.length > 1) {
- var diagnostic = forInOrOfStatement.kind === 207
+ var diagnostic = forInOrOfStatement.kind === 208
? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement
: ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;
return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic);
}
var firstDeclaration = declarations[0];
if (firstDeclaration.initializer) {
- var diagnostic = forInOrOfStatement.kind === 207
+ var diagnostic = forInOrOfStatement.kind === 208
? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer
: ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;
return grammarErrorOnNode(firstDeclaration.name, diagnostic);
}
if (firstDeclaration.type) {
- var diagnostic = forInOrOfStatement.kind === 207
+ var diagnostic = forInOrOfStatement.kind === 208
? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation
: ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;
return grammarErrorOnNode(firstDeclaration, diagnostic);
@@ -35262,11 +35117,11 @@ var ts;
return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters);
}
else if (!doesAccessorHaveCorrectParameterCount(accessor)) {
- return grammarErrorOnNode(accessor.name, kind === 149 ?
+ return grammarErrorOnNode(accessor.name, kind === 150 ?
ts.Diagnostics.A_get_accessor_cannot_have_parameters :
ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter);
}
- else if (kind === 150) {
+ else if (kind === 151) {
if (accessor.type) {
return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);
}
@@ -35285,10 +35140,10 @@ var ts;
}
}
function doesAccessorHaveCorrectParameterCount(accessor) {
- return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 149 ? 0 : 1);
+ return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 150 ? 0 : 1);
}
function getAccessorThisParameter(accessor) {
- if (accessor.parameters.length === (accessor.kind === 149 ? 1 : 2)) {
+ if (accessor.parameters.length === (accessor.kind === 150 ? 1 : 2)) {
return ts.getThisParameter(accessor);
}
}
@@ -35303,8 +35158,8 @@ var ts;
checkGrammarForGenerator(node)) {
return true;
}
- if (node.parent.kind === 171) {
- if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) {
+ if (node.parent.kind === 172) {
+ if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) {
return true;
}
else if (node.body === undefined) {
@@ -35319,10 +35174,10 @@ var ts;
return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol);
}
}
- else if (node.parent.kind === 222) {
+ else if (node.parent.kind === 223) {
return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol);
}
- else if (node.parent.kind === 159) {
+ else if (node.parent.kind === 160) {
return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol);
}
}
@@ -35333,9 +35188,9 @@ var ts;
return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary);
}
switch (current.kind) {
- case 214:
+ case 215:
if (node.label && current.label.text === node.label.text) {
- var isMisplacedContinueLabel = node.kind === 209
+ var isMisplacedContinueLabel = node.kind === 210
&& !ts.isIterationStatement(current.statement, true);
if (isMisplacedContinueLabel) {
return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement);
@@ -35343,8 +35198,8 @@ var ts;
return false;
}
break;
- case 213:
- if (node.kind === 210 && !node.label) {
+ case 214:
+ if (node.kind === 211 && !node.label) {
return false;
}
break;
@@ -35357,13 +35212,13 @@ var ts;
current = current.parent;
}
if (node.label) {
- var message = node.kind === 210
+ var message = node.kind === 211
? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement
: ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
}
else {
- var message = node.kind === 210
+ var message = node.kind === 211
? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement
: ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
@@ -35375,7 +35230,7 @@ var ts;
if (node !== ts.lastOrUndefined(elements)) {
return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern);
}
- if (node.name.kind === 168 || node.name.kind === 167) {
+ if (node.name.kind === 169 || node.name.kind === 168) {
return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern);
}
if (node.initializer) {
@@ -35385,11 +35240,11 @@ var ts;
}
function isStringOrNumberLiteralExpression(expr) {
return expr.kind === 9 || expr.kind === 8 ||
- expr.kind === 185 && expr.operator === 36 &&
+ expr.kind === 186 && expr.operator === 37 &&
expr.operand.kind === 8;
}
function checkGrammarVariableDeclaration(node) {
- if (node.parent.parent.kind !== 207 && node.parent.parent.kind !== 208) {
+ if (node.parent.parent.kind !== 208 && node.parent.parent.kind !== 209) {
if (ts.isInAmbientContext(node)) {
if (node.initializer) {
if (ts.isConst(node) && !node.type) {
@@ -35420,8 +35275,8 @@ var ts;
return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name);
}
function checkGrammarNameInLetOrConstDeclarations(name) {
- if (name.kind === 69) {
- if (name.originalKeywordKind === 108) {
+ if (name.kind === 70) {
+ if (name.originalKeywordKind === 109) {
return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations);
}
}
@@ -35446,15 +35301,15 @@ var ts;
}
function allowLetAndConstDeclarations(parent) {
switch (parent.kind) {
- case 203:
case 204:
case 205:
- case 212:
case 206:
+ case 213:
case 207:
case 208:
+ case 209:
return false;
- case 214:
+ case 215:
return allowLetAndConstDeclarations(parent.parent);
}
return true;
@@ -35509,7 +35364,7 @@ var ts;
return true;
}
}
- else if (node.parent.kind === 222) {
+ else if (node.parent.kind === 223) {
if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) {
return true;
}
@@ -35517,7 +35372,7 @@ var ts;
return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer);
}
}
- else if (node.parent.kind === 159) {
+ else if (node.parent.kind === 160) {
if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) {
return true;
}
@@ -35530,13 +35385,13 @@ var ts;
}
}
function checkGrammarTopLevelElementForRequiredDeclareModifier(node) {
- if (node.kind === 222 ||
- node.kind === 223 ||
+ if (node.kind === 223 ||
+ node.kind === 224 ||
+ node.kind === 231 ||
node.kind === 230 ||
- node.kind === 229 ||
+ node.kind === 237 ||
node.kind === 236 ||
- node.kind === 235 ||
- node.kind === 228 ||
+ node.kind === 229 ||
ts.getModifierFlags(node) & (2 | 1 | 512)) {
return false;
}
@@ -35545,7 +35400,7 @@ var ts;
function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) {
for (var _i = 0, _a = file.statements; _i < _a.length; _i++) {
var decl = _a[_i];
- if (ts.isDeclaration(decl) || decl.kind === 200) {
+ if (ts.isDeclaration(decl) || decl.kind === 201) {
if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) {
return true;
}
@@ -35564,7 +35419,7 @@ var ts;
if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) {
return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
}
- if (node.parent.kind === 199 || node.parent.kind === 226 || node.parent.kind === 256) {
+ if (node.parent.kind === 200 || node.parent.kind === 227 || node.parent.kind === 256) {
var links_1 = getNodeLinks(node.parent);
if (!links_1.hasReportedStatementInAmbientContext) {
return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts);
@@ -35603,46 +35458,46 @@ var ts;
(function (ts) {
;
var nodeEdgeTraversalMap = ts.createMap((_a = {},
- _a[139] = [
+ _a[140] = [
{ name: "left", test: ts.isEntityName },
{ name: "right", test: ts.isIdentifier }
],
- _a[143] = [
+ _a[144] = [
{ name: "expression", test: ts.isLeftHandSideExpression }
],
- _a[177] = [
+ _a[178] = [
{ name: "type", test: ts.isTypeNode },
{ name: "expression", test: ts.isUnaryExpression }
],
- _a[195] = [
+ _a[196] = [
{ name: "expression", test: ts.isExpression },
{ name: "type", test: ts.isTypeNode }
],
- _a[196] = [
+ _a[197] = [
{ name: "expression", test: ts.isLeftHandSideExpression }
],
- _a[224] = [
+ _a[225] = [
{ name: "decorators", test: ts.isDecorator },
{ name: "modifiers", test: ts.isModifier },
{ name: "name", test: ts.isIdentifier },
{ name: "members", test: ts.isEnumMember }
],
- _a[225] = [
+ _a[226] = [
{ name: "decorators", test: ts.isDecorator },
{ name: "modifiers", test: ts.isModifier },
{ name: "name", test: ts.isModuleName },
{ name: "body", test: ts.isModuleBody }
],
- _a[226] = [
+ _a[227] = [
{ name: "statements", test: ts.isStatement }
],
- _a[229] = [
+ _a[230] = [
{ name: "decorators", test: ts.isDecorator },
{ name: "modifiers", test: ts.isModifier },
{ name: "name", test: ts.isIdentifier },
{ name: "moduleReference", test: ts.isModuleReference }
],
- _a[240] = [
+ _a[241] = [
{ name: "expression", test: ts.isExpression, optional: true }
],
_a[255] = [
@@ -35658,41 +35513,41 @@ var ts;
return initial;
}
var kind = node.kind;
- if ((kind > 0 && kind <= 138)) {
+ if ((kind > 0 && kind <= 139)) {
return initial;
}
- if ((kind >= 154 && kind <= 166)) {
+ if ((kind >= 155 && kind <= 167)) {
return initial;
}
var result = initial;
switch (node.kind) {
- case 198:
- case 201:
- case 193:
- case 217:
+ case 199:
+ case 202:
+ case 194:
+ case 218:
case 287:
break;
- case 140:
+ case 141:
result = reduceNode(node.expression, f, result);
break;
- case 142:
- result = ts.reduceLeft(node.decorators, f, result);
- result = ts.reduceLeft(node.modifiers, f, result);
- result = reduceNode(node.name, f, result);
- result = reduceNode(node.type, f, result);
- result = reduceNode(node.initializer, f, result);
- break;
case 143:
- result = reduceNode(node.expression, f, result);
- break;
- case 145:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
result = reduceNode(node.type, f, result);
result = reduceNode(node.initializer, f, result);
break;
- case 147:
+ case 144:
+ result = reduceNode(node.expression, f, result);
+ break;
+ case 146:
+ result = ts.reduceLeft(node.decorators, f, result);
+ result = ts.reduceLeft(node.modifiers, f, result);
+ result = reduceNode(node.name, f, result);
+ result = reduceNode(node.type, f, result);
+ result = reduceNode(node.initializer, f, result);
+ break;
+ case 148:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
@@ -35701,53 +35556,48 @@ var ts;
result = reduceNode(node.type, f, result);
result = reduceNode(node.body, f, result);
break;
- case 148:
- result = ts.reduceLeft(node.modifiers, f, result);
- result = ts.reduceLeft(node.parameters, f, result);
- result = reduceNode(node.body, f, result);
- break;
case 149:
- result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
- result = reduceNode(node.name, f, result);
result = ts.reduceLeft(node.parameters, f, result);
- result = reduceNode(node.type, f, result);
result = reduceNode(node.body, f, result);
break;
case 150:
+ result = ts.reduceLeft(node.decorators, f, result);
+ result = ts.reduceLeft(node.modifiers, f, result);
+ result = reduceNode(node.name, f, result);
+ result = ts.reduceLeft(node.parameters, f, result);
+ result = reduceNode(node.type, f, result);
+ result = reduceNode(node.body, f, result);
+ break;
+ case 151:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
result = ts.reduceLeft(node.parameters, f, result);
result = reduceNode(node.body, f, result);
break;
- case 167:
case 168:
+ case 169:
result = ts.reduceLeft(node.elements, f, result);
break;
- case 169:
+ case 170:
result = reduceNode(node.propertyName, f, result);
result = reduceNode(node.name, f, result);
result = reduceNode(node.initializer, f, result);
break;
- case 170:
+ case 171:
result = ts.reduceLeft(node.elements, f, result);
break;
- case 171:
- result = ts.reduceLeft(node.properties, f, result);
- break;
case 172:
- result = reduceNode(node.expression, f, result);
- result = reduceNode(node.name, f, result);
+ result = ts.reduceLeft(node.properties, f, result);
break;
case 173:
result = reduceNode(node.expression, f, result);
- result = reduceNode(node.argumentExpression, f, result);
+ result = reduceNode(node.name, f, result);
break;
case 174:
result = reduceNode(node.expression, f, result);
- result = ts.reduceLeft(node.typeArguments, f, result);
- result = ts.reduceLeft(node.arguments, f, result);
+ result = reduceNode(node.argumentExpression, f, result);
break;
case 175:
result = reduceNode(node.expression, f, result);
@@ -35755,10 +35605,15 @@ var ts;
result = ts.reduceLeft(node.arguments, f, result);
break;
case 176:
+ result = reduceNode(node.expression, f, result);
+ result = ts.reduceLeft(node.typeArguments, f, result);
+ result = ts.reduceLeft(node.arguments, f, result);
+ break;
+ case 177:
result = reduceNode(node.tag, f, result);
result = reduceNode(node.template, f, result);
break;
- case 179:
+ case 180:
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
result = ts.reduceLeft(node.typeParameters, f, result);
@@ -35766,126 +35621,126 @@ var ts;
result = reduceNode(node.type, f, result);
result = reduceNode(node.body, f, result);
break;
- case 180:
+ case 181:
result = ts.reduceLeft(node.modifiers, f, result);
result = ts.reduceLeft(node.typeParameters, f, result);
result = ts.reduceLeft(node.parameters, f, result);
result = reduceNode(node.type, f, result);
result = reduceNode(node.body, f, result);
break;
- case 178:
- case 181:
+ case 179:
case 182:
case 183:
case 184:
- case 190:
+ case 185:
case 191:
- case 196:
+ case 192:
+ case 197:
result = reduceNode(node.expression, f, result);
break;
- case 185:
case 186:
+ case 187:
result = reduceNode(node.operand, f, result);
break;
- case 187:
+ case 188:
result = reduceNode(node.left, f, result);
result = reduceNode(node.right, f, result);
break;
- case 188:
+ case 189:
result = reduceNode(node.condition, f, result);
result = reduceNode(node.whenTrue, f, result);
result = reduceNode(node.whenFalse, f, result);
break;
- case 189:
+ case 190:
result = reduceNode(node.head, f, result);
result = ts.reduceLeft(node.templateSpans, f, result);
break;
- case 192:
+ case 193:
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
result = ts.reduceLeft(node.typeParameters, f, result);
result = ts.reduceLeft(node.heritageClauses, f, result);
result = ts.reduceLeft(node.members, f, result);
break;
- case 194:
+ case 195:
result = reduceNode(node.expression, f, result);
result = ts.reduceLeft(node.typeArguments, f, result);
break;
- case 197:
+ case 198:
result = reduceNode(node.expression, f, result);
result = reduceNode(node.literal, f, result);
break;
- case 199:
+ case 200:
result = ts.reduceLeft(node.statements, f, result);
break;
- case 200:
+ case 201:
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.declarationList, f, result);
break;
- case 202:
+ case 203:
result = reduceNode(node.expression, f, result);
break;
- case 203:
+ case 204:
result = reduceNode(node.expression, f, result);
result = reduceNode(node.thenStatement, f, result);
result = reduceNode(node.elseStatement, f, result);
break;
- case 204:
- result = reduceNode(node.statement, f, result);
- result = reduceNode(node.expression, f, result);
- break;
case 205:
- case 212:
- result = reduceNode(node.expression, f, result);
result = reduceNode(node.statement, f, result);
+ result = reduceNode(node.expression, f, result);
break;
case 206:
+ case 213:
+ result = reduceNode(node.expression, f, result);
+ result = reduceNode(node.statement, f, result);
+ break;
+ case 207:
result = reduceNode(node.initializer, f, result);
result = reduceNode(node.condition, f, result);
result = reduceNode(node.incrementor, f, result);
result = reduceNode(node.statement, f, result);
break;
- case 207:
case 208:
+ case 209:
result = reduceNode(node.initializer, f, result);
result = reduceNode(node.expression, f, result);
result = reduceNode(node.statement, f, result);
break;
- case 211:
- case 215:
+ case 212:
+ case 216:
result = reduceNode(node.expression, f, result);
break;
- case 213:
+ case 214:
result = reduceNode(node.expression, f, result);
result = reduceNode(node.caseBlock, f, result);
break;
- case 214:
+ case 215:
result = reduceNode(node.label, f, result);
result = reduceNode(node.statement, f, result);
break;
- case 216:
+ case 217:
result = reduceNode(node.tryBlock, f, result);
result = reduceNode(node.catchClause, f, result);
result = reduceNode(node.finallyBlock, f, result);
break;
- case 218:
+ case 219:
result = reduceNode(node.name, f, result);
result = reduceNode(node.type, f, result);
result = reduceNode(node.initializer, f, result);
break;
- case 219:
- result = ts.reduceLeft(node.declarations, f, result);
- break;
case 220:
- result = ts.reduceLeft(node.decorators, f, result);
- result = ts.reduceLeft(node.modifiers, f, result);
- result = reduceNode(node.name, f, result);
- result = ts.reduceLeft(node.typeParameters, f, result);
- result = ts.reduceLeft(node.parameters, f, result);
- result = reduceNode(node.type, f, result);
- result = reduceNode(node.body, f, result);
+ result = ts.reduceLeft(node.declarations, f, result);
break;
case 221:
+ result = ts.reduceLeft(node.decorators, f, result);
+ result = ts.reduceLeft(node.modifiers, f, result);
+ result = reduceNode(node.name, f, result);
+ result = ts.reduceLeft(node.typeParameters, f, result);
+ result = ts.reduceLeft(node.parameters, f, result);
+ result = reduceNode(node.type, f, result);
+ result = reduceNode(node.body, f, result);
+ break;
+ case 222:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
@@ -35893,49 +35748,49 @@ var ts;
result = ts.reduceLeft(node.heritageClauses, f, result);
result = ts.reduceLeft(node.members, f, result);
break;
- case 227:
+ case 228:
result = ts.reduceLeft(node.clauses, f, result);
break;
- case 230:
+ case 231:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.importClause, f, result);
result = reduceNode(node.moduleSpecifier, f, result);
break;
- case 231:
+ case 232:
result = reduceNode(node.name, f, result);
result = reduceNode(node.namedBindings, f, result);
break;
- case 232:
- result = reduceNode(node.name, f, result);
- break;
case 233:
- case 237:
- result = ts.reduceLeft(node.elements, f, result);
+ result = reduceNode(node.name, f, result);
break;
case 234:
case 238:
+ result = ts.reduceLeft(node.elements, f, result);
+ break;
+ case 235:
+ case 239:
result = reduceNode(node.propertyName, f, result);
result = reduceNode(node.name, f, result);
break;
- case 235:
+ case 236:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.expression, f, result);
break;
- case 236:
+ case 237:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.exportClause, f, result);
result = reduceNode(node.moduleSpecifier, f, result);
break;
- case 241:
+ case 242:
result = reduceNode(node.openingElement, f, result);
result = ts.reduceLeft(node.children, f, result);
result = reduceNode(node.closingElement, f, result);
break;
- case 242:
case 243:
+ case 244:
result = reduceNode(node.tagName, f, result);
result = ts.reduceLeft(node.attributes, f, result);
break;
@@ -36078,153 +35933,153 @@ var ts;
return undefined;
}
var kind = node.kind;
- if ((kind > 0 && kind <= 138)) {
+ if ((kind > 0 && kind <= 139)) {
return node;
}
- if ((kind >= 154 && kind <= 166)) {
+ if ((kind >= 155 && kind <= 167)) {
return node;
}
switch (node.kind) {
- case 198:
- case 201:
- case 193:
- case 217:
- return node;
- case 140:
- return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression));
- case 142:
- return ts.updateParameterDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
- case 145:
- return ts.updateProperty(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
- case 147:
- return ts.updateMethod(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
- case 148:
- return ts.updateConstructor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
- case 149:
- return ts.updateGetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
- case 150:
- return ts.updateSetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
- case 167:
- return ts.updateObjectBindingPattern(node, visitNodes(node.elements, visitor, ts.isBindingElement));
- case 168:
- return ts.updateArrayBindingPattern(node, visitNodes(node.elements, visitor, ts.isArrayBindingElement));
- case 169:
- return ts.updateBindingElement(node, visitNode(node.propertyName, visitor, ts.isPropertyName, true), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression, true));
- case 170:
- return ts.updateArrayLiteral(node, visitNodes(node.elements, visitor, ts.isExpression));
- case 171:
- return ts.updateObjectLiteral(node, visitNodes(node.properties, visitor, ts.isObjectLiteralElementLike));
- case 172:
- return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier));
- case 173:
- return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression));
- case 174:
- return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression));
- case 175:
- return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression));
- case 176:
- return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral));
- case 178:
- return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression));
- case 179:
- return ts.updateFunctionExpression(node, visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
- case 180:
- return ts.updateArrowFunction(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isConciseBody, true), context.endLexicalEnvironment()));
- case 181:
- return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression));
- case 182:
- return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression));
- case 183:
- return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression));
- case 184:
- return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression));
- case 187:
- return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression));
- case 185:
- return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression));
- case 186:
- return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression));
- case 188:
- return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.whenFalse, visitor, ts.isExpression));
- case 189:
- return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), visitNodes(node.templateSpans, visitor, ts.isTemplateSpan));
- case 190:
- return ts.updateYield(node, visitNode(node.expression, visitor, ts.isExpression));
- case 191:
- return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression));
- case 192:
- return ts.updateClassExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement));
- case 194:
- return ts.updateExpressionWithTypeArguments(node, visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression));
- case 197:
- return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail));
case 199:
- return ts.updateBlock(node, visitNodes(node.statements, visitor, ts.isStatement));
- case 200:
- return ts.updateVariableStatement(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList));
case 202:
- return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression));
- case 203:
- return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, true, liftToBlock));
- case 204:
- return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.expression, visitor, ts.isExpression));
- case 205:
- return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 206:
- return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 207:
- return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 208:
- return ts.updateForOf(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 209:
- return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier, true));
- case 210:
- return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier, true));
- case 211:
- return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression, true));
- case 212:
- return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 213:
- return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock));
- case 214:
- return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 215:
- return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression));
- case 216:
- return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause, true), visitNode(node.finallyBlock, visitor, ts.isBlock, true));
+ case 194:
case 218:
- return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
+ return node;
+ case 141:
+ return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 143:
+ return ts.updateParameterDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
+ case 146:
+ return ts.updateProperty(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
+ case 148:
+ return ts.updateMethod(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 149:
+ return ts.updateConstructor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 150:
+ return ts.updateGetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 151:
+ return ts.updateSetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 168:
+ return ts.updateObjectBindingPattern(node, visitNodes(node.elements, visitor, ts.isBindingElement));
+ case 169:
+ return ts.updateArrayBindingPattern(node, visitNodes(node.elements, visitor, ts.isArrayBindingElement));
+ case 170:
+ return ts.updateBindingElement(node, visitNode(node.propertyName, visitor, ts.isPropertyName, true), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression, true));
+ case 171:
+ return ts.updateArrayLiteral(node, visitNodes(node.elements, visitor, ts.isExpression));
+ case 172:
+ return ts.updateObjectLiteral(node, visitNodes(node.properties, visitor, ts.isObjectLiteralElementLike));
+ case 173:
+ return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier));
+ case 174:
+ return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression));
+ case 175:
+ return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression));
+ case 176:
+ return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression));
+ case 177:
+ return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral));
+ case 179:
+ return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 180:
+ return ts.updateFunctionExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 181:
+ return ts.updateArrowFunction(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isConciseBody, true), context.endLexicalEnvironment()));
+ case 182:
+ return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 183:
+ return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 184:
+ return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 185:
+ return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 188:
+ return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression));
+ case 186:
+ return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression));
+ case 187:
+ return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression));
+ case 189:
+ return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.whenFalse, visitor, ts.isExpression));
+ case 190:
+ return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), visitNodes(node.templateSpans, visitor, ts.isTemplateSpan));
+ case 191:
+ return ts.updateYield(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 192:
+ return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 193:
+ return ts.updateClassExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement));
+ case 195:
+ return ts.updateExpressionWithTypeArguments(node, visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression));
+ case 198:
+ return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail));
+ case 200:
+ return ts.updateBlock(node, visitNodes(node.statements, visitor, ts.isStatement));
+ case 201:
+ return ts.updateVariableStatement(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList));
+ case 203:
+ return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 204:
+ return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, true, liftToBlock));
+ case 205:
+ return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.expression, visitor, ts.isExpression));
+ case 206:
+ return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 207:
+ return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 208:
+ return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 209:
+ return ts.updateForOf(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 210:
+ return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier, true));
+ case 211:
+ return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier, true));
+ case 212:
+ return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression, true));
+ case 213:
+ return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 214:
+ return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock));
+ case 215:
+ return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 216:
+ return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 217:
+ return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause, true), visitNode(node.finallyBlock, visitor, ts.isBlock, true));
case 219:
- return ts.updateVariableDeclarationList(node, visitNodes(node.declarations, visitor, ts.isVariableDeclaration));
+ return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
case 220:
- return ts.updateFunctionDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ return ts.updateVariableDeclarationList(node, visitNodes(node.declarations, visitor, ts.isVariableDeclaration));
case 221:
+ return ts.updateFunctionDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 222:
return ts.updateClassDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement));
- case 227:
+ case 228:
return ts.updateCaseBlock(node, visitNodes(node.clauses, visitor, ts.isCaseOrDefaultClause));
- case 230:
- return ts.updateImportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression));
case 231:
- return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier, true), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings, true));
+ return ts.updateImportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression));
case 232:
- return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier, true), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings, true));
case 233:
- return ts.updateNamedImports(node, visitNodes(node.elements, visitor, ts.isImportSpecifier));
+ return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier));
case 234:
- return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, true), visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateNamedImports(node, visitNodes(node.elements, visitor, ts.isImportSpecifier));
case 235:
- return ts.updateExportAssignment(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, true), visitNode(node.name, visitor, ts.isIdentifier));
case 236:
- return ts.updateExportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression, true));
+ return ts.updateExportAssignment(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression));
case 237:
- return ts.updateNamedExports(node, visitNodes(node.elements, visitor, ts.isExportSpecifier));
+ return ts.updateExportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression, true));
case 238:
+ return ts.updateNamedExports(node, visitNodes(node.elements, visitor, ts.isExportSpecifier));
+ case 239:
return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, true), visitNode(node.name, visitor, ts.isIdentifier));
- case 241:
- return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), visitNodes(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement));
case 242:
- return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike));
+ return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), visitNodes(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement));
case 243:
+ return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike));
+ case 244:
return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike));
case 245:
return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression));
@@ -36325,67 +36180,67 @@ var ts;
return transformFlags | aggregateTransformFlagsForNode(child);
}
function getTransformFlagsSubtreeExclusions(kind) {
- if (kind >= 154 && kind <= 166) {
+ if (kind >= 155 && kind <= 167) {
return -3;
}
switch (kind) {
- case 174:
case 175:
- case 170:
- return 537133909;
- case 225:
- return 546335573;
- case 142:
- return 538968917;
+ case 176:
+ case 171:
+ return 537922901;
+ case 226:
+ return 574729557;
+ case 143:
+ return 545262933;
+ case 181:
+ return 592227669;
case 180:
- return 550710101;
- case 179:
- case 220:
- return 550726485;
- case 219:
- return 538968917;
case 221:
- case 192:
- return 537590613;
- case 148:
- return 550593365;
- case 147:
+ return 592293205;
+ case 220:
+ return 545262933;
+ case 222:
+ case 193:
+ return 539749717;
case 149:
+ return 591760725;
+ case 148:
case 150:
- return 550593365;
- case 117:
- case 130:
- case 127:
- case 132:
- case 120:
- case 133:
- case 103:
- case 141:
- case 144:
- case 146:
case 151:
+ return 591760725;
+ case 118:
+ case 131:
+ case 128:
+ case 133:
+ case 121:
+ case 134:
+ case 104:
+ case 142:
+ case 145:
+ case 147:
case 152:
case 153:
- case 222:
+ case 154:
case 223:
+ case 224:
return -3;
- case 171:
- return 537430869;
+ case 172:
+ return 539110741;
default:
- return 536871765;
+ return 536874325;
}
}
var Debug;
(function (Debug) {
Debug.failNotOptional = Debug.shouldAssert(1)
? function (message) { return Debug.assert(false, message || "Node not optional."); }
- : function (message) { };
+ : function () { };
Debug.failBadSyntaxKind = Debug.shouldAssert(1)
? function (node, message) { return Debug.assert(false, message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " was unexpected."; }); }
- : function (node, message) { };
+ : function () { };
Debug.assertNode = Debug.shouldAssert(1)
? function (node, test, message) { return Debug.assert(test === undefined || test(node), message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }); }
- : function (node, test, message) { };
+ : function () { };
function getFunctionName(func) {
if (typeof func !== "function") {
return "";
@@ -36423,7 +36278,7 @@ var ts;
else if (ts.nodeIsSynthesized(node)) {
location = value;
}
- flattenDestructuring(context, node, value, location, emitAssignment, emitTempVariableAssignment, visitor);
+ flattenDestructuring(node, value, location, emitAssignment, emitTempVariableAssignment, visitor);
if (needsValue) {
expressions.push(value);
}
@@ -36443,9 +36298,9 @@ var ts;
}
}
ts.flattenDestructuringAssignment = flattenDestructuringAssignment;
- function flattenParameterDestructuring(context, node, value, visitor) {
+ function flattenParameterDestructuring(node, value, visitor) {
var declarations = [];
- flattenDestructuring(context, node, value, node, emitAssignment, emitTempVariableAssignment, visitor);
+ flattenDestructuring(node, value, node, emitAssignment, emitTempVariableAssignment, visitor);
return declarations;
function emitAssignment(name, value, location) {
var declaration = ts.createVariableDeclaration(name, undefined, value, location);
@@ -36460,10 +36315,10 @@ var ts;
}
}
ts.flattenParameterDestructuring = flattenParameterDestructuring;
- function flattenVariableDestructuring(context, node, value, visitor, recordTempVariable) {
+ function flattenVariableDestructuring(node, value, visitor, recordTempVariable) {
var declarations = [];
var pendingAssignments;
- flattenDestructuring(context, node, value, node, emitAssignment, emitTempVariableAssignment, visitor);
+ flattenDestructuring(node, value, node, emitAssignment, emitTempVariableAssignment, visitor);
return declarations;
function emitAssignment(name, value, location, original) {
if (pendingAssignments) {
@@ -36495,9 +36350,9 @@ var ts;
}
}
ts.flattenVariableDestructuring = flattenVariableDestructuring;
- function flattenVariableDestructuringToExpression(context, node, recordTempVariable, nameSubstitution, visitor) {
+ function flattenVariableDestructuringToExpression(node, recordTempVariable, nameSubstitution, visitor) {
var pendingAssignments = [];
- flattenDestructuring(context, node, undefined, node, emitAssignment, emitTempVariableAssignment, visitor);
+ flattenDestructuring(node, undefined, node, emitAssignment, emitTempVariableAssignment, visitor);
var expression = ts.inlineExpressions(pendingAssignments);
ts.aggregateTransformFlags(expression);
return expression;
@@ -36519,7 +36374,7 @@ var ts;
}
}
ts.flattenVariableDestructuringToExpression = flattenVariableDestructuringToExpression;
- function flattenDestructuring(context, root, value, location, emitAssignment, emitTempVariableAssignment, visitor) {
+ function flattenDestructuring(root, value, location, emitAssignment, emitTempVariableAssignment, visitor) {
if (value && visitor) {
value = ts.visitNode(value, visitor, ts.isExpression);
}
@@ -36540,7 +36395,7 @@ var ts;
}
target = bindingTarget.name;
}
- else if (ts.isBinaryExpression(bindingTarget) && bindingTarget.operatorToken.kind === 56) {
+ else if (ts.isBinaryExpression(bindingTarget) && bindingTarget.operatorToken.kind === 57) {
var initializer = visitor
? ts.visitNode(bindingTarget.right, visitor, ts.isExpression)
: bindingTarget.right;
@@ -36550,17 +36405,17 @@ var ts;
else {
target = bindingTarget;
}
- if (target.kind === 171) {
+ if (target.kind === 172) {
emitObjectLiteralAssignment(target, value, location);
}
- else if (target.kind === 170) {
+ else if (target.kind === 171) {
emitArrayLiteralAssignment(target, value, location);
}
else {
- var name_29 = ts.getMutableClone(target);
- ts.setSourceMapRange(name_29, target);
- ts.setCommentRange(name_29, target);
- emitAssignment(name_29, value, location, undefined);
+ var name_26 = ts.getMutableClone(target);
+ ts.setSourceMapRange(name_26, target);
+ ts.setCommentRange(name_26, target);
+ emitAssignment(name_26, value, location, undefined);
}
}
function emitObjectLiteralAssignment(target, value, location) {
@@ -36585,8 +36440,8 @@ var ts;
}
for (var i = 0; i < numElements; i++) {
var e = elements[i];
- if (e.kind !== 193) {
- if (e.kind !== 191) {
+ if (e.kind !== 194) {
+ if (e.kind !== 192) {
emitDestructuringAssignment(e, ts.createElementAccess(value, ts.createLiteral(i)), e);
}
else if (i === numElements - 1) {
@@ -36615,7 +36470,7 @@ var ts;
if (ts.isOmittedExpression(element)) {
continue;
}
- else if (name.kind === 167) {
+ else if (name.kind === 168) {
var propName = element.propertyName || element.name;
emitBindingElement(element, createDestructuringPropertyAccess(value, propName));
}
@@ -36635,7 +36490,7 @@ var ts;
}
function createDefaultValueCheck(value, defaultValue, location) {
value = ensureIdentifier(value, true, location, emitTempVariableAssignment);
- return ts.createConditional(ts.createStrictEquality(value, ts.createVoidZero()), ts.createToken(53), defaultValue, ts.createToken(54), value);
+ return ts.createConditional(ts.createStrictEquality(value, ts.createVoidZero()), ts.createToken(54), defaultValue, ts.createToken(55), value);
}
function createDestructuringPropertyAccess(expression, propertyName) {
if (ts.isComputedPropertyName(propertyName)) {
@@ -36673,6 +36528,12 @@ var ts;
var ts;
(function (ts) {
var USE_NEW_TYPE_METADATA_FORMAT = false;
+ var TypeScriptSubstitutionFlags;
+ (function (TypeScriptSubstitutionFlags) {
+ TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["ClassAliases"] = 1] = "ClassAliases";
+ TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["NamespaceExports"] = 2] = "NamespaceExports";
+ TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["NonQualifiedEnumMembers"] = 8] = "NonQualifiedEnumMembers";
+ })(TypeScriptSubstitutionFlags || (TypeScriptSubstitutionFlags = {}));
function transformTypeScript(context) {
var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration;
var resolver = context.getEmitResolver();
@@ -36683,8 +36544,8 @@ var ts;
var previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(172);
context.enableSubstitution(173);
+ context.enableSubstitution(174);
var currentSourceFile;
var currentNamespace;
var currentNamespaceContainerName;
@@ -36694,7 +36555,6 @@ var ts;
var enabledSubstitutions;
var classAliases;
var applicableSubstitutions;
- var currentSuperContainer;
return transformSourceFile;
function transformSourceFile(node) {
if (ts.isDeclarationFile(node)) {
@@ -36728,15 +36588,32 @@ var ts;
}
return node;
}
+ function sourceElementVisitor(node) {
+ return saveStateAndInvoke(node, sourceElementVisitorWorker);
+ }
+ function sourceElementVisitorWorker(node) {
+ switch (node.kind) {
+ case 231:
+ return visitImportDeclaration(node);
+ case 230:
+ return visitImportEqualsDeclaration(node);
+ case 236:
+ return visitExportAssignment(node);
+ case 237:
+ return visitExportDeclaration(node);
+ default:
+ return visitorWorker(node);
+ }
+ }
function namespaceElementVisitor(node) {
return saveStateAndInvoke(node, namespaceElementVisitorWorker);
}
function namespaceElementVisitorWorker(node) {
- if (node.kind === 236 ||
- node.kind === 230 ||
+ if (node.kind === 237 ||
node.kind === 231 ||
- (node.kind === 229 &&
- node.moduleReference.kind === 240)) {
+ node.kind === 232 ||
+ (node.kind === 230 &&
+ node.moduleReference.kind === 241)) {
return undefined;
}
else if (node.transformFlags & 1 || ts.hasModifier(node, 1)) {
@@ -36752,15 +36629,15 @@ var ts;
}
function classElementVisitorWorker(node) {
switch (node.kind) {
- case 148:
- return undefined;
- case 145:
- case 153:
case 149:
+ return undefined;
+ case 146:
+ case 154:
case 150:
- case 147:
+ case 151:
+ case 148:
return visitorWorker(node);
- case 198:
+ case 199:
return node;
default:
ts.Debug.failBadSyntaxKind(node);
@@ -36772,84 +36649,87 @@ var ts;
return ts.createNotEmittedStatement(node);
}
switch (node.kind) {
- case 82:
- case 77:
+ case 83:
+ case 78:
return currentNamespace ? undefined : node;
- case 112:
- case 110:
+ case 113:
case 111:
- case 115:
- case 118:
- case 74:
- case 122:
- case 128:
- case 160:
+ case 112:
+ case 116:
+ case 75:
+ case 123:
+ case 129:
case 161:
- case 159:
- case 154:
- case 141:
- case 117:
- case 120:
- case 132:
- case 130:
- case 127:
- case 103:
- case 133:
- case 157:
- case 156:
- case 158:
- case 155:
case 162:
+ case 160:
+ case 155:
+ case 142:
+ case 118:
+ case 121:
+ case 133:
+ case 131:
+ case 128:
+ case 104:
+ case 134:
+ case 158:
+ case 157:
+ case 159:
+ case 156:
case 163:
case 164:
case 165:
case 166:
- case 153:
- case 143:
+ case 167:
+ case 154:
+ case 144:
+ case 224:
+ case 146:
+ case 149:
+ return visitConstructor(node);
case 223:
- case 145:
- case 148:
- return undefined;
- case 222:
return ts.createNotEmittedStatement(node);
- case 221:
+ case 222:
return visitClassDeclaration(node);
- case 192:
+ case 193:
return visitClassExpression(node);
case 251:
return visitHeritageClause(node);
- case 194:
- return visitExpressionWithTypeArguments(node);
- case 147:
- return visitMethodDeclaration(node);
- case 149:
- return visitGetAccessor(node);
- case 150:
- return visitSetAccessor(node);
- case 220:
- return visitFunctionDeclaration(node);
- case 179:
- return visitFunctionExpression(node);
- case 180:
- return visitArrowFunction(node);
- case 142:
- return visitParameter(node);
- case 178:
- return visitParenthesizedExpression(node);
- case 177:
case 195:
- return visitAssertionExpression(node);
+ return visitExpressionWithTypeArguments(node);
+ case 148:
+ return visitMethodDeclaration(node);
+ case 150:
+ return visitGetAccessor(node);
+ case 151:
+ return visitSetAccessor(node);
+ case 221:
+ return visitFunctionDeclaration(node);
+ case 180:
+ return visitFunctionExpression(node);
+ case 181:
+ return visitArrowFunction(node);
+ case 143:
+ return visitParameter(node);
+ case 179:
+ return visitParenthesizedExpression(node);
+ case 178:
case 196:
+ return visitAssertionExpression(node);
+ case 175:
+ return visitCallExpression(node);
+ case 176:
+ return visitNewExpression(node);
+ case 197:
return visitNonNullExpression(node);
- case 224:
- return visitEnumDeclaration(node);
- case 184:
- return visitAwaitExpression(node);
- case 200:
- return visitVariableStatement(node);
case 225:
+ return visitEnumDeclaration(node);
+ case 201:
+ return visitVariableStatement(node);
+ case 219:
+ return visitVariableDeclaration(node);
+ case 226:
return visitModuleDeclaration(node);
- case 229:
+ case 230:
return visitImportEqualsDeclaration(node);
default:
ts.Debug.failBadSyntaxKind(node);
@@ -36859,14 +36739,14 @@ var ts;
function onBeforeVisitNode(node) {
switch (node.kind) {
case 256:
+ case 228:
case 227:
- case 226:
- case 199:
+ case 200:
currentScope = node;
currentScopeFirstDeclarationsOfName = undefined;
break;
+ case 222:
case 221:
- case 220:
if (ts.hasModifier(node, 2)) {
break;
}
@@ -36891,14 +36771,14 @@ var ts;
externalHelpersModuleImport.flags &= ~8;
statements.push(externalHelpersModuleImport);
currentSourceFileExternalHelpersModuleName = externalHelpersModuleName;
- ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset));
+ ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset));
ts.addRange(statements, endLexicalEnvironment());
currentSourceFileExternalHelpersModuleName = undefined;
node = ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements));
node.externalHelpersModuleName = externalHelpersModuleName;
}
else {
- node = ts.visitEachChild(node, visitor, context);
+ node = ts.visitEachChild(node, sourceElementVisitor, context);
}
ts.setEmitFlags(node, 1 | ts.getEmitFlags(node));
return node;
@@ -36938,7 +36818,7 @@ var ts;
classAlias = addClassDeclarationHeadWithDecorators(statements, node, name, hasExtendsClause);
}
if (staticProperties.length) {
- addInitializedPropertyStatements(statements, node, staticProperties, getLocalName(node, true));
+ addInitializedPropertyStatements(statements, staticProperties, getLocalName(node, true));
}
addClassElementDecorationStatements(statements, node, false);
addClassElementDecorationStatements(statements, node, true);
@@ -36984,7 +36864,7 @@ var ts;
function visitClassExpression(node) {
var staticProperties = getInitializedProperties(node, true);
var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause);
- var members = transformClassMembers(node, heritageClauses !== undefined);
+ var members = transformClassMembers(node, ts.some(heritageClauses, function (c) { return c.token === 84; }));
var classExpression = ts.setOriginalNode(ts.createClassExpression(undefined, node.name, undefined, heritageClauses, members, node), node);
if (staticProperties.length > 0) {
var expressions = [];
@@ -36995,7 +36875,7 @@ var ts;
}
ts.setEmitFlags(classExpression, 524288 | ts.getEmitFlags(classExpression));
expressions.push(ts.startOnNewLine(ts.createAssignment(temp, classExpression)));
- ts.addRange(expressions, generateInitializedPropertyExpressions(node, staticProperties, temp));
+ ts.addRange(expressions, generateInitializedPropertyExpressions(staticProperties, temp));
expressions.push(ts.startOnNewLine(temp));
return ts.inlineExpressions(expressions);
}
@@ -37012,13 +36892,13 @@ var ts;
}
function transformConstructor(node, hasExtendsClause) {
var hasInstancePropertyWithInitializer = ts.forEach(node.members, isInstanceInitializedProperty);
- var hasParameterPropertyAssignments = node.transformFlags & 131072;
+ var hasParameterPropertyAssignments = node.transformFlags & 524288;
var constructor = ts.getFirstConstructorWithBody(node);
if (!hasInstancePropertyWithInitializer && !hasParameterPropertyAssignments) {
return ts.visitEachChild(constructor, visitor, context);
}
var parameters = transformConstructorParameters(constructor);
- var body = transformConstructorBody(node, constructor, hasExtendsClause, parameters);
+ var body = transformConstructorBody(node, constructor, hasExtendsClause);
return ts.startOnNewLine(ts.setOriginalNode(ts.createConstructor(undefined, undefined, parameters, body, constructor || node), constructor));
}
function transformConstructorParameters(constructor) {
@@ -37026,7 +36906,7 @@ var ts;
? ts.visitNodes(constructor.parameters, visitor, ts.isParameter)
: [];
}
- function transformConstructorBody(node, constructor, hasExtendsClause, parameters) {
+ function transformConstructorBody(node, constructor, hasExtendsClause) {
var statements = [];
var indexOfFirstStatement = 0;
startLexicalEnvironment();
@@ -37039,7 +36919,7 @@ var ts;
statements.push(ts.createStatement(ts.createCall(ts.createSuper(), undefined, [ts.createSpread(ts.createIdentifier("arguments"))])));
}
var properties = getInitializedProperties(node, false);
- addInitializedPropertyStatements(statements, node, properties, ts.createThis());
+ addInitializedPropertyStatements(statements, properties, ts.createThis());
if (constructor) {
ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement));
}
@@ -37054,7 +36934,7 @@ var ts;
return index;
}
var statement = statements[index];
- if (statement.kind === 202 && ts.isSuperCall(statement.expression)) {
+ if (statement.kind === 203 && ts.isSuperCall(statement.expression)) {
result.push(ts.visitNode(statement, visitor, ts.isStatement));
return index + 1;
}
@@ -37088,24 +36968,24 @@ var ts;
return isInitializedProperty(member, false);
}
function isInitializedProperty(member, isStatic) {
- return member.kind === 145
+ return member.kind === 146
&& isStatic === ts.hasModifier(member, 32)
&& member.initializer !== undefined;
}
- function addInitializedPropertyStatements(statements, node, properties, receiver) {
+ function addInitializedPropertyStatements(statements, properties, receiver) {
for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) {
var property = properties_7[_i];
- var statement = ts.createStatement(transformInitializedProperty(node, property, receiver));
+ var statement = ts.createStatement(transformInitializedProperty(property, receiver));
ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));
ts.setCommentRange(statement, property);
statements.push(statement);
}
}
- function generateInitializedPropertyExpressions(node, properties, receiver) {
+ function generateInitializedPropertyExpressions(properties, receiver) {
var expressions = [];
for (var _i = 0, properties_8 = properties; _i < properties_8.length; _i++) {
var property = properties_8[_i];
- var expression = transformInitializedProperty(node, property, receiver);
+ var expression = transformInitializedProperty(property, receiver);
expression.startsOnNewLine = true;
ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property));
ts.setCommentRange(expression, property);
@@ -37113,7 +36993,7 @@ var ts;
}
return expressions;
}
- function transformInitializedProperty(node, property, receiver) {
+ function transformInitializedProperty(property, receiver) {
var propertyName = visitPropertyNameOfClassElement(property);
var initializer = ts.visitNode(property.initializer, visitor, ts.isExpression);
var memberAccess = ts.createMemberAccessForPropertyName(receiver, propertyName, propertyName);
@@ -37161,12 +37041,12 @@ var ts;
}
function getAllDecoratorsOfClassElement(node, member) {
switch (member.kind) {
- case 149:
case 150:
+ case 151:
return getAllDecoratorsOfAccessors(node, member);
- case 147:
+ case 148:
return getAllDecoratorsOfMethod(member);
- case 145:
+ case 146:
return getAllDecoratorsOfProperty(member);
default:
return undefined;
@@ -37244,7 +37124,7 @@ var ts;
var prefix = getClassMemberPrefix(node, member);
var memberName = getExpressionForPropertyName(member, true);
var descriptor = languageVersion > 0
- ? member.kind === 145
+ ? member.kind === 146
? ts.createVoidZero()
: ts.createNull()
: undefined;
@@ -37332,43 +37212,43 @@ var ts;
}
function shouldAddTypeMetadata(node) {
var kind = node.kind;
- return kind === 147
- || kind === 149
+ return kind === 148
|| kind === 150
- || kind === 145;
+ || kind === 151
+ || kind === 146;
}
function shouldAddReturnTypeMetadata(node) {
- return node.kind === 147;
+ return node.kind === 148;
}
function shouldAddParamTypesMetadata(node) {
var kind = node.kind;
- return kind === 221
- || kind === 192
- || kind === 147
- || kind === 149
- || kind === 150;
+ return kind === 222
+ || kind === 193
+ || kind === 148
+ || kind === 150
+ || kind === 151;
}
function serializeTypeOfNode(node) {
switch (node.kind) {
- case 145:
- case 142:
- case 149:
- return serializeTypeNode(node.type);
+ case 146:
+ case 143:
case 150:
+ return serializeTypeNode(node.type);
+ case 151:
return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node));
- case 221:
- case 192:
- case 147:
+ case 222:
+ case 193:
+ case 148:
return ts.createIdentifier("Function");
default:
return ts.createVoidZero();
}
}
function getRestParameterElementType(node) {
- if (node && node.kind === 160) {
+ if (node && node.kind === 161) {
return node.elementType;
}
- else if (node && node.kind === 155) {
+ else if (node && node.kind === 156) {
return ts.singleOrUndefined(node.typeArguments);
}
else {
@@ -37414,52 +37294,52 @@ var ts;
return ts.createIdentifier("Object");
}
switch (node.kind) {
- case 103:
+ case 104:
return ts.createVoidZero();
- case 164:
+ case 165:
return serializeTypeNode(node.type);
- case 156:
case 157:
+ case 158:
return ts.createIdentifier("Function");
- case 160:
case 161:
+ case 162:
return ts.createIdentifier("Array");
- case 154:
- case 120:
+ case 155:
+ case 121:
return ts.createIdentifier("Boolean");
- case 132:
+ case 133:
return ts.createIdentifier("String");
- case 166:
+ case 167:
switch (node.literal.kind) {
case 9:
return ts.createIdentifier("String");
case 8:
return ts.createIdentifier("Number");
- case 99:
- case 84:
+ case 100:
+ case 85:
return ts.createIdentifier("Boolean");
default:
ts.Debug.failBadSyntaxKind(node.literal);
break;
}
break;
- case 130:
+ case 131:
return ts.createIdentifier("Number");
- case 133:
+ case 134:
return languageVersion < 2
? getGlobalSymbolNameWithFallback()
: ts.createIdentifier("Symbol");
- case 155:
+ case 156:
return serializeTypeReferenceNode(node);
+ case 164:
case 163:
- case 162:
{
var unionOrIntersection = node;
var serializedUnion = void 0;
for (var _i = 0, _a = unionOrIntersection.types; _i < _a.length; _i++) {
var typeNode = _a[_i];
var serializedIndividual = serializeTypeNode(typeNode);
- if (serializedIndividual.kind !== 69) {
+ if (serializedIndividual.kind !== 70) {
serializedUnion = undefined;
break;
}
@@ -37476,10 +37356,10 @@ var ts;
return serializedUnion;
}
}
- case 158:
case 159:
- case 117:
- case 165:
+ case 160:
+ case 118:
+ case 166:
break;
default:
ts.Debug.failBadSyntaxKind(node);
@@ -37520,22 +37400,22 @@ var ts;
}
function serializeEntityNameAsExpression(node, useFallback) {
switch (node.kind) {
- case 69:
- var name_30 = ts.getMutableClone(node);
- name_30.flags &= ~8;
- name_30.original = undefined;
- name_30.parent = currentScope;
+ case 70:
+ var name_27 = ts.getMutableClone(node);
+ name_27.flags &= ~8;
+ name_27.original = undefined;
+ name_27.parent = currentScope;
if (useFallback) {
- return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name_30), ts.createLiteral("undefined")), name_30);
+ return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name_27), ts.createLiteral("undefined")), name_27);
}
- return name_30;
- case 139:
+ return name_27;
+ case 140:
return serializeQualifiedNameAsExpression(node, useFallback);
}
}
function serializeQualifiedNameAsExpression(node, useFallback) {
var left;
- if (node.left.kind === 69) {
+ if (node.left.kind === 70) {
left = serializeEntityNameAsExpression(node.left, useFallback);
}
else if (useFallback) {
@@ -37548,7 +37428,7 @@ var ts;
return ts.createPropertyAccess(left, node.right);
}
function getGlobalSymbolNameWithFallback() {
- return ts.createConditional(ts.createStrictEquality(ts.createTypeOf(ts.createIdentifier("Symbol")), ts.createLiteral("function")), ts.createToken(53), ts.createIdentifier("Symbol"), ts.createToken(54), ts.createIdentifier("Object"));
+ return ts.createConditional(ts.createStrictEquality(ts.createTypeOf(ts.createIdentifier("Symbol")), ts.createLiteral("function")), ts.createToken(54), ts.createIdentifier("Symbol"), ts.createToken(55), ts.createIdentifier("Object"));
}
function getExpressionForPropertyName(member, generateNameForComputedPropertyName) {
var name = member.name;
@@ -37580,9 +37460,9 @@ var ts;
}
}
function visitHeritageClause(node) {
- if (node.token === 83) {
+ if (node.token === 84) {
var types = ts.visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments, 0, 1);
- return ts.createHeritageClause(83, types, node);
+ return ts.createHeritageClause(84, types, node);
}
return undefined;
}
@@ -37593,6 +37473,12 @@ var ts;
function shouldEmitFunctionLikeDeclaration(node) {
return !ts.nodeIsMissing(node.body);
}
+ function visitConstructor(node) {
+ if (!shouldEmitFunctionLikeDeclaration(node)) {
+ return undefined;
+ }
+ return ts.visitEachChild(node, visitor, context);
+ }
function visitMethodDeclaration(node) {
if (!shouldEmitFunctionLikeDeclaration(node)) {
return undefined;
@@ -37643,36 +37529,33 @@ var ts;
if (ts.nodeIsMissing(node.body)) {
return ts.createOmittedExpression();
}
- var func = ts.createFunctionExpression(node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node);
+ var func = ts.createFunctionExpression(ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node);
ts.setOriginalNode(func, node);
return func;
}
function visitArrowFunction(node) {
- var func = ts.createArrowFunction(undefined, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, node.equalsGreaterThanToken, transformConciseBody(node), node);
+ var func = ts.createArrowFunction(ts.visitNodes(node.modifiers, visitor, ts.isModifier), undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, node.equalsGreaterThanToken, transformConciseBody(node), node);
ts.setOriginalNode(func, node);
return func;
}
function transformFunctionBody(node) {
- if (ts.isAsyncFunctionLike(node)) {
- return transformAsyncFunctionBody(node);
- }
return transformFunctionBodyWorker(node.body);
}
function transformFunctionBodyWorker(body, start) {
if (start === void 0) { start = 0; }
var savedCurrentScope = currentScope;
+ var savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName;
currentScope = body;
+ currentScopeFirstDeclarationsOfName = ts.createMap();
startLexicalEnvironment();
var statements = ts.visitNodes(body.statements, visitor, ts.isStatement, start);
var visited = ts.updateBlock(body, statements);
var declarations = endLexicalEnvironment();
currentScope = savedCurrentScope;
+ currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName;
return ts.mergeFunctionBodyLexicalEnvironment(visited, declarations);
}
function transformConciseBody(node) {
- if (ts.isAsyncFunctionLike(node)) {
- return transformAsyncFunctionBody(node);
- }
return transformConciseBodyWorker(node.body, false);
}
function transformConciseBodyWorker(body, forceBlockFunctionBody) {
@@ -37694,42 +37577,6 @@ var ts;
}
}
}
- function getPromiseConstructor(type) {
- var typeName = ts.getEntityNameFromTypeNode(type);
- if (typeName && ts.isEntityName(typeName)) {
- var serializationKind = resolver.getTypeReferenceSerializationKind(typeName);
- if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue
- || serializationKind === ts.TypeReferenceSerializationKind.Unknown) {
- return typeName;
- }
- }
- return undefined;
- }
- function transformAsyncFunctionBody(node) {
- var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(node.type) : undefined;
- var isArrowFunction = node.kind === 180;
- var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0;
- if (!isArrowFunction) {
- var statements = [];
- var statementOffset = ts.addPrologueDirectives(statements, node.body.statements, false, visitor);
- statements.push(ts.createReturn(ts.createAwaiterHelper(currentSourceFileExternalHelpersModuleName, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset))));
- var block = ts.createBlock(statements, node.body, true);
- if (languageVersion >= 2) {
- if (resolver.getNodeCheckFlags(node) & 4096) {
- enableSubstitutionForAsyncMethodsWithSuper();
- ts.setEmitFlags(block, 8);
- }
- else if (resolver.getNodeCheckFlags(node) & 2048) {
- enableSubstitutionForAsyncMethodsWithSuper();
- ts.setEmitFlags(block, 4);
- }
- }
- return block;
- }
- else {
- return ts.createAwaiterHelper(currentSourceFileExternalHelpersModuleName, hasLexicalArguments, promiseConstructor, transformConciseBodyWorker(node.body, true));
- }
- }
function visitParameter(node) {
if (ts.parameterIsThisKeyword(node)) {
return undefined;
@@ -37756,14 +37603,14 @@ var ts;
function transformInitializedVariable(node) {
var name = node.name;
if (ts.isBindingPattern(name)) {
- return ts.flattenVariableDestructuringToExpression(context, node, hoistVariableDeclaration, getNamespaceMemberNameWithSourceMapsAndWithoutComments, visitor);
+ return ts.flattenVariableDestructuringToExpression(node, hoistVariableDeclaration, getNamespaceMemberNameWithSourceMapsAndWithoutComments, visitor);
}
else {
return ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression), node);
}
}
- function visitAwaitExpression(node) {
- return ts.setOriginalNode(ts.createYield(undefined, ts.visitNode(node.expression, visitor, ts.isExpression), node), node);
+ function visitVariableDeclaration(node) {
+ return ts.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName), undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
}
function visitParenthesizedExpression(node) {
var innerExpression = ts.skipOuterExpressions(node.expression, ~2);
@@ -37781,6 +37628,12 @@ var ts;
var expression = ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression);
return ts.createPartiallyEmittedExpression(expression, node);
}
+ function visitCallExpression(node) {
+ return ts.updateCall(node, ts.visitNode(node.expression, visitor, ts.isExpression), undefined, ts.visitNodes(node.arguments, visitor, ts.isExpression));
+ }
+ function visitNewExpression(node) {
+ return ts.updateNew(node, ts.visitNode(node.expression, visitor, ts.isExpression), undefined, ts.visitNodes(node.arguments, visitor, ts.isExpression));
+ }
function shouldEmitEnumDeclaration(node) {
return !ts.isConst(node)
|| compilerOptions.preserveConstEnums
@@ -37812,7 +37665,7 @@ var ts;
var parameterName = getNamespaceParameterName(node);
var containerName = getNamespaceContainerName(node);
var exportName = getExportName(node);
- var enumStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, transformEnumBody(node, containerName)), undefined, [ts.createLogicalOr(exportName, ts.createAssignment(exportName, ts.createObjectLiteral()))]), node);
+ var enumStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, transformEnumBody(node, containerName)), undefined, [ts.createLogicalOr(exportName, ts.createAssignment(exportName, ts.createObjectLiteral()))]), node);
ts.setOriginalNode(enumStatement, node);
ts.setEmitFlags(enumStatement, emitFlags);
statements.push(enumStatement);
@@ -37855,7 +37708,7 @@ var ts;
}
function isES6ExportedDeclaration(node) {
return isExternalModuleExport(node)
- && moduleKind === ts.ModuleKind.ES6;
+ && moduleKind === ts.ModuleKind.ES2015;
}
function recordEmittedDeclarationInScope(node) {
var name = node.symbol && node.symbol.name;
@@ -37870,9 +37723,9 @@ var ts;
}
function isFirstEmittedDeclarationInScope(node) {
if (currentScopeFirstDeclarationsOfName) {
- var name_31 = node.symbol && node.symbol.name;
- if (name_31) {
- return currentScopeFirstDeclarationsOfName[name_31] === node;
+ var name_28 = node.symbol && node.symbol.name;
+ if (name_28) {
+ return currentScopeFirstDeclarationsOfName[name_28] === node;
}
}
return false;
@@ -37887,7 +37740,7 @@ var ts;
ts.createVariableDeclaration(getDeclarationName(node, false, true))
]);
ts.setOriginalNode(statement, node);
- if (node.kind === 224) {
+ if (node.kind === 225) {
ts.setSourceMapRange(statement.declarationList, node);
}
else {
@@ -37920,7 +37773,7 @@ var ts;
var localName = getLocalName(node);
moduleArg = ts.createAssignment(localName, moduleArg);
}
- var moduleStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, transformModuleBody(node, containerName)), undefined, [moduleArg]), node);
+ var moduleStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, transformModuleBody(node, containerName)), undefined, [moduleArg]), node);
ts.setOriginalNode(moduleStatement, node);
ts.setEmitFlags(moduleStatement, emitFlags);
statements.push(moduleStatement);
@@ -37938,7 +37791,7 @@ var ts;
var statementsLocation;
var blockLocation;
var body = node.body;
- if (body.kind === 226) {
+ if (body.kind === 227) {
ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement));
statementsLocation = body.statements;
blockLocation = body;
@@ -37961,17 +37814,67 @@ var ts;
currentNamespace = savedCurrentNamespace;
currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName;
var block = ts.createBlock(ts.createNodeArray(statements, statementsLocation), blockLocation, true);
- if (body.kind !== 226) {
+ if (body.kind !== 227) {
ts.setEmitFlags(block, ts.getEmitFlags(block) | 49152);
}
return block;
}
function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) {
- if (moduleDeclaration.body.kind === 225) {
+ if (moduleDeclaration.body.kind === 226) {
var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body);
return recursiveInnerModule || moduleDeclaration.body;
}
}
+ function visitImportDeclaration(node) {
+ if (!node.importClause) {
+ return node;
+ }
+ var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause, true);
+ return importClause
+ ? ts.updateImportDeclaration(node, undefined, undefined, importClause, node.moduleSpecifier)
+ : undefined;
+ }
+ function visitImportClause(node) {
+ var name = resolver.isReferencedAliasDeclaration(node) ? node.name : undefined;
+ var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings, true);
+ return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings) : undefined;
+ }
+ function visitNamedImportBindings(node) {
+ if (node.kind === 233) {
+ return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
+ }
+ else {
+ var elements = ts.visitNodes(node.elements, visitImportSpecifier, ts.isImportSpecifier);
+ return ts.some(elements) ? ts.updateNamedImports(node, elements) : undefined;
+ }
+ }
+ function visitImportSpecifier(node) {
+ return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
+ }
+ function visitExportAssignment(node) {
+ return resolver.isValueAliasDeclaration(node)
+ ? ts.visitEachChild(node, visitor, context)
+ : undefined;
+ }
+ function visitExportDeclaration(node) {
+ if (!node.exportClause) {
+ return resolver.moduleExportsSomeValue(node.moduleSpecifier) ? node : undefined;
+ }
+ if (!resolver.isValueAliasDeclaration(node)) {
+ return undefined;
+ }
+ var exportClause = ts.visitNode(node.exportClause, visitNamedExports, ts.isNamedExports, true);
+ return exportClause
+ ? ts.updateExportDeclaration(node, undefined, undefined, exportClause, node.moduleSpecifier)
+ : undefined;
+ }
+ function visitNamedExports(node) {
+ var elements = ts.visitNodes(node.elements, visitExportSpecifier, ts.isExportSpecifier);
+ return ts.some(elements) ? ts.updateNamedExports(node, elements) : undefined;
+ }
+ function visitExportSpecifier(node) {
+ return resolver.isValueAliasDeclaration(node) ? node : undefined;
+ }
function shouldEmitImportEqualsDeclaration(node) {
return resolver.isReferencedAliasDeclaration(node)
|| (!ts.isExternalModule(currentSourceFile)
@@ -37979,7 +37882,9 @@ var ts;
}
function visitImportEqualsDeclaration(node) {
if (ts.isExternalModuleImportEqualsDeclaration(node)) {
- return ts.visitEachChild(node, visitor, context);
+ return resolver.isReferencedAliasDeclaration(node)
+ ? ts.visitEachChild(node, visitor, context)
+ : undefined;
}
if (!shouldEmitImportEqualsDeclaration(node)) {
return undefined;
@@ -38063,7 +37968,7 @@ var ts;
}
function getDeclarationName(node, allowComments, allowSourceMaps, emitFlags) {
if (node.name) {
- var name_32 = ts.getMutableClone(node.name);
+ var name_29 = ts.getMutableClone(node.name);
emitFlags |= ts.getEmitFlags(node.name);
if (!allowSourceMaps) {
emitFlags |= 1536;
@@ -38072,9 +37977,9 @@ var ts;
emitFlags |= 49152;
}
if (emitFlags) {
- ts.setEmitFlags(name_32, emitFlags);
+ ts.setEmitFlags(name_29, emitFlags);
}
- return name_32;
+ return name_29;
}
else {
return ts.getGeneratedNameForNode(node);
@@ -38091,57 +37996,32 @@ var ts;
function enableSubstitutionForNonQualifiedEnumMembers() {
if ((enabledSubstitutions & 8) === 0) {
enabledSubstitutions |= 8;
- context.enableSubstitution(69);
- }
- }
- function enableSubstitutionForAsyncMethodsWithSuper() {
- if ((enabledSubstitutions & 4) === 0) {
- enabledSubstitutions |= 4;
- context.enableSubstitution(174);
- context.enableSubstitution(172);
- context.enableSubstitution(173);
- context.enableEmitNotification(221);
- context.enableEmitNotification(147);
- context.enableEmitNotification(149);
- context.enableEmitNotification(150);
- context.enableEmitNotification(148);
+ context.enableSubstitution(70);
}
}
function enableSubstitutionForClassAliases() {
if ((enabledSubstitutions & 1) === 0) {
enabledSubstitutions |= 1;
- context.enableSubstitution(69);
+ context.enableSubstitution(70);
classAliases = ts.createMap();
}
}
function enableSubstitutionForNamespaceExports() {
if ((enabledSubstitutions & 2) === 0) {
enabledSubstitutions |= 2;
- context.enableSubstitution(69);
+ context.enableSubstitution(70);
context.enableSubstitution(254);
- context.enableEmitNotification(225);
+ context.enableEmitNotification(226);
}
}
- function isSuperContainer(node) {
- var kind = node.kind;
- return kind === 221
- || kind === 148
- || kind === 147
- || kind === 149
- || kind === 150;
- }
function isTransformedModuleDeclaration(node) {
- return ts.getOriginalNode(node).kind === 225;
+ return ts.getOriginalNode(node).kind === 226;
}
function isTransformedEnumDeclaration(node) {
- return ts.getOriginalNode(node).kind === 224;
+ return ts.getOriginalNode(node).kind === 225;
}
function onEmitNode(emitContext, node, emitCallback) {
var savedApplicableSubstitutions = applicableSubstitutions;
- var savedCurrentSuperContainer = currentSuperContainer;
- if (enabledSubstitutions & 4 && isSuperContainer(node)) {
- currentSuperContainer = node;
- }
if (enabledSubstitutions & 2 && isTransformedModuleDeclaration(node)) {
applicableSubstitutions |= 2;
}
@@ -38150,7 +38030,6 @@ var ts;
}
previousOnEmitNode(emitContext, node, emitCallback);
applicableSubstitutions = savedApplicableSubstitutions;
- currentSuperContainer = savedCurrentSuperContainer;
}
function onSubstituteNode(emitContext, node) {
node = previousOnSubstituteNode(emitContext, node);
@@ -38164,31 +38043,26 @@ var ts;
}
function substituteShorthandPropertyAssignment(node) {
if (enabledSubstitutions & 2) {
- var name_33 = node.name;
- var exportedName = trySubstituteNamespaceExportedName(name_33);
+ var name_30 = node.name;
+ var exportedName = trySubstituteNamespaceExportedName(name_30);
if (exportedName) {
if (node.objectAssignmentInitializer) {
var initializer = ts.createAssignment(exportedName, node.objectAssignmentInitializer);
- return ts.createPropertyAssignment(name_33, initializer, node);
+ return ts.createPropertyAssignment(name_30, initializer, node);
}
- return ts.createPropertyAssignment(name_33, exportedName, node);
+ return ts.createPropertyAssignment(name_30, exportedName, node);
}
}
return node;
}
function substituteExpression(node) {
switch (node.kind) {
- case 69:
+ case 70:
return substituteExpressionIdentifier(node);
- case 172:
- return substitutePropertyAccessExpression(node);
case 173:
- return substituteElementAccessExpression(node);
+ return substitutePropertyAccessExpression(node);
case 174:
- if (enabledSubstitutions & 4) {
- return substituteCallExpression(node);
- }
- break;
+ return substituteElementAccessExpression(node);
}
return node;
}
@@ -38218,8 +38092,8 @@ var ts;
if (enabledSubstitutions & applicableSubstitutions && (ts.getEmitFlags(node) & 262144) === 0) {
var container = resolver.getReferencedExportContainer(node, false);
if (container) {
- var substitute = (applicableSubstitutions & 2 && container.kind === 225) ||
- (applicableSubstitutions & 8 && container.kind === 224);
+ var substitute = (applicableSubstitutions & 2 && container.kind === 226) ||
+ (applicableSubstitutions & 8 && container.kind === 225);
if (substitute) {
return ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node, node);
}
@@ -38227,37 +38101,10 @@ var ts;
}
return undefined;
}
- function substituteCallExpression(node) {
- var expression = node.expression;
- if (ts.isSuperProperty(expression)) {
- var flags = getSuperContainerAsyncMethodFlags();
- if (flags) {
- var argumentExpression = ts.isPropertyAccessExpression(expression)
- ? substitutePropertyAccessExpression(expression)
- : substituteElementAccessExpression(expression);
- return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [
- ts.createThis()
- ].concat(node.arguments));
- }
- }
- return node;
- }
function substitutePropertyAccessExpression(node) {
- if (enabledSubstitutions & 4 && node.expression.kind === 95) {
- var flags = getSuperContainerAsyncMethodFlags();
- if (flags) {
- return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), flags, node);
- }
- }
return substituteConstantValue(node);
}
function substituteElementAccessExpression(node) {
- if (enabledSubstitutions & 4 && node.expression.kind === 95) {
- var flags = getSuperContainerAsyncMethodFlags();
- if (flags) {
- return createSuperAccessInAsyncMethod(node.argumentExpression, flags, node);
- }
- }
return substituteConstantValue(node);
}
function substituteConstantValue(node) {
@@ -38285,18 +38132,6 @@ var ts;
? resolver.getConstantValue(node)
: undefined;
}
- function createSuperAccessInAsyncMethod(argumentExpression, flags, location) {
- if (flags & 4096) {
- return ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), "value", location);
- }
- else {
- return ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression], location);
- }
- }
- function getSuperContainerAsyncMethodFlags() {
- return currentSuperContainer !== undefined
- && resolver.getNodeCheckFlags(currentSuperContainer) & (2048 | 4096);
- }
}
ts.transformTypeScript = transformTypeScript;
})(ts || (ts = {}));
@@ -38329,9 +38164,9 @@ var ts;
}
function visitorWorker(node) {
switch (node.kind) {
- case 241:
- return visitJsxElement(node, false);
case 242:
+ return visitJsxElement(node, false);
+ case 243:
return visitJsxSelfClosingElement(node, false);
case 248:
return visitJsxExpression(node);
@@ -38342,13 +38177,13 @@ var ts;
}
function transformJsxChildToExpression(node) {
switch (node.kind) {
- case 244:
+ case 10:
return visitJsxText(node);
case 248:
return visitJsxExpression(node);
- case 241:
- return visitJsxElement(node, true);
case 242:
+ return visitJsxElement(node, true);
+ case 243:
return visitJsxSelfClosingElement(node, true);
default:
ts.Debug.failBadSyntaxKind(node);
@@ -38465,16 +38300,16 @@ var ts;
return decoded === text ? undefined : decoded;
}
function getTagName(node) {
- if (node.kind === 241) {
+ if (node.kind === 242) {
return getTagName(node.openingElement);
}
else {
- var name_34 = node.tagName;
- if (ts.isIdentifier(name_34) && ts.isIntrinsicJsxName(name_34.text)) {
- return ts.createLiteral(name_34.text);
+ var name_31 = node.tagName;
+ if (ts.isIdentifier(name_31) && ts.isIntrinsicJsxName(name_31.text)) {
+ return ts.createLiteral(name_31.text);
}
else {
- return ts.createExpressionFromEntityName(name_34);
+ return ts.createExpressionFromEntityName(name_31);
}
}
}
@@ -38752,13 +38587,30 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
- function transformES7(context) {
- var hoistVariableDeclaration = context.hoistVariableDeclaration;
+ function transformES2017(context) {
+ var ES2017SubstitutionFlags;
+ (function (ES2017SubstitutionFlags) {
+ ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper";
+ })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {}));
+ var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment;
+ var resolver = context.getEmitResolver();
+ var compilerOptions = context.getCompilerOptions();
+ var languageVersion = ts.getEmitScriptTarget(compilerOptions);
+ var currentSourceFileExternalHelpersModuleName;
+ var enabledSubstitutions;
+ var applicableSubstitutions;
+ var currentSuperContainer;
+ var previousOnEmitNode = context.onEmitNode;
+ var previousOnSubstituteNode = context.onSubstituteNode;
+ context.onEmitNode = onEmitNode;
+ context.onSubstituteNode = onSubstituteNode;
+ var currentScope;
return transformSourceFile;
function transformSourceFile(node) {
if (ts.isDeclarationFile(node)) {
return node;
}
+ currentSourceFileExternalHelpersModuleName = node.externalHelpersModuleName;
return ts.visitEachChild(node, visitor, context);
}
function visitor(node) {
@@ -38768,13 +38620,265 @@ var ts;
else if (node.transformFlags & 32) {
return ts.visitEachChild(node, visitor, context);
}
+ return node;
+ }
+ function visitorWorker(node) {
+ switch (node.kind) {
+ case 119:
+ return undefined;
+ case 185:
+ return visitAwaitExpression(node);
+ case 148:
+ return visitMethodDeclaration(node);
+ case 221:
+ return visitFunctionDeclaration(node);
+ case 180:
+ return visitFunctionExpression(node);
+ case 181:
+ return visitArrowFunction(node);
+ default:
+ ts.Debug.failBadSyntaxKind(node);
+ return node;
+ }
+ }
+ function visitAwaitExpression(node) {
+ return ts.setOriginalNode(ts.createYield(undefined, ts.visitNode(node.expression, visitor, ts.isExpression), node), node);
+ }
+ function visitMethodDeclaration(node) {
+ if (!ts.isAsyncFunctionLike(node)) {
+ return node;
+ }
+ var method = ts.createMethod(undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node);
+ ts.setCommentRange(method, node);
+ ts.setSourceMapRange(method, ts.moveRangePastDecorators(node));
+ ts.setOriginalNode(method, node);
+ return method;
+ }
+ function visitFunctionDeclaration(node) {
+ if (!ts.isAsyncFunctionLike(node)) {
+ return node;
+ }
+ var func = ts.createFunctionDeclaration(undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node);
+ ts.setOriginalNode(func, node);
+ return func;
+ }
+ function visitFunctionExpression(node) {
+ if (!ts.isAsyncFunctionLike(node)) {
+ return node;
+ }
+ if (ts.nodeIsMissing(node.body)) {
+ return ts.createOmittedExpression();
+ }
+ var func = ts.createFunctionExpression(undefined, node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node);
+ ts.setOriginalNode(func, node);
+ return func;
+ }
+ function visitArrowFunction(node) {
+ if (!ts.isAsyncFunctionLike(node)) {
+ return node;
+ }
+ var func = ts.createArrowFunction(ts.visitNodes(node.modifiers, visitor, ts.isModifier), undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, node.equalsGreaterThanToken, transformConciseBody(node), node);
+ ts.setOriginalNode(func, node);
+ return func;
+ }
+ function transformFunctionBody(node) {
+ return transformAsyncFunctionBody(node);
+ }
+ function transformConciseBody(node) {
+ return transformAsyncFunctionBody(node);
+ }
+ function transformFunctionBodyWorker(body, start) {
+ if (start === void 0) { start = 0; }
+ var savedCurrentScope = currentScope;
+ currentScope = body;
+ startLexicalEnvironment();
+ var statements = ts.visitNodes(body.statements, visitor, ts.isStatement, start);
+ var visited = ts.updateBlock(body, statements);
+ var declarations = endLexicalEnvironment();
+ currentScope = savedCurrentScope;
+ return ts.mergeFunctionBodyLexicalEnvironment(visited, declarations);
+ }
+ function transformAsyncFunctionBody(node) {
+ var nodeType = node.original ? node.original.type : node.type;
+ var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : undefined;
+ var isArrowFunction = node.kind === 181;
+ var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0;
+ if (!isArrowFunction) {
+ var statements = [];
+ var statementOffset = ts.addPrologueDirectives(statements, node.body.statements, false, visitor);
+ statements.push(ts.createReturn(ts.createAwaiterHelper(currentSourceFileExternalHelpersModuleName, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset))));
+ var block = ts.createBlock(statements, node.body, true);
+ if (languageVersion >= 2) {
+ if (resolver.getNodeCheckFlags(node) & 4096) {
+ enableSubstitutionForAsyncMethodsWithSuper();
+ ts.setEmitFlags(block, 8);
+ }
+ else if (resolver.getNodeCheckFlags(node) & 2048) {
+ enableSubstitutionForAsyncMethodsWithSuper();
+ ts.setEmitFlags(block, 4);
+ }
+ }
+ return block;
+ }
+ else {
+ return ts.createAwaiterHelper(currentSourceFileExternalHelpersModuleName, hasLexicalArguments, promiseConstructor, transformConciseBodyWorker(node.body, true));
+ }
+ }
+ function transformConciseBodyWorker(body, forceBlockFunctionBody) {
+ if (ts.isBlock(body)) {
+ return transformFunctionBodyWorker(body);
+ }
+ else {
+ startLexicalEnvironment();
+ var visited = ts.visitNode(body, visitor, ts.isConciseBody);
+ var declarations = endLexicalEnvironment();
+ var merged = ts.mergeFunctionBodyLexicalEnvironment(visited, declarations);
+ if (forceBlockFunctionBody && !ts.isBlock(merged)) {
+ return ts.createBlock([
+ ts.createReturn(merged)
+ ]);
+ }
+ else {
+ return merged;
+ }
+ }
+ }
+ function getPromiseConstructor(type) {
+ var typeName = ts.getEntityNameFromTypeNode(type);
+ if (typeName && ts.isEntityName(typeName)) {
+ var serializationKind = resolver.getTypeReferenceSerializationKind(typeName);
+ if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue
+ || serializationKind === ts.TypeReferenceSerializationKind.Unknown) {
+ return typeName;
+ }
+ }
+ return undefined;
+ }
+ function enableSubstitutionForAsyncMethodsWithSuper() {
+ if ((enabledSubstitutions & 1) === 0) {
+ enabledSubstitutions |= 1;
+ context.enableSubstitution(175);
+ context.enableSubstitution(173);
+ context.enableSubstitution(174);
+ context.enableEmitNotification(222);
+ context.enableEmitNotification(148);
+ context.enableEmitNotification(150);
+ context.enableEmitNotification(151);
+ context.enableEmitNotification(149);
+ }
+ }
+ function substituteExpression(node) {
+ switch (node.kind) {
+ case 173:
+ return substitutePropertyAccessExpression(node);
+ case 174:
+ return substituteElementAccessExpression(node);
+ case 175:
+ if (enabledSubstitutions & 1) {
+ return substituteCallExpression(node);
+ }
+ break;
+ }
+ return node;
+ }
+ function substitutePropertyAccessExpression(node) {
+ if (enabledSubstitutions & 1 && node.expression.kind === 96) {
+ var flags = getSuperContainerAsyncMethodFlags();
+ if (flags) {
+ return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), flags, node);
+ }
+ }
+ return node;
+ }
+ function substituteElementAccessExpression(node) {
+ if (enabledSubstitutions & 1 && node.expression.kind === 96) {
+ var flags = getSuperContainerAsyncMethodFlags();
+ if (flags) {
+ return createSuperAccessInAsyncMethod(node.argumentExpression, flags, node);
+ }
+ }
+ return node;
+ }
+ function substituteCallExpression(node) {
+ var expression = node.expression;
+ if (ts.isSuperProperty(expression)) {
+ var flags = getSuperContainerAsyncMethodFlags();
+ if (flags) {
+ var argumentExpression = ts.isPropertyAccessExpression(expression)
+ ? substitutePropertyAccessExpression(expression)
+ : substituteElementAccessExpression(expression);
+ return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [
+ ts.createThis()
+ ].concat(node.arguments));
+ }
+ }
+ return node;
+ }
+ function isSuperContainer(node) {
+ var kind = node.kind;
+ return kind === 222
+ || kind === 149
+ || kind === 148
+ || kind === 150
+ || kind === 151;
+ }
+ function onEmitNode(emitContext, node, emitCallback) {
+ var savedApplicableSubstitutions = applicableSubstitutions;
+ var savedCurrentSuperContainer = currentSuperContainer;
+ if (enabledSubstitutions & 1 && isSuperContainer(node)) {
+ currentSuperContainer = node;
+ }
+ previousOnEmitNode(emitContext, node, emitCallback);
+ applicableSubstitutions = savedApplicableSubstitutions;
+ currentSuperContainer = savedCurrentSuperContainer;
+ }
+ function onSubstituteNode(emitContext, node) {
+ node = previousOnSubstituteNode(emitContext, node);
+ if (emitContext === 1) {
+ return substituteExpression(node);
+ }
+ return node;
+ }
+ function createSuperAccessInAsyncMethod(argumentExpression, flags, location) {
+ if (flags & 4096) {
+ return ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), "value", location);
+ }
+ else {
+ return ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression], location);
+ }
+ }
+ function getSuperContainerAsyncMethodFlags() {
+ return currentSuperContainer !== undefined
+ && resolver.getNodeCheckFlags(currentSuperContainer) & (2048 | 4096);
+ }
+ }
+ ts.transformES2017 = transformES2017;
+})(ts || (ts = {}));
+var ts;
+(function (ts) {
+ function transformES2016(context) {
+ var hoistVariableDeclaration = context.hoistVariableDeclaration;
+ return transformSourceFile;
+ function transformSourceFile(node) {
+ if (ts.isDeclarationFile(node)) {
+ return node;
+ }
+ return ts.visitEachChild(node, visitor, context);
+ }
+ function visitor(node) {
+ if (node.transformFlags & 64) {
+ return visitorWorker(node);
+ }
+ else if (node.transformFlags & 128) {
+ return ts.visitEachChild(node, visitor, context);
+ }
else {
return node;
}
}
function visitorWorker(node) {
switch (node.kind) {
- case 187:
+ case 188:
return visitBinaryExpression(node);
default:
ts.Debug.failBadSyntaxKind(node);
@@ -38784,7 +38888,7 @@ var ts;
function visitBinaryExpression(node) {
var left = ts.visitNode(node.left, visitor, ts.isExpression);
var right = ts.visitNode(node.right, visitor, ts.isExpression);
- if (node.operatorToken.kind === 60) {
+ if (node.operatorToken.kind === 61) {
var target = void 0;
var value = void 0;
if (ts.isElementAccessExpression(left)) {
@@ -38804,7 +38908,7 @@ var ts;
}
return ts.createAssignment(target, ts.createMathPow(value, right, node), node);
}
- else if (node.operatorToken.kind === 38) {
+ else if (node.operatorToken.kind === 39) {
return ts.createMathPow(left, right, node);
}
else {
@@ -38813,11 +38917,33 @@ var ts;
}
}
}
- ts.transformES7 = transformES7;
+ ts.transformES2016 = transformES2016;
})(ts || (ts = {}));
var ts;
(function (ts) {
- function transformES6(context) {
+ var ES2015SubstitutionFlags;
+ (function (ES2015SubstitutionFlags) {
+ ES2015SubstitutionFlags[ES2015SubstitutionFlags["CapturedThis"] = 1] = "CapturedThis";
+ ES2015SubstitutionFlags[ES2015SubstitutionFlags["BlockScopedBindings"] = 2] = "BlockScopedBindings";
+ })(ES2015SubstitutionFlags || (ES2015SubstitutionFlags = {}));
+ var CopyDirection;
+ (function (CopyDirection) {
+ CopyDirection[CopyDirection["ToOriginal"] = 0] = "ToOriginal";
+ CopyDirection[CopyDirection["ToOutParameter"] = 1] = "ToOutParameter";
+ })(CopyDirection || (CopyDirection = {}));
+ var Jump;
+ (function (Jump) {
+ Jump[Jump["Break"] = 2] = "Break";
+ Jump[Jump["Continue"] = 4] = "Continue";
+ Jump[Jump["Return"] = 8] = "Return";
+ })(Jump || (Jump = {}));
+ var SuperCaptureResult;
+ (function (SuperCaptureResult) {
+ SuperCaptureResult[SuperCaptureResult["NoReplacement"] = 0] = "NoReplacement";
+ SuperCaptureResult[SuperCaptureResult["ReplaceSuperCapture"] = 1] = "ReplaceSuperCapture";
+ SuperCaptureResult[SuperCaptureResult["ReplaceWithReturn"] = 2] = "ReplaceWithReturn";
+ })(SuperCaptureResult || (SuperCaptureResult = {}));
+ function transformES2015(context) {
var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration;
var resolver = context.getEmitResolver();
var previousOnSubstituteNode = context.onSubstituteNode;
@@ -38880,15 +39006,15 @@ var ts;
return visited;
}
function shouldCheckNode(node) {
- return (node.transformFlags & 64) !== 0 ||
- node.kind === 214 ||
+ return (node.transformFlags & 256) !== 0 ||
+ node.kind === 215 ||
(ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node));
}
function visitorWorker(node) {
if (shouldCheckNode(node)) {
return visitJavaScript(node);
}
- else if (node.transformFlags & 128) {
+ else if (node.transformFlags & 512) {
return ts.visitEachChild(node, visitor, context);
}
else {
@@ -38907,18 +39033,18 @@ var ts;
}
function visitNodesInConvertedLoop(node) {
switch (node.kind) {
- case 211:
+ case 212:
return visitReturnStatement(node);
- case 200:
+ case 201:
return visitVariableStatement(node);
- case 213:
+ case 214:
return visitSwitchStatement(node);
+ case 211:
case 210:
- case 209:
return visitBreakOrContinueStatement(node);
- case 97:
+ case 98:
return visitThisKeyword(node);
- case 69:
+ case 70:
return visitIdentifier(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -38926,74 +39052,74 @@ var ts;
}
function visitJavaScript(node) {
switch (node.kind) {
- case 82:
+ case 83:
return node;
- case 221:
+ case 222:
return visitClassDeclaration(node);
- case 192:
+ case 193:
return visitClassExpression(node);
- case 142:
+ case 143:
return visitParameter(node);
- case 220:
+ case 221:
return visitFunctionDeclaration(node);
- case 180:
+ case 181:
return visitArrowFunction(node);
- case 179:
+ case 180:
return visitFunctionExpression(node);
- case 218:
- return visitVariableDeclaration(node);
- case 69:
- return visitIdentifier(node);
case 219:
+ return visitVariableDeclaration(node);
+ case 70:
+ return visitIdentifier(node);
+ case 220:
return visitVariableDeclarationList(node);
- case 214:
+ case 215:
return visitLabeledStatement(node);
- case 204:
- return visitDoStatement(node);
case 205:
- return visitWhileStatement(node);
+ return visitDoStatement(node);
case 206:
- return visitForStatement(node);
+ return visitWhileStatement(node);
case 207:
- return visitForInStatement(node);
+ return visitForStatement(node);
case 208:
+ return visitForInStatement(node);
+ case 209:
return visitForOfStatement(node);
- case 202:
+ case 203:
return visitExpressionStatement(node);
- case 171:
+ case 172:
return visitObjectLiteralExpression(node);
case 254:
return visitShorthandPropertyAssignment(node);
- case 170:
+ case 171:
return visitArrayLiteralExpression(node);
- case 174:
- return visitCallExpression(node);
case 175:
+ return visitCallExpression(node);
+ case 176:
return visitNewExpression(node);
- case 178:
+ case 179:
return visitParenthesizedExpression(node, true);
- case 187:
+ case 188:
return visitBinaryExpression(node, true);
- case 11:
case 12:
case 13:
case 14:
+ case 15:
return visitTemplateLiteral(node);
- case 176:
+ case 177:
return visitTaggedTemplateExpression(node);
- case 189:
+ case 190:
return visitTemplateExpression(node);
- case 190:
+ case 191:
return visitYieldExpression(node);
- case 95:
- return visitSuperKeyword(node);
- case 190:
+ case 96:
+ return visitSuperKeyword();
+ case 191:
return ts.visitEachChild(node, visitor, context);
- case 147:
+ case 148:
return visitMethodDeclaration(node);
case 256:
return visitSourceFileNode(node);
- case 200:
+ case 201:
return visitVariableStatement(node);
default:
ts.Debug.failBadSyntaxKind(node);
@@ -39008,7 +39134,7 @@ var ts;
}
if (ts.isFunctionLike(currentNode)) {
enclosingFunction = currentNode;
- if (currentNode.kind !== 180) {
+ if (currentNode.kind !== 181) {
enclosingNonArrowFunction = currentNode;
if (!(ts.getEmitFlags(currentNode) & 2097152)) {
enclosingNonAsyncFunctionBody = currentNode;
@@ -39016,14 +39142,14 @@ var ts;
}
}
switch (currentNode.kind) {
- case 200:
+ case 201:
enclosingVariableStatement = currentNode;
break;
+ case 220:
case 219:
- case 218:
- case 169:
- case 167:
+ case 170:
case 168:
+ case 169:
break;
default:
enclosingVariableStatement = undefined;
@@ -39051,7 +39177,7 @@ var ts;
}
function visitThisKeyword(node) {
ts.Debug.assert(convertedLoopState !== undefined);
- if (enclosingFunction && enclosingFunction.kind === 180) {
+ if (enclosingFunction && enclosingFunction.kind === 181) {
convertedLoopState.containsLexicalThis = true;
return node;
}
@@ -39071,13 +39197,13 @@ var ts;
}
function visitBreakOrContinueStatement(node) {
if (convertedLoopState) {
- var jump = node.kind === 210 ? 2 : 4;
+ var jump = node.kind === 211 ? 2 : 4;
var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) ||
(!node.label && (convertedLoopState.allowedNonLabeledJumps & jump));
if (!canUseBreakOrContinue) {
var labelMarker = void 0;
if (!node.label) {
- if (node.kind === 210) {
+ if (node.kind === 211) {
convertedLoopState.nonLocalJumps |= 2;
labelMarker = "break";
}
@@ -39087,7 +39213,7 @@ var ts;
}
}
else {
- if (node.kind === 210) {
+ if (node.kind === 211) {
labelMarker = "break-" + node.label.text;
setLabeledJump(convertedLoopState, true, node.label.text, labelMarker);
}
@@ -39106,10 +39232,10 @@ var ts;
expr = copyExpr;
}
else {
- expr = ts.createBinary(expr, 24, copyExpr);
+ expr = ts.createBinary(expr, 25, copyExpr);
}
}
- returnExpression = ts.createBinary(expr, 24, returnExpression);
+ returnExpression = ts.createBinary(expr, 25, returnExpression);
}
return ts.createReturn(returnExpression);
}
@@ -39136,7 +39262,7 @@ var ts;
return statement;
}
function isExportModifier(node) {
- return node.kind === 82;
+ return node.kind === 83;
}
function visitClassExpression(node) {
return transformClassLikeDeclarationToExpression(node);
@@ -39146,7 +39272,7 @@ var ts;
enableSubstitutionsForBlockScopedBindings();
}
var extendsClauseElement = ts.getClassExtendsHeritageClauseElement(node);
- var classFunction = ts.createFunctionExpression(undefined, undefined, undefined, extendsClauseElement ? [ts.createParameter("_super")] : [], undefined, transformClassBody(node, extendsClauseElement));
+ var classFunction = ts.createFunctionExpression(undefined, undefined, undefined, undefined, extendsClauseElement ? [ts.createParameter("_super")] : [], undefined, transformClassBody(node, extendsClauseElement));
if (ts.getEmitFlags(node) & 524288) {
ts.setEmitFlags(classFunction, 524288);
}
@@ -39166,7 +39292,7 @@ var ts;
addExtendsHelperIfNeeded(statements, node, extendsClauseElement);
addConstructor(statements, node, extendsClauseElement);
addClassMembers(statements, node);
- var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 16);
+ var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 17);
var localName = getLocalName(node);
var outer = ts.createPartiallyEmittedExpression(localName);
outer.end = closingBraceLocation.end;
@@ -39236,17 +39362,17 @@ var ts;
return block;
}
function isSufficientlyCoveredByReturnStatements(statement) {
- if (statement.kind === 211) {
+ if (statement.kind === 212) {
return true;
}
- else if (statement.kind === 203) {
+ else if (statement.kind === 204) {
var ifStatement = statement;
if (ifStatement.elseStatement) {
return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) &&
isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement);
}
}
- else if (statement.kind === 199) {
+ else if (statement.kind === 200) {
var lastStatement = ts.lastOrUndefined(statement.statements);
if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) {
return true;
@@ -39275,7 +39401,7 @@ var ts;
var ctorStatements = ctor.body.statements;
if (statementOffset < ctorStatements.length) {
firstStatement = ctorStatements[statementOffset];
- if (firstStatement.kind === 202 && ts.isSuperCall(firstStatement.expression)) {
+ if (firstStatement.kind === 203 && ts.isSuperCall(firstStatement.expression)) {
var superCall = firstStatement.expression;
superCallExpression = ts.setOriginalNode(saveStateAndInvoke(superCall, visitImmediateSuperCallInBody), superCall);
}
@@ -39311,7 +39437,7 @@ var ts;
}
}
function shouldAddDefaultValueAssignments(node) {
- return (node.transformFlags & 65536) !== 0;
+ return (node.transformFlags & 262144) !== 0;
}
function addDefaultValueAssignmentsIfNeeded(statements, node) {
if (!shouldAddDefaultValueAssignments(node)) {
@@ -39319,22 +39445,22 @@ var ts;
}
for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
var parameter = _a[_i];
- var name_35 = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken;
+ var name_32 = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken;
if (dotDotDotToken) {
continue;
}
- if (ts.isBindingPattern(name_35)) {
- addDefaultValueAssignmentForBindingPattern(statements, parameter, name_35, initializer);
+ if (ts.isBindingPattern(name_32)) {
+ addDefaultValueAssignmentForBindingPattern(statements, parameter, name_32, initializer);
}
else if (initializer) {
- addDefaultValueAssignmentForInitializer(statements, parameter, name_35, initializer);
+ addDefaultValueAssignmentForInitializer(statements, parameter, name_32, initializer);
}
}
}
function addDefaultValueAssignmentForBindingPattern(statements, parameter, name, initializer) {
var temp = ts.getGeneratedNameForNode(parameter);
if (name.elements.length > 0) {
- statements.push(ts.setEmitFlags(ts.createVariableStatement(undefined, ts.createVariableDeclarationList(ts.flattenParameterDestructuring(context, parameter, temp, visitor))), 8388608));
+ statements.push(ts.setEmitFlags(ts.createVariableStatement(undefined, ts.createVariableDeclarationList(ts.flattenParameterDestructuring(parameter, temp, visitor))), 8388608));
}
else if (initializer) {
statements.push(ts.setEmitFlags(ts.createStatement(ts.createAssignment(temp, ts.visitNode(initializer, visitor, ts.isExpression))), 8388608));
@@ -39350,7 +39476,7 @@ var ts;
statements.push(statement);
}
function shouldAddRestParameter(node, inConstructorWithSynthesizedSuper) {
- return node && node.dotDotDotToken && node.name.kind === 69 && !inConstructorWithSynthesizedSuper;
+ return node && node.dotDotDotToken && node.name.kind === 70 && !inConstructorWithSynthesizedSuper;
}
function addRestParameterIfNeeded(statements, node, inConstructorWithSynthesizedSuper) {
var parameter = ts.lastOrUndefined(node.parameters);
@@ -39375,7 +39501,7 @@ var ts;
statements.push(forStatement);
}
function addCaptureThisForNodeIfNeeded(statements, node) {
- if (node.transformFlags & 16384 && node.kind !== 180) {
+ if (node.transformFlags & 65536 && node.kind !== 181) {
captureThisForNode(statements, node, ts.createThis());
}
}
@@ -39392,20 +39518,20 @@ var ts;
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
switch (member.kind) {
- case 198:
+ case 199:
statements.push(transformSemicolonClassElementToStatement(member));
break;
- case 147:
+ case 148:
statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member));
break;
- case 149:
case 150:
+ case 151:
var accessors = ts.getAllAccessorDeclarations(node.members, member);
if (member === accessors.firstAccessor) {
statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors));
}
break;
- case 148:
+ case 149:
break;
default:
ts.Debug.failBadSyntaxKind(node);
@@ -39445,6 +39571,7 @@ var ts;
if (getAccessor) {
var getterFunction = transformFunctionLikeToExpression(getAccessor, undefined, undefined);
ts.setSourceMapRange(getterFunction, ts.getSourceMapRange(getAccessor));
+ ts.setEmitFlags(getterFunction, 16384);
var getter = ts.createPropertyAssignment("get", getterFunction);
ts.setCommentRange(getter, ts.getCommentRange(getAccessor));
properties.push(getter);
@@ -39452,6 +39579,7 @@ var ts;
if (setAccessor) {
var setterFunction = transformFunctionLikeToExpression(setAccessor, undefined, undefined);
ts.setSourceMapRange(setterFunction, ts.getSourceMapRange(setAccessor));
+ ts.setEmitFlags(setterFunction, 16384);
var setter = ts.createPropertyAssignment("set", setterFunction);
ts.setCommentRange(setter, ts.getCommentRange(setAccessor));
properties.push(setter);
@@ -39468,7 +39596,7 @@ var ts;
return call;
}
function visitArrowFunction(node) {
- if (node.transformFlags & 8192) {
+ if (node.transformFlags & 32768) {
enableSubstitutionsForCapturedThis();
}
var func = transformFunctionLikeToExpression(node, node, undefined);
@@ -39483,10 +39611,10 @@ var ts;
}
function transformFunctionLikeToExpression(node, location, name) {
var savedContainingNonArrowFunction = enclosingNonArrowFunction;
- if (node.kind !== 180) {
+ if (node.kind !== 181) {
enclosingNonArrowFunction = node;
}
- var expression = ts.setOriginalNode(ts.createFunctionExpression(node.asteriskToken, name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, saveStateAndInvoke(node, transformFunctionBody), location), node);
+ var expression = ts.setOriginalNode(ts.createFunctionExpression(undefined, node.asteriskToken, name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, saveStateAndInvoke(node, transformFunctionBody), location), node);
enclosingNonArrowFunction = savedContainingNonArrowFunction;
return expression;
}
@@ -39516,7 +39644,7 @@ var ts;
}
}
else {
- ts.Debug.assert(node.kind === 180);
+ ts.Debug.assert(node.kind === 181);
statementsLocation = ts.moveRangeEnd(body, -1);
var equalsGreaterThanToken = node.equalsGreaterThanToken;
if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) {
@@ -39543,16 +39671,16 @@ var ts;
ts.setEmitFlags(block, 32);
}
if (closeBraceLocation) {
- ts.setTokenSourceMapRange(block, 16, closeBraceLocation);
+ ts.setTokenSourceMapRange(block, 17, closeBraceLocation);
}
ts.setOriginalNode(block, node.body);
return block;
}
function visitExpressionStatement(node) {
switch (node.expression.kind) {
- case 178:
+ case 179:
return ts.updateStatement(node, visitParenthesizedExpression(node.expression, false));
- case 187:
+ case 188:
return ts.updateStatement(node, visitBinaryExpression(node.expression, false));
}
return ts.visitEachChild(node, visitor, context);
@@ -39560,9 +39688,9 @@ var ts;
function visitParenthesizedExpression(node, needsDestructuringValue) {
if (needsDestructuringValue) {
switch (node.expression.kind) {
- case 178:
+ case 179:
return ts.createParen(visitParenthesizedExpression(node.expression, true), node);
- case 187:
+ case 188:
return ts.createParen(visitBinaryExpression(node.expression, true), node);
}
}
@@ -39581,16 +39709,16 @@ var ts;
if (decl.initializer) {
var assignment = void 0;
if (ts.isBindingPattern(decl.name)) {
- assignment = ts.flattenVariableDestructuringToExpression(context, decl, hoistVariableDeclaration, undefined, visitor);
+ assignment = ts.flattenVariableDestructuringToExpression(decl, hoistVariableDeclaration, undefined, visitor);
}
else {
- assignment = ts.createBinary(decl.name, 56, ts.visitNode(decl.initializer, visitor, ts.isExpression));
+ assignment = ts.createBinary(decl.name, 57, ts.visitNode(decl.initializer, visitor, ts.isExpression));
}
(assignments || (assignments = [])).push(assignment);
}
}
if (assignments) {
- return ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 24, acc); }), node);
+ return ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 25, acc); }), node);
}
else {
return undefined;
@@ -39608,7 +39736,7 @@ var ts;
var declarationList = ts.createVariableDeclarationList(declarations, node);
ts.setOriginalNode(declarationList, node);
ts.setCommentRange(declarationList, node);
- if (node.transformFlags & 2097152
+ if (node.transformFlags & 8388608
&& (ts.isBindingPattern(node.declarations[0].name)
|| ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) {
var firstDeclaration = ts.firstOrUndefined(declarations);
@@ -39627,8 +39755,8 @@ var ts;
&& ts.isBlock(enclosingBlockScopeContainer)
&& ts.isIterationStatement(enclosingBlockScopeContainerParent, false));
var emitExplicitInitializer = !emittedAsTopLevel
- && enclosingBlockScopeContainer.kind !== 207
&& enclosingBlockScopeContainer.kind !== 208
+ && enclosingBlockScopeContainer.kind !== 209
&& (!resolver.isDeclarationWithCollidingName(node)
|| (isDeclaredInLoop
&& !isCapturedInFunction
@@ -39651,7 +39779,7 @@ var ts;
if (ts.isBindingPattern(node.name)) {
var recordTempVariablesInLine = !enclosingVariableStatement
|| !ts.hasModifier(enclosingVariableStatement, 1);
- return ts.flattenVariableDestructuring(context, node, undefined, visitor, recordTempVariablesInLine ? undefined : hoistVariableDeclaration);
+ return ts.flattenVariableDestructuring(node, undefined, visitor, recordTempVariablesInLine ? undefined : hoistVariableDeclaration);
}
return ts.visitEachChild(node, visitor, context);
}
@@ -39694,7 +39822,7 @@ var ts;
var initializer = node.initializer;
var statements = [];
var counter = ts.createLoopVariable();
- var rhsReference = expression.kind === 69
+ var rhsReference = expression.kind === 70
? ts.createUniqueName(expression.text)
: ts.createTempVariable(undefined);
if (ts.isVariableDeclarationList(initializer)) {
@@ -39703,7 +39831,7 @@ var ts;
}
var firstOriginalDeclaration = ts.firstOrUndefined(initializer.declarations);
if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) {
- var declarations = ts.flattenVariableDestructuring(context, firstOriginalDeclaration, ts.createElementAccess(rhsReference, counter), visitor);
+ var declarations = ts.flattenVariableDestructuring(firstOriginalDeclaration, ts.createElementAccess(rhsReference, counter), visitor);
var declarationList = ts.createVariableDeclarationList(declarations, initializer);
ts.setOriginalNode(declarationList, initializer);
var firstDeclaration = declarations[0];
@@ -39759,8 +39887,8 @@ var ts;
var numInitialProperties = numProperties;
for (var i = 0; i < numProperties; i++) {
var property = properties[i];
- if (property.transformFlags & 4194304
- || property.name.kind === 140) {
+ if (property.transformFlags & 16777216
+ || property.name.kind === 141) {
numInitialProperties = i;
break;
}
@@ -39786,7 +39914,7 @@ var ts;
}
visit(node.name);
function visit(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
state.hoistedLocalVariables.push(node);
}
else {
@@ -39815,11 +39943,11 @@ var ts;
var functionName = ts.createUniqueName("_loop");
var loopInitializer;
switch (node.kind) {
- case 206:
case 207:
case 208:
+ case 209:
var initializer = node.initializer;
- if (initializer && initializer.kind === 219) {
+ if (initializer && initializer.kind === 220) {
loopInitializer = initializer;
}
break;
@@ -39858,7 +39986,7 @@ var ts;
}
var isAsyncBlockContainingAwait = enclosingNonArrowFunction
&& (ts.getEmitFlags(enclosingNonArrowFunction) & 2097152) !== 0
- && (node.statement.transformFlags & 4194304) !== 0;
+ && (node.statement.transformFlags & 16777216) !== 0;
var loopBodyFlags = 0;
if (currentState.containsLexicalThis) {
loopBodyFlags |= 256;
@@ -39867,7 +39995,7 @@ var ts;
loopBodyFlags |= 2097152;
}
var convertedLoopVariable = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
- ts.createVariableDeclaration(functionName, undefined, ts.setEmitFlags(ts.createFunctionExpression(isAsyncBlockContainingAwait ? ts.createToken(37) : undefined, undefined, undefined, loopParameters, undefined, loopBody), loopBodyFlags))
+ ts.createVariableDeclaration(functionName, undefined, ts.setEmitFlags(ts.createFunctionExpression(undefined, isAsyncBlockContainingAwait ? ts.createToken(38) : undefined, undefined, undefined, loopParameters, undefined, loopBody), loopBodyFlags))
]));
var statements = [convertedLoopVariable];
var extraVariableDeclarations;
@@ -39926,7 +40054,7 @@ var ts;
loop.transformFlags = 0;
ts.aggregateTransformFlags(loop);
}
- statements.push(currentParent.kind === 214
+ statements.push(currentParent.kind === 215
? ts.createLabel(currentParent.label, loop)
: loop);
return statements;
@@ -39934,7 +40062,7 @@ var ts;
function copyOutParameter(outParam, copyDirection) {
var source = copyDirection === 0 ? outParam.outParamName : outParam.originalName;
var target = copyDirection === 0 ? outParam.originalName : outParam.outParamName;
- return ts.createBinary(target, 56, source);
+ return ts.createBinary(target, 57, source);
}
function copyOutParameters(outParams, copyDirection, statements) {
for (var _i = 0, outParams_1 = outParams; _i < outParams_1.length; _i++) {
@@ -39949,7 +40077,7 @@ var ts;
!state.labeledNonLocalBreaks &&
!state.labeledNonLocalContinues;
var call = ts.createCall(loopFunctionExpressionName, undefined, ts.map(parameters, function (p) { return p.name; }));
- var callResult = isAsyncBlockContainingAwait ? ts.createYield(ts.createToken(37), call) : call;
+ var callResult = isAsyncBlockContainingAwait ? ts.createYield(ts.createToken(38), call) : call;
if (isSimpleLoop) {
statements.push(ts.createStatement(callResult));
copyOutParameters(state.loopOutParameters, 0, statements);
@@ -39968,10 +40096,10 @@ var ts;
else {
returnStatement = ts.createReturn(ts.createPropertyAccess(loopResultName, "value"));
}
- statements.push(ts.createIf(ts.createBinary(ts.createTypeOf(loopResultName), 32, ts.createLiteral("object")), returnStatement));
+ statements.push(ts.createIf(ts.createBinary(ts.createTypeOf(loopResultName), 33, ts.createLiteral("object")), returnStatement));
}
if (state.nonLocalJumps & 2) {
- statements.push(ts.createIf(ts.createBinary(loopResultName, 32, ts.createLiteral("break")), ts.createBreak()));
+ statements.push(ts.createIf(ts.createBinary(loopResultName, 33, ts.createLiteral("break")), ts.createBreak()));
}
if (state.labeledNonLocalBreaks || state.labeledNonLocalContinues) {
var caseClauses = [];
@@ -40038,21 +40166,21 @@ var ts;
for (var i = start; i < numProperties; i++) {
var property = properties[i];
switch (property.kind) {
- case 149:
case 150:
+ case 151:
var accessors = ts.getAllAccessorDeclarations(node.properties, property);
if (property === accessors.firstAccessor) {
expressions.push(transformAccessorsToExpression(receiver, accessors, node.multiLine));
}
break;
case 253:
- expressions.push(transformPropertyAssignmentToExpression(node, property, receiver, node.multiLine));
+ expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
case 254:
- expressions.push(transformShorthandPropertyAssignmentToExpression(node, property, receiver, node.multiLine));
+ expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
- case 147:
- expressions.push(transformObjectLiteralMethodDeclarationToExpression(node, property, receiver, node.multiLine));
+ case 148:
+ expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node.multiLine));
break;
default:
ts.Debug.failBadSyntaxKind(node);
@@ -40060,21 +40188,21 @@ var ts;
}
}
}
- function transformPropertyAssignmentToExpression(node, property, receiver, startsOnNewLine) {
+ function transformPropertyAssignmentToExpression(property, receiver, startsOnNewLine) {
var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression), property);
if (startsOnNewLine) {
expression.startsOnNewLine = true;
}
return expression;
}
- function transformShorthandPropertyAssignmentToExpression(node, property, receiver, startsOnNewLine) {
+ function transformShorthandPropertyAssignmentToExpression(property, receiver, startsOnNewLine) {
var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name), property);
if (startsOnNewLine) {
expression.startsOnNewLine = true;
}
return expression;
}
- function transformObjectLiteralMethodDeclarationToExpression(node, method, receiver, startsOnNewLine) {
+ function transformObjectLiteralMethodDeclarationToExpression(method, receiver, startsOnNewLine) {
var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, method, undefined), method);
if (startsOnNewLine) {
expression.startsOnNewLine = true;
@@ -40104,17 +40232,17 @@ var ts;
}
function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) {
var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
- if (node.expression.kind === 95) {
+ if (node.expression.kind === 96) {
ts.setEmitFlags(thisArg, 128);
}
var resultingCall;
- if (node.transformFlags & 262144) {
+ if (node.transformFlags & 1048576) {
resultingCall = ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, false, false, false));
}
else {
resultingCall = ts.createFunctionCall(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), node);
}
- if (node.expression.kind === 95) {
+ if (node.expression.kind === 96) {
var actualThis = ts.createThis();
ts.setEmitFlags(actualThis, 128);
var initializer = ts.createLogicalOr(resultingCall, actualThis);
@@ -40125,18 +40253,18 @@ var ts;
return resultingCall;
}
function visitNewExpression(node) {
- ts.Debug.assert((node.transformFlags & 262144) !== 0);
+ ts.Debug.assert((node.transformFlags & 1048576) !== 0);
var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), false, false, false)), undefined, []);
}
function transformAndSpreadElements(elements, needsUniqueCopy, multiLine, hasTrailingComma) {
var numElements = elements.length;
- var segments = ts.flatten(ts.spanMap(elements, partitionSpreadElement, function (partition, visitPartition, start, end) {
+ var segments = ts.flatten(ts.spanMap(elements, partitionSpreadElement, function (partition, visitPartition, _start, end) {
return visitPartition(partition, multiLine, hasTrailingComma && end === numElements);
}));
if (segments.length === 1) {
var firstElement = elements[0];
- return needsUniqueCopy && ts.isSpreadElementExpression(firstElement) && firstElement.expression.kind !== 170
+ return needsUniqueCopy && ts.isSpreadElementExpression(firstElement) && firstElement.expression.kind !== 171
? ts.createArraySlice(segments[0])
: segments[0];
}
@@ -40147,7 +40275,7 @@ var ts;
? visitSpanOfSpreadElements
: visitSpanOfNonSpreadElements;
}
- function visitSpanOfSpreadElements(chunk, multiLine, hasTrailingComma) {
+ function visitSpanOfSpreadElements(chunk) {
return ts.map(chunk, visitExpressionOfSpreadElement);
}
function visitSpanOfNonSpreadElements(chunk, multiLine, hasTrailingComma) {
@@ -40188,7 +40316,7 @@ var ts;
}
function getRawLiteral(node) {
var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node);
- var isLast = node.kind === 11 || node.kind === 14;
+ var isLast = node.kind === 12 || node.kind === 15;
text = text.substring(1, text.length - (isLast ? 1 : 2));
text = text.replace(/\r\n?/g, "\n");
return ts.createLiteral(text, node);
@@ -40222,11 +40350,11 @@ var ts;
}
}
}
- function visitSuperKeyword(node) {
+ function visitSuperKeyword() {
return enclosingNonAsyncFunctionBody
&& ts.isClassElement(enclosingNonAsyncFunctionBody)
&& !ts.hasModifier(enclosingNonAsyncFunctionBody, 32)
- && currentParent.kind !== 174
+ && currentParent.kind !== 175
? ts.createPropertyAccess(ts.createIdentifier("_super"), "prototype")
: ts.createIdentifier("_super");
}
@@ -40253,20 +40381,20 @@ var ts;
function enableSubstitutionsForBlockScopedBindings() {
if ((enabledSubstitutions & 2) === 0) {
enabledSubstitutions |= 2;
- context.enableSubstitution(69);
+ context.enableSubstitution(70);
}
}
function enableSubstitutionsForCapturedThis() {
if ((enabledSubstitutions & 1) === 0) {
enabledSubstitutions |= 1;
- context.enableSubstitution(97);
- context.enableEmitNotification(148);
- context.enableEmitNotification(147);
+ context.enableSubstitution(98);
context.enableEmitNotification(149);
+ context.enableEmitNotification(148);
context.enableEmitNotification(150);
+ context.enableEmitNotification(151);
+ context.enableEmitNotification(181);
context.enableEmitNotification(180);
- context.enableEmitNotification(179);
- context.enableEmitNotification(220);
+ context.enableEmitNotification(221);
}
}
function onSubstituteNode(emitContext, node) {
@@ -40291,10 +40419,10 @@ var ts;
function isNameOfDeclarationWithCollidingName(node) {
var parent = node.parent;
switch (parent.kind) {
- case 169:
- case 221:
- case 224:
- case 218:
+ case 170:
+ case 222:
+ case 225:
+ case 219:
return parent.name === node
&& resolver.isDeclarationWithCollidingName(parent);
}
@@ -40302,9 +40430,9 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 69:
+ case 70:
return substituteExpressionIdentifier(node);
- case 97:
+ case 98:
return substituteThisKeyword(node);
}
return node;
@@ -40331,7 +40459,7 @@ var ts;
}
function getDeclarationName(node, allowComments, allowSourceMaps, emitFlags) {
if (node.name && !ts.isGeneratedIdentifier(node.name)) {
- var name_36 = ts.getMutableClone(node.name);
+ var name_33 = ts.getMutableClone(node.name);
emitFlags |= ts.getEmitFlags(node.name);
if (!allowSourceMaps) {
emitFlags |= 1536;
@@ -40340,9 +40468,9 @@ var ts;
emitFlags |= 49152;
}
if (emitFlags) {
- ts.setEmitFlags(name_36, emitFlags);
+ ts.setEmitFlags(name_33, emitFlags);
}
- return name_36;
+ return name_33;
}
return ts.getGeneratedNameForNode(node);
}
@@ -40359,29 +40487,74 @@ var ts;
return false;
}
var statement = ts.firstOrUndefined(constructor.body.statements);
- if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 202) {
+ if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 203) {
return false;
}
var statementExpression = statement.expression;
- if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 174) {
+ if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 175) {
return false;
}
var callTarget = statementExpression.expression;
- if (!ts.nodeIsSynthesized(callTarget) || callTarget.kind !== 95) {
+ if (!ts.nodeIsSynthesized(callTarget) || callTarget.kind !== 96) {
return false;
}
var callArgument = ts.singleOrUndefined(statementExpression.arguments);
- if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 191) {
+ if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 192) {
return false;
}
var expression = callArgument.expression;
return ts.isIdentifier(expression) && expression === parameter.name;
}
}
- ts.transformES6 = transformES6;
+ ts.transformES2015 = transformES2015;
})(ts || (ts = {}));
var ts;
(function (ts) {
+ var OpCode;
+ (function (OpCode) {
+ OpCode[OpCode["Nop"] = 0] = "Nop";
+ OpCode[OpCode["Statement"] = 1] = "Statement";
+ OpCode[OpCode["Assign"] = 2] = "Assign";
+ OpCode[OpCode["Break"] = 3] = "Break";
+ OpCode[OpCode["BreakWhenTrue"] = 4] = "BreakWhenTrue";
+ OpCode[OpCode["BreakWhenFalse"] = 5] = "BreakWhenFalse";
+ OpCode[OpCode["Yield"] = 6] = "Yield";
+ OpCode[OpCode["YieldStar"] = 7] = "YieldStar";
+ OpCode[OpCode["Return"] = 8] = "Return";
+ OpCode[OpCode["Throw"] = 9] = "Throw";
+ OpCode[OpCode["Endfinally"] = 10] = "Endfinally";
+ })(OpCode || (OpCode = {}));
+ var BlockAction;
+ (function (BlockAction) {
+ BlockAction[BlockAction["Open"] = 0] = "Open";
+ BlockAction[BlockAction["Close"] = 1] = "Close";
+ })(BlockAction || (BlockAction = {}));
+ var CodeBlockKind;
+ (function (CodeBlockKind) {
+ CodeBlockKind[CodeBlockKind["Exception"] = 0] = "Exception";
+ CodeBlockKind[CodeBlockKind["With"] = 1] = "With";
+ CodeBlockKind[CodeBlockKind["Switch"] = 2] = "Switch";
+ CodeBlockKind[CodeBlockKind["Loop"] = 3] = "Loop";
+ CodeBlockKind[CodeBlockKind["Labeled"] = 4] = "Labeled";
+ })(CodeBlockKind || (CodeBlockKind = {}));
+ var ExceptionBlockState;
+ (function (ExceptionBlockState) {
+ ExceptionBlockState[ExceptionBlockState["Try"] = 0] = "Try";
+ ExceptionBlockState[ExceptionBlockState["Catch"] = 1] = "Catch";
+ ExceptionBlockState[ExceptionBlockState["Finally"] = 2] = "Finally";
+ ExceptionBlockState[ExceptionBlockState["Done"] = 3] = "Done";
+ })(ExceptionBlockState || (ExceptionBlockState = {}));
+ var Instruction;
+ (function (Instruction) {
+ Instruction[Instruction["Next"] = 0] = "Next";
+ Instruction[Instruction["Throw"] = 1] = "Throw";
+ Instruction[Instruction["Return"] = 2] = "Return";
+ Instruction[Instruction["Break"] = 3] = "Break";
+ Instruction[Instruction["Yield"] = 4] = "Yield";
+ Instruction[Instruction["YieldStar"] = 5] = "YieldStar";
+ Instruction[Instruction["Catch"] = 6] = "Catch";
+ Instruction[Instruction["Endfinally"] = 7] = "Endfinally";
+ })(Instruction || (Instruction = {}));
var instructionNames = ts.createMap((_a = {},
_a[2] = "return",
_a[3] = "break",
@@ -40427,7 +40600,7 @@ var ts;
if (ts.isDeclarationFile(node)) {
return node;
}
- if (node.transformFlags & 1024) {
+ if (node.transformFlags & 4096) {
currentSourceFile = node;
node = ts.visitEachChild(node, visitor, context);
currentSourceFile = undefined;
@@ -40442,10 +40615,10 @@ var ts;
else if (inGeneratorFunctionBody) {
return visitJavaScriptInGeneratorFunctionBody(node);
}
- else if (transformFlags & 512) {
+ else if (transformFlags & 2048) {
return visitGenerator(node);
}
- else if (transformFlags & 1024) {
+ else if (transformFlags & 4096) {
return ts.visitEachChild(node, visitor, context);
}
else {
@@ -40454,13 +40627,13 @@ var ts;
}
function visitJavaScriptInStatementContainingYield(node) {
switch (node.kind) {
- case 204:
- return visitDoStatement(node);
case 205:
+ return visitDoStatement(node);
+ case 206:
return visitWhileStatement(node);
- case 213:
- return visitSwitchStatement(node);
case 214:
+ return visitSwitchStatement(node);
+ case 215:
return visitLabeledStatement(node);
default:
return visitJavaScriptInGeneratorFunctionBody(node);
@@ -40468,30 +40641,30 @@ var ts;
}
function visitJavaScriptInGeneratorFunctionBody(node) {
switch (node.kind) {
- case 220:
+ case 221:
return visitFunctionDeclaration(node);
- case 179:
+ case 180:
return visitFunctionExpression(node);
- case 149:
case 150:
+ case 151:
return visitAccessorDeclaration(node);
- case 200:
+ case 201:
return visitVariableStatement(node);
- case 206:
- return visitForStatement(node);
case 207:
+ return visitForStatement(node);
+ case 208:
return visitForInStatement(node);
- case 210:
- return visitBreakStatement(node);
- case 209:
- return visitContinueStatement(node);
case 211:
+ return visitBreakStatement(node);
+ case 210:
+ return visitContinueStatement(node);
+ case 212:
return visitReturnStatement(node);
default:
- if (node.transformFlags & 4194304) {
+ if (node.transformFlags & 16777216) {
return visitJavaScriptContainingYield(node);
}
- else if (node.transformFlags & (1024 | 8388608)) {
+ else if (node.transformFlags & (4096 | 33554432)) {
return ts.visitEachChild(node, visitor, context);
}
else {
@@ -40501,21 +40674,21 @@ var ts;
}
function visitJavaScriptContainingYield(node) {
switch (node.kind) {
- case 187:
- return visitBinaryExpression(node);
case 188:
+ return visitBinaryExpression(node);
+ case 189:
return visitConditionalExpression(node);
- case 190:
+ case 191:
return visitYieldExpression(node);
- case 170:
- return visitArrayLiteralExpression(node);
case 171:
+ return visitArrayLiteralExpression(node);
+ case 172:
return visitObjectLiteralExpression(node);
- case 173:
- return visitElementAccessExpression(node);
case 174:
- return visitCallExpression(node);
+ return visitElementAccessExpression(node);
case 175:
+ return visitCallExpression(node);
+ case 176:
return visitNewExpression(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -40523,9 +40696,9 @@ var ts;
}
function visitGenerator(node) {
switch (node.kind) {
- case 220:
+ case 221:
return visitFunctionDeclaration(node);
- case 179:
+ case 180:
return visitFunctionExpression(node);
default:
ts.Debug.failBadSyntaxKind(node);
@@ -40555,7 +40728,7 @@ var ts;
}
function visitFunctionExpression(node) {
if (node.asteriskToken && ts.getEmitFlags(node) & 2097152) {
- node = ts.setOriginalNode(ts.createFunctionExpression(undefined, node.name, undefined, node.parameters, undefined, transformGeneratorFunctionBody(node.body), node), node);
+ node = ts.setOriginalNode(ts.createFunctionExpression(undefined, undefined, node.name, undefined, node.parameters, undefined, transformGeneratorFunctionBody(node.body), node), node);
}
else {
var savedInGeneratorFunctionBody = inGeneratorFunctionBody;
@@ -40628,7 +40801,7 @@ var ts;
return ts.createBlock(statements, body, body.multiLine);
}
function visitVariableStatement(node) {
- if (node.transformFlags & 4194304) {
+ if (node.transformFlags & 16777216) {
transformAndEmitVariableDeclarationList(node.declarationList);
return undefined;
}
@@ -40658,23 +40831,23 @@ var ts;
}
}
function isCompoundAssignment(kind) {
- return kind >= 57
- && kind <= 68;
+ return kind >= 58
+ && kind <= 69;
}
function getOperatorForCompoundAssignment(kind) {
switch (kind) {
- case 57: return 35;
case 58: return 36;
case 59: return 37;
case 60: return 38;
case 61: return 39;
case 62: return 40;
- case 63: return 43;
+ case 63: return 41;
case 64: return 44;
case 65: return 45;
case 66: return 46;
case 67: return 47;
case 68: return 48;
+ case 69: return 49;
}
}
function visitRightAssociativeBinaryExpression(node) {
@@ -40682,10 +40855,10 @@ var ts;
if (containsYield(right)) {
var target = void 0;
switch (left.kind) {
- case 172:
+ case 173:
target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name);
break;
- case 173:
+ case 174:
target = ts.updateElementAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression)));
break;
default:
@@ -40694,7 +40867,7 @@ var ts;
}
var operator = node.operatorToken.kind;
if (isCompoundAssignment(operator)) {
- return ts.createBinary(target, 56, ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression), node), node);
+ return ts.createBinary(target, 57, ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression), node), node);
}
else {
return ts.updateBinary(node, target, ts.visitNode(right, visitor, ts.isExpression));
@@ -40707,7 +40880,7 @@ var ts;
if (ts.isLogicalOperator(node.operatorToken.kind)) {
return visitLogicalBinaryExpression(node);
}
- else if (node.operatorToken.kind === 24) {
+ else if (node.operatorToken.kind === 25) {
return visitCommaExpression(node);
}
var clone_6 = ts.getMutableClone(node);
@@ -40721,7 +40894,7 @@ var ts;
var resultLabel = defineLabel();
var resultLocal = declareLocal();
emitAssignment(resultLocal, ts.visitNode(node.left, visitor, ts.isExpression), node.left);
- if (node.operatorToken.kind === 51) {
+ if (node.operatorToken.kind === 52) {
emitBreakWhenFalse(resultLabel, resultLocal, node.left);
}
else {
@@ -40737,7 +40910,7 @@ var ts;
visit(node.right);
return ts.inlineExpressions(pendingExpressions);
function visit(node) {
- if (ts.isBinaryExpression(node) && node.operatorToken.kind === 24) {
+ if (ts.isBinaryExpression(node) && node.operatorToken.kind === 25) {
visit(node.left);
visit(node.right);
}
@@ -40780,7 +40953,7 @@ var ts;
function visitArrayLiteralExpression(node) {
return visitElements(node.elements, node.multiLine);
}
- function visitElements(elements, multiLine) {
+ function visitElements(elements, _multiLine) {
var numInitialElements = countInitialNodesWithoutYield(elements);
var temp = declareLocal();
var hasAssignedTemp = false;
@@ -40841,14 +41014,14 @@ var ts;
function visitCallExpression(node) {
if (ts.forEach(node.arguments, containsYield)) {
var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion, true), target = _a.target, thisArg = _a.thisArg;
- return ts.setOriginalNode(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isLeftHandSideExpression)), thisArg, visitElements(node.arguments, false), node), node);
+ return ts.setOriginalNode(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isLeftHandSideExpression)), thisArg, visitElements(node.arguments), node), node);
}
return ts.visitEachChild(node, visitor, context);
}
function visitNewExpression(node) {
if (ts.forEach(node.arguments, containsYield)) {
var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
- return ts.setOriginalNode(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, false)), undefined, [], node), node);
+ return ts.setOriginalNode(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments)), undefined, [], node), node);
}
return ts.visitEachChild(node, visitor, context);
}
@@ -40877,35 +41050,35 @@ var ts;
}
function transformAndEmitStatementWorker(node) {
switch (node.kind) {
- case 199:
+ case 200:
return transformAndEmitBlock(node);
- case 202:
- return transformAndEmitExpressionStatement(node);
case 203:
- return transformAndEmitIfStatement(node);
+ return transformAndEmitExpressionStatement(node);
case 204:
- return transformAndEmitDoStatement(node);
+ return transformAndEmitIfStatement(node);
case 205:
- return transformAndEmitWhileStatement(node);
+ return transformAndEmitDoStatement(node);
case 206:
- return transformAndEmitForStatement(node);
+ return transformAndEmitWhileStatement(node);
case 207:
+ return transformAndEmitForStatement(node);
+ case 208:
return transformAndEmitForInStatement(node);
- case 209:
- return transformAndEmitContinueStatement(node);
case 210:
- return transformAndEmitBreakStatement(node);
+ return transformAndEmitContinueStatement(node);
case 211:
- return transformAndEmitReturnStatement(node);
+ return transformAndEmitBreakStatement(node);
case 212:
- return transformAndEmitWithStatement(node);
+ return transformAndEmitReturnStatement(node);
case 213:
- return transformAndEmitSwitchStatement(node);
+ return transformAndEmitWithStatement(node);
case 214:
- return transformAndEmitLabeledStatement(node);
+ return transformAndEmitSwitchStatement(node);
case 215:
- return transformAndEmitThrowStatement(node);
+ return transformAndEmitLabeledStatement(node);
case 216:
+ return transformAndEmitThrowStatement(node);
+ case 217:
return transformAndEmitTryStatement(node);
default:
return emitStatement(ts.visitNode(node, visitor, ts.isStatement, true));
@@ -41290,7 +41463,7 @@ var ts;
}
}
function containsYield(node) {
- return node && (node.transformFlags & 4194304) !== 0;
+ return node && (node.transformFlags & 16777216) !== 0;
}
function countInitialNodesWithoutYield(nodes) {
var numNodes = nodes.length;
@@ -41320,9 +41493,9 @@ var ts;
if (ts.isIdentifier(original) && original.parent) {
var declaration = resolver.getReferencedValueDeclaration(original);
if (declaration) {
- var name_37 = ts.getProperty(renamedCatchVariableDeclarations, String(ts.getOriginalNodeId(declaration)));
- if (name_37) {
- var clone_8 = ts.getMutableClone(name_37);
+ var name_34 = ts.getProperty(renamedCatchVariableDeclarations, String(ts.getOriginalNodeId(declaration)));
+ if (name_34) {
+ var clone_8 = ts.getMutableClone(name_34);
ts.setSourceMapRange(clone_8, node);
ts.setCommentRange(clone_8, node);
return clone_8;
@@ -41431,7 +41604,7 @@ var ts;
if (!renamedCatchVariables) {
renamedCatchVariables = ts.createMap();
renamedCatchVariableDeclarations = ts.createMap();
- context.enableSubstitution(69);
+ context.enableSubstitution(70);
}
renamedCatchVariables[text] = true;
renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name;
@@ -41630,7 +41803,7 @@ var ts;
}
return expression;
}
- return ts.createNode(193);
+ return ts.createNode(194);
}
function createInstruction(instruction) {
var literal = ts.createLiteral(instruction);
@@ -41718,7 +41891,7 @@ var ts;
var buildResult = buildStatements();
return ts.createCall(ts.createHelperName(currentSourceFile.externalHelpersModuleName, "__generator"), undefined, [
ts.createThis(),
- ts.setEmitFlags(ts.createFunctionExpression(undefined, undefined, undefined, [ts.createParameter(state)], undefined, ts.createBlock(buildResult, undefined, buildResult.length > 0)), 4194304)
+ ts.setEmitFlags(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(state)], undefined, ts.createBlock(buildResult, undefined, buildResult.length > 0)), 4194304)
]);
}
function buildStatements() {
@@ -41985,6 +42158,51 @@ var ts;
var _a;
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ function transformES5(context) {
+ var previousOnSubstituteNode = context.onSubstituteNode;
+ context.onSubstituteNode = onSubstituteNode;
+ context.enableSubstitution(173);
+ context.enableSubstitution(253);
+ return transformSourceFile;
+ function transformSourceFile(node) {
+ return node;
+ }
+ function onSubstituteNode(emitContext, node) {
+ node = previousOnSubstituteNode(emitContext, node);
+ if (ts.isPropertyAccessExpression(node)) {
+ return substitutePropertyAccessExpression(node);
+ }
+ else if (ts.isPropertyAssignment(node)) {
+ return substitutePropertyAssignment(node);
+ }
+ return node;
+ }
+ function substitutePropertyAccessExpression(node) {
+ var literalName = trySubstituteReservedName(node.name);
+ if (literalName) {
+ return ts.createElementAccess(node.expression, literalName, node);
+ }
+ return node;
+ }
+ function substitutePropertyAssignment(node) {
+ var literalName = ts.isIdentifier(node.name) && trySubstituteReservedName(node.name);
+ if (literalName) {
+ return ts.updatePropertyAssignment(node, literalName, node.initializer);
+ }
+ return node;
+ }
+ function trySubstituteReservedName(name) {
+ var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(name.text) : undefined);
+ if (token >= 71 && token <= 106) {
+ return ts.createLiteral(name, name);
+ }
+ return undefined;
+ }
+ }
+ ts.transformES5 = transformES5;
+})(ts || (ts = {}));
+var ts;
(function (ts) {
function transformModule(context) {
var transformModuleDelegates = ts.createMap((_a = {},
@@ -42003,10 +42221,10 @@ var ts;
var previousOnEmitNode = context.onEmitNode;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
- context.enableSubstitution(69);
- context.enableSubstitution(187);
- context.enableSubstitution(185);
+ context.enableSubstitution(70);
+ context.enableSubstitution(188);
context.enableSubstitution(186);
+ context.enableSubstitution(187);
context.enableSubstitution(254);
context.enableEmitNotification(256);
var currentSourceFile;
@@ -42023,7 +42241,7 @@ var ts;
}
if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
currentSourceFile = node;
- (_a = ts.collectExternalModuleInfo(node, resolver), externalImports = _a.externalImports, exportSpecifiers = _a.exportSpecifiers, exportEquals = _a.exportEquals, hasExportStarsToExportValues = _a.hasExportStarsToExportValues, _a);
+ (_a = ts.collectExternalModuleInfo(node), externalImports = _a.externalImports, exportSpecifiers = _a.exportSpecifiers, exportEquals = _a.exportEquals, hasExportStarsToExportValues = _a.hasExportStarsToExportValues, _a);
var transformModule_1 = transformModuleDelegates[moduleKind] || transformModuleDelegates[ts.ModuleKind.None];
var updated = transformModule_1(node);
ts.aggregateTransformFlags(updated);
@@ -42068,7 +42286,7 @@ var ts;
ts.createLiteral("require"),
ts.createLiteral("exports")
].concat(aliasedModuleNames, unaliasedModuleNames)),
- ts.createFunctionExpression(undefined, undefined, undefined, [
+ ts.createFunctionExpression(undefined, undefined, undefined, undefined, [
ts.createParameter("require"),
ts.createParameter("exports")
].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node))
@@ -42089,7 +42307,7 @@ var ts;
return body;
}
function addExportEqualsIfNeeded(statements, emitAsReturn) {
- if (exportEquals && resolver.isValueAliasDeclaration(exportEquals)) {
+ if (exportEquals) {
if (emitAsReturn) {
var statement = ts.createReturn(exportEquals.expression, exportEquals);
ts.setEmitFlags(statement, 12288 | 49152);
@@ -42104,21 +42322,21 @@ var ts;
}
function visitor(node) {
switch (node.kind) {
- case 230:
+ case 231:
return visitImportDeclaration(node);
- case 229:
+ case 230:
return visitImportEqualsDeclaration(node);
- case 236:
+ case 237:
return visitExportDeclaration(node);
- case 235:
+ case 236:
return visitExportAssignment(node);
- case 200:
+ case 201:
return visitVariableStatement(node);
- case 220:
- return visitFunctionDeclaration(node);
case 221:
+ return visitFunctionDeclaration(node);
+ case 222:
return visitClassDeclaration(node);
- case 202:
+ case 203:
return visitExpressionStatement(node);
default:
return node;
@@ -42194,14 +42412,12 @@ var ts;
}
for (var _i = 0, _a = node.exportClause.elements; _i < _a.length; _i++) {
var specifier = _a[_i];
- if (resolver.isValueAliasDeclaration(specifier)) {
- var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name);
- statements.push(ts.createStatement(createExportAssignment(specifier.name, exportedValue), specifier));
- }
+ var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name);
+ statements.push(ts.createStatement(createExportAssignment(specifier.name, exportedValue), specifier));
}
return ts.singleOrMany(statements);
}
- else if (resolver.moduleExportsSomeValue(node.moduleSpecifier)) {
+ else {
return ts.createStatement(ts.createCall(ts.createIdentifier("__export"), undefined, [
moduleKind !== ts.ModuleKind.AMD
? createRequireCall(node)
@@ -42210,14 +42426,12 @@ var ts;
}
}
function visitExportAssignment(node) {
- if (!node.isExportEquals) {
- if (ts.nodeIsSynthesized(node) || resolver.isValueAliasDeclaration(node)) {
- var statements = [];
- addExportDefault(statements, node.expression, node);
- return statements;
- }
+ if (node.isExportEquals) {
+ return undefined;
}
- return undefined;
+ var statements = [];
+ addExportDefault(statements, node.expression, node);
+ return statements;
}
function addExportDefault(statements, expression, location) {
tryAddExportDefaultCompat(statements);
@@ -42248,16 +42462,16 @@ var ts;
else {
var names = ts.reduceEachChild(node, collectExportMembers, []);
for (var _i = 0, names_1 = names; _i < names_1.length; _i++) {
- var name_38 = names_1[_i];
- addExportMemberAssignments(statements, name_38);
+ var name_35 = names_1[_i];
+ addExportMemberAssignments(statements, name_35);
}
}
}
function collectExportMembers(names, node) {
- if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node) && ts.isDeclaration(node)) {
- var name_39 = node.name;
- if (ts.isIdentifier(name_39)) {
- names.push(name_39);
+ if (ts.isAliasSymbolDeclaration(node) && ts.isDeclaration(node)) {
+ var name_36 = node.name;
+ if (ts.isIdentifier(name_36)) {
+ names.push(name_36);
}
}
return ts.reduceEachChild(node, collectExportMembers, names);
@@ -42280,9 +42494,9 @@ var ts;
}
function visitVariableStatement(node) {
var originalKind = ts.getOriginalNode(node).kind;
- if (originalKind === 225 ||
- originalKind === 224 ||
- originalKind === 221) {
+ if (originalKind === 226 ||
+ originalKind === 225 ||
+ originalKind === 222) {
if (!ts.hasModifier(node, 1)) {
return node;
}
@@ -42328,7 +42542,7 @@ var ts;
function transformInitializedVariable(node) {
var name = node.name;
if (ts.isBindingPattern(name)) {
- return ts.flattenVariableDestructuringToExpression(context, node, hoistVariableDeclaration, getModuleMemberName, visitor);
+ return ts.flattenVariableDestructuringToExpression(node, hoistVariableDeclaration, getModuleMemberName, visitor);
}
else {
return ts.createAssignment(getModuleMemberName(name), ts.visitNode(node.initializer, visitor, ts.isExpression));
@@ -42338,7 +42552,8 @@ var ts;
var statements = [];
var name = node.name || ts.getGeneratedNameForNode(node);
if (ts.hasModifier(node, 1)) {
- statements.push(ts.setOriginalNode(ts.createFunctionDeclaration(undefined, undefined, node.asteriskToken, name, undefined, node.parameters, undefined, node.body, node), node));
+ var isAsync = ts.hasModifier(node, 256);
+ statements.push(ts.setOriginalNode(ts.createFunctionDeclaration(undefined, isAsync ? [ts.createNode(119)] : undefined, node.asteriskToken, name, undefined, node.parameters, undefined, node.body, node), node));
addExportMemberAssignment(statements, node);
}
else {
@@ -42367,10 +42582,10 @@ var ts;
function visitExpressionStatement(node) {
var original = ts.getOriginalNode(node);
var origKind = original.kind;
- if (origKind === 224 || origKind === 225) {
+ if (origKind === 225 || origKind === 226) {
return visitExpressionStatementForEnumOrNamespaceDeclaration(node, original);
}
- else if (origKind === 221) {
+ else if (origKind === 222) {
var classDecl = original;
if (classDecl.name) {
var statements = [node];
@@ -42383,8 +42598,8 @@ var ts;
function visitExpressionStatementForEnumOrNamespaceDeclaration(node, original) {
var statements = [node];
if (ts.hasModifier(original, 1) &&
- original.kind === 224 &&
- ts.isFirstDeclarationOfKind(original, 224)) {
+ original.kind === 225 &&
+ ts.isFirstDeclarationOfKind(original, 225)) {
addVarForExportedEnumOrNamespaceDeclaration(statements, original);
}
addExportMemberAssignments(statements, original.name);
@@ -42432,12 +42647,12 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 69:
+ case 70:
return substituteExpressionIdentifier(node);
- case 187:
+ case 188:
return substituteBinaryExpression(node);
+ case 187:
case 186:
- case 185:
return substituteUnaryExpression(node);
}
return node;
@@ -42471,8 +42686,8 @@ var ts;
if (bindingNameExportSpecifiersMap && ts.hasProperty(bindingNameExportSpecifiersMap, operand.text)) {
ts.setEmitFlags(node, 128);
var transformedUnaryExpression = void 0;
- if (node.kind === 186) {
- transformedUnaryExpression = ts.createBinary(operand, ts.createToken(operator === 41 ? 57 : 58), ts.createLiteral(1), node);
+ if (node.kind === 187) {
+ transformedUnaryExpression = ts.createBinary(operand, ts.createToken(operator === 42 ? 58 : 59), ts.createLiteral(1), node);
ts.setEmitFlags(transformedUnaryExpression, 128);
}
var nestedExportAssignment = void 0;
@@ -42504,21 +42719,11 @@ var ts;
var declaration = resolver.getReferencedImportDeclaration(node);
if (declaration) {
if (ts.isImportClause(declaration)) {
- if (languageVersion >= 1) {
- return ts.createPropertyAccess(ts.getGeneratedNameForNode(declaration.parent), ts.createIdentifier("default"), node);
- }
- else {
- return ts.createElementAccess(ts.getGeneratedNameForNode(declaration.parent), ts.createLiteral("default"), node);
- }
+ return ts.createPropertyAccess(ts.getGeneratedNameForNode(declaration.parent), ts.createIdentifier("default"), node);
}
else if (ts.isImportSpecifier(declaration)) {
- var name_40 = declaration.propertyName || declaration.name;
- if (name_40.originalKeywordKind === 77 && languageVersion <= 0) {
- return ts.createElementAccess(ts.getGeneratedNameForNode(declaration.parent.parent.parent), ts.createLiteral(name_40.text), node);
- }
- else {
- return ts.createPropertyAccess(ts.getGeneratedNameForNode(declaration.parent.parent.parent), ts.getSynthesizedClone(name_40), node);
- }
+ var name_37 = declaration.propertyName || declaration.name;
+ return ts.createPropertyAccess(ts.getGeneratedNameForNode(declaration.parent.parent.parent), ts.getSynthesizedClone(name_37), node);
}
}
}
@@ -42544,9 +42749,7 @@ var ts;
return statement;
}
function createExportAssignment(name, value) {
- return ts.createAssignment(name.originalKeywordKind === 77 && languageVersion === 0
- ? ts.createElementAccess(ts.createIdentifier("exports"), ts.createLiteral(name.text))
- : ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value);
+ return ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value);
}
function collectAsynchronousDependencies(node, includeNonAmdDependencies) {
var aliasedModuleNames = [];
@@ -42593,15 +42796,14 @@ var ts;
var compilerOptions = context.getCompilerOptions();
var resolver = context.getEmitResolver();
var host = context.getEmitHost();
- var languageVersion = ts.getEmitScriptTarget(compilerOptions);
var previousOnSubstituteNode = context.onSubstituteNode;
var previousOnEmitNode = context.onEmitNode;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
- context.enableSubstitution(69);
- context.enableSubstitution(187);
- context.enableSubstitution(185);
+ context.enableSubstitution(70);
+ context.enableSubstitution(188);
context.enableSubstitution(186);
+ context.enableSubstitution(187);
context.enableEmitNotification(256);
var exportFunctionForFileMap = [];
var currentSourceFile;
@@ -42641,7 +42843,7 @@ var ts;
}
function transformSystemModuleWorker(node) {
ts.Debug.assert(!exportFunctionForFile);
- (_a = ts.collectExternalModuleInfo(node, resolver), externalImports = _a.externalImports, exportSpecifiers = _a.exportSpecifiers, exportEquals = _a.exportEquals, hasExportStarsToExportValues = _a.hasExportStarsToExportValues, _a);
+ (_a = ts.collectExternalModuleInfo(node), externalImports = _a.externalImports, exportSpecifiers = _a.exportSpecifiers, exportEquals = _a.exportEquals, hasExportStarsToExportValues = _a.hasExportStarsToExportValues, _a);
exportFunctionForFile = ts.createUniqueName("exports");
contextObjectForFile = ts.createUniqueName("context");
exportFunctionForFileMap[ts.getOriginalNodeId(node)] = exportFunctionForFile;
@@ -42650,7 +42852,7 @@ var ts;
addSystemModuleBody(statements, node, dependencyGroups);
var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions);
var dependencies = ts.createArrayLiteral(ts.map(dependencyGroups, getNameOfDependencyGroup));
- var body = ts.createFunctionExpression(undefined, undefined, undefined, [
+ var body = ts.createFunctionExpression(undefined, undefined, undefined, undefined, [
ts.createParameter(exportFunctionForFile),
ts.createParameter(contextObjectForFile)
], undefined, ts.setEmitFlags(ts.createBlock(statements, undefined, true), 1));
@@ -42673,7 +42875,7 @@ var ts;
var exportStarFunction = addExportStarIfNeeded(statements);
statements.push(ts.createReturn(ts.setMultiLine(ts.createObjectLiteral([
ts.createPropertyAssignment("setters", generateSetters(exportStarFunction, dependencyGroups)),
- ts.createPropertyAssignment("execute", ts.createFunctionExpression(undefined, undefined, undefined, [], undefined, ts.createBlock(executeStatements, undefined, true)))
+ ts.createPropertyAssignment("execute", ts.createFunctionExpression(undefined, undefined, undefined, undefined, [], undefined, ts.createBlock(executeStatements, undefined, true)))
]), true)));
}
function addExportStarIfNeeded(statements) {
@@ -42684,7 +42886,7 @@ var ts;
var hasExportDeclarationWithExportClause = false;
for (var _i = 0, externalImports_2 = externalImports; _i < externalImports_2.length; _i++) {
var externalImport = externalImports_2[_i];
- if (externalImport.kind === 236 && externalImport.exportClause) {
+ if (externalImport.kind === 237 && externalImport.exportClause) {
hasExportDeclarationWithExportClause = true;
break;
}
@@ -42702,7 +42904,7 @@ var ts;
}
for (var _b = 0, externalImports_3 = externalImports; _b < externalImports_3.length; _b++) {
var externalImport = externalImports_3[_b];
- if (externalImport.kind !== 236) {
+ if (externalImport.kind !== 237) {
continue;
}
var exportDecl = externalImport;
@@ -42731,15 +42933,15 @@ var ts;
var entry = _b[_a];
var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile);
switch (entry.kind) {
- case 230:
+ case 231:
if (!entry.importClause) {
break;
}
- case 229:
+ case 230:
ts.Debug.assert(importVariableName !== undefined);
statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName)));
break;
- case 236:
+ case 237:
ts.Debug.assert(importVariableName !== undefined);
if (entry.exportClause) {
var properties = [];
@@ -42755,19 +42957,19 @@ var ts;
break;
}
}
- setters.push(ts.createFunctionExpression(undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, ts.createBlock(statements, undefined, true)));
+ setters.push(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, ts.createBlock(statements, undefined, true)));
}
return ts.createArrayLiteral(setters, undefined, true);
}
function visitSourceElement(node) {
switch (node.kind) {
- case 230:
+ case 231:
return visitImportDeclaration(node);
- case 229:
+ case 230:
return visitImportEqualsDeclaration(node);
- case 236:
+ case 237:
return visitExportDeclaration(node);
- case 235:
+ case 236:
return visitExportAssignment(node);
default:
return visitNestedNode(node);
@@ -42791,41 +42993,41 @@ var ts;
}
function visitNestedNodeWorker(node) {
switch (node.kind) {
- case 200:
+ case 201:
return visitVariableStatement(node);
- case 220:
- return visitFunctionDeclaration(node);
case 221:
+ return visitFunctionDeclaration(node);
+ case 222:
return visitClassDeclaration(node);
- case 206:
- return visitForStatement(node);
case 207:
- return visitForInStatement(node);
+ return visitForStatement(node);
case 208:
+ return visitForInStatement(node);
+ case 209:
return visitForOfStatement(node);
- case 204:
- return visitDoStatement(node);
case 205:
+ return visitDoStatement(node);
+ case 206:
return visitWhileStatement(node);
- case 214:
+ case 215:
return visitLabeledStatement(node);
- case 212:
- return visitWithStatement(node);
case 213:
+ return visitWithStatement(node);
+ case 214:
return visitSwitchStatement(node);
- case 227:
+ case 228:
return visitCaseBlock(node);
case 249:
return visitCaseClause(node);
case 250:
return visitDefaultClause(node);
- case 216:
+ case 217:
return visitTryStatement(node);
case 252:
return visitCatchClause(node);
- case 199:
+ case 200:
return visitBlock(node);
- case 202:
+ case 203:
return visitExpressionStatement(node);
default:
return node;
@@ -42852,20 +43054,14 @@ var ts;
return undefined;
}
function visitExportSpecifier(specifier) {
- if (resolver.getReferencedValueDeclaration(specifier.propertyName || specifier.name)
- || resolver.isValueAliasDeclaration(specifier)) {
- recordExportName(specifier.name);
- return createExportStatement(specifier.name, specifier.propertyName || specifier.name);
- }
- return undefined;
+ recordExportName(specifier.name);
+ return createExportStatement(specifier.name, specifier.propertyName || specifier.name);
}
function visitExportAssignment(node) {
- if (!node.isExportEquals) {
- if (ts.nodeIsSynthesized(node) || resolver.isValueAliasDeclaration(node)) {
- return createExportStatement(ts.createLiteral("default"), node.expression);
- }
+ if (node.isExportEquals) {
+ return undefined;
}
- return undefined;
+ return createExportStatement(ts.createLiteral("default"), node.expression);
}
function visitVariableStatement(node) {
var shouldHoist = ((ts.getCombinedNodeFlags(ts.getOriginalNode(node.declarationList)) & 3) == 0) ||
@@ -42897,16 +43093,17 @@ var ts;
return ts.createAssignment(name, node.initializer);
}
else {
- return ts.flattenVariableDestructuringToExpression(context, node, hoistVariableDeclaration);
+ return ts.flattenVariableDestructuringToExpression(node, hoistVariableDeclaration);
}
}
function visitFunctionDeclaration(node) {
if (ts.hasModifier(node, 1)) {
- var name_41 = node.name || ts.getGeneratedNameForNode(node);
- var newNode = ts.createFunctionDeclaration(undefined, undefined, node.asteriskToken, name_41, undefined, node.parameters, undefined, node.body, node);
+ var name_38 = node.name || ts.getGeneratedNameForNode(node);
+ var isAsync = ts.hasModifier(node, 256);
+ var newNode = ts.createFunctionDeclaration(undefined, isAsync ? [ts.createNode(119)] : undefined, node.asteriskToken, name_38, undefined, node.parameters, undefined, node.body, node);
recordExportedFunctionDeclaration(node);
if (!ts.hasModifier(node, 512)) {
- recordExportName(name_41);
+ recordExportName(name_38);
}
ts.setOriginalNode(newNode, node);
node = newNode;
@@ -42916,14 +43113,14 @@ var ts;
}
function visitExpressionStatement(node) {
var originalNode = ts.getOriginalNode(node);
- if ((originalNode.kind === 225 || originalNode.kind === 224) && ts.hasModifier(originalNode, 1)) {
- var name_42 = getDeclarationName(originalNode);
- if (originalNode.kind === 224) {
- hoistVariableDeclaration(name_42);
+ if ((originalNode.kind === 226 || originalNode.kind === 225) && ts.hasModifier(originalNode, 1)) {
+ var name_39 = getDeclarationName(originalNode);
+ if (originalNode.kind === 225) {
+ hoistVariableDeclaration(name_39);
}
return [
node,
- createExportStatement(name_42, name_42)
+ createExportStatement(name_39, name_39)
];
}
return node;
@@ -42958,7 +43155,7 @@ var ts;
;
return ts.createFor(expressions.length
? ts.inlineExpressions(expressions)
- : ts.createSynthesizedNode(193), node.condition, node.incrementor, ts.visitNode(node.statement, visitNestedNode, ts.isStatement), node);
+ : ts.createSynthesizedNode(194), node.condition, node.incrementor, ts.visitNode(node.statement, visitNestedNode, ts.isStatement), node);
}
else {
return ts.visitEachChild(node, visitNestedNode, context);
@@ -42970,7 +43167,7 @@ var ts;
var name = firstDeclaration.name;
return ts.isIdentifier(name)
? name
- : ts.flattenVariableDestructuringToExpression(context, firstDeclaration, hoistVariableDeclaration);
+ : ts.flattenVariableDestructuringToExpression(firstDeclaration, hoistVariableDeclaration);
}
function visitForInStatement(node) {
var initializer = node.initializer;
@@ -43096,12 +43293,12 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 69:
+ case 70:
return substituteExpressionIdentifier(node);
- case 187:
+ case 188:
return substituteBinaryExpression(node);
- case 185:
case 186:
+ case 187:
return substituteUnaryExpression(node);
}
return node;
@@ -43126,14 +43323,14 @@ var ts;
ts.setEmitFlags(node, 128);
var left = node.left;
switch (left.kind) {
- case 69:
+ case 70:
var exportDeclaration = resolver.getReferencedExportContainer(left);
if (exportDeclaration) {
return createExportExpression(left, node);
}
break;
+ case 172:
case 171:
- case 170:
if (hasExportedReferenceInDestructuringPattern(left)) {
return substituteDestructuring(node);
}
@@ -43147,9 +43344,9 @@ var ts;
}
function hasExportedReferenceInDestructuringPattern(node) {
switch (node.kind) {
- case 69:
+ case 70:
return isExportedBinding(node);
- case 171:
+ case 172:
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var property = _a[_i];
if (hasExportedReferenceInObjectDestructuringElement(property)) {
@@ -43157,7 +43354,7 @@ var ts;
}
}
break;
- case 170:
+ case 171:
for (var _b = 0, _c = node.elements; _b < _c.length; _b++) {
var element = _c[_b];
if (hasExportedReferenceInArrayDestructuringElement(element)) {
@@ -43191,7 +43388,7 @@ var ts;
function hasExportedReferenceInDestructuringElement(node) {
if (ts.isBinaryExpression(node)) {
var left = node.left;
- return node.operatorToken.kind === 56
+ return node.operatorToken.kind === 57
&& isDestructuringPattern(left)
&& hasExportedReferenceInDestructuringPattern(left);
}
@@ -43211,9 +43408,9 @@ var ts;
}
function isDestructuringPattern(node) {
var kind = node.kind;
- return kind === 69
- || kind === 171
- || kind === 170;
+ return kind === 70
+ || kind === 172
+ || kind === 171;
}
function substituteDestructuring(node) {
return ts.flattenDestructuringAssignment(context, node, true, hoistVariableDeclaration);
@@ -43222,19 +43419,19 @@ var ts;
var operand = node.operand;
var operator = node.operator;
var substitute = ts.isIdentifier(operand) &&
- (node.kind === 186 ||
- (node.kind === 185 && (operator === 41 || operator === 42)));
+ (node.kind === 187 ||
+ (node.kind === 186 && (operator === 42 || operator === 43)));
if (substitute) {
var exportDeclaration = resolver.getReferencedExportContainer(operand);
if (exportDeclaration) {
var expr = ts.createPrefix(node.operator, operand, node);
ts.setEmitFlags(expr, 128);
var call = createExportExpression(operand, expr);
- if (node.kind === 185) {
+ if (node.kind === 186) {
return call;
}
else {
- return operator === 41
+ return operator === 42
? ts.createSubtract(call, ts.createLiteral(1))
: ts.createAdd(call, ts.createLiteral(1));
}
@@ -43293,12 +43490,7 @@ var ts;
else {
return undefined;
}
- if (name.originalKeywordKind && languageVersion === 0) {
- return ts.createElementAccess(importAlias, ts.createLiteral(name.text));
- }
- else {
- return ts.createPropertyAccess(importAlias, ts.getSynthesizedClone(name));
- }
+ return ts.createPropertyAccess(importAlias, ts.getSynthesizedClone(name));
}
function collectDependencyGroups(externalImports) {
var groupIndices = ts.createMap();
@@ -43369,17 +43561,14 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
- function transformES6Module(context) {
+ function transformES2015Module(context) {
var compilerOptions = context.getCompilerOptions();
- var resolver = context.getEmitResolver();
- var currentSourceFile;
return transformSourceFile;
function transformSourceFile(node) {
if (ts.isDeclarationFile(node)) {
return node;
}
if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
- currentSourceFile = node;
return ts.visitEachChild(node, visitor, context);
}
return node;
@@ -43387,115 +43576,33 @@ var ts;
function visitor(node) {
switch (node.kind) {
case 230:
- return visitImportDeclaration(node);
- case 229:
- return visitImportEqualsDeclaration(node);
- case 231:
- return visitImportClause(node);
- case 233:
- case 232:
- return visitNamedBindings(node);
- case 234:
- return visitImportSpecifier(node);
- case 235:
- return visitExportAssignment(node);
+ return undefined;
case 236:
- return visitExportDeclaration(node);
- case 237:
- return visitNamedExports(node);
- case 238:
- return visitExportSpecifier(node);
+ return visitExportAssignment(node);
}
return node;
}
function visitExportAssignment(node) {
- if (node.isExportEquals) {
- return undefined;
- }
- var original = ts.getOriginalNode(node);
- return ts.nodeIsSynthesized(original) || resolver.isValueAliasDeclaration(original) ? node : undefined;
- }
- function visitExportDeclaration(node) {
- if (!node.exportClause) {
- return resolver.moduleExportsSomeValue(node.moduleSpecifier) ? node : undefined;
- }
- if (!resolver.isValueAliasDeclaration(node)) {
- return undefined;
- }
- var newExportClause = ts.visitNode(node.exportClause, visitor, ts.isNamedExports, true);
- if (node.exportClause === newExportClause) {
- return node;
- }
- return newExportClause
- ? ts.createExportDeclaration(undefined, undefined, newExportClause, node.moduleSpecifier)
- : undefined;
- }
- function visitNamedExports(node) {
- var newExports = ts.visitNodes(node.elements, visitor, ts.isExportSpecifier);
- if (node.elements === newExports) {
- return node;
- }
- return newExports.length ? ts.createNamedExports(newExports) : undefined;
- }
- function visitExportSpecifier(node) {
- return resolver.isValueAliasDeclaration(node) ? node : undefined;
- }
- function visitImportEqualsDeclaration(node) {
- return !ts.isExternalModuleImportEqualsDeclaration(node) || resolver.isReferencedAliasDeclaration(node) ? node : undefined;
- }
- function visitImportDeclaration(node) {
- if (node.importClause) {
- var newImportClause = ts.visitNode(node.importClause, visitor, ts.isImportClause);
- if (!newImportClause.name && !newImportClause.namedBindings) {
- return undefined;
- }
- else if (newImportClause !== node.importClause) {
- return ts.createImportDeclaration(undefined, undefined, newImportClause, node.moduleSpecifier);
- }
- }
- return node;
- }
- function visitImportClause(node) {
- var newDefaultImport = node.name;
- if (!resolver.isReferencedAliasDeclaration(node)) {
- newDefaultImport = undefined;
- }
- var newNamedBindings = ts.visitNode(node.namedBindings, visitor, ts.isNamedImportBindings, true);
- return newDefaultImport !== node.name || newNamedBindings !== node.namedBindings
- ? ts.createImportClause(newDefaultImport, newNamedBindings)
- : node;
- }
- function visitNamedBindings(node) {
- if (node.kind === 232) {
- return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
- }
- else {
- var newNamedImportElements = ts.visitNodes(node.elements, visitor, ts.isImportSpecifier);
- if (!newNamedImportElements || newNamedImportElements.length == 0) {
- return undefined;
- }
- if (newNamedImportElements === node.elements) {
- return node;
- }
- return ts.createNamedImports(newNamedImportElements);
- }
- }
- function visitImportSpecifier(node) {
- return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
+ return node.isExportEquals ? undefined : node;
}
}
- ts.transformES6Module = transformES6Module;
+ ts.transformES2015Module = transformES2015Module;
})(ts || (ts = {}));
var ts;
(function (ts) {
var moduleTransformerMap = ts.createMap((_a = {},
- _a[ts.ModuleKind.ES6] = ts.transformES6Module,
+ _a[ts.ModuleKind.ES2015] = ts.transformES2015Module,
_a[ts.ModuleKind.System] = ts.transformSystemModule,
_a[ts.ModuleKind.AMD] = ts.transformModule,
_a[ts.ModuleKind.CommonJS] = ts.transformModule,
_a[ts.ModuleKind.UMD] = ts.transformModule,
_a[ts.ModuleKind.None] = ts.transformModule,
_a));
+ var SyntaxKindFeatureFlags;
+ (function (SyntaxKindFeatureFlags) {
+ SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["Substitution"] = 1] = "Substitution";
+ SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["EmitNotifications"] = 2] = "EmitNotifications";
+ })(SyntaxKindFeatureFlags || (SyntaxKindFeatureFlags = {}));
function getTransformers(compilerOptions) {
var jsx = compilerOptions.jsx;
var languageVersion = ts.getEmitScriptTarget(compilerOptions);
@@ -43506,11 +43613,19 @@ var ts;
if (jsx === 2) {
transformers.push(ts.transformJsx);
}
- transformers.push(ts.transformES7);
+ if (languageVersion < 4) {
+ transformers.push(ts.transformES2017);
+ }
+ if (languageVersion < 3) {
+ transformers.push(ts.transformES2016);
+ }
if (languageVersion < 2) {
- transformers.push(ts.transformES6);
+ transformers.push(ts.transformES2015);
transformers.push(ts.transformGenerators);
}
+ if (languageVersion < 1) {
+ transformers.push(ts.transformES5);
+ }
return transformers;
}
ts.getTransformers = getTransformers;
@@ -43530,7 +43645,7 @@ var ts;
hoistFunctionDeclaration: hoistFunctionDeclaration,
startLexicalEnvironment: startLexicalEnvironment,
endLexicalEnvironment: endLexicalEnvironment,
- onSubstituteNode: function (emitContext, node) { return node; },
+ onSubstituteNode: function (_emitContext, node) { return node; },
enableSubstitution: enableSubstitution,
isSubstitutionEnabled: isSubstitutionEnabled,
onEmitNode: function (node, emitContext, emitCallback) { return emitCallback(node, emitContext); },
@@ -43670,7 +43785,7 @@ var ts;
var isCurrentFileExternalModule;
var reportedDeclarationError = false;
var errorNameNode;
- var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments;
+ var emitJsDocComments = compilerOptions.removeComments ? function () { } : writeJsDocComments;
var emit = compilerOptions.stripInternal ? stripInternal : emitNode;
var noDeclare;
var moduleElementDeclarationEmitInfo = [];
@@ -43714,7 +43829,7 @@ var ts;
var oldWriter = writer;
ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) {
if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) {
- ts.Debug.assert(aliasEmitInfo.node.kind === 230);
+ ts.Debug.assert(aliasEmitInfo.node.kind === 231);
createAndSetNewTextWriterWithSymbolWriter();
ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit));
for (var i = 0; i < aliasEmitInfo.indent; i++) {
@@ -43745,7 +43860,7 @@ var ts;
reportedDeclarationError: reportedDeclarationError,
moduleElementDeclarationEmitInfo: allSourcesModuleElementDeclarationEmitInfo,
synchronousDeclarationOutput: writer.getText(),
- referencesOutput: referencesOutput
+ referencesOutput: referencesOutput,
};
function hasInternalAnnotation(range) {
var comment = currentText.substring(range.pos, range.end);
@@ -43785,10 +43900,10 @@ var ts;
var oldWriter = writer;
ts.forEach(nodes, function (declaration) {
var nodeToCheck;
- if (declaration.kind === 218) {
+ if (declaration.kind === 219) {
nodeToCheck = declaration.parent.parent;
}
- else if (declaration.kind === 233 || declaration.kind === 234 || declaration.kind === 231) {
+ else if (declaration.kind === 234 || declaration.kind === 235 || declaration.kind === 232) {
ts.Debug.fail("We should be getting ImportDeclaration instead to write");
}
else {
@@ -43799,7 +43914,7 @@ var ts;
moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; });
}
if (moduleElementEmitInfo) {
- if (moduleElementEmitInfo.node.kind === 230) {
+ if (moduleElementEmitInfo.node.kind === 231) {
moduleElementEmitInfo.isVisible = true;
}
else {
@@ -43807,12 +43922,12 @@ var ts;
for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) {
increaseIndent();
}
- if (nodeToCheck.kind === 225) {
+ if (nodeToCheck.kind === 226) {
ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined);
asynchronousSubModuleDeclarationEmitInfo = [];
}
writeModuleElement(nodeToCheck);
- if (nodeToCheck.kind === 225) {
+ if (nodeToCheck.kind === 226) {
moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo;
asynchronousSubModuleDeclarationEmitInfo = undefined;
}
@@ -43924,67 +44039,67 @@ var ts;
}
function emitType(type) {
switch (type.kind) {
- case 117:
- case 132:
- case 130:
- case 120:
+ case 118:
case 133:
- case 103:
- case 135:
- case 93:
- case 127:
- case 165:
+ case 131:
+ case 121:
+ case 134:
+ case 104:
+ case 136:
+ case 94:
+ case 128:
case 166:
+ case 167:
return writeTextOfNode(currentText, type);
- case 194:
+ case 195:
return emitExpressionWithTypeArguments(type);
- case 155:
- return emitTypeReference(type);
- case 158:
- return emitTypeQuery(type);
- case 160:
- return emitArrayType(type);
- case 161:
- return emitTupleType(type);
- case 162:
- return emitUnionType(type);
- case 163:
- return emitIntersectionType(type);
- case 164:
- return emitParenType(type);
case 156:
- case 157:
- return emitSignatureDeclarationWithJsDocComments(type);
+ return emitTypeReference(type);
case 159:
+ return emitTypeQuery(type);
+ case 161:
+ return emitArrayType(type);
+ case 162:
+ return emitTupleType(type);
+ case 163:
+ return emitUnionType(type);
+ case 164:
+ return emitIntersectionType(type);
+ case 165:
+ return emitParenType(type);
+ case 157:
+ case 158:
+ return emitSignatureDeclarationWithJsDocComments(type);
+ case 160:
return emitTypeLiteral(type);
- case 69:
+ case 70:
return emitEntityName(type);
- case 139:
+ case 140:
return emitEntityName(type);
- case 154:
+ case 155:
return emitTypePredicate(type);
}
function writeEntityName(entityName) {
- if (entityName.kind === 69) {
+ if (entityName.kind === 70) {
writeTextOfNode(currentText, entityName);
}
else {
- var left = entityName.kind === 139 ? entityName.left : entityName.expression;
- var right = entityName.kind === 139 ? entityName.right : entityName.name;
+ var left = entityName.kind === 140 ? entityName.left : entityName.expression;
+ var right = entityName.kind === 140 ? entityName.right : entityName.name;
writeEntityName(left);
write(".");
writeTextOfNode(currentText, right);
}
}
function emitEntityName(entityName) {
- var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 229 ? entityName.parent : enclosingDeclaration);
+ var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 230 ? entityName.parent : enclosingDeclaration);
handleSymbolAccessibilityError(visibilityResult);
recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName));
writeEntityName(entityName);
}
function emitExpressionWithTypeArguments(node) {
if (ts.isEntityNameExpression(node.expression)) {
- ts.Debug.assert(node.expression.kind === 69 || node.expression.kind === 172);
+ ts.Debug.assert(node.expression.kind === 70 || node.expression.kind === 173);
emitEntityName(node.expression);
if (node.typeArguments) {
write("<");
@@ -44058,14 +44173,14 @@ var ts;
var count = 0;
while (true) {
count++;
- var name_43 = baseName + "_" + count;
- if (!(name_43 in currentIdentifiers)) {
- return name_43;
+ var name_40 = baseName + "_" + count;
+ if (!(name_40 in currentIdentifiers)) {
+ return name_40;
}
}
}
function emitExportAssignment(node) {
- if (node.expression.kind === 69) {
+ if (node.expression.kind === 70) {
write(node.isExportEquals ? "export = " : "export default ");
writeTextOfNode(currentText, node.expression);
}
@@ -44086,11 +44201,11 @@ var ts;
}
write(";");
writeLine();
- if (node.expression.kind === 69) {
+ if (node.expression.kind === 70) {
var nodes = resolver.collectLinkedAliases(node.expression);
writeAsynchronousModuleElements(nodes);
}
- function getDefaultExportAccessibilityDiagnostic(diagnostic) {
+ function getDefaultExportAccessibilityDiagnostic() {
return {
diagnosticMessage: ts.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0,
errorNode: node
@@ -44104,7 +44219,7 @@ var ts;
if (isModuleElementVisible) {
writeModuleElement(node);
}
- else if (node.kind === 229 ||
+ else if (node.kind === 230 ||
(node.parent.kind === 256 && isCurrentFileExternalModule)) {
var isVisible = void 0;
if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 256) {
@@ -44116,7 +44231,7 @@ var ts;
});
}
else {
- if (node.kind === 230) {
+ if (node.kind === 231) {
var importDeclaration = node;
if (importDeclaration.importClause) {
isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) ||
@@ -44134,23 +44249,23 @@ var ts;
}
function writeModuleElement(node) {
switch (node.kind) {
- case 220:
- return writeFunctionDeclaration(node);
- case 200:
- return writeVariableStatement(node);
- case 222:
- return writeInterfaceDeclaration(node);
case 221:
- return writeClassDeclaration(node);
+ return writeFunctionDeclaration(node);
+ case 201:
+ return writeVariableStatement(node);
case 223:
- return writeTypeAliasDeclaration(node);
+ return writeInterfaceDeclaration(node);
+ case 222:
+ return writeClassDeclaration(node);
case 224:
- return writeEnumDeclaration(node);
+ return writeTypeAliasDeclaration(node);
case 225:
+ return writeEnumDeclaration(node);
+ case 226:
return writeModuleDeclaration(node);
- case 229:
- return writeImportEqualsDeclaration(node);
case 230:
+ return writeImportEqualsDeclaration(node);
+ case 231:
return writeImportDeclaration(node);
default:
ts.Debug.fail("Unknown symbol kind");
@@ -44165,7 +44280,7 @@ var ts;
if (modifiers & 512) {
write("default ");
}
- else if (node.kind !== 222 && !noDeclare) {
+ else if (node.kind !== 223 && !noDeclare) {
write("declare ");
}
}
@@ -44205,7 +44320,7 @@ var ts;
write(");");
}
writer.writeLine();
- function getImportEntityNameVisibilityError(symbolAccessibilityResult) {
+ function getImportEntityNameVisibilityError() {
return {
diagnosticMessage: ts.Diagnostics.Import_declaration_0_is_using_private_name_1,
errorNode: node,
@@ -44215,7 +44330,7 @@ var ts;
}
function isVisibleNamedBinding(namedBindings) {
if (namedBindings) {
- if (namedBindings.kind === 232) {
+ if (namedBindings.kind === 233) {
return resolver.isDeclarationVisible(namedBindings);
}
else {
@@ -44238,7 +44353,7 @@ var ts;
if (currentWriterPos !== writer.getTextPos()) {
write(", ");
}
- if (node.importClause.namedBindings.kind === 232) {
+ if (node.importClause.namedBindings.kind === 233) {
write("* as ");
writeTextOfNode(currentText, node.importClause.namedBindings.name);
}
@@ -44255,13 +44370,13 @@ var ts;
writer.writeLine();
}
function emitExternalModuleSpecifier(parent) {
- resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 225;
+ resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 226;
var moduleSpecifier;
- if (parent.kind === 229) {
+ if (parent.kind === 230) {
var node = parent;
moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node);
}
- else if (parent.kind === 225) {
+ else if (parent.kind === 226) {
moduleSpecifier = parent.name;
}
else {
@@ -44329,7 +44444,7 @@ var ts;
writeTextOfNode(currentText, node.name);
}
}
- while (node.body && node.body.kind !== 226) {
+ while (node.body && node.body.kind !== 227) {
node = node.body;
write(".");
writeTextOfNode(currentText, node.name);
@@ -44363,7 +44478,7 @@ var ts;
write(";");
writeLine();
enclosingDeclaration = prevEnclosingDeclaration;
- function getTypeAliasDeclarationVisibilityError(symbolAccessibilityResult) {
+ function getTypeAliasDeclarationVisibilityError() {
return {
diagnosticMessage: ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1,
errorNode: node.type,
@@ -44399,7 +44514,7 @@ var ts;
writeLine();
}
function isPrivateMethodTypeParameter(node) {
- return node.parent.kind === 147 && ts.hasModifier(node.parent, 8);
+ return node.parent.kind === 148 && ts.hasModifier(node.parent, 8);
}
function emitTypeParameters(typeParameters) {
function emitTypeParameter(node) {
@@ -44409,49 +44524,49 @@ var ts;
writeTextOfNode(currentText, node.name);
if (node.constraint && !isPrivateMethodTypeParameter(node)) {
write(" extends ");
- if (node.parent.kind === 156 ||
- node.parent.kind === 157 ||
- (node.parent.parent && node.parent.parent.kind === 159)) {
- ts.Debug.assert(node.parent.kind === 147 ||
- node.parent.kind === 146 ||
- node.parent.kind === 156 ||
+ if (node.parent.kind === 157 ||
+ node.parent.kind === 158 ||
+ (node.parent.parent && node.parent.parent.kind === 160)) {
+ ts.Debug.assert(node.parent.kind === 148 ||
+ node.parent.kind === 147 ||
node.parent.kind === 157 ||
- node.parent.kind === 151 ||
- node.parent.kind === 152);
+ node.parent.kind === 158 ||
+ node.parent.kind === 152 ||
+ node.parent.kind === 153);
emitType(node.constraint);
}
else {
emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.constraint, getTypeParameterConstraintVisibilityError);
}
}
- function getTypeParameterConstraintVisibilityError(symbolAccessibilityResult) {
+ function getTypeParameterConstraintVisibilityError() {
var diagnosticMessage;
switch (node.parent.kind) {
- case 221:
+ case 222:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;
break;
- case 222:
+ case 223:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;
break;
- case 152:
+ case 153:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
- case 151:
+ case 152:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
+ case 148:
case 147:
- case 146:
if (ts.hasModifier(node.parent, 32)) {
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
}
- else if (node.parent.parent.kind === 221) {
+ else if (node.parent.parent.kind === 222) {
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1;
}
else {
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
break;
- case 220:
+ case 221:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
break;
default:
@@ -44479,16 +44594,16 @@ var ts;
if (ts.isEntityNameExpression(node.expression)) {
emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError);
}
- else if (!isImplementsList && node.expression.kind === 93) {
+ else if (!isImplementsList && node.expression.kind === 94) {
write("null");
}
else {
writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError;
resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 | 1024, writer);
}
- function getHeritageClauseVisibilityError(symbolAccessibilityResult) {
+ function getHeritageClauseVisibilityError() {
var diagnosticMessage;
- if (node.parent.parent.kind === 221) {
+ if (node.parent.parent.kind === 222) {
diagnosticMessage = isImplementsList ?
ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 :
ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1;
@@ -44568,17 +44683,17 @@ var ts;
writeLine();
}
function emitVariableDeclaration(node) {
- if (node.kind !== 218 || resolver.isDeclarationVisible(node)) {
+ if (node.kind !== 219 || resolver.isDeclarationVisible(node)) {
if (ts.isBindingPattern(node.name)) {
emitBindingPattern(node.name);
}
else {
writeTextOfNode(currentText, node.name);
- if ((node.kind === 145 || node.kind === 144 ||
- (node.kind === 142 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) {
+ if ((node.kind === 146 || node.kind === 145 ||
+ (node.kind === 143 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) {
write("?");
}
- if ((node.kind === 145 || node.kind === 144) && node.parent.kind === 159) {
+ if ((node.kind === 146 || node.kind === 145) && node.parent.kind === 160) {
emitTypeOfVariableDeclarationFromTypeLiteral(node);
}
else if (resolver.isLiteralConstDeclaration(node)) {
@@ -44591,14 +44706,14 @@ var ts;
}
}
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
- if (node.kind === 218) {
+ if (node.kind === 219) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
}
- else if (node.kind === 145 || node.kind === 144) {
+ else if (node.kind === 146 || node.kind === 145) {
if (ts.hasModifier(node, 32)) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -44606,7 +44721,7 @@ var ts;
ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
}
- else if (node.parent.kind === 221) {
+ else if (node.parent.kind === 222) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -44632,7 +44747,7 @@ var ts;
var elements = [];
for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) {
var element = _a[_i];
- if (element.kind !== 193) {
+ if (element.kind !== 194) {
elements.push(element);
}
}
@@ -44698,7 +44813,7 @@ var ts;
accessorWithTypeAnnotation = node;
var type = getTypeAnnotationFromAccessor(node);
if (!type) {
- var anotherAccessor = node.kind === 149 ? accessors.setAccessor : accessors.getAccessor;
+ var anotherAccessor = node.kind === 150 ? accessors.setAccessor : accessors.getAccessor;
type = getTypeAnnotationFromAccessor(anotherAccessor);
if (type) {
accessorWithTypeAnnotation = anotherAccessor;
@@ -44711,7 +44826,7 @@ var ts;
}
function getTypeAnnotationFromAccessor(accessor) {
if (accessor) {
- return accessor.kind === 149
+ return accessor.kind === 150
? accessor.type
: accessor.parameters.length > 0
? accessor.parameters[0].type
@@ -44720,7 +44835,7 @@ var ts;
}
function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) {
var diagnosticMessage;
- if (accessorWithTypeAnnotation.kind === 150) {
+ if (accessorWithTypeAnnotation.kind === 151) {
if (ts.hasModifier(accessorWithTypeAnnotation.parent, 32)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 :
@@ -44766,17 +44881,17 @@ var ts;
}
if (!resolver.isImplementationOfOverload(node)) {
emitJsDocComments(node);
- if (node.kind === 220) {
+ if (node.kind === 221) {
emitModuleElementDeclarationFlags(node);
}
- else if (node.kind === 147 || node.kind === 148) {
+ else if (node.kind === 148 || node.kind === 149) {
emitClassMemberDeclarationFlags(ts.getModifierFlags(node));
}
- if (node.kind === 220) {
+ if (node.kind === 221) {
write("function ");
writeTextOfNode(currentText, node.name);
}
- else if (node.kind === 148) {
+ else if (node.kind === 149) {
write("constructor");
}
else {
@@ -44796,15 +44911,15 @@ var ts;
var prevEnclosingDeclaration = enclosingDeclaration;
enclosingDeclaration = node;
var closeParenthesizedFunctionType = false;
- if (node.kind === 153) {
+ if (node.kind === 154) {
emitClassMemberDeclarationFlags(ts.getModifierFlags(node));
write("[");
}
else {
- if (node.kind === 152 || node.kind === 157) {
+ if (node.kind === 153 || node.kind === 158) {
write("new ");
}
- else if (node.kind === 156) {
+ else if (node.kind === 157) {
var currentOutput = writer.getText();
if (node.typeParameters && currentOutput.charAt(currentOutput.length - 1) === "<") {
closeParenthesizedFunctionType = true;
@@ -44815,20 +44930,20 @@ var ts;
write("(");
}
emitCommaList(node.parameters, emitParameterDeclaration);
- if (node.kind === 153) {
+ if (node.kind === 154) {
write("]");
}
else {
write(")");
}
- var isFunctionTypeOrConstructorType = node.kind === 156 || node.kind === 157;
- if (isFunctionTypeOrConstructorType || node.parent.kind === 159) {
+ var isFunctionTypeOrConstructorType = node.kind === 157 || node.kind === 158;
+ if (isFunctionTypeOrConstructorType || node.parent.kind === 160) {
if (node.type) {
write(isFunctionTypeOrConstructorType ? " => " : ": ");
emitType(node.type);
}
}
- else if (node.kind !== 148 && !ts.hasModifier(node, 8)) {
+ else if (node.kind !== 149 && !ts.hasModifier(node, 8)) {
writeReturnTypeAtSignature(node, getReturnTypeVisibilityError);
}
enclosingDeclaration = prevEnclosingDeclaration;
@@ -44842,23 +44957,23 @@ var ts;
function getReturnTypeVisibilityError(symbolAccessibilityResult) {
var diagnosticMessage;
switch (node.kind) {
- case 152:
+ case 153:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 151:
+ case 152:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 153:
+ case 154:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
+ case 148:
case 147:
- case 146:
if (ts.hasModifier(node, 32)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -44866,7 +44981,7 @@ var ts;
ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0;
}
- else if (node.parent.kind === 221) {
+ else if (node.parent.kind === 222) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named :
@@ -44879,7 +44994,7 @@ var ts;
ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;
}
break;
- case 220:
+ case 221:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named :
@@ -44911,9 +45026,9 @@ var ts;
write("?");
}
decreaseIndent();
- if (node.parent.kind === 156 ||
- node.parent.kind === 157 ||
- node.parent.parent.kind === 159) {
+ if (node.parent.kind === 157 ||
+ node.parent.kind === 158 ||
+ node.parent.parent.kind === 160) {
emitTypeOfVariableDeclarationFromTypeLiteral(node);
}
else if (!ts.hasModifier(node.parent, 8)) {
@@ -44929,22 +45044,22 @@ var ts;
}
function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
switch (node.parent.kind) {
- case 148:
+ case 149:
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;
- case 152:
+ case 153:
return symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 151:
+ case 152:
return symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
+ case 148:
case 147:
- case 146:
if (ts.hasModifier(node.parent, 32)) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -44952,7 +45067,7 @@ var ts;
ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
}
- else if (node.parent.parent.kind === 221) {
+ else if (node.parent.parent.kind === 222) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -44964,7 +45079,7 @@ var ts;
ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
- case 220:
+ case 221:
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -44975,12 +45090,12 @@ var ts;
}
}
function emitBindingPattern(bindingPattern) {
- if (bindingPattern.kind === 167) {
+ if (bindingPattern.kind === 168) {
write("{");
emitCommaList(bindingPattern.elements, emitBindingElement);
write("}");
}
- else if (bindingPattern.kind === 168) {
+ else if (bindingPattern.kind === 169) {
write("[");
var elements = bindingPattern.elements;
emitCommaList(elements, emitBindingElement);
@@ -44991,10 +45106,10 @@ var ts;
}
}
function emitBindingElement(bindingElement) {
- if (bindingElement.kind === 193) {
+ if (bindingElement.kind === 194) {
write(" ");
}
- else if (bindingElement.kind === 169) {
+ else if (bindingElement.kind === 170) {
if (bindingElement.propertyName) {
writeTextOfNode(currentText, bindingElement.propertyName);
write(": ");
@@ -45004,7 +45119,7 @@ var ts;
emitBindingPattern(bindingElement.name);
}
else {
- ts.Debug.assert(bindingElement.name.kind === 69);
+ ts.Debug.assert(bindingElement.name.kind === 70);
if (bindingElement.dotDotDotToken) {
write("...");
}
@@ -45016,37 +45131,37 @@ var ts;
}
function emitNode(node) {
switch (node.kind) {
- case 220:
- case 225:
- case 229:
- case 222:
case 221:
- case 223:
- case 224:
- return emitModuleElement(node, isModuleElementVisible(node));
- case 200:
- return emitModuleElement(node, isVariableStatementVisible(node));
+ case 226:
case 230:
+ case 223:
+ case 222:
+ case 224:
+ case 225:
+ return emitModuleElement(node, isModuleElementVisible(node));
+ case 201:
+ return emitModuleElement(node, isVariableStatementVisible(node));
+ case 231:
return emitModuleElement(node, !node.importClause);
- case 236:
+ case 237:
return emitExportDeclaration(node);
+ case 149:
case 148:
case 147:
- case 146:
return writeFunctionDeclaration(node);
- case 152:
- case 151:
case 153:
+ case 152:
+ case 154:
return emitSignatureDeclarationWithJsDocComments(node);
- case 149:
case 150:
+ case 151:
return emitAccessorDeclaration(node);
+ case 146:
case 145:
- case 144:
return emitPropertyDeclaration(node);
case 255:
return emitEnumMemberDeclaration(node);
- case 235:
+ case 236:
return emitExportAssignment(node);
case 256:
return emitSourceFile(node);
@@ -45066,7 +45181,7 @@ var ts;
referencesOutput += "/// " + newLine;
}
return addedBundledEmitReference;
- function getDeclFileName(emitFileNames, sourceFiles, isBundledEmit) {
+ function getDeclFileName(emitFileNames, _sourceFiles, isBundledEmit) {
if (isBundledEmit && !addBundledFileReference) {
return;
}
@@ -45131,7 +45246,7 @@ var ts;
emitNodeWithSourceMap: emitNodeWithSourceMap,
emitTokenWithSourceMap: emitTokenWithSourceMap,
getText: getText,
- getSourceMappingURL: getSourceMappingURL
+ getSourceMappingURL: getSourceMappingURL,
};
function initialize(filePath, sourceMapFilePath, sourceFiles, isBundledEmit) {
if (disabled) {
@@ -45334,7 +45449,7 @@ var ts;
sources: sourceMapData.sourceMapSources,
names: sourceMapData.sourceMapNames,
mappings: sourceMapData.sourceMapMappings,
- sourcesContent: sourceMapData.sourceMapSourcesContent
+ sourcesContent: sourceMapData.sourceMapSourcesContent,
});
}
function getSourceMappingURL() {
@@ -45398,7 +45513,7 @@ var ts;
setSourceFile: setSourceFile,
emitNodeWithComments: emitNodeWithComments,
emitBodyWithDetachedComments: emitBodyWithDetachedComments,
- emitTrailingCommentsOfPosition: emitTrailingCommentsOfPosition
+ emitTrailingCommentsOfPosition: emitTrailingCommentsOfPosition,
};
function emitNodeWithComments(emitContext, node, emitCallback) {
if (disabled) {
@@ -45436,7 +45551,7 @@ var ts;
}
if (!skipTrailingComments) {
containerEnd = end;
- if (node.kind === 219) {
+ if (node.kind === 220) {
declarationListContainerEnd = end;
}
}
@@ -45512,7 +45627,7 @@ var ts;
emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos);
}
}
- function emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) {
+ function emitLeadingComment(commentPos, commentEnd, _kind, hasTrailingNewLine, rangePos) {
if (!hasWrittenComment) {
ts.emitNewLineBeforeLeadingCommentOfPosition(currentLineMap, writer, rangePos, commentPos);
hasWrittenComment = true;
@@ -45530,7 +45645,7 @@ var ts;
function emitTrailingComments(pos) {
forEachTrailingCommentToEmit(pos, emitTrailingComment);
}
- function emitTrailingComment(commentPos, commentEnd, kind, hasTrailingNewLine) {
+ function emitTrailingComment(commentPos, commentEnd, _kind, hasTrailingNewLine) {
if (!writer.isAtStartOfLine()) {
writer.write(" ");
}
@@ -45553,7 +45668,7 @@ var ts;
ts.performance.measure("commentTime", "beforeEmitTrailingCommentsOfPosition");
}
}
- function emitTrailingCommentOfPosition(commentPos, commentEnd, kind, hasTrailingNewLine) {
+ function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) {
emitPos(commentPos);
ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine);
emitPos(commentEnd);
@@ -45636,8 +45751,14 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
+ var TempFlags;
+ (function (TempFlags) {
+ TempFlags[TempFlags["Auto"] = 0] = "Auto";
+ TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask";
+ TempFlags[TempFlags["_i"] = 268435456] = "_i";
+ })(TempFlags || (TempFlags = {}));
var id = function (s) { return s; };
- var nullTransformers = [function (ctx) { return id; }];
+ var nullTransformers = [function (_) { return id; }];
function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles) {
var delimiters = createDelimiterMap();
var brackets = createBracketsMap();
@@ -45815,191 +45936,205 @@ var ts;
function pipelineEmitInIdentifierNameContext(node) {
var kind = node.kind;
switch (kind) {
- case 69:
+ case 70:
return emitIdentifier(node);
}
}
function pipelineEmitInUnspecifiedContext(node) {
var kind = node.kind;
switch (kind) {
- case 12:
case 13:
case 14:
+ case 15:
return emitLiteral(node);
- case 69:
+ case 70:
return emitIdentifier(node);
- case 74:
- case 77:
- case 82:
- case 103:
- case 110:
+ case 75:
+ case 78:
+ case 83:
+ case 104:
case 111:
case 112:
case 113:
- case 115:
+ case 114:
+ case 116:
case 117:
case 118:
+ case 119:
case 120:
+ case 121:
case 122:
- case 130:
+ case 123:
+ case 124:
+ case 125:
+ case 126:
+ case 127:
case 128:
+ case 129:
+ case 130:
+ case 131:
case 132:
case 133:
+ case 134:
+ case 135:
+ case 136:
case 137:
+ case 138:
+ case 139:
writeTokenText(kind);
return;
- case 139:
- return emitQualifiedName(node);
case 140:
- return emitComputedPropertyName(node);
+ return emitQualifiedName(node);
case 141:
- return emitTypeParameter(node);
+ return emitComputedPropertyName(node);
case 142:
- return emitParameter(node);
+ return emitTypeParameter(node);
case 143:
- return emitDecorator(node);
+ return emitParameter(node);
case 144:
- return emitPropertySignature(node);
+ return emitDecorator(node);
case 145:
- return emitPropertyDeclaration(node);
+ return emitPropertySignature(node);
case 146:
- return emitMethodSignature(node);
+ return emitPropertyDeclaration(node);
case 147:
- return emitMethodDeclaration(node);
+ return emitMethodSignature(node);
case 148:
- return emitConstructor(node);
+ return emitMethodDeclaration(node);
case 149:
+ return emitConstructor(node);
case 150:
- return emitAccessorDeclaration(node);
case 151:
- return emitCallSignature(node);
+ return emitAccessorDeclaration(node);
case 152:
- return emitConstructSignature(node);
+ return emitCallSignature(node);
case 153:
- return emitIndexSignature(node);
+ return emitConstructSignature(node);
case 154:
- return emitTypePredicate(node);
+ return emitIndexSignature(node);
case 155:
- return emitTypeReference(node);
+ return emitTypePredicate(node);
case 156:
- return emitFunctionType(node);
+ return emitTypeReference(node);
case 157:
- return emitConstructorType(node);
+ return emitFunctionType(node);
case 158:
- return emitTypeQuery(node);
+ return emitConstructorType(node);
case 159:
- return emitTypeLiteral(node);
+ return emitTypeQuery(node);
case 160:
- return emitArrayType(node);
+ return emitTypeLiteral(node);
case 161:
- return emitTupleType(node);
+ return emitArrayType(node);
case 162:
- return emitUnionType(node);
+ return emitTupleType(node);
case 163:
- return emitIntersectionType(node);
+ return emitUnionType(node);
case 164:
- return emitParenthesizedType(node);
- case 194:
- return emitExpressionWithTypeArguments(node);
+ return emitIntersectionType(node);
case 165:
- return emitThisType(node);
+ return emitParenthesizedType(node);
+ case 195:
+ return emitExpressionWithTypeArguments(node);
case 166:
- return emitLiteralType(node);
+ return emitThisType();
case 167:
- return emitObjectBindingPattern(node);
+ return emitLiteralType(node);
case 168:
- return emitArrayBindingPattern(node);
+ return emitObjectBindingPattern(node);
case 169:
+ return emitArrayBindingPattern(node);
+ case 170:
return emitBindingElement(node);
- case 197:
- return emitTemplateSpan(node);
case 198:
- return emitSemicolonClassElement(node);
+ return emitTemplateSpan(node);
case 199:
- return emitBlock(node);
+ return emitSemicolonClassElement();
case 200:
- return emitVariableStatement(node);
+ return emitBlock(node);
case 201:
- return emitEmptyStatement(node);
+ return emitVariableStatement(node);
case 202:
- return emitExpressionStatement(node);
+ return emitEmptyStatement();
case 203:
- return emitIfStatement(node);
+ return emitExpressionStatement(node);
case 204:
- return emitDoStatement(node);
+ return emitIfStatement(node);
case 205:
- return emitWhileStatement(node);
+ return emitDoStatement(node);
case 206:
- return emitForStatement(node);
+ return emitWhileStatement(node);
case 207:
- return emitForInStatement(node);
+ return emitForStatement(node);
case 208:
- return emitForOfStatement(node);
+ return emitForInStatement(node);
case 209:
- return emitContinueStatement(node);
+ return emitForOfStatement(node);
case 210:
- return emitBreakStatement(node);
+ return emitContinueStatement(node);
case 211:
- return emitReturnStatement(node);
+ return emitBreakStatement(node);
case 212:
- return emitWithStatement(node);
+ return emitReturnStatement(node);
case 213:
- return emitSwitchStatement(node);
+ return emitWithStatement(node);
case 214:
- return emitLabeledStatement(node);
+ return emitSwitchStatement(node);
case 215:
- return emitThrowStatement(node);
+ return emitLabeledStatement(node);
case 216:
- return emitTryStatement(node);
+ return emitThrowStatement(node);
case 217:
- return emitDebuggerStatement(node);
+ return emitTryStatement(node);
case 218:
- return emitVariableDeclaration(node);
+ return emitDebuggerStatement(node);
case 219:
- return emitVariableDeclarationList(node);
+ return emitVariableDeclaration(node);
case 220:
- return emitFunctionDeclaration(node);
+ return emitVariableDeclarationList(node);
case 221:
- return emitClassDeclaration(node);
+ return emitFunctionDeclaration(node);
case 222:
- return emitInterfaceDeclaration(node);
+ return emitClassDeclaration(node);
case 223:
- return emitTypeAliasDeclaration(node);
+ return emitInterfaceDeclaration(node);
case 224:
- return emitEnumDeclaration(node);
+ return emitTypeAliasDeclaration(node);
case 225:
- return emitModuleDeclaration(node);
+ return emitEnumDeclaration(node);
case 226:
- return emitModuleBlock(node);
+ return emitModuleDeclaration(node);
case 227:
+ return emitModuleBlock(node);
+ case 228:
return emitCaseBlock(node);
- case 229:
- return emitImportEqualsDeclaration(node);
case 230:
- return emitImportDeclaration(node);
+ return emitImportEqualsDeclaration(node);
case 231:
- return emitImportClause(node);
+ return emitImportDeclaration(node);
case 232:
- return emitNamespaceImport(node);
+ return emitImportClause(node);
case 233:
- return emitNamedImports(node);
+ return emitNamespaceImport(node);
case 234:
- return emitImportSpecifier(node);
+ return emitNamedImports(node);
case 235:
- return emitExportAssignment(node);
+ return emitImportSpecifier(node);
case 236:
- return emitExportDeclaration(node);
+ return emitExportAssignment(node);
case 237:
- return emitNamedExports(node);
+ return emitExportDeclaration(node);
case 238:
- return emitExportSpecifier(node);
+ return emitNamedExports(node);
case 239:
- return;
+ return emitExportSpecifier(node);
case 240:
+ return;
+ case 241:
return emitExternalModuleReference(node);
- case 244:
+ case 10:
return emitJsxText(node);
- case 243:
+ case 244:
return emitJsxOpeningElement(node);
case 245:
return emitJsxClosingElement(node);
@@ -46034,73 +46169,73 @@ var ts;
case 8:
return emitNumericLiteral(node);
case 9:
- case 10:
case 11:
+ case 12:
return emitLiteral(node);
- case 69:
+ case 70:
return emitIdentifier(node);
- case 84:
- case 93:
- case 95:
- case 99:
- case 97:
+ case 85:
+ case 94:
+ case 96:
+ case 100:
+ case 98:
writeTokenText(kind);
return;
- case 170:
- return emitArrayLiteralExpression(node);
case 171:
- return emitObjectLiteralExpression(node);
+ return emitArrayLiteralExpression(node);
case 172:
- return emitPropertyAccessExpression(node);
+ return emitObjectLiteralExpression(node);
case 173:
- return emitElementAccessExpression(node);
+ return emitPropertyAccessExpression(node);
case 174:
- return emitCallExpression(node);
+ return emitElementAccessExpression(node);
case 175:
- return emitNewExpression(node);
+ return emitCallExpression(node);
case 176:
- return emitTaggedTemplateExpression(node);
+ return emitNewExpression(node);
case 177:
- return emitTypeAssertionExpression(node);
+ return emitTaggedTemplateExpression(node);
case 178:
- return emitParenthesizedExpression(node);
+ return emitTypeAssertionExpression(node);
case 179:
- return emitFunctionExpression(node);
+ return emitParenthesizedExpression(node);
case 180:
- return emitArrowFunction(node);
+ return emitFunctionExpression(node);
case 181:
- return emitDeleteExpression(node);
+ return emitArrowFunction(node);
case 182:
- return emitTypeOfExpression(node);
+ return emitDeleteExpression(node);
case 183:
- return emitVoidExpression(node);
+ return emitTypeOfExpression(node);
case 184:
- return emitAwaitExpression(node);
+ return emitVoidExpression(node);
case 185:
- return emitPrefixUnaryExpression(node);
+ return emitAwaitExpression(node);
case 186:
- return emitPostfixUnaryExpression(node);
+ return emitPrefixUnaryExpression(node);
case 187:
- return emitBinaryExpression(node);
+ return emitPostfixUnaryExpression(node);
case 188:
- return emitConditionalExpression(node);
+ return emitBinaryExpression(node);
case 189:
- return emitTemplateExpression(node);
+ return emitConditionalExpression(node);
case 190:
- return emitYieldExpression(node);
+ return emitTemplateExpression(node);
case 191:
- return emitSpreadElementExpression(node);
+ return emitYieldExpression(node);
case 192:
- return emitClassExpression(node);
+ return emitSpreadElementExpression(node);
case 193:
+ return emitClassExpression(node);
+ case 194:
return;
- case 195:
- return emitAsExpression(node);
case 196:
+ return emitAsExpression(node);
+ case 197:
return emitNonNullExpression(node);
- case 241:
- return emitJsxElement(node);
case 242:
+ return emitJsxElement(node);
+ case 243:
return emitJsxSelfClosingElement(node);
case 288:
return emitPartiallyEmittedExpression(node);
@@ -46136,7 +46271,7 @@ var ts;
emit(node.right);
}
function emitEntityName(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
emitExpression(node);
}
else {
@@ -46206,7 +46341,7 @@ var ts;
function emitAccessorDeclaration(node) {
emitDecorators(node, node.decorators);
emitModifiers(node, node.modifiers);
- write(node.kind === 149 ? "get " : "set ");
+ write(node.kind === 150 ? "get " : "set ");
emit(node.name);
emitSignatureAndBody(node, emitSignatureHead);
}
@@ -46234,7 +46369,7 @@ var ts;
emitWithPrefix(": ", node.type);
write(";");
}
- function emitSemicolonClassElement(node) {
+ function emitSemicolonClassElement() {
write(";");
}
function emitTypePredicate(node) {
@@ -46288,7 +46423,7 @@ var ts;
emit(node.type);
write(")");
}
- function emitThisType(node) {
+ function emitThisType() {
write("this");
}
function emitLiteralType(node) {
@@ -46356,7 +46491,7 @@ var ts;
if (!(ts.getEmitFlags(node) & 1048576)) {
var dotRangeStart = node.expression.end;
var dotRangeEnd = ts.skipTrivia(currentText, node.expression.end) + 1;
- var dotToken = { kind: 21, pos: dotRangeStart, end: dotRangeEnd };
+ var dotToken = { kind: 22, pos: dotRangeStart, end: dotRangeEnd };
indentBeforeDot = needsIndentation(node, node.expression, dotToken);
indentAfterDot = needsIndentation(node, dotToken, node.name);
}
@@ -46371,7 +46506,7 @@ var ts;
function needsDotDotForPropertyAccess(expression) {
if (expression.kind === 8) {
var text = getLiteralTextOfNode(expression);
- return text.indexOf(ts.tokenToString(21)) < 0;
+ return text.indexOf(ts.tokenToString(22)) < 0;
}
else if (ts.isPropertyAccessExpression(expression) || ts.isElementAccessExpression(expression)) {
var constantValue = ts.getConstantValue(expression);
@@ -46388,11 +46523,13 @@ var ts;
}
function emitCallExpression(node) {
emitExpression(node.expression);
+ emitTypeArguments(node, node.typeArguments);
emitExpressionList(node, node.arguments, 1296);
}
function emitNewExpression(node) {
write("new ");
emitExpression(node.expression);
+ emitTypeArguments(node, node.typeArguments);
emitExpressionList(node, node.arguments, 9488);
}
function emitTaggedTemplateExpression(node) {
@@ -46452,16 +46589,16 @@ var ts;
}
function shouldEmitWhitespaceBeforeOperand(node) {
var operand = node.operand;
- return operand.kind === 185
- && ((node.operator === 35 && (operand.operator === 35 || operand.operator === 41))
- || (node.operator === 36 && (operand.operator === 36 || operand.operator === 42)));
+ return operand.kind === 186
+ && ((node.operator === 36 && (operand.operator === 36 || operand.operator === 42))
+ || (node.operator === 37 && (operand.operator === 37 || operand.operator === 43)));
}
function emitPostfixUnaryExpression(node) {
emitExpression(node.operand);
writeTokenText(node.operator);
}
function emitBinaryExpression(node) {
- var isCommaOperator = node.operatorToken.kind !== 24;
+ var isCommaOperator = node.operatorToken.kind !== 25;
var indentBeforeOperator = needsIndentation(node, node.left, node.operatorToken);
var indentAfterOperator = needsIndentation(node, node.operatorToken, node.right);
emitExpression(node.left);
@@ -46522,16 +46659,16 @@ var ts;
emitExpression(node.expression);
emit(node.literal);
}
- function emitBlock(node, format) {
+ function emitBlock(node) {
if (isSingleLineEmptyBlock(node)) {
- writeToken(15, node.pos, node);
+ writeToken(16, node.pos, node);
write(" ");
- writeToken(16, node.statements.end, node);
+ writeToken(17, node.statements.end, node);
}
else {
- writeToken(15, node.pos, node);
+ writeToken(16, node.pos, node);
emitBlockStatements(node);
- writeToken(16, node.statements.end, node);
+ writeToken(17, node.statements.end, node);
}
}
function emitBlockStatements(node) {
@@ -46547,7 +46684,7 @@ var ts;
emit(node.declarationList);
write(";");
}
- function emitEmptyStatement(node) {
+ function emitEmptyStatement() {
write(";");
}
function emitExpressionStatement(node) {
@@ -46555,16 +46692,16 @@ var ts;
write(";");
}
function emitIfStatement(node) {
- var openParenPos = writeToken(88, node.pos, node);
+ var openParenPos = writeToken(89, node.pos, node);
write(" ");
- writeToken(17, openParenPos, node);
+ writeToken(18, openParenPos, node);
emitExpression(node.expression);
- writeToken(18, node.expression.end, node);
+ writeToken(19, node.expression.end, node);
emitEmbeddedStatement(node.thenStatement);
if (node.elseStatement) {
writeLine();
- writeToken(80, node.thenStatement.end, node);
- if (node.elseStatement.kind === 203) {
+ writeToken(81, node.thenStatement.end, node);
+ if (node.elseStatement.kind === 204) {
write(" ");
emit(node.elseStatement);
}
@@ -46593,9 +46730,9 @@ var ts;
emitEmbeddedStatement(node.statement);
}
function emitForStatement(node) {
- var openParenPos = writeToken(86, node.pos);
+ var openParenPos = writeToken(87, node.pos);
write(" ");
- writeToken(17, openParenPos, node);
+ writeToken(18, openParenPos, node);
emitForBinding(node.initializer);
write(";");
emitExpressionWithPrefix(" ", node.condition);
@@ -46605,28 +46742,28 @@ var ts;
emitEmbeddedStatement(node.statement);
}
function emitForInStatement(node) {
- var openParenPos = writeToken(86, node.pos);
+ var openParenPos = writeToken(87, node.pos);
write(" ");
- writeToken(17, openParenPos);
+ writeToken(18, openParenPos);
emitForBinding(node.initializer);
write(" in ");
emitExpression(node.expression);
- writeToken(18, node.expression.end);
+ writeToken(19, node.expression.end);
emitEmbeddedStatement(node.statement);
}
function emitForOfStatement(node) {
- var openParenPos = writeToken(86, node.pos);
+ var openParenPos = writeToken(87, node.pos);
write(" ");
- writeToken(17, openParenPos);
+ writeToken(18, openParenPos);
emitForBinding(node.initializer);
write(" of ");
emitExpression(node.expression);
- writeToken(18, node.expression.end);
+ writeToken(19, node.expression.end);
emitEmbeddedStatement(node.statement);
}
function emitForBinding(node) {
if (node !== undefined) {
- if (node.kind === 219) {
+ if (node.kind === 220) {
emit(node);
}
else {
@@ -46635,17 +46772,17 @@ var ts;
}
}
function emitContinueStatement(node) {
- writeToken(75, node.pos);
+ writeToken(76, node.pos);
emitWithPrefix(" ", node.label);
write(";");
}
function emitBreakStatement(node) {
- writeToken(70, node.pos);
+ writeToken(71, node.pos);
emitWithPrefix(" ", node.label);
write(";");
}
function emitReturnStatement(node) {
- writeToken(94, node.pos, node);
+ writeToken(95, node.pos, node);
emitExpressionWithPrefix(" ", node.expression);
write(";");
}
@@ -46656,11 +46793,11 @@ var ts;
emitEmbeddedStatement(node.statement);
}
function emitSwitchStatement(node) {
- var openParenPos = writeToken(96, node.pos);
+ var openParenPos = writeToken(97, node.pos);
write(" ");
- writeToken(17, openParenPos);
+ writeToken(18, openParenPos);
emitExpression(node.expression);
- writeToken(18, node.expression.end);
+ writeToken(19, node.expression.end);
write(" ");
emit(node.caseBlock);
}
@@ -46685,11 +46822,12 @@ var ts;
}
}
function emitDebuggerStatement(node) {
- writeToken(76, node.pos);
+ writeToken(77, node.pos);
write(";");
}
function emitVariableDeclaration(node) {
emit(node.name);
+ emitWithPrefix(": ", node.type);
emitExpressionWithPrefix(" = ", node.initializer);
}
function emitVariableDeclarationList(node) {
@@ -46716,13 +46854,13 @@ var ts;
}
if (ts.getEmitFlags(node) & 4194304) {
emitSignatureHead(node);
- emitBlockFunctionBody(node, body);
+ emitBlockFunctionBody(body);
}
else {
var savedTempFlags = tempFlags;
tempFlags = 0;
emitSignatureHead(node);
- emitBlockFunctionBody(node, body);
+ emitBlockFunctionBody(body);
tempFlags = savedTempFlags;
}
if (indentedFlag) {
@@ -46745,7 +46883,7 @@ var ts;
emitParameters(node, node.parameters);
emitWithPrefix(": ", node.type);
}
- function shouldEmitBlockFunctionBodyOnSingleLine(parentNode, body) {
+ function shouldEmitBlockFunctionBodyOnSingleLine(body) {
if (ts.getEmitFlags(body) & 32) {
return true;
}
@@ -46769,14 +46907,14 @@ var ts;
}
return true;
}
- function emitBlockFunctionBody(parentNode, body) {
+ function emitBlockFunctionBody(body) {
write(" {");
increaseIndent();
- emitBodyWithDetachedComments(body, body.statements, shouldEmitBlockFunctionBodyOnSingleLine(parentNode, body)
+ emitBodyWithDetachedComments(body, body.statements, shouldEmitBlockFunctionBodyOnSingleLine(body)
? emitBlockFunctionBodyOnSingleLine
: emitBlockFunctionBodyWorker);
decreaseIndent();
- writeToken(16, body.statements.end, body);
+ writeToken(17, body.statements.end, body);
}
function emitBlockFunctionBodyOnSingleLine(body) {
emitBlockFunctionBodyWorker(body, true);
@@ -46854,7 +46992,7 @@ var ts;
write(node.flags & 16 ? "namespace " : "module ");
emit(node.name);
var body = node.body;
- while (body.kind === 225) {
+ while (body.kind === 226) {
write(".");
emit(body.name);
body = body.body;
@@ -46877,9 +47015,9 @@ var ts;
}
}
function emitCaseBlock(node) {
- writeToken(15, node.pos);
+ writeToken(16, node.pos);
emitList(node, node.clauses, 65);
- writeToken(16, node.clauses.end);
+ writeToken(17, node.clauses.end);
}
function emitImportEqualsDeclaration(node) {
emitModifiers(node, node.modifiers);
@@ -46890,7 +47028,7 @@ var ts;
write(";");
}
function emitModuleReference(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
emitExpression(node);
}
else {
@@ -47010,7 +47148,7 @@ var ts;
}
}
function emitJsxTagName(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
emitExpression(node);
}
else {
@@ -47048,11 +47186,11 @@ var ts;
}
function emitCatchClause(node) {
writeLine();
- var openParenPos = writeToken(72, node.pos);
+ var openParenPos = writeToken(73, node.pos);
write(" ");
- writeToken(17, openParenPos);
+ writeToken(18, openParenPos);
emit(node.variableDeclaration);
- writeToken(18, node.variableDeclaration ? node.variableDeclaration.end : openParenPos);
+ writeToken(19, node.variableDeclaration ? node.variableDeclaration.end : openParenPos);
write(" ");
emit(node.block);
}
@@ -47159,7 +47297,7 @@ var ts;
paramEmitted = true;
helpersEmitted = true;
}
- if (!awaiterEmitted && node.flags & 8192) {
+ if ((languageVersion < 4) && (!awaiterEmitted && node.flags & 8192)) {
writeLines(awaiterHelper);
if (languageVersion < 2) {
writeLines(generatorHelper);
@@ -47468,7 +47606,7 @@ var ts;
&& !ts.rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile);
}
function skipSynthesizedParentheses(node) {
- while (node.kind === 178 && ts.nodeIsSynthesized(node)) {
+ while (node.kind === 179 && ts.nodeIsSynthesized(node)) {
node = node.expression;
}
return node;
@@ -47525,21 +47663,21 @@ var ts;
}
function makeTempVariableName(flags) {
if (flags && !(tempFlags & flags)) {
- var name_44 = flags === 268435456 ? "_i" : "_n";
- if (isUniqueName(name_44)) {
+ var name_41 = flags === 268435456 ? "_i" : "_n";
+ if (isUniqueName(name_41)) {
tempFlags |= flags;
- return name_44;
+ return name_41;
}
}
while (true) {
var count = tempFlags & 268435455;
tempFlags++;
if (count !== 8 && count !== 13) {
- var name_45 = count < 26
+ var name_42 = count < 26
? "_" + String.fromCharCode(97 + count)
: "_" + (count - 26);
- if (isUniqueName(name_45)) {
- return name_45;
+ if (isUniqueName(name_42)) {
+ return name_42;
}
}
}
@@ -47575,19 +47713,19 @@ var ts;
}
function generateNameForNode(node) {
switch (node.kind) {
- case 69:
+ case 70:
return makeUniqueName(getTextOfNode(node));
+ case 226:
case 225:
- case 224:
return generateNameForModuleOrEnum(node);
- case 230:
- case 236:
+ case 231:
+ case 237:
return generateNameForImportOrExportDeclaration(node);
- case 220:
case 221:
- case 235:
+ case 222:
+ case 236:
return generateNameForExportDefault();
- case 192:
+ case 193:
return generateNameForClassExpression();
default:
return makeTempVariableName(0);
@@ -47657,6 +47795,68 @@ var ts;
}
}
ts.emitFiles = emitFiles;
+ var ListFormat;
+ (function (ListFormat) {
+ ListFormat[ListFormat["None"] = 0] = "None";
+ ListFormat[ListFormat["SingleLine"] = 0] = "SingleLine";
+ ListFormat[ListFormat["MultiLine"] = 1] = "MultiLine";
+ ListFormat[ListFormat["PreserveLines"] = 2] = "PreserveLines";
+ ListFormat[ListFormat["LinesMask"] = 3] = "LinesMask";
+ ListFormat[ListFormat["NotDelimited"] = 0] = "NotDelimited";
+ ListFormat[ListFormat["BarDelimited"] = 4] = "BarDelimited";
+ ListFormat[ListFormat["AmpersandDelimited"] = 8] = "AmpersandDelimited";
+ ListFormat[ListFormat["CommaDelimited"] = 16] = "CommaDelimited";
+ ListFormat[ListFormat["DelimitersMask"] = 28] = "DelimitersMask";
+ ListFormat[ListFormat["AllowTrailingComma"] = 32] = "AllowTrailingComma";
+ ListFormat[ListFormat["Indented"] = 64] = "Indented";
+ ListFormat[ListFormat["SpaceBetweenBraces"] = 128] = "SpaceBetweenBraces";
+ ListFormat[ListFormat["SpaceBetweenSiblings"] = 256] = "SpaceBetweenSiblings";
+ ListFormat[ListFormat["Braces"] = 512] = "Braces";
+ ListFormat[ListFormat["Parenthesis"] = 1024] = "Parenthesis";
+ ListFormat[ListFormat["AngleBrackets"] = 2048] = "AngleBrackets";
+ ListFormat[ListFormat["SquareBrackets"] = 4096] = "SquareBrackets";
+ ListFormat[ListFormat["BracketsMask"] = 7680] = "BracketsMask";
+ ListFormat[ListFormat["OptionalIfUndefined"] = 8192] = "OptionalIfUndefined";
+ ListFormat[ListFormat["OptionalIfEmpty"] = 16384] = "OptionalIfEmpty";
+ ListFormat[ListFormat["Optional"] = 24576] = "Optional";
+ ListFormat[ListFormat["PreferNewLine"] = 32768] = "PreferNewLine";
+ ListFormat[ListFormat["NoTrailingNewLine"] = 65536] = "NoTrailingNewLine";
+ ListFormat[ListFormat["NoInterveningComments"] = 131072] = "NoInterveningComments";
+ ListFormat[ListFormat["Modifiers"] = 256] = "Modifiers";
+ ListFormat[ListFormat["HeritageClauses"] = 256] = "HeritageClauses";
+ ListFormat[ListFormat["TypeLiteralMembers"] = 65] = "TypeLiteralMembers";
+ ListFormat[ListFormat["TupleTypeElements"] = 336] = "TupleTypeElements";
+ ListFormat[ListFormat["UnionTypeConstituents"] = 260] = "UnionTypeConstituents";
+ ListFormat[ListFormat["IntersectionTypeConstituents"] = 264] = "IntersectionTypeConstituents";
+ ListFormat[ListFormat["ObjectBindingPatternElements"] = 432] = "ObjectBindingPatternElements";
+ ListFormat[ListFormat["ArrayBindingPatternElements"] = 304] = "ArrayBindingPatternElements";
+ ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 978] = "ObjectLiteralExpressionProperties";
+ ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 4466] = "ArrayLiteralExpressionElements";
+ ListFormat[ListFormat["CallExpressionArguments"] = 1296] = "CallExpressionArguments";
+ ListFormat[ListFormat["NewExpressionArguments"] = 9488] = "NewExpressionArguments";
+ ListFormat[ListFormat["TemplateExpressionSpans"] = 131072] = "TemplateExpressionSpans";
+ ListFormat[ListFormat["SingleLineBlockStatements"] = 384] = "SingleLineBlockStatements";
+ ListFormat[ListFormat["MultiLineBlockStatements"] = 65] = "MultiLineBlockStatements";
+ ListFormat[ListFormat["VariableDeclarationList"] = 272] = "VariableDeclarationList";
+ ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 384] = "SingleLineFunctionBodyStatements";
+ ListFormat[ListFormat["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements";
+ ListFormat[ListFormat["ClassHeritageClauses"] = 256] = "ClassHeritageClauses";
+ ListFormat[ListFormat["ClassMembers"] = 65] = "ClassMembers";
+ ListFormat[ListFormat["InterfaceMembers"] = 65] = "InterfaceMembers";
+ ListFormat[ListFormat["EnumMembers"] = 81] = "EnumMembers";
+ ListFormat[ListFormat["CaseBlockClauses"] = 65] = "CaseBlockClauses";
+ ListFormat[ListFormat["NamedImportsOrExportsElements"] = 432] = "NamedImportsOrExportsElements";
+ ListFormat[ListFormat["JsxElementChildren"] = 131072] = "JsxElementChildren";
+ ListFormat[ListFormat["JsxElementAttributes"] = 131328] = "JsxElementAttributes";
+ ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 81985] = "CaseOrDefaultClauseStatements";
+ ListFormat[ListFormat["HeritageClauseTypes"] = 272] = "HeritageClauseTypes";
+ ListFormat[ListFormat["SourceFileStatements"] = 65537] = "SourceFileStatements";
+ ListFormat[ListFormat["Decorators"] = 24577] = "Decorators";
+ ListFormat[ListFormat["TypeArguments"] = 26960] = "TypeArguments";
+ ListFormat[ListFormat["TypeParameters"] = 26960] = "TypeParameters";
+ ListFormat[ListFormat["Parameters"] = 1360] = "Parameters";
+ ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters";
+ })(ListFormat || (ListFormat = {}));
})(ts || (ts = {}));
var ts;
(function (ts) {
@@ -47876,10 +48076,10 @@ var ts;
var resolutions = [];
var cache = ts.createMap();
for (var _i = 0, names_2 = names; _i < names_2.length; _i++) {
- var name_46 = names_2[_i];
- var result = name_46 in cache
- ? cache[name_46]
- : cache[name_46] = loader(name_46, containingFile);
+ var name_43 = names_2[_i];
+ var result = name_43 in cache
+ ? cache[name_43]
+ : cache[name_43] = loader(name_43, containingFile);
resolutions.push(result);
}
return resolutions;
@@ -48110,7 +48310,7 @@ var ts;
getSourceFiles: program.getSourceFiles,
isSourceFileFromExternalLibrary: function (file) { return !!sourceFilesFoundSearchingNodeModules[file.path]; },
writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }),
- isEmitBlocked: isEmitBlocked
+ isEmitBlocked: isEmitBlocked,
};
}
function getDiagnosticsProducingTypeChecker() {
@@ -48188,7 +48388,7 @@ var ts;
return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken);
}
}
- function getSyntacticDiagnosticsForFile(sourceFile, cancellationToken) {
+ function getSyntacticDiagnosticsForFile(sourceFile) {
return sourceFile.parseDiagnostics;
}
function runWithCancellationToken(func) {
@@ -48209,14 +48409,14 @@ var ts;
ts.Debug.assert(!!sourceFile.bindDiagnostics);
var bindDiagnostics = sourceFile.bindDiagnostics;
var checkDiagnostics = ts.isSourceFileJavaScript(sourceFile) ?
- getJavaScriptSemanticDiagnosticsForFile(sourceFile, cancellationToken) :
+ getJavaScriptSemanticDiagnosticsForFile(sourceFile) :
typeChecker.getDiagnostics(sourceFile, cancellationToken);
var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName);
var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName);
- return bindDiagnostics.concat(checkDiagnostics).concat(fileProcessingDiagnosticsInFile).concat(programDiagnosticsInFile);
+ return bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile);
});
}
- function getJavaScriptSemanticDiagnosticsForFile(sourceFile, cancellationToken) {
+ function getJavaScriptSemanticDiagnosticsForFile(sourceFile) {
return runWithCancellationToken(function () {
var diagnostics = [];
walk(sourceFile);
@@ -48226,16 +48426,16 @@ var ts;
return false;
}
switch (node.kind) {
- case 229:
+ case 230:
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file));
return true;
- case 235:
+ case 236:
if (node.isExportEquals) {
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file));
return true;
}
break;
- case 221:
+ case 222:
var classDeclaration = node;
if (checkModifiers(classDeclaration.modifiers) ||
checkTypeParameters(classDeclaration.typeParameters)) {
@@ -48244,29 +48444,29 @@ var ts;
break;
case 251:
var heritageClause = node;
- if (heritageClause.token === 106) {
+ if (heritageClause.token === 107) {
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file));
return true;
}
break;
- case 222:
+ case 223:
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file));
return true;
- case 225:
+ case 226:
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file));
return true;
- case 223:
+ case 224:
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file));
return true;
- case 147:
- case 146:
case 148:
+ case 147:
case 149:
case 150:
- case 179:
- case 220:
+ case 151:
case 180:
- case 220:
+ case 221:
+ case 181:
+ case 221:
var functionDeclaration = node;
if (checkModifiers(functionDeclaration.modifiers) ||
checkTypeParameters(functionDeclaration.typeParameters) ||
@@ -48274,20 +48474,20 @@ var ts;
return true;
}
break;
- case 200:
+ case 201:
var variableStatement = node;
if (checkModifiers(variableStatement.modifiers)) {
return true;
}
break;
- case 218:
+ case 219:
var variableDeclaration = node;
if (checkTypeAnnotation(variableDeclaration.type)) {
return true;
}
break;
- case 174:
case 175:
+ case 176:
var expression = node;
if (expression.typeArguments && expression.typeArguments.length > 0) {
var start = expression.typeArguments.pos;
@@ -48295,7 +48495,7 @@ var ts;
return true;
}
break;
- case 142:
+ case 143:
var parameter = node;
if (parameter.modifiers) {
var start = parameter.modifiers.pos;
@@ -48311,12 +48511,12 @@ var ts;
return true;
}
break;
- case 145:
+ case 146:
var propertyDeclaration = node;
if (propertyDeclaration.modifiers) {
for (var _i = 0, _a = propertyDeclaration.modifiers; _i < _a.length; _i++) {
var modifier = _a[_i];
- if (modifier.kind !== 113) {
+ if (modifier.kind !== 114) {
diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind)));
return true;
}
@@ -48326,14 +48526,14 @@ var ts;
return true;
}
break;
- case 224:
+ case 225:
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file));
return true;
- case 177:
+ case 178:
var typeAssertionExpression = node;
diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file));
return true;
- case 143:
+ case 144:
if (!options.experimentalDecorators) {
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning));
}
@@ -48361,18 +48561,18 @@ var ts;
for (var _i = 0, modifiers_1 = modifiers; _i < modifiers_1.length; _i++) {
var modifier = modifiers_1[_i];
switch (modifier.kind) {
- case 112:
- case 110:
+ case 113:
case 111:
- case 128:
- case 122:
+ case 112:
+ case 129:
+ case 123:
diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind)));
return true;
- case 113:
- case 82:
- case 74:
- case 77:
- case 115:
+ case 114:
+ case 83:
+ case 75:
+ case 78:
+ case 116:
}
}
}
@@ -48405,7 +48605,7 @@ var ts;
return ts.getBaseFileName(fileName).indexOf(".") >= 0;
}
function processRootFile(fileName, isDefaultLib) {
- processSourceFile(ts.normalizePath(fileName), isDefaultLib, true);
+ processSourceFile(ts.normalizePath(fileName), isDefaultLib);
}
function fileReferenceIsEqualTo(a, b) {
return a.fileName === b.fileName;
@@ -48444,9 +48644,9 @@ var ts;
return;
function collectModuleReferences(node, inAmbientModule) {
switch (node.kind) {
+ case 231:
case 230:
- case 229:
- case 236:
+ case 237:
var moduleNameExpr = ts.getExternalModuleName(node);
if (!moduleNameExpr || moduleNameExpr.kind !== 9) {
break;
@@ -48458,7 +48658,7 @@ var ts;
(imports || (imports = [])).push(moduleNameExpr);
}
break;
- case 225:
+ case 226:
if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2) || ts.isDeclarationFile(file))) {
var moduleName = node.name;
if (isExternalModuleFile || (inAmbientModule && !ts.isExternalModuleNameRelative(moduleName.text))) {
@@ -48485,7 +48685,7 @@ var ts;
}
}
}
- function processSourceFile(fileName, isDefaultLib, isReference, refFile, refPos, refEnd) {
+ function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) {
var diagnosticArgument;
var diagnostic;
if (hasExtension(fileName)) {
@@ -48493,7 +48693,7 @@ var ts;
diagnostic = ts.Diagnostics.File_0_has_unsupported_extension_The_only_supported_extensions_are_1;
diagnosticArgument = [fileName, "'" + supportedExtensions.join("', '") + "'"];
}
- else if (!findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, isReference, refFile, refPos, refEnd)) {
+ else if (!findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd)) {
diagnostic = ts.Diagnostics.File_0_not_found;
diagnosticArgument = [fileName];
}
@@ -48503,13 +48703,13 @@ var ts;
}
}
else {
- var nonTsFile = options.allowNonTsExtensions && findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, isReference, refFile, refPos, refEnd);
+ var nonTsFile = options.allowNonTsExtensions && findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd);
if (!nonTsFile) {
if (options.allowNonTsExtensions) {
diagnostic = ts.Diagnostics.File_0_not_found;
diagnosticArgument = [fileName];
}
- else if (!ts.forEach(supportedExtensions, function (extension) { return findSourceFile(fileName + extension, ts.toPath(fileName + extension, currentDirectory, getCanonicalFileName), isDefaultLib, isReference, refFile, refPos, refEnd); })) {
+ else if (!ts.forEach(supportedExtensions, function (extension) { return findSourceFile(fileName + extension, ts.toPath(fileName + extension, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd); })) {
diagnostic = ts.Diagnostics.File_0_not_found;
fileName += ".ts";
diagnosticArgument = [fileName];
@@ -48533,7 +48733,7 @@ var ts;
fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, existingFileName));
}
}
- function findSourceFile(fileName, path, isDefaultLib, isReference, refFile, refPos, refEnd) {
+ function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd) {
if (filesByName.contains(path)) {
var file_1 = filesByName.get(path);
if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) {
@@ -48542,16 +48742,16 @@ var ts;
if (file_1 && sourceFilesFoundSearchingNodeModules[file_1.path] && currentNodeModulesDepth == 0) {
sourceFilesFoundSearchingNodeModules[file_1.path] = false;
if (!options.noResolve) {
- processReferencedFiles(file_1, ts.getDirectoryPath(fileName), isDefaultLib);
+ processReferencedFiles(file_1, isDefaultLib);
processTypeReferenceDirectives(file_1);
}
modulesWithElidedImports[file_1.path] = false;
- processImportedModules(file_1, ts.getDirectoryPath(fileName));
+ processImportedModules(file_1);
}
else if (file_1 && modulesWithElidedImports[file_1.path]) {
if (currentNodeModulesDepth < maxNodeModulesJsDepth) {
modulesWithElidedImports[file_1.path] = false;
- processImportedModules(file_1, ts.getDirectoryPath(fileName));
+ processImportedModules(file_1);
}
}
return file_1;
@@ -48578,12 +48778,11 @@ var ts;
}
}
skipDefaultLib = skipDefaultLib || file.hasNoDefaultLib;
- var basePath = ts.getDirectoryPath(fileName);
if (!options.noResolve) {
- processReferencedFiles(file, basePath, isDefaultLib);
+ processReferencedFiles(file, isDefaultLib);
processTypeReferenceDirectives(file);
}
- processImportedModules(file, basePath);
+ processImportedModules(file);
if (isDefaultLib) {
files.unshift(file);
}
@@ -48593,10 +48792,10 @@ var ts;
}
return file;
}
- function processReferencedFiles(file, basePath, isDefaultLib) {
+ function processReferencedFiles(file, isDefaultLib) {
ts.forEach(file.referencedFiles, function (ref) {
var referencedFileName = resolveTripleslashReference(ref.fileName, file.fileName);
- processSourceFile(referencedFileName, isDefaultLib, true, file, ref.pos, ref.end);
+ processSourceFile(referencedFileName, isDefaultLib, file, ref.pos, ref.end);
});
}
function processTypeReferenceDirectives(file) {
@@ -48618,7 +48817,7 @@ var ts;
var saveResolution = true;
if (resolvedTypeReferenceDirective) {
if (resolvedTypeReferenceDirective.primary) {
- processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, false, true, refFile, refPos, refEnd);
+ processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, false, refFile, refPos, refEnd);
}
else {
if (previousResolution) {
@@ -48629,7 +48828,7 @@ var ts;
saveResolution = false;
}
else {
- processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, false, true, refFile, refPos, refEnd);
+ processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, false, refFile, refPos, refEnd);
}
}
}
@@ -48655,7 +48854,7 @@ var ts;
function getCanonicalFileName(fileName) {
return host.getCanonicalFileName(fileName);
}
- function processImportedModules(file, basePath) {
+ function processImportedModules(file) {
collectExternalModuleReferences(file);
if (file.imports.length || file.moduleAugmentations.length) {
file.resolvedModules = ts.createMap();
@@ -48675,7 +48874,7 @@ var ts;
modulesWithElidedImports[file.path] = true;
}
else if (shouldAddFile) {
- findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end);
+ findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end);
}
if (isFromNodeModulesSearch) {
currentNodeModulesDepth--;
@@ -48845,7 +49044,7 @@ var ts;
if (!options.noEmit && !options.suppressOutputPathCheck) {
var emitHost = getEmitHost();
var emitFilesSeen_1 = ts.createFileMap(!host.useCaseSensitiveFileNames() ? function (key) { return key.toLocaleLowerCase(); } : undefined);
- ts.forEachExpectedEmitFile(emitHost, function (emitFileNames, sourceFiles, isBundledEmit) {
+ ts.forEachExpectedEmitFile(emitHost, function (emitFileNames) {
verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1);
verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1);
});
@@ -48854,10 +49053,10 @@ var ts;
if (emitFileName) {
var emitFilePath = ts.toPath(emitFileName, currentDirectory, getCanonicalFileName);
if (filesByName.contains(emitFilePath)) {
- createEmitBlockingDiagnostics(emitFileName, emitFilePath, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file);
+ createEmitBlockingDiagnostics(emitFileName, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file);
}
if (emitFilesSeen.contains(emitFilePath)) {
- createEmitBlockingDiagnostics(emitFileName, emitFilePath, ts.Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files);
+ createEmitBlockingDiagnostics(emitFileName, ts.Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files);
}
else {
emitFilesSeen.set(emitFilePath, true);
@@ -48865,7 +49064,7 @@ var ts;
}
}
}
- function createEmitBlockingDiagnostics(emitFileName, emitFilePath, message) {
+ function createEmitBlockingDiagnostics(emitFileName, message) {
hasEmitBlockingDiagnostics.set(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName), true);
programDiagnostics.add(ts.createCompilerDiagnostic(message, emitFileName));
}
@@ -48873,6 +49072,1090 @@ var ts;
ts.createProgram = createProgram;
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" };
+ ts.optionDeclarations = [
+ {
+ name: "charset",
+ type: "string",
+ },
+ ts.compileOnSaveCommandLineOption,
+ {
+ name: "declaration",
+ shortName: "d",
+ type: "boolean",
+ description: ts.Diagnostics.Generates_corresponding_d_ts_file,
+ },
+ {
+ name: "declarationDir",
+ type: "string",
+ isFilePath: true,
+ paramType: ts.Diagnostics.DIRECTORY,
+ },
+ {
+ name: "diagnostics",
+ type: "boolean",
+ },
+ {
+ name: "extendedDiagnostics",
+ type: "boolean",
+ experimental: true
+ },
+ {
+ name: "emitBOM",
+ type: "boolean"
+ },
+ {
+ name: "help",
+ shortName: "h",
+ type: "boolean",
+ description: ts.Diagnostics.Print_this_message,
+ },
+ {
+ name: "help",
+ shortName: "?",
+ type: "boolean"
+ },
+ {
+ name: "init",
+ type: "boolean",
+ description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,
+ },
+ {
+ name: "inlineSourceMap",
+ type: "boolean",
+ },
+ {
+ name: "inlineSources",
+ type: "boolean",
+ },
+ {
+ name: "jsx",
+ type: ts.createMap({
+ "preserve": 1,
+ "react": 2
+ }),
+ paramType: ts.Diagnostics.KIND,
+ description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react,
+ },
+ {
+ name: "reactNamespace",
+ type: "string",
+ description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit
+ },
+ {
+ name: "listFiles",
+ type: "boolean",
+ },
+ {
+ name: "locale",
+ type: "string",
+ },
+ {
+ name: "mapRoot",
+ type: "string",
+ isFilePath: true,
+ description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,
+ paramType: ts.Diagnostics.LOCATION,
+ },
+ {
+ name: "module",
+ shortName: "m",
+ type: ts.createMap({
+ "none": ts.ModuleKind.None,
+ "commonjs": ts.ModuleKind.CommonJS,
+ "amd": ts.ModuleKind.AMD,
+ "system": ts.ModuleKind.System,
+ "umd": ts.ModuleKind.UMD,
+ "es6": ts.ModuleKind.ES2015,
+ "es2015": ts.ModuleKind.ES2015,
+ }),
+ description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015,
+ paramType: ts.Diagnostics.KIND,
+ },
+ {
+ name: "newLine",
+ type: ts.createMap({
+ "crlf": 0,
+ "lf": 1
+ }),
+ description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix,
+ paramType: ts.Diagnostics.NEWLINE,
+ },
+ {
+ name: "noEmit",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_emit_outputs,
+ },
+ {
+ name: "noEmitHelpers",
+ type: "boolean"
+ },
+ {
+ name: "noEmitOnError",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported,
+ },
+ {
+ name: "noErrorTruncation",
+ type: "boolean"
+ },
+ {
+ name: "noImplicitAny",
+ type: "boolean",
+ description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type,
+ },
+ {
+ name: "noImplicitThis",
+ type: "boolean",
+ description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type,
+ },
+ {
+ name: "noUnusedLocals",
+ type: "boolean",
+ description: ts.Diagnostics.Report_errors_on_unused_locals,
+ },
+ {
+ name: "noUnusedParameters",
+ type: "boolean",
+ description: ts.Diagnostics.Report_errors_on_unused_parameters,
+ },
+ {
+ name: "noLib",
+ type: "boolean",
+ },
+ {
+ name: "noResolve",
+ type: "boolean",
+ },
+ {
+ name: "skipDefaultLibCheck",
+ type: "boolean",
+ },
+ {
+ name: "skipLibCheck",
+ type: "boolean",
+ description: ts.Diagnostics.Skip_type_checking_of_declaration_files,
+ },
+ {
+ name: "out",
+ type: "string",
+ isFilePath: false,
+ paramType: ts.Diagnostics.FILE,
+ },
+ {
+ name: "outFile",
+ type: "string",
+ isFilePath: true,
+ description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file,
+ paramType: ts.Diagnostics.FILE,
+ },
+ {
+ name: "outDir",
+ type: "string",
+ isFilePath: true,
+ description: ts.Diagnostics.Redirect_output_structure_to_the_directory,
+ paramType: ts.Diagnostics.DIRECTORY,
+ },
+ {
+ name: "preserveConstEnums",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code
+ },
+ {
+ name: "pretty",
+ description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental,
+ type: "boolean"
+ },
+ {
+ name: "project",
+ shortName: "p",
+ type: "string",
+ isFilePath: true,
+ description: ts.Diagnostics.Compile_the_project_in_the_given_directory,
+ paramType: ts.Diagnostics.DIRECTORY
+ },
+ {
+ name: "removeComments",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_emit_comments_to_output,
+ },
+ {
+ name: "rootDir",
+ type: "string",
+ isFilePath: true,
+ paramType: ts.Diagnostics.LOCATION,
+ description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir,
+ },
+ {
+ name: "isolatedModules",
+ type: "boolean",
+ },
+ {
+ name: "sourceMap",
+ type: "boolean",
+ description: ts.Diagnostics.Generates_corresponding_map_file,
+ },
+ {
+ name: "sourceRoot",
+ type: "string",
+ isFilePath: true,
+ description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations,
+ paramType: ts.Diagnostics.LOCATION,
+ },
+ {
+ name: "suppressExcessPropertyErrors",
+ type: "boolean",
+ description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals,
+ experimental: true
+ },
+ {
+ name: "suppressImplicitAnyIndexErrors",
+ type: "boolean",
+ description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures,
+ },
+ {
+ name: "stripInternal",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation,
+ experimental: true
+ },
+ {
+ name: "target",
+ shortName: "t",
+ type: ts.createMap({
+ "es3": 0,
+ "es5": 1,
+ "es6": 2,
+ "es2015": 2,
+ "es2016": 3,
+ "es2017": 4,
+ }),
+ description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015,
+ paramType: ts.Diagnostics.VERSION,
+ },
+ {
+ name: "version",
+ shortName: "v",
+ type: "boolean",
+ description: ts.Diagnostics.Print_the_compiler_s_version,
+ },
+ {
+ name: "watch",
+ shortName: "w",
+ type: "boolean",
+ description: ts.Diagnostics.Watch_input_files,
+ },
+ {
+ name: "experimentalDecorators",
+ type: "boolean",
+ description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators
+ },
+ {
+ name: "emitDecoratorMetadata",
+ type: "boolean",
+ experimental: true,
+ description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators
+ },
+ {
+ name: "moduleResolution",
+ type: ts.createMap({
+ "node": ts.ModuleResolutionKind.NodeJs,
+ "classic": ts.ModuleResolutionKind.Classic,
+ }),
+ description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6,
+ paramType: ts.Diagnostics.STRATEGY,
+ },
+ {
+ name: "allowUnusedLabels",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_report_errors_on_unused_labels
+ },
+ {
+ name: "noImplicitReturns",
+ type: "boolean",
+ description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value
+ },
+ {
+ name: "noFallthroughCasesInSwitch",
+ type: "boolean",
+ description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement
+ },
+ {
+ name: "allowUnreachableCode",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code
+ },
+ {
+ name: "forceConsistentCasingInFileNames",
+ type: "boolean",
+ description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file
+ },
+ {
+ name: "baseUrl",
+ type: "string",
+ isFilePath: true,
+ description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names
+ },
+ {
+ name: "paths",
+ type: "object",
+ isTSConfigOnly: true
+ },
+ {
+ name: "rootDirs",
+ type: "list",
+ isTSConfigOnly: true,
+ element: {
+ name: "rootDirs",
+ type: "string",
+ isFilePath: true
+ }
+ },
+ {
+ name: "typeRoots",
+ type: "list",
+ element: {
+ name: "typeRoots",
+ type: "string",
+ isFilePath: true
+ }
+ },
+ {
+ name: "types",
+ type: "list",
+ element: {
+ name: "types",
+ type: "string"
+ },
+ description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation
+ },
+ {
+ name: "traceResolution",
+ type: "boolean",
+ description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process
+ },
+ {
+ name: "allowJs",
+ type: "boolean",
+ description: ts.Diagnostics.Allow_javascript_files_to_be_compiled
+ },
+ {
+ name: "allowSyntheticDefaultImports",
+ type: "boolean",
+ description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking
+ },
+ {
+ name: "noImplicitUseStrict",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output
+ },
+ {
+ name: "maxNodeModuleJsDepth",
+ type: "number",
+ description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files
+ },
+ {
+ name: "listEmittedFiles",
+ type: "boolean"
+ },
+ {
+ name: "lib",
+ type: "list",
+ element: {
+ name: "lib",
+ type: ts.createMap({
+ "es5": "lib.es5.d.ts",
+ "es6": "lib.es2015.d.ts",
+ "es2015": "lib.es2015.d.ts",
+ "es7": "lib.es2016.d.ts",
+ "es2016": "lib.es2016.d.ts",
+ "es2017": "lib.es2017.d.ts",
+ "dom": "lib.dom.d.ts",
+ "dom.iterable": "lib.dom.iterable.d.ts",
+ "webworker": "lib.webworker.d.ts",
+ "scripthost": "lib.scripthost.d.ts",
+ "es2015.core": "lib.es2015.core.d.ts",
+ "es2015.collection": "lib.es2015.collection.d.ts",
+ "es2015.generator": "lib.es2015.generator.d.ts",
+ "es2015.iterable": "lib.es2015.iterable.d.ts",
+ "es2015.promise": "lib.es2015.promise.d.ts",
+ "es2015.proxy": "lib.es2015.proxy.d.ts",
+ "es2015.reflect": "lib.es2015.reflect.d.ts",
+ "es2015.symbol": "lib.es2015.symbol.d.ts",
+ "es2015.symbol.wellknown": "lib.es2015.symbol.wellknown.d.ts",
+ "es2016.array.include": "lib.es2016.array.include.d.ts",
+ "es2017.object": "lib.es2017.object.d.ts",
+ "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts"
+ }),
+ },
+ description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon
+ },
+ {
+ name: "disableSizeLimit",
+ type: "boolean"
+ },
+ {
+ name: "strictNullChecks",
+ type: "boolean",
+ description: ts.Diagnostics.Enable_strict_null_checks
+ },
+ {
+ name: "importHelpers",
+ type: "boolean",
+ description: ts.Diagnostics.Import_emit_helpers_from_tslib
+ },
+ {
+ name: "alwaysStrict",
+ type: "boolean",
+ description: ts.Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file
+ }
+ ];
+ ts.typingOptionDeclarations = [
+ {
+ name: "enableAutoDiscovery",
+ type: "boolean",
+ },
+ {
+ name: "include",
+ type: "list",
+ element: {
+ name: "include",
+ type: "string"
+ }
+ },
+ {
+ name: "exclude",
+ type: "list",
+ element: {
+ name: "exclude",
+ type: "string"
+ }
+ }
+ ];
+ ts.defaultInitCompilerOptions = {
+ module: ts.ModuleKind.CommonJS,
+ target: 1,
+ noImplicitAny: false,
+ sourceMap: false,
+ };
+ var optionNameMapCache;
+ function getOptionNameMap() {
+ if (optionNameMapCache) {
+ return optionNameMapCache;
+ }
+ var optionNameMap = ts.createMap();
+ var shortOptionNames = ts.createMap();
+ ts.forEach(ts.optionDeclarations, function (option) {
+ optionNameMap[option.name.toLowerCase()] = option;
+ if (option.shortName) {
+ shortOptionNames[option.shortName] = option.name;
+ }
+ });
+ optionNameMapCache = { optionNameMap: optionNameMap, shortOptionNames: shortOptionNames };
+ return optionNameMapCache;
+ }
+ ts.getOptionNameMap = getOptionNameMap;
+ function createCompilerDiagnosticForInvalidCustomType(opt) {
+ var namesOfType = Object.keys(opt.type).map(function (key) { return "'" + key + "'"; }).join(", ");
+ return ts.createCompilerDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
+ }
+ ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
+ function parseCustomTypeOption(opt, value, errors) {
+ var key = trimString((value || "")).toLowerCase();
+ var map = opt.type;
+ if (key in map) {
+ return map[key];
+ }
+ else {
+ errors.push(createCompilerDiagnosticForInvalidCustomType(opt));
+ }
+ }
+ ts.parseCustomTypeOption = parseCustomTypeOption;
+ function parseListTypeOption(opt, value, errors) {
+ if (value === void 0) { value = ""; }
+ value = trimString(value);
+ if (ts.startsWith(value, "-")) {
+ return undefined;
+ }
+ if (value === "") {
+ return [];
+ }
+ var values = value.split(",");
+ switch (opt.element.type) {
+ case "number":
+ return ts.map(values, parseInt);
+ case "string":
+ return ts.map(values, function (v) { return v || ""; });
+ default:
+ return ts.filter(ts.map(values, function (v) { return parseCustomTypeOption(opt.element, v, errors); }), function (v) { return !!v; });
+ }
+ }
+ ts.parseListTypeOption = parseListTypeOption;
+ function parseCommandLine(commandLine, readFile) {
+ var options = {};
+ var fileNames = [];
+ var errors = [];
+ var _a = getOptionNameMap(), optionNameMap = _a.optionNameMap, shortOptionNames = _a.shortOptionNames;
+ parseStrings(commandLine);
+ return {
+ options: options,
+ fileNames: fileNames,
+ errors: errors
+ };
+ function parseStrings(args) {
+ var i = 0;
+ while (i < args.length) {
+ var s = args[i];
+ i++;
+ if (s.charCodeAt(0) === 64) {
+ parseResponseFile(s.slice(1));
+ }
+ else if (s.charCodeAt(0) === 45) {
+ s = s.slice(s.charCodeAt(1) === 45 ? 2 : 1).toLowerCase();
+ if (s in shortOptionNames) {
+ s = shortOptionNames[s];
+ }
+ if (s in optionNameMap) {
+ var opt = optionNameMap[s];
+ if (opt.isTSConfigOnly) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name));
+ }
+ else {
+ if (!args[i] && opt.type !== "boolean") {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_expects_an_argument, opt.name));
+ }
+ switch (opt.type) {
+ case "number":
+ options[opt.name] = parseInt(args[i]);
+ i++;
+ break;
+ case "boolean":
+ options[opt.name] = true;
+ break;
+ case "string":
+ options[opt.name] = args[i] || "";
+ i++;
+ break;
+ case "list":
+ var result = parseListTypeOption(opt, args[i], errors);
+ options[opt.name] = result || [];
+ if (result) {
+ i++;
+ }
+ break;
+ default:
+ options[opt.name] = parseCustomTypeOption(opt, args[i], errors);
+ i++;
+ break;
+ }
+ }
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_compiler_option_0, s));
+ }
+ }
+ else {
+ fileNames.push(s);
+ }
+ }
+ }
+ function parseResponseFile(fileName) {
+ var text = readFile ? readFile(fileName) : ts.sys.readFile(fileName);
+ if (!text) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, fileName));
+ return;
+ }
+ var args = [];
+ var pos = 0;
+ while (true) {
+ while (pos < text.length && text.charCodeAt(pos) <= 32)
+ pos++;
+ if (pos >= text.length)
+ break;
+ var start = pos;
+ if (text.charCodeAt(start) === 34) {
+ pos++;
+ while (pos < text.length && text.charCodeAt(pos) !== 34)
+ pos++;
+ if (pos < text.length) {
+ args.push(text.substring(start + 1, pos));
+ pos++;
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unterminated_quoted_string_in_response_file_0, fileName));
+ }
+ }
+ else {
+ while (text.charCodeAt(pos) > 32)
+ pos++;
+ args.push(text.substring(start, pos));
+ }
+ }
+ parseStrings(args);
+ }
+ }
+ ts.parseCommandLine = parseCommandLine;
+ function readConfigFile(fileName, readFile) {
+ var text = "";
+ try {
+ text = readFile(fileName);
+ }
+ catch (e) {
+ return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) };
+ }
+ return parseConfigFileTextToJson(fileName, text);
+ }
+ ts.readConfigFile = readConfigFile;
+ function parseConfigFileTextToJson(fileName, jsonText, stripComments) {
+ if (stripComments === void 0) { stripComments = true; }
+ try {
+ var jsonTextToParse = stripComments ? removeComments(jsonText) : jsonText;
+ return { config: /\S/.test(jsonTextToParse) ? JSON.parse(jsonTextToParse) : {} };
+ }
+ catch (e) {
+ return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Failed_to_parse_file_0_Colon_1, fileName, e.message) };
+ }
+ }
+ ts.parseConfigFileTextToJson = parseConfigFileTextToJson;
+ function generateTSConfig(options, fileNames) {
+ var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions);
+ var configurations = {
+ compilerOptions: serializeCompilerOptions(compilerOptions)
+ };
+ if (fileNames && fileNames.length) {
+ configurations.files = fileNames;
+ }
+ return configurations;
+ function getCustomTypeMapOfCommandLineOption(optionDefinition) {
+ if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") {
+ return undefined;
+ }
+ else if (optionDefinition.type === "list") {
+ return getCustomTypeMapOfCommandLineOption(optionDefinition.element);
+ }
+ else {
+ return optionDefinition.type;
+ }
+ }
+ function getNameOfCompilerOptionValue(value, customTypeMap) {
+ for (var key in customTypeMap) {
+ if (customTypeMap[key] === value) {
+ return key;
+ }
+ }
+ return undefined;
+ }
+ function serializeCompilerOptions(options) {
+ var result = ts.createMap();
+ var optionsNameMap = getOptionNameMap().optionNameMap;
+ for (var name_44 in options) {
+ if (ts.hasProperty(options, name_44)) {
+ switch (name_44) {
+ case "init":
+ case "watch":
+ case "version":
+ case "help":
+ case "project":
+ break;
+ default:
+ var value = options[name_44];
+ var optionDefinition = optionsNameMap[name_44.toLowerCase()];
+ if (optionDefinition) {
+ var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition);
+ if (!customTypeMap) {
+ result[name_44] = value;
+ }
+ else {
+ if (optionDefinition.type === "list") {
+ var convertedValue = [];
+ for (var _i = 0, _a = value; _i < _a.length; _i++) {
+ var element = _a[_i];
+ convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap));
+ }
+ result[name_44] = convertedValue;
+ }
+ else {
+ result[name_44] = getNameOfCompilerOptionValue(value, customTypeMap);
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+ return result;
+ }
+ }
+ ts.generateTSConfig = generateTSConfig;
+ function removeComments(jsonText) {
+ var output = "";
+ var scanner = ts.createScanner(1, false, 0, jsonText);
+ var token;
+ while ((token = scanner.scan()) !== 1) {
+ switch (token) {
+ case 2:
+ case 3:
+ output += scanner.getTokenText().replace(/\S/g, " ");
+ break;
+ default:
+ output += scanner.getTokenText();
+ break;
+ }
+ }
+ return output;
+ }
+ function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack) {
+ if (existingOptions === void 0) { existingOptions = {}; }
+ if (resolutionStack === void 0) { resolutionStack = []; }
+ var errors = [];
+ var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames);
+ var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName);
+ if (resolutionStack.indexOf(resolvedPath) >= 0) {
+ return {
+ options: {},
+ fileNames: [],
+ typingOptions: {},
+ raw: json,
+ errors: [ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> "))],
+ wildcardDirectories: {}
+ };
+ }
+ var options = convertCompilerOptionsFromJsonWorker(json["compilerOptions"], basePath, errors, configFileName);
+ var typingOptions = convertTypingOptionsFromJsonWorker(json["typingOptions"], basePath, errors, configFileName);
+ if (json["extends"]) {
+ var _a = [undefined, undefined, undefined, {}], include = _a[0], exclude = _a[1], files = _a[2], baseOptions = _a[3];
+ if (typeof json["extends"] === "string") {
+ _b = (tryExtendsName(json["extends"]) || [include, exclude, files, baseOptions]), include = _b[0], exclude = _b[1], files = _b[2], baseOptions = _b[3];
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", "string"));
+ }
+ if (include && !json["include"]) {
+ json["include"] = include;
+ }
+ if (exclude && !json["exclude"]) {
+ json["exclude"] = exclude;
+ }
+ if (files && !json["files"]) {
+ json["files"] = files;
+ }
+ options = ts.assign({}, baseOptions, options);
+ }
+ options = ts.extend(existingOptions, options);
+ options.configFilePath = configFileName;
+ var _c = getFileNames(errors), fileNames = _c.fileNames, wildcardDirectories = _c.wildcardDirectories;
+ var compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors);
+ return {
+ options: options,
+ fileNames: fileNames,
+ typingOptions: typingOptions,
+ raw: json,
+ errors: errors,
+ wildcardDirectories: wildcardDirectories,
+ compileOnSave: compileOnSave
+ };
+ function tryExtendsName(extendedConfig) {
+ if (!(ts.isRootedDiskPath(extendedConfig) || ts.startsWith(ts.normalizeSlashes(extendedConfig), "./") || ts.startsWith(ts.normalizeSlashes(extendedConfig), "../"))) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.The_path_in_an_extends_options_must_be_relative_or_rooted));
+ return;
+ }
+ var extendedConfigPath = ts.toPath(extendedConfig, basePath, getCanonicalFileName);
+ if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json")) {
+ extendedConfigPath = extendedConfigPath + ".json";
+ if (!host.fileExists(extendedConfigPath)) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_does_not_exist, extendedConfig));
+ return;
+ }
+ }
+ var extendedResult = readConfigFile(extendedConfigPath, function (path) { return host.readFile(path); });
+ if (extendedResult.error) {
+ errors.push(extendedResult.error);
+ return;
+ }
+ var extendedDirname = ts.getDirectoryPath(extendedConfigPath);
+ var relativeDifference = ts.convertToRelativePath(extendedDirname, basePath, getCanonicalFileName);
+ var updatePath = function (path) { return ts.isRootedDiskPath(path) ? path : ts.combinePaths(relativeDifference, path); };
+ var result = parseJsonConfigFileContent(extendedResult.config, host, extendedDirname, undefined, ts.getBaseFileName(extendedConfigPath), resolutionStack.concat([resolvedPath]));
+ errors.push.apply(errors, result.errors);
+ var _a = ts.map(["include", "exclude", "files"], function (key) {
+ if (!json[key] && extendedResult.config[key]) {
+ return ts.map(extendedResult.config[key], updatePath);
+ }
+ }), include = _a[0], exclude = _a[1], files = _a[2];
+ return [include, exclude, files, result.options];
+ }
+ function getFileNames(errors) {
+ var fileNames;
+ if (ts.hasProperty(json, "files")) {
+ if (ts.isArray(json["files"])) {
+ fileNames = json["files"];
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "files", "Array"));
+ }
+ }
+ var includeSpecs;
+ if (ts.hasProperty(json, "include")) {
+ if (ts.isArray(json["include"])) {
+ includeSpecs = json["include"];
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "include", "Array"));
+ }
+ }
+ var excludeSpecs;
+ if (ts.hasProperty(json, "exclude")) {
+ if (ts.isArray(json["exclude"])) {
+ excludeSpecs = json["exclude"];
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "exclude", "Array"));
+ }
+ }
+ else if (ts.hasProperty(json, "excludes")) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));
+ }
+ else {
+ excludeSpecs = ["node_modules", "bower_components", "jspm_packages"];
+ var outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"];
+ if (outDir) {
+ excludeSpecs.push(outDir);
+ }
+ }
+ if (fileNames === undefined && includeSpecs === undefined) {
+ includeSpecs = ["**/*"];
+ }
+ return matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors);
+ }
+ var _b;
+ }
+ ts.parseJsonConfigFileContent = parseJsonConfigFileContent;
+ function convertCompileOnSaveOptionFromJson(jsonOption, basePath, errors) {
+ if (!ts.hasProperty(jsonOption, ts.compileOnSaveCommandLineOption.name)) {
+ return false;
+ }
+ var result = convertJsonOption(ts.compileOnSaveCommandLineOption, jsonOption["compileOnSave"], basePath, errors);
+ if (typeof result === "boolean" && result) {
+ return result;
+ }
+ return false;
+ }
+ ts.convertCompileOnSaveOptionFromJson = convertCompileOnSaveOptionFromJson;
+ function convertCompilerOptionsFromJson(jsonOptions, basePath, configFileName) {
+ var errors = [];
+ var options = convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName);
+ return { options: options, errors: errors };
+ }
+ ts.convertCompilerOptionsFromJson = convertCompilerOptionsFromJson;
+ function convertTypingOptionsFromJson(jsonOptions, basePath, configFileName) {
+ var errors = [];
+ var options = convertTypingOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName);
+ return { options: options, errors: errors };
+ }
+ ts.convertTypingOptionsFromJson = convertTypingOptionsFromJson;
+ function convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) {
+ var options = ts.getBaseFileName(configFileName) === "jsconfig.json"
+ ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true }
+ : {};
+ convertOptionsFromJson(ts.optionDeclarations, jsonOptions, basePath, options, ts.Diagnostics.Unknown_compiler_option_0, errors);
+ return options;
+ }
+ function convertTypingOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) {
+ var options = ts.getBaseFileName(configFileName) === "jsconfig.json"
+ ? { enableAutoDiscovery: true, include: [], exclude: [] }
+ : { enableAutoDiscovery: false, include: [], exclude: [] };
+ convertOptionsFromJson(ts.typingOptionDeclarations, jsonOptions, basePath, options, ts.Diagnostics.Unknown_typing_option_0, errors);
+ return options;
+ }
+ function convertOptionsFromJson(optionDeclarations, jsonOptions, basePath, defaultOptions, diagnosticMessage, errors) {
+ if (!jsonOptions) {
+ return;
+ }
+ var optionNameMap = ts.arrayToMap(optionDeclarations, function (opt) { return opt.name; });
+ for (var id in jsonOptions) {
+ if (id in optionNameMap) {
+ var opt = optionNameMap[id];
+ defaultOptions[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors);
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(diagnosticMessage, id));
+ }
+ }
+ }
+ function convertJsonOption(opt, value, basePath, errors) {
+ var optType = opt.type;
+ var expectedType = typeof optType === "string" ? optType : "string";
+ if (optType === "list" && ts.isArray(value)) {
+ return convertJsonOptionOfListType(opt, value, basePath, errors);
+ }
+ else if (typeof value === expectedType) {
+ if (typeof optType !== "string") {
+ return convertJsonOptionOfCustomType(opt, value, errors);
+ }
+ else {
+ if (opt.isFilePath) {
+ value = ts.normalizePath(ts.combinePaths(basePath, value));
+ if (value === "") {
+ value = ".";
+ }
+ }
+ }
+ return value;
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, opt.name, expectedType));
+ }
+ }
+ function convertJsonOptionOfCustomType(opt, value, errors) {
+ var key = value.toLowerCase();
+ if (key in opt.type) {
+ return opt.type[key];
+ }
+ else {
+ errors.push(createCompilerDiagnosticForInvalidCustomType(opt));
+ }
+ }
+ function convertJsonOptionOfListType(option, values, basePath, errors) {
+ return ts.filter(ts.map(values, function (v) { return convertJsonOption(option.element, v, basePath, errors); }), function (v) { return !!v; });
+ }
+ function trimString(s) {
+ return typeof s.trim === "function" ? s.trim() : s.replace(/^[\s]+|[\s]+$/g, "");
+ }
+ var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/;
+ var invalidMultipleRecursionPatterns = /(^|\/)\*\*\/(.*\/)?\*\*($|\/)/;
+ var invalidDotDotAfterRecursiveWildcardPattern = /(^|\/)\*\*\/(.*\/)?\.\.($|\/)/;
+ var watchRecursivePattern = /\/[^/]*?[*?][^/]*\//;
+ var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/;
+ function matchFileNames(fileNames, include, exclude, basePath, options, host, errors) {
+ basePath = ts.normalizePath(basePath);
+ var keyMapper = host.useCaseSensitiveFileNames ? caseSensitiveKeyMapper : caseInsensitiveKeyMapper;
+ var literalFileMap = ts.createMap();
+ var wildcardFileMap = ts.createMap();
+ if (include) {
+ include = validateSpecs(include, errors, false);
+ }
+ if (exclude) {
+ exclude = validateSpecs(exclude, errors, true);
+ }
+ var wildcardDirectories = getWildcardDirectories(include, exclude, basePath, host.useCaseSensitiveFileNames);
+ var supportedExtensions = ts.getSupportedExtensions(options);
+ if (fileNames) {
+ for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) {
+ var fileName = fileNames_1[_i];
+ var file = ts.combinePaths(basePath, fileName);
+ literalFileMap[keyMapper(file)] = file;
+ }
+ }
+ if (include && include.length > 0) {
+ for (var _a = 0, _b = host.readDirectory(basePath, supportedExtensions, exclude, include); _a < _b.length; _a++) {
+ var file = _b[_a];
+ if (hasFileWithHigherPriorityExtension(file, literalFileMap, wildcardFileMap, supportedExtensions, keyMapper)) {
+ continue;
+ }
+ removeWildcardFilesWithLowerPriorityExtension(file, wildcardFileMap, supportedExtensions, keyMapper);
+ var key = keyMapper(file);
+ if (!(key in literalFileMap) && !(key in wildcardFileMap)) {
+ wildcardFileMap[key] = file;
+ }
+ }
+ }
+ var literalFiles = ts.reduceProperties(literalFileMap, addFileToOutput, []);
+ var wildcardFiles = ts.reduceProperties(wildcardFileMap, addFileToOutput, []);
+ wildcardFiles.sort(host.useCaseSensitiveFileNames ? ts.compareStrings : ts.compareStringsCaseInsensitive);
+ return {
+ fileNames: literalFiles.concat(wildcardFiles),
+ wildcardDirectories: wildcardDirectories
+ };
+ }
+ function validateSpecs(specs, errors, allowTrailingRecursion) {
+ var validSpecs = [];
+ for (var _i = 0, specs_2 = specs; _i < specs_2.length; _i++) {
+ var spec = specs_2[_i];
+ if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec));
+ }
+ else if (invalidMultipleRecursionPatterns.test(spec)) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0, spec));
+ }
+ else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec));
+ }
+ else {
+ validSpecs.push(spec);
+ }
+ }
+ return validSpecs;
+ }
+ function getWildcardDirectories(include, exclude, path, useCaseSensitiveFileNames) {
+ var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude");
+ var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i");
+ var wildcardDirectories = ts.createMap();
+ if (include !== undefined) {
+ var recursiveKeys = [];
+ for (var _i = 0, include_1 = include; _i < include_1.length; _i++) {
+ var file = include_1[_i];
+ var name_45 = ts.normalizePath(ts.combinePaths(path, file));
+ if (excludeRegex && excludeRegex.test(name_45)) {
+ continue;
+ }
+ var match = wildcardDirectoryPattern.exec(name_45);
+ if (match) {
+ var key = useCaseSensitiveFileNames ? match[0] : match[0].toLowerCase();
+ var flags = watchRecursivePattern.test(name_45) ? 1 : 0;
+ var existingFlags = wildcardDirectories[key];
+ if (existingFlags === undefined || existingFlags < flags) {
+ wildcardDirectories[key] = flags;
+ if (flags === 1) {
+ recursiveKeys.push(key);
+ }
+ }
+ }
+ }
+ for (var key in wildcardDirectories) {
+ for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) {
+ var recursiveKey = recursiveKeys_1[_a];
+ if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) {
+ delete wildcardDirectories[key];
+ }
+ }
+ }
+ }
+ return wildcardDirectories;
+ }
+ function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) {
+ var extensionPriority = ts.getExtensionPriority(file, extensions);
+ var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority);
+ for (var i = 0; i < adjustedExtensionPriority; i++) {
+ var higherPriorityExtension = extensions[i];
+ var higherPriorityPath = keyMapper(ts.changeExtension(file, higherPriorityExtension));
+ if (higherPriorityPath in literalFiles || higherPriorityPath in wildcardFiles) {
+ return true;
+ }
+ }
+ return false;
+ }
+ function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) {
+ var extensionPriority = ts.getExtensionPriority(file, extensions);
+ var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority);
+ for (var i = nextExtensionPriority; i < extensions.length; i++) {
+ var lowerPriorityExtension = extensions[i];
+ var lowerPriorityPath = keyMapper(ts.changeExtension(file, lowerPriorityExtension));
+ delete wildcardFiles[lowerPriorityPath];
+ }
+ }
+ function addFileToOutput(output, file) {
+ output.push(file);
+ return output;
+ }
+ function caseSensitiveKeyMapper(key) {
+ return key;
+ }
+ function caseInsensitiveKeyMapper(key) {
+ return key.toLowerCase();
+ }
+})(ts || (ts = {}));
+var ts;
(function (ts) {
var ScriptSnapshot;
(function (ScriptSnapshot) {
@@ -48886,7 +50169,7 @@ var ts;
StringScriptSnapshot.prototype.getLength = function () {
return this.text.length;
};
- StringScriptSnapshot.prototype.getChangeRange = function (oldSnapshot) {
+ StringScriptSnapshot.prototype.getChangeRange = function () {
return undefined;
};
return StringScriptSnapshot;
@@ -48940,6 +50223,22 @@ var ts;
SymbolDisplayPartKind[SymbolDisplayPartKind["regularExpressionLiteral"] = 21] = "regularExpressionLiteral";
})(ts.SymbolDisplayPartKind || (ts.SymbolDisplayPartKind = {}));
var SymbolDisplayPartKind = ts.SymbolDisplayPartKind;
+ (function (OutputFileType) {
+ OutputFileType[OutputFileType["JavaScript"] = 0] = "JavaScript";
+ OutputFileType[OutputFileType["SourceMap"] = 1] = "SourceMap";
+ OutputFileType[OutputFileType["Declaration"] = 2] = "Declaration";
+ })(ts.OutputFileType || (ts.OutputFileType = {}));
+ var OutputFileType = ts.OutputFileType;
+ (function (EndOfLineState) {
+ EndOfLineState[EndOfLineState["None"] = 0] = "None";
+ EndOfLineState[EndOfLineState["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia";
+ EndOfLineState[EndOfLineState["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral";
+ EndOfLineState[EndOfLineState["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral";
+ EndOfLineState[EndOfLineState["InTemplateHeadOrNoSubstitutionTemplate"] = 4] = "InTemplateHeadOrNoSubstitutionTemplate";
+ EndOfLineState[EndOfLineState["InTemplateMiddleOrTail"] = 5] = "InTemplateMiddleOrTail";
+ EndOfLineState[EndOfLineState["InTemplateSubstitutionPosition"] = 6] = "InTemplateSubstitutionPosition";
+ })(ts.EndOfLineState || (ts.EndOfLineState = {}));
+ var EndOfLineState = ts.EndOfLineState;
(function (TokenClass) {
TokenClass[TokenClass["Punctuation"] = 0] = "Punctuation";
TokenClass[TokenClass["Keyword"] = 1] = "Keyword";
@@ -49027,40 +50326,75 @@ var ts;
ClassificationTypeNames.jsxText = "jsx text";
ClassificationTypeNames.jsxAttributeStringLiteralValue = "jsx attribute string literal value";
ts.ClassificationTypeNames = ClassificationTypeNames;
+ (function (ClassificationType) {
+ ClassificationType[ClassificationType["comment"] = 1] = "comment";
+ ClassificationType[ClassificationType["identifier"] = 2] = "identifier";
+ ClassificationType[ClassificationType["keyword"] = 3] = "keyword";
+ ClassificationType[ClassificationType["numericLiteral"] = 4] = "numericLiteral";
+ ClassificationType[ClassificationType["operator"] = 5] = "operator";
+ ClassificationType[ClassificationType["stringLiteral"] = 6] = "stringLiteral";
+ ClassificationType[ClassificationType["regularExpressionLiteral"] = 7] = "regularExpressionLiteral";
+ ClassificationType[ClassificationType["whiteSpace"] = 8] = "whiteSpace";
+ ClassificationType[ClassificationType["text"] = 9] = "text";
+ ClassificationType[ClassificationType["punctuation"] = 10] = "punctuation";
+ ClassificationType[ClassificationType["className"] = 11] = "className";
+ ClassificationType[ClassificationType["enumName"] = 12] = "enumName";
+ ClassificationType[ClassificationType["interfaceName"] = 13] = "interfaceName";
+ ClassificationType[ClassificationType["moduleName"] = 14] = "moduleName";
+ ClassificationType[ClassificationType["typeParameterName"] = 15] = "typeParameterName";
+ ClassificationType[ClassificationType["typeAliasName"] = 16] = "typeAliasName";
+ ClassificationType[ClassificationType["parameterName"] = 17] = "parameterName";
+ ClassificationType[ClassificationType["docCommentTagName"] = 18] = "docCommentTagName";
+ ClassificationType[ClassificationType["jsxOpenTagName"] = 19] = "jsxOpenTagName";
+ ClassificationType[ClassificationType["jsxCloseTagName"] = 20] = "jsxCloseTagName";
+ ClassificationType[ClassificationType["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName";
+ ClassificationType[ClassificationType["jsxAttribute"] = 22] = "jsxAttribute";
+ ClassificationType[ClassificationType["jsxText"] = 23] = "jsxText";
+ ClassificationType[ClassificationType["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue";
+ })(ts.ClassificationType || (ts.ClassificationType = {}));
+ var ClassificationType = ts.ClassificationType;
})(ts || (ts = {}));
var ts;
(function (ts) {
- ts.scanner = ts.createScanner(2, true);
+ ts.scanner = ts.createScanner(4, true);
ts.emptyArray = [];
+ (function (SemanticMeaning) {
+ SemanticMeaning[SemanticMeaning["None"] = 0] = "None";
+ SemanticMeaning[SemanticMeaning["Value"] = 1] = "Value";
+ SemanticMeaning[SemanticMeaning["Type"] = 2] = "Type";
+ SemanticMeaning[SemanticMeaning["Namespace"] = 4] = "Namespace";
+ SemanticMeaning[SemanticMeaning["All"] = 7] = "All";
+ })(ts.SemanticMeaning || (ts.SemanticMeaning = {}));
+ var SemanticMeaning = ts.SemanticMeaning;
function getMeaningFromDeclaration(node) {
switch (node.kind) {
- case 142:
- case 218:
- case 169:
+ case 143:
+ case 219:
+ case 170:
+ case 146:
case 145:
- case 144:
case 253:
case 254:
case 255:
- case 147:
- case 146:
case 148:
+ case 147:
case 149:
case 150:
- case 220:
- case 179:
+ case 151:
+ case 221:
case 180:
+ case 181:
case 252:
return 1;
- case 141:
- case 222:
+ case 142:
case 223:
- case 159:
- return 2;
- case 221:
case 224:
- return 1 | 2;
+ case 160:
+ return 2;
+ case 222:
case 225:
+ return 1 | 2;
+ case 226:
if (ts.isAmbientModule(node)) {
return 4 | 1;
}
@@ -49070,12 +50404,12 @@ var ts;
else {
return 4;
}
- case 233:
case 234:
- case 229:
- case 230:
case 235:
+ case 230:
+ case 231:
case 236:
+ case 237:
return 1 | 2 | 4;
case 256:
return 4 | 1;
@@ -49084,7 +50418,7 @@ var ts;
}
ts.getMeaningFromDeclaration = getMeaningFromDeclaration;
function getMeaningFromLocation(node) {
- if (node.parent.kind === 235) {
+ if (node.parent.kind === 236) {
return 1 | 2 | 4;
}
else if (isInRightSideOfImport(node)) {
@@ -49105,16 +50439,16 @@ var ts;
}
ts.getMeaningFromLocation = getMeaningFromLocation;
function getMeaningFromRightHandSideOfImportEquals(node) {
- ts.Debug.assert(node.kind === 69);
- if (node.parent.kind === 139 &&
+ ts.Debug.assert(node.kind === 70);
+ if (node.parent.kind === 140 &&
node.parent.right === node &&
- node.parent.parent.kind === 229) {
+ node.parent.parent.kind === 230) {
return 1 | 2 | 4;
}
return 4;
}
function isInRightSideOfImport(node) {
- while (node.parent.kind === 139) {
+ while (node.parent.kind === 140) {
node = node.parent;
}
return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node;
@@ -49125,27 +50459,27 @@ var ts;
function isQualifiedNameNamespaceReference(node) {
var root = node;
var isLastClause = true;
- if (root.parent.kind === 139) {
- while (root.parent && root.parent.kind === 139) {
+ if (root.parent.kind === 140) {
+ while (root.parent && root.parent.kind === 140) {
root = root.parent;
}
isLastClause = root.right === node;
}
- return root.parent.kind === 155 && !isLastClause;
+ return root.parent.kind === 156 && !isLastClause;
}
function isPropertyAccessNamespaceReference(node) {
var root = node;
var isLastClause = true;
- if (root.parent.kind === 172) {
- while (root.parent && root.parent.kind === 172) {
+ if (root.parent.kind === 173) {
+ while (root.parent && root.parent.kind === 173) {
root = root.parent;
}
isLastClause = root.name === node;
}
- if (!isLastClause && root.parent.kind === 194 && root.parent.parent.kind === 251) {
+ if (!isLastClause && root.parent.kind === 195 && root.parent.parent.kind === 251) {
var decl = root.parent.parent.parent;
- return (decl.kind === 221 && root.parent.parent.token === 106) ||
- (decl.kind === 222 && root.parent.parent.token === 83);
+ return (decl.kind === 222 && root.parent.parent.token === 107) ||
+ (decl.kind === 223 && root.parent.parent.token === 84);
}
return false;
}
@@ -49153,17 +50487,17 @@ var ts;
if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) {
node = node.parent;
}
- return node.parent.kind === 155 ||
- (node.parent.kind === 194 && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) ||
- (node.kind === 97 && !ts.isPartOfExpression(node)) ||
- node.kind === 165;
+ return node.parent.kind === 156 ||
+ (node.parent.kind === 195 && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) ||
+ (node.kind === 98 && !ts.isPartOfExpression(node)) ||
+ node.kind === 166;
}
function isCallExpressionTarget(node) {
- return isCallOrNewExpressionTarget(node, 174);
+ return isCallOrNewExpressionTarget(node, 175);
}
ts.isCallExpressionTarget = isCallExpressionTarget;
function isNewExpressionTarget(node) {
- return isCallOrNewExpressionTarget(node, 175);
+ return isCallOrNewExpressionTarget(node, 176);
}
ts.isNewExpressionTarget = isNewExpressionTarget;
function isCallOrNewExpressionTarget(node, kind) {
@@ -49176,7 +50510,7 @@ var ts;
ts.climbPastPropertyAccess = climbPastPropertyAccess;
function getTargetLabel(referenceNode, labelName) {
while (referenceNode) {
- if (referenceNode.kind === 214 && referenceNode.label.text === labelName) {
+ if (referenceNode.kind === 215 && referenceNode.label.text === labelName) {
return referenceNode.label;
}
referenceNode = referenceNode.parent;
@@ -49185,14 +50519,14 @@ var ts;
}
ts.getTargetLabel = getTargetLabel;
function isJumpStatementTarget(node) {
- return node.kind === 69 &&
- (node.parent.kind === 210 || node.parent.kind === 209) &&
+ return node.kind === 70 &&
+ (node.parent.kind === 211 || node.parent.kind === 210) &&
node.parent.label === node;
}
ts.isJumpStatementTarget = isJumpStatementTarget;
function isLabelOfLabeledStatement(node) {
- return node.kind === 69 &&
- node.parent.kind === 214 &&
+ return node.kind === 70 &&
+ node.parent.kind === 215 &&
node.parent.label === node;
}
function isLabelName(node) {
@@ -49200,38 +50534,38 @@ var ts;
}
ts.isLabelName = isLabelName;
function isRightSideOfQualifiedName(node) {
- return node.parent.kind === 139 && node.parent.right === node;
+ return node.parent.kind === 140 && node.parent.right === node;
}
ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName;
function isRightSideOfPropertyAccess(node) {
- return node && node.parent && node.parent.kind === 172 && node.parent.name === node;
+ return node && node.parent && node.parent.kind === 173 && node.parent.name === node;
}
ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess;
function isNameOfModuleDeclaration(node) {
- return node.parent.kind === 225 && node.parent.name === node;
+ return node.parent.kind === 226 && node.parent.name === node;
}
ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration;
function isNameOfFunctionDeclaration(node) {
- return node.kind === 69 &&
+ return node.kind === 70 &&
ts.isFunctionLike(node.parent) && node.parent.name === node;
}
ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration;
function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) {
if (node.kind === 9 || node.kind === 8) {
switch (node.parent.kind) {
+ case 146:
case 145:
- case 144:
case 253:
case 255:
+ case 148:
case 147:
- case 146:
- case 149:
case 150:
- case 225:
+ case 151:
+ case 226:
return node.parent.name === node;
- case 173:
+ case 174:
return node.parent.argumentExpression === node;
- case 140:
+ case 141:
return true;
}
}
@@ -49276,16 +50610,16 @@ var ts;
}
switch (node.kind) {
case 256:
+ case 148:
case 147:
- case 146:
- case 220:
- case 179:
- case 149:
- case 150:
case 221:
+ case 180:
+ case 150:
+ case 151:
case 222:
- case 224:
+ case 223:
case 225:
+ case 226:
return node;
}
}
@@ -49295,42 +50629,42 @@ var ts;
switch (node.kind) {
case 256:
return ts.isExternalModule(node) ? ts.ScriptElementKind.moduleElement : ts.ScriptElementKind.scriptElement;
- case 225:
+ case 226:
return ts.ScriptElementKind.moduleElement;
- case 221:
- case 192:
+ case 222:
+ case 193:
return ts.ScriptElementKind.classElement;
- case 222: return ts.ScriptElementKind.interfaceElement;
- case 223: return ts.ScriptElementKind.typeElement;
- case 224: return ts.ScriptElementKind.enumElement;
- case 218:
+ case 223: return ts.ScriptElementKind.interfaceElement;
+ case 224: return ts.ScriptElementKind.typeElement;
+ case 225: return ts.ScriptElementKind.enumElement;
+ case 219:
return getKindOfVariableDeclaration(node);
- case 169:
+ case 170:
return getKindOfVariableDeclaration(ts.getRootDeclaration(node));
+ case 181:
+ case 221:
case 180:
- case 220:
- case 179:
return ts.ScriptElementKind.functionElement;
- case 149: return ts.ScriptElementKind.memberGetAccessorElement;
- case 150: return ts.ScriptElementKind.memberSetAccessorElement;
+ case 150: return ts.ScriptElementKind.memberGetAccessorElement;
+ case 151: return ts.ScriptElementKind.memberSetAccessorElement;
+ case 148:
case 147:
- case 146:
return ts.ScriptElementKind.memberFunctionElement;
+ case 146:
case 145:
- case 144:
return ts.ScriptElementKind.memberVariableElement;
- case 153: return ts.ScriptElementKind.indexSignatureElement;
- case 152: return ts.ScriptElementKind.constructSignatureElement;
- case 151: return ts.ScriptElementKind.callSignatureElement;
- case 148: return ts.ScriptElementKind.constructorImplementationElement;
- case 141: return ts.ScriptElementKind.typeParameterElement;
+ case 154: return ts.ScriptElementKind.indexSignatureElement;
+ case 153: return ts.ScriptElementKind.constructSignatureElement;
+ case 152: return ts.ScriptElementKind.callSignatureElement;
+ case 149: return ts.ScriptElementKind.constructorImplementationElement;
+ case 142: return ts.ScriptElementKind.typeParameterElement;
case 255: return ts.ScriptElementKind.enumMemberElement;
- case 142: return ts.hasModifier(node, 92) ? ts.ScriptElementKind.memberVariableElement : ts.ScriptElementKind.parameterElement;
- case 229:
- case 234:
- case 231:
- case 238:
+ case 143: return ts.hasModifier(node, 92) ? ts.ScriptElementKind.memberVariableElement : ts.ScriptElementKind.parameterElement;
+ case 230:
+ case 235:
case 232:
+ case 239:
+ case 233:
return ts.ScriptElementKind.alias;
case 279:
return ts.ScriptElementKind.typeElement;
@@ -49347,7 +50681,7 @@ var ts;
}
ts.getNodeKind = getNodeKind;
function getStringLiteralTypeForNode(node, typeChecker) {
- var searchNode = node.parent.kind === 166 ? node.parent : node;
+ var searchNode = node.parent.kind === 167 ? node.parent : node;
var type = typeChecker.getTypeAtLocation(searchNode);
if (type && type.flags & 32) {
return type;
@@ -49357,10 +50691,10 @@ var ts;
ts.getStringLiteralTypeForNode = getStringLiteralTypeForNode;
function isThis(node) {
switch (node.kind) {
- case 97:
+ case 98:
return true;
- case 69:
- return ts.identifierIsThisKeyword(node) && node.parent.kind === 142;
+ case 70:
+ return ts.identifierIsThisKeyword(node) && node.parent.kind === 143;
default:
return false;
}
@@ -49404,107 +50738,107 @@ var ts;
return false;
}
switch (n.kind) {
- case 221:
case 222:
- case 224:
- case 171:
- case 167:
- case 159:
- case 199:
- case 226:
+ case 223:
+ case 225:
+ case 172:
+ case 168:
+ case 160:
+ case 200:
case 227:
- case 233:
- case 237:
- return nodeEndsWith(n, 16, sourceFile);
+ case 228:
+ case 234:
+ case 238:
+ return nodeEndsWith(n, 17, sourceFile);
case 252:
return isCompletedNode(n.block, sourceFile);
- case 175:
+ case 176:
if (!n.arguments) {
return true;
}
- case 174:
- case 178:
- case 164:
- return nodeEndsWith(n, 18, sourceFile);
- case 156:
+ case 175:
+ case 179:
+ case 165:
+ return nodeEndsWith(n, 19, sourceFile);
case 157:
+ case 158:
return isCompletedNode(n.type, sourceFile);
- case 148:
case 149:
case 150:
- case 220:
- case 179:
- case 147:
- case 146:
- case 152:
case 151:
+ case 221:
case 180:
+ case 148:
+ case 147:
+ case 153:
+ case 152:
+ case 181:
if (n.body) {
return isCompletedNode(n.body, sourceFile);
}
if (n.type) {
return isCompletedNode(n.type, sourceFile);
}
- return hasChildOfKind(n, 18, sourceFile);
- case 225:
+ return hasChildOfKind(n, 19, sourceFile);
+ case 226:
return n.body && isCompletedNode(n.body, sourceFile);
- case 203:
+ case 204:
if (n.elseStatement) {
return isCompletedNode(n.elseStatement, sourceFile);
}
return isCompletedNode(n.thenStatement, sourceFile);
- case 202:
+ case 203:
return isCompletedNode(n.expression, sourceFile) ||
- hasChildOfKind(n, 23);
- case 170:
- case 168:
- case 173:
- case 140:
- case 161:
- return nodeEndsWith(n, 20, sourceFile);
- case 153:
+ hasChildOfKind(n, 24);
+ case 171:
+ case 169:
+ case 174:
+ case 141:
+ case 162:
+ return nodeEndsWith(n, 21, sourceFile);
+ case 154:
if (n.type) {
return isCompletedNode(n.type, sourceFile);
}
- return hasChildOfKind(n, 20, sourceFile);
+ return hasChildOfKind(n, 21, sourceFile);
case 249:
case 250:
return false;
- case 206:
case 207:
case 208:
- case 205:
+ case 209:
+ case 206:
return isCompletedNode(n.statement, sourceFile);
- case 204:
- var hasWhileKeyword = findChildOfKind(n, 104, sourceFile);
+ case 205:
+ var hasWhileKeyword = findChildOfKind(n, 105, sourceFile);
if (hasWhileKeyword) {
- return nodeEndsWith(n, 18, sourceFile);
+ return nodeEndsWith(n, 19, sourceFile);
}
return isCompletedNode(n.statement, sourceFile);
- case 158:
+ case 159:
return isCompletedNode(n.exprName, sourceFile);
- case 182:
- case 181:
case 183:
- case 190:
+ case 182:
+ case 184:
case 191:
+ case 192:
var unaryWordExpression = n;
return isCompletedNode(unaryWordExpression.expression, sourceFile);
- case 176:
+ case 177:
return isCompletedNode(n.template, sourceFile);
- case 189:
+ case 190:
var lastSpan = ts.lastOrUndefined(n.templateSpans);
return isCompletedNode(lastSpan, sourceFile);
- case 197:
+ case 198:
return ts.nodeIsPresent(n.literal);
- case 236:
- case 230:
+ case 237:
+ case 231:
return ts.nodeIsPresent(n.moduleSpecifier);
- case 185:
+ case 186:
return isCompletedNode(n.operand, sourceFile);
- case 187:
- return isCompletedNode(n.right, sourceFile);
case 188:
+ return isCompletedNode(n.right, sourceFile);
+ case 189:
return isCompletedNode(n.whenFalse, sourceFile);
default:
return true;
@@ -49518,7 +50852,7 @@ var ts;
if (last.kind === expectedLastToken) {
return true;
}
- else if (last.kind === 23 && children.length !== 1) {
+ else if (last.kind === 24 && children.length !== 1) {
return children[children.length - 2].kind === expectedLastToken;
}
}
@@ -49655,7 +50989,7 @@ var ts;
function findPrecedingToken(position, sourceFile, startNode) {
return find(startNode || sourceFile);
function findRightmostToken(n) {
- if (isToken(n) || n.kind === 244) {
+ if (isToken(n)) {
return n;
}
var children = n.getChildren();
@@ -49663,16 +50997,16 @@ var ts;
return candidate && findRightmostToken(candidate);
}
function find(n) {
- if (isToken(n) || n.kind === 244) {
+ if (isToken(n)) {
return n;
}
var children = n.getChildren();
for (var i = 0, len = children.length; i < len; i++) {
var child = children[i];
- if (position < child.end && (nodeHasTokens(child) || child.kind === 244)) {
+ if (position < child.end && (nodeHasTokens(child) || child.kind === 10)) {
var start = child.getStart(sourceFile);
var lookInPreviousChild = (start >= position) ||
- (child.kind === 244 && start === child.end);
+ (child.kind === 10 && start === child.end);
if (lookInPreviousChild) {
var candidate = findRightmostChildNodeWithTokens(children, i);
return candidate && findRightmostToken(candidate);
@@ -49721,19 +51055,19 @@ var ts;
if (!token) {
return false;
}
- if (token.kind === 244) {
+ if (token.kind === 10) {
return true;
}
- if (token.kind === 25 && token.parent.kind === 244) {
+ if (token.kind === 26 && token.parent.kind === 10) {
return true;
}
- if (token.kind === 25 && token.parent.kind === 248) {
+ if (token.kind === 26 && token.parent.kind === 248) {
return true;
}
- if (token && token.kind === 16 && token.parent.kind === 248) {
+ if (token && token.kind === 17 && token.parent.kind === 248) {
return true;
}
- if (token.kind === 25 && token.parent.kind === 245) {
+ if (token.kind === 26 && token.parent.kind === 245) {
return true;
}
return false;
@@ -49772,9 +51106,9 @@ var ts;
var node = ts.getTokenAtPosition(sourceFile, position);
if (isToken(node)) {
switch (node.kind) {
- case 102:
- case 108:
- case 74:
+ case 103:
+ case 109:
+ case 75:
node = node.parent === undefined ? undefined : node.parent.parent;
break;
default:
@@ -49824,21 +51158,21 @@ var ts;
}
ts.getNodeModifiers = getNodeModifiers;
function getTypeArgumentOrTypeParameterList(node) {
- if (node.kind === 155 || node.kind === 174) {
+ if (node.kind === 156 || node.kind === 175) {
return node.typeArguments;
}
- if (ts.isFunctionLike(node) || node.kind === 221 || node.kind === 222) {
+ if (ts.isFunctionLike(node) || node.kind === 222 || node.kind === 223) {
return node.typeParameters;
}
return undefined;
}
ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList;
function isToken(n) {
- return n.kind >= 0 && n.kind <= 138;
+ return n.kind >= 0 && n.kind <= 139;
}
ts.isToken = isToken;
function isWord(kind) {
- return kind === 69 || ts.isKeyword(kind);
+ return kind === 70 || ts.isKeyword(kind);
}
ts.isWord = isWord;
function isPropertyName(kind) {
@@ -49850,7 +51184,7 @@ var ts;
ts.isComment = isComment;
function isStringOrRegularExpressionOrTemplateLiteral(kind) {
if (kind === 9
- || kind === 10
+ || kind === 11
|| ts.isTemplateLiteralKind(kind)) {
return true;
}
@@ -49858,7 +51192,7 @@ var ts;
}
ts.isStringOrRegularExpressionOrTemplateLiteral = isStringOrRegularExpressionOrTemplateLiteral;
function isPunctuation(kind) {
- return 15 <= kind && kind <= 68;
+ return 16 <= kind && kind <= 69;
}
ts.isPunctuation = isPunctuation;
function isInsideTemplateLiteral(node, position) {
@@ -49868,9 +51202,9 @@ var ts;
ts.isInsideTemplateLiteral = isInsideTemplateLiteral;
function isAccessibilityModifier(kind) {
switch (kind) {
- case 112:
- case 110:
+ case 113:
case 111:
+ case 112:
return true;
}
return false;
@@ -49893,14 +51227,14 @@ var ts;
}
ts.compareDataObjects = compareDataObjects;
function isArrayLiteralOrObjectLiteralDestructuringPattern(node) {
- if (node.kind === 170 ||
- node.kind === 171) {
- if (node.parent.kind === 187 &&
+ if (node.kind === 171 ||
+ node.kind === 172) {
+ if (node.parent.kind === 188 &&
node.parent.left === node &&
- node.parent.operatorToken.kind === 56) {
+ node.parent.operatorToken.kind === 57) {
return true;
}
- if (node.parent.kind === 208 &&
+ if (node.parent.kind === 209 &&
node.parent.initializer === node) {
return true;
}
@@ -49935,7 +51269,7 @@ var ts;
})(ts || (ts = {}));
(function (ts) {
function isFirstDeclarationOfSymbolParameter(symbol) {
- return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 142;
+ return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 143;
}
ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter;
var displayPartWriter = getDisplayPartWriter();
@@ -49988,7 +51322,7 @@ var ts;
}
}
function symbolPart(text, symbol) {
- return displayPart(text, displayPartKind(symbol), symbol);
+ return displayPart(text, displayPartKind(symbol));
function displayPartKind(symbol) {
var flags = symbol.flags;
if (flags & 3) {
@@ -50037,7 +51371,7 @@ var ts;
}
}
ts.symbolPart = symbolPart;
- function displayPart(text, kind, symbol) {
+ function displayPart(text, kind) {
return {
text: text,
kind: ts.SymbolDisplayPartKind[kind]
@@ -50110,7 +51444,7 @@ var ts;
return location.getText();
}
else if (ts.isStringOrNumericLiteral(location.kind) &&
- location.parent.kind === 140) {
+ location.parent.kind === 141) {
return location.text;
}
var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol);
@@ -50120,7 +51454,7 @@ var ts;
ts.getDeclaredName = getDeclaredName;
function isImportOrExportSpecifierName(location) {
return location.parent &&
- (location.parent.kind === 234 || location.parent.kind === 238) &&
+ (location.parent.kind === 235 || location.parent.kind === 239) &&
location.parent.propertyName === location;
}
ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName;
@@ -50225,157 +51559,157 @@ var ts;
function spanInNode(node) {
if (node) {
switch (node.kind) {
- case 200:
+ case 201:
return spanInVariableDeclaration(node.declarationList.declarations[0]);
- case 218:
- case 145:
- case 144:
- return spanInVariableDeclaration(node);
- case 142:
- return spanInParameterDeclaration(node);
- case 220:
- case 147:
+ case 219:
case 146:
- case 149:
- case 150:
+ case 145:
+ return spanInVariableDeclaration(node);
+ case 143:
+ return spanInParameterDeclaration(node);
+ case 221:
case 148:
- case 179:
+ case 147:
+ case 150:
+ case 151:
+ case 149:
case 180:
+ case 181:
return spanInFunctionDeclaration(node);
- case 199:
+ case 200:
if (ts.isFunctionBlock(node)) {
return spanInFunctionBlock(node);
}
- case 226:
+ case 227:
return spanInBlock(node);
case 252:
return spanInBlock(node.block);
- case 202:
- return textSpan(node.expression);
- case 211:
- return textSpan(node.getChildAt(0), node.expression);
- case 205:
- return textSpanEndingAtNextToken(node, node.expression);
- case 204:
- return spanInNode(node.statement);
- case 217:
- return textSpan(node.getChildAt(0));
case 203:
- return textSpanEndingAtNextToken(node, node.expression);
- case 214:
- return spanInNode(node.statement);
- case 210:
- case 209:
- return textSpan(node.getChildAt(0), node.label);
+ return textSpan(node.expression);
+ case 212:
+ return textSpan(node.getChildAt(0), node.expression);
case 206:
- return spanInForStatement(node);
- case 207:
return textSpanEndingAtNextToken(node, node.expression);
+ case 205:
+ return spanInNode(node.statement);
+ case 218:
+ return textSpan(node.getChildAt(0));
+ case 204:
+ return textSpanEndingAtNextToken(node, node.expression);
+ case 215:
+ return spanInNode(node.statement);
+ case 211:
+ case 210:
+ return textSpan(node.getChildAt(0), node.label);
+ case 207:
+ return spanInForStatement(node);
case 208:
+ return textSpanEndingAtNextToken(node, node.expression);
+ case 209:
return spanInInitializerOfForLike(node);
- case 213:
+ case 214:
return textSpanEndingAtNextToken(node, node.expression);
case 249:
case 250:
return spanInNode(node.statements[0]);
- case 216:
+ case 217:
return spanInBlock(node.tryBlock);
- case 215:
+ case 216:
return textSpan(node, node.expression);
- case 235:
- return textSpan(node, node.expression);
- case 229:
- return textSpan(node, node.moduleReference);
- case 230:
- return textSpan(node, node.moduleSpecifier);
case 236:
+ return textSpan(node, node.expression);
+ case 230:
+ return textSpan(node, node.moduleReference);
+ case 231:
return textSpan(node, node.moduleSpecifier);
- case 225:
+ case 237:
+ return textSpan(node, node.moduleSpecifier);
+ case 226:
if (ts.getModuleInstanceState(node) !== 1) {
return undefined;
}
- case 221:
- case 224:
- case 255:
- case 169:
- return textSpan(node);
- case 212:
- return spanInNode(node.statement);
- case 143:
- return spanInNodeArray(node.parent.decorators);
- case 167:
- case 168:
- return spanInBindingPattern(node);
case 222:
+ case 225:
+ case 255:
+ case 170:
+ return textSpan(node);
+ case 213:
+ return spanInNode(node.statement);
+ case 144:
+ return spanInNodeArray(node.parent.decorators);
+ case 168:
+ case 169:
+ return spanInBindingPattern(node);
case 223:
+ case 224:
return undefined;
- case 23:
+ case 24:
case 1:
return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile));
- case 24:
- return spanInPreviousNode(node);
- case 15:
- return spanInOpenBraceToken(node);
- case 16:
- return spanInCloseBraceToken(node);
- case 20:
- return spanInCloseBracketToken(node);
- case 17:
- return spanInOpenParenToken(node);
- case 18:
- return spanInCloseParenToken(node);
- case 54:
- return spanInColonToken(node);
- case 27:
case 25:
+ return spanInPreviousNode(node);
+ case 16:
+ return spanInOpenBraceToken(node);
+ case 17:
+ return spanInCloseBraceToken(node);
+ case 21:
+ return spanInCloseBracketToken(node);
+ case 18:
+ return spanInOpenParenToken(node);
+ case 19:
+ return spanInCloseParenToken(node);
+ case 55:
+ return spanInColonToken(node);
+ case 28:
+ case 26:
return spanInGreaterThanOrLessThanToken(node);
- case 104:
+ case 105:
return spanInWhileKeyword(node);
- case 80:
- case 72:
- case 85:
+ case 81:
+ case 73:
+ case 86:
return spanInNextNode(node);
- case 138:
+ case 139:
return spanInOfKeyword(node);
default:
if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node)) {
return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node);
}
- if ((node.kind === 69 ||
- node.kind == 191 ||
+ if ((node.kind === 70 ||
+ node.kind == 192 ||
node.kind === 253 ||
node.kind === 254) &&
ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) {
return textSpan(node);
}
- if (node.kind === 187) {
+ if (node.kind === 188) {
var binaryExpression = node;
if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left)) {
return spanInArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left);
}
- if (binaryExpression.operatorToken.kind === 56 &&
+ if (binaryExpression.operatorToken.kind === 57 &&
ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.parent)) {
return textSpan(node);
}
- if (binaryExpression.operatorToken.kind === 24) {
+ if (binaryExpression.operatorToken.kind === 25) {
return spanInNode(binaryExpression.left);
}
}
if (ts.isPartOfExpression(node)) {
switch (node.parent.kind) {
- case 204:
+ case 205:
return spanInPreviousNode(node);
- case 143:
+ case 144:
return spanInNode(node.parent);
- case 206:
- case 208:
+ case 207:
+ case 209:
return textSpan(node);
- case 187:
- if (node.parent.operatorToken.kind === 24) {
+ case 188:
+ if (node.parent.operatorToken.kind === 25) {
return textSpan(node);
}
break;
- case 180:
+ case 181:
if (node.parent.body === node) {
return textSpan(node);
}
@@ -50387,14 +51721,14 @@ var ts;
!ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) {
return spanInNode(node.parent.initializer);
}
- if (node.parent.kind === 177 && node.parent.type === node) {
+ if (node.parent.kind === 178 && node.parent.type === node) {
return spanInNextNode(node.parent.type);
}
if (ts.isFunctionLike(node.parent) && node.parent.type === node) {
return spanInPreviousNode(node);
}
- if ((node.parent.kind === 218 ||
- node.parent.kind === 142)) {
+ if ((node.parent.kind === 219 ||
+ node.parent.kind === 143)) {
var paramOrVarDecl = node.parent;
if (paramOrVarDecl.initializer === node ||
paramOrVarDecl.type === node ||
@@ -50402,7 +51736,7 @@ var ts;
return spanInPreviousNode(node);
}
}
- if (node.parent.kind === 187) {
+ if (node.parent.kind === 188) {
var binaryExpression = node.parent;
if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) &&
(binaryExpression.right === node ||
@@ -50423,7 +51757,7 @@ var ts;
}
}
function spanInVariableDeclaration(variableDeclaration) {
- if (variableDeclaration.parent.parent.kind === 207) {
+ if (variableDeclaration.parent.parent.kind === 208) {
return spanInNode(variableDeclaration.parent.parent);
}
if (ts.isBindingPattern(variableDeclaration.name)) {
@@ -50431,7 +51765,7 @@ var ts;
}
if (variableDeclaration.initializer ||
ts.hasModifier(variableDeclaration, 1) ||
- variableDeclaration.parent.parent.kind === 208) {
+ variableDeclaration.parent.parent.kind === 209) {
return textSpanFromVariableDeclaration(variableDeclaration);
}
var declarations = variableDeclaration.parent.declarations;
@@ -50463,7 +51797,7 @@ var ts;
}
function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) {
return ts.hasModifier(functionDeclaration, 1) ||
- (functionDeclaration.parent.kind === 221 && functionDeclaration.kind !== 148);
+ (functionDeclaration.parent.kind === 222 && functionDeclaration.kind !== 149);
}
function spanInFunctionDeclaration(functionDeclaration) {
if (!functionDeclaration.body) {
@@ -50483,22 +51817,22 @@ var ts;
}
function spanInBlock(block) {
switch (block.parent.kind) {
- case 225:
+ case 226:
if (ts.getModuleInstanceState(block.parent) !== 1) {
return undefined;
}
- case 205:
- case 203:
- case 207:
- return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]);
case 206:
+ case 204:
case 208:
+ return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]);
+ case 207:
+ case 209:
return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]);
}
return spanInNode(block.statements[0]);
}
function spanInInitializerOfForLike(forLikeStatement) {
- if (forLikeStatement.initializer.kind === 219) {
+ if (forLikeStatement.initializer.kind === 220) {
var variableDeclarationList = forLikeStatement.initializer;
if (variableDeclarationList.declarations.length > 0) {
return spanInNode(variableDeclarationList.declarations[0]);
@@ -50520,62 +51854,62 @@ var ts;
}
}
function spanInBindingPattern(bindingPattern) {
- var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 193 ? element : undefined; });
+ var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 194 ? element : undefined; });
if (firstBindingElement) {
return spanInNode(firstBindingElement);
}
- if (bindingPattern.parent.kind === 169) {
+ if (bindingPattern.parent.kind === 170) {
return textSpan(bindingPattern.parent);
}
return textSpanFromVariableDeclaration(bindingPattern.parent);
}
function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) {
- ts.Debug.assert(node.kind !== 168 && node.kind !== 167);
- var elements = node.kind === 170 ?
+ ts.Debug.assert(node.kind !== 169 && node.kind !== 168);
+ var elements = node.kind === 171 ?
node.elements :
node.properties;
- var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 193 ? element : undefined; });
+ var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 194 ? element : undefined; });
if (firstBindingElement) {
return spanInNode(firstBindingElement);
}
- return textSpan(node.parent.kind === 187 ? node.parent : node);
+ return textSpan(node.parent.kind === 188 ? node.parent : node);
}
function spanInOpenBraceToken(node) {
switch (node.parent.kind) {
- case 224:
+ case 225:
var enumDeclaration = node.parent;
return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile));
- case 221:
+ case 222:
var classDeclaration = node.parent;
return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile));
- case 227:
+ case 228:
return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]);
}
return spanInNode(node.parent);
}
function spanInCloseBraceToken(node) {
switch (node.parent.kind) {
- case 226:
+ case 227:
if (ts.getModuleInstanceState(node.parent.parent) !== 1) {
return undefined;
}
- case 224:
- case 221:
+ case 225:
+ case 222:
return textSpan(node);
- case 199:
+ case 200:
if (ts.isFunctionBlock(node.parent)) {
return textSpan(node);
}
case 252:
return spanInNode(ts.lastOrUndefined(node.parent.statements));
- case 227:
+ case 228:
var caseBlock = node.parent;
var lastClause = ts.lastOrUndefined(caseBlock.clauses);
if (lastClause) {
return spanInNode(ts.lastOrUndefined(lastClause.statements));
}
return undefined;
- case 167:
+ case 168:
var bindingPattern = node.parent;
return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern);
default:
@@ -50588,7 +51922,7 @@ var ts;
}
function spanInCloseBracketToken(node) {
switch (node.parent.kind) {
- case 168:
+ case 169:
var bindingPattern = node.parent;
return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern);
default:
@@ -50600,33 +51934,33 @@ var ts;
}
}
function spanInOpenParenToken(node) {
- if (node.parent.kind === 204 ||
- node.parent.kind === 174 ||
- node.parent.kind === 175) {
+ if (node.parent.kind === 205 ||
+ node.parent.kind === 175 ||
+ node.parent.kind === 176) {
return spanInPreviousNode(node);
}
- if (node.parent.kind === 178) {
+ if (node.parent.kind === 179) {
return spanInNextNode(node);
}
return spanInNode(node.parent);
}
function spanInCloseParenToken(node) {
switch (node.parent.kind) {
- case 179:
- case 220:
case 180:
- case 147:
- case 146:
- case 149:
- case 150:
+ case 221:
+ case 181:
case 148:
- case 205:
- case 204:
+ case 147:
+ case 150:
+ case 151:
+ case 149:
case 206:
- case 208:
- case 174:
+ case 205:
+ case 207:
+ case 209:
case 175:
- case 178:
+ case 176:
+ case 179:
return spanInPreviousNode(node);
default:
return spanInNode(node.parent);
@@ -50635,25 +51969,25 @@ var ts;
function spanInColonToken(node) {
if (ts.isFunctionLike(node.parent) ||
node.parent.kind === 253 ||
- node.parent.kind === 142) {
+ node.parent.kind === 143) {
return spanInPreviousNode(node);
}
return spanInNode(node.parent);
}
function spanInGreaterThanOrLessThanToken(node) {
- if (node.parent.kind === 177) {
+ if (node.parent.kind === 178) {
return spanInNextNode(node);
}
return spanInNode(node.parent);
}
function spanInWhileKeyword(node) {
- if (node.parent.kind === 204) {
+ if (node.parent.kind === 205) {
return textSpanEndingAtNextToken(node, node.parent.expression);
}
return spanInNode(node.parent);
}
function spanInOfKeyword(node) {
- if (node.parent.kind === 208) {
+ if (node.parent.kind === 209) {
return spanInNextNode(node);
}
return spanInNode(node.parent);
@@ -50666,27 +52000,27 @@ var ts;
var ts;
(function (ts) {
function createClassifier() {
- var scanner = ts.createScanner(2, false);
+ var scanner = ts.createScanner(4, false);
var noRegexTable = [];
- noRegexTable[69] = true;
+ noRegexTable[70] = true;
noRegexTable[9] = true;
noRegexTable[8] = true;
- noRegexTable[10] = true;
- noRegexTable[97] = true;
- noRegexTable[41] = true;
+ noRegexTable[11] = true;
+ noRegexTable[98] = true;
noRegexTable[42] = true;
- noRegexTable[18] = true;
- noRegexTable[20] = true;
- noRegexTable[16] = true;
- noRegexTable[99] = true;
- noRegexTable[84] = true;
+ noRegexTable[43] = true;
+ noRegexTable[19] = true;
+ noRegexTable[21] = true;
+ noRegexTable[17] = true;
+ noRegexTable[100] = true;
+ noRegexTable[85] = true;
var templateStack = [];
function canFollow(keyword1, keyword2) {
if (ts.isAccessibilityModifier(keyword1)) {
- if (keyword2 === 123 ||
- keyword2 === 131 ||
- keyword2 === 121 ||
- keyword2 === 113) {
+ if (keyword2 === 124 ||
+ keyword2 === 132 ||
+ keyword2 === 122 ||
+ keyword2 === 114) {
return true;
}
return false;
@@ -50769,7 +52103,7 @@ var ts;
text = "}\n" + text;
offset = 2;
case 6:
- templateStack.push(12);
+ templateStack.push(13);
break;
}
scanner.setText(text);
@@ -50781,55 +52115,55 @@ var ts;
do {
token = scanner.scan();
if (!ts.isTrivia(token)) {
- if ((token === 39 || token === 61) && !noRegexTable[lastNonTriviaToken]) {
- if (scanner.reScanSlashToken() === 10) {
- token = 10;
+ if ((token === 40 || token === 62) && !noRegexTable[lastNonTriviaToken]) {
+ if (scanner.reScanSlashToken() === 11) {
+ token = 11;
}
}
- else if (lastNonTriviaToken === 21 && isKeyword(token)) {
- token = 69;
+ else if (lastNonTriviaToken === 22 && isKeyword(token)) {
+ token = 70;
}
else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) {
- token = 69;
+ token = 70;
}
- else if (lastNonTriviaToken === 69 &&
- token === 25) {
+ else if (lastNonTriviaToken === 70 &&
+ token === 26) {
angleBracketStack++;
}
- else if (token === 27 && angleBracketStack > 0) {
+ else if (token === 28 && angleBracketStack > 0) {
angleBracketStack--;
}
- else if (token === 117 ||
- token === 132 ||
- token === 130 ||
- token === 120 ||
- token === 133) {
+ else if (token === 118 ||
+ token === 133 ||
+ token === 131 ||
+ token === 121 ||
+ token === 134) {
if (angleBracketStack > 0 && !syntacticClassifierAbsent) {
- token = 69;
+ token = 70;
}
}
- else if (token === 12) {
+ else if (token === 13) {
templateStack.push(token);
}
- else if (token === 15) {
+ else if (token === 16) {
if (templateStack.length > 0) {
templateStack.push(token);
}
}
- else if (token === 16) {
+ else if (token === 17) {
if (templateStack.length > 0) {
var lastTemplateStackToken = ts.lastOrUndefined(templateStack);
- if (lastTemplateStackToken === 12) {
+ if (lastTemplateStackToken === 13) {
token = scanner.reScanTemplateToken();
- if (token === 14) {
+ if (token === 15) {
templateStack.pop();
}
else {
- ts.Debug.assert(token === 13, "Should have been a template middle. Was " + token);
+ ts.Debug.assert(token === 14, "Should have been a template middle. Was " + token);
}
}
else {
- ts.Debug.assert(lastTemplateStackToken === 15, "Should have been an open brace. Was: " + token);
+ ts.Debug.assert(lastTemplateStackToken === 16, "Should have been an open brace. Was: " + token);
templateStack.pop();
}
}
@@ -50867,10 +52201,10 @@ var ts;
}
else if (ts.isTemplateLiteralKind(token)) {
if (scanner.isUnterminated()) {
- if (token === 14) {
+ if (token === 15) {
result.endOfLineState = 5;
}
- else if (token === 11) {
+ else if (token === 12) {
result.endOfLineState = 4;
}
else {
@@ -50878,7 +52212,7 @@ var ts;
}
}
}
- else if (templateStack.length > 0 && ts.lastOrUndefined(templateStack) === 12) {
+ else if (templateStack.length > 0 && ts.lastOrUndefined(templateStack) === 13) {
result.endOfLineState = 6;
}
}
@@ -50902,43 +52236,43 @@ var ts;
}
function isBinaryExpressionOperatorToken(token) {
switch (token) {
- case 37:
- case 39:
+ case 38:
case 40:
- case 35:
+ case 41:
case 36:
- case 43:
+ case 37:
case 44:
case 45:
- case 25:
- case 27:
+ case 46:
+ case 26:
case 28:
case 29:
- case 91:
- case 90:
- case 116:
case 30:
+ case 92:
+ case 91:
+ case 117:
case 31:
case 32:
case 33:
- case 46:
- case 48:
+ case 34:
case 47:
- case 51:
+ case 49:
+ case 48:
case 52:
- case 67:
- case 66:
+ case 53:
case 68:
- case 63:
+ case 67:
+ case 69:
case 64:
case 65:
- case 57:
+ case 66:
case 58:
case 59:
- case 61:
+ case 60:
case 62:
- case 56:
- case 24:
+ case 63:
+ case 57:
+ case 25:
return true;
default:
return false;
@@ -50946,19 +52280,19 @@ var ts;
}
function isPrefixUnaryExpressionOperatorToken(token) {
switch (token) {
- case 35:
case 36:
+ case 37:
+ case 51:
case 50:
- case 49:
- case 41:
case 42:
+ case 43:
return true;
default:
return false;
}
}
function isKeyword(token) {
- return token >= 70 && token <= 138;
+ return token >= 71 && token <= 139;
}
function classFromKind(token) {
if (isKeyword(token)) {
@@ -50967,7 +52301,7 @@ var ts;
else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) {
return 5;
}
- else if (token >= 15 && token <= 68) {
+ else if (token >= 16 && token <= 69) {
return 10;
}
switch (token) {
@@ -50975,7 +52309,7 @@ var ts;
return 4;
case 9:
return 6;
- case 10:
+ case 11:
return 7;
case 7:
case 3:
@@ -50984,7 +52318,7 @@ var ts;
case 5:
case 4:
return 8;
- case 69:
+ case 70:
default:
if (ts.isTemplateLiteralKind(token)) {
return 6;
@@ -51004,10 +52338,10 @@ var ts;
ts.getSemanticClassifications = getSemanticClassifications;
function checkForClassificationCancellation(cancellationToken, kind) {
switch (kind) {
- case 225:
- case 221:
+ case 226:
case 222:
- case 220:
+ case 223:
+ case 221:
cancellationToken.throwIfCancellationRequested();
}
}
@@ -51051,7 +52385,7 @@ var ts;
return undefined;
function hasValueSideModule(symbol) {
return ts.forEach(symbol.declarations, function (declaration) {
- return declaration.kind === 225 &&
+ return declaration.kind === 226 &&
ts.getModuleInstanceState(declaration) === 1;
});
}
@@ -51060,7 +52394,7 @@ var ts;
if (node && ts.textSpanIntersectsWith(span, node.getFullStart(), node.getFullWidth())) {
var kind = node.kind;
checkForClassificationCancellation(cancellationToken, kind);
- if (kind === 69 && !ts.nodeIsMissing(node)) {
+ if (kind === 70 && !ts.nodeIsMissing(node)) {
var identifier = node;
if (classifiableNames[identifier.text]) {
var symbol = typeChecker.getSymbolAtLocation(node);
@@ -51123,8 +52457,8 @@ var ts;
function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) {
var spanStart = span.start;
var spanLength = span.length;
- var triviaScanner = ts.createScanner(2, false, sourceFile.languageVariant, sourceFile.text);
- var mergeConflictScanner = ts.createScanner(2, false, sourceFile.languageVariant, sourceFile.text);
+ var triviaScanner = ts.createScanner(4, false, sourceFile.languageVariant, sourceFile.text);
+ var mergeConflictScanner = ts.createScanner(4, false, sourceFile.languageVariant, sourceFile.text);
var result = [];
processElement(sourceFile);
return { spans: result, endOfLineState: 0 };
@@ -51266,10 +52600,10 @@ var ts;
return true;
}
var classifiedElementName = tryClassifyJsxElementName(node);
- if (!ts.isToken(node) && node.kind !== 244 && classifiedElementName === undefined) {
+ if (!ts.isToken(node) && node.kind !== 10 && classifiedElementName === undefined) {
return false;
}
- var tokenStart = node.kind === 244 ? node.pos : classifyLeadingTriviaAndGetTokenStart(node);
+ var tokenStart = node.kind === 10 ? node.pos : classifyLeadingTriviaAndGetTokenStart(node);
var tokenWidth = node.end - tokenStart;
ts.Debug.assert(tokenWidth >= 0);
if (tokenWidth > 0) {
@@ -51282,7 +52616,7 @@ var ts;
}
function tryClassifyJsxElementName(token) {
switch (token.parent && token.parent.kind) {
- case 243:
+ case 244:
if (token.parent.tagName === token) {
return 19;
}
@@ -51292,7 +52626,7 @@ var ts;
return 20;
}
break;
- case 242:
+ case 243:
if (token.parent.tagName === token) {
return 21;
}
@@ -51309,25 +52643,25 @@ var ts;
if (ts.isKeyword(tokenKind)) {
return 3;
}
- if (tokenKind === 25 || tokenKind === 27) {
+ if (tokenKind === 26 || tokenKind === 28) {
if (token && ts.getTypeArgumentOrTypeParameterList(token.parent)) {
return 10;
}
}
if (ts.isPunctuation(tokenKind)) {
if (token) {
- if (tokenKind === 56) {
- if (token.parent.kind === 218 ||
- token.parent.kind === 145 ||
- token.parent.kind === 142 ||
+ if (tokenKind === 57) {
+ if (token.parent.kind === 219 ||
+ token.parent.kind === 146 ||
+ token.parent.kind === 143 ||
token.parent.kind === 246) {
return 5;
}
}
- if (token.parent.kind === 187 ||
- token.parent.kind === 185 ||
+ if (token.parent.kind === 188 ||
token.parent.kind === 186 ||
- token.parent.kind === 188) {
+ token.parent.kind === 187 ||
+ token.parent.kind === 189) {
return 5;
}
}
@@ -51339,44 +52673,44 @@ var ts;
else if (tokenKind === 9) {
return token.parent.kind === 246 ? 24 : 6;
}
- else if (tokenKind === 10) {
+ else if (tokenKind === 11) {
return 6;
}
else if (ts.isTemplateLiteralKind(tokenKind)) {
return 6;
}
- else if (tokenKind === 244) {
+ else if (tokenKind === 10) {
return 23;
}
- else if (tokenKind === 69) {
+ else if (tokenKind === 70) {
if (token) {
switch (token.parent.kind) {
- case 221:
+ case 222:
if (token.parent.name === token) {
return 11;
}
return;
- case 141:
+ case 142:
if (token.parent.name === token) {
return 15;
}
return;
- case 222:
+ case 223:
if (token.parent.name === token) {
return 13;
}
return;
- case 224:
+ case 225:
if (token.parent.name === token) {
return 12;
}
return;
- case 225:
+ case 226:
if (token.parent.name === token) {
return 14;
}
return;
- case 142:
+ case 143:
if (token.parent.name === token) {
return ts.isThisIdentifier(token) ? 3 : 17;
}
@@ -51437,7 +52771,7 @@ var ts;
name: tagName.text,
kind: undefined,
kindModifiers: undefined,
- sortText: "0"
+ sortText: "0",
});
}
else {
@@ -51453,13 +52787,13 @@ var ts;
function getJavaScriptCompletionEntries(sourceFile, position, uniqueNames) {
var entries = [];
var nameTable = ts.getNameTable(sourceFile);
- for (var name_47 in nameTable) {
- if (nameTable[name_47] === position) {
+ for (var name_46 in nameTable) {
+ if (nameTable[name_46] === position) {
continue;
}
- if (!uniqueNames[name_47]) {
- uniqueNames[name_47] = name_47;
- var displayName = getCompletionEntryDisplayName(ts.unescapeIdentifier(name_47), compilerOptions.target, true);
+ if (!uniqueNames[name_46]) {
+ uniqueNames[name_46] = name_46;
+ var displayName = getCompletionEntryDisplayName(ts.unescapeIdentifier(name_46), compilerOptions.target, true);
if (displayName) {
var entry = {
name: displayName,
@@ -51482,7 +52816,7 @@ var ts;
name: displayName,
kind: ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location),
kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol),
- sortText: "0"
+ sortText: "0",
};
}
function getCompletionEntriesFromSymbols(symbols, entries, location, performCharacterChecks) {
@@ -51510,20 +52844,20 @@ var ts;
return undefined;
}
if (node.parent.kind === 253 &&
- node.parent.parent.kind === 171 &&
+ node.parent.parent.kind === 172 &&
node.parent.name === node) {
return getStringLiteralCompletionEntriesFromPropertyAssignment(node.parent);
}
else if (ts.isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) {
return getStringLiteralCompletionEntriesFromElementAccess(node.parent);
}
- else if (node.parent.kind === 230 || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node) || ts.isRequireCall(node.parent, false)) {
+ else if (node.parent.kind === 231 || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node) || ts.isRequireCall(node.parent, false)) {
return getStringLiteralCompletionEntriesFromModuleNames(node);
}
else {
var argumentInfo = ts.SignatureHelp.getContainingArgumentInfo(node, position, sourceFile);
if (argumentInfo) {
- return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, node);
+ return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo);
}
return getStringLiteralCompletionEntriesFromContextualType(node);
}
@@ -51538,7 +52872,7 @@ var ts;
}
}
}
- function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, location) {
+ function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo) {
var candidates = [];
var entries = [];
typeChecker.getResolvedSignature(argumentInfo.invocation, candidates);
@@ -51848,7 +53182,7 @@ var ts;
if (typeRoots) {
for (var _b = 0, typeRoots_2 = typeRoots; _b < typeRoots_2.length; _b++) {
var root = typeRoots_2[_b];
- getCompletionEntriesFromDirectories(host, options, root, span, result);
+ getCompletionEntriesFromDirectories(host, root, span, result);
}
}
}
@@ -51856,12 +53190,12 @@ var ts;
for (var _c = 0, _d = findPackageJsons(scriptPath); _c < _d.length; _c++) {
var packageJson = _d[_c];
var typesDir = ts.combinePaths(ts.getDirectoryPath(packageJson), "node_modules/@types");
- getCompletionEntriesFromDirectories(host, options, typesDir, span, result);
+ getCompletionEntriesFromDirectories(host, typesDir, span, result);
}
}
return result;
}
- function getCompletionEntriesFromDirectories(host, options, directory, span, result) {
+ function getCompletionEntriesFromDirectories(host, directory, span, result) {
if (host.getDirectories && tryDirectoryExists(host, directory)) {
var directories = tryGetDirectories(host, directory);
if (directories) {
@@ -52055,12 +53389,12 @@ var ts;
return undefined;
}
var parent_17 = contextToken.parent, kind = contextToken.kind;
- if (kind === 21) {
- if (parent_17.kind === 172) {
+ if (kind === 22) {
+ if (parent_17.kind === 173) {
node = contextToken.parent.expression;
isRightOfDot = true;
}
- else if (parent_17.kind === 139) {
+ else if (parent_17.kind === 140) {
node = contextToken.parent.left;
isRightOfDot = true;
}
@@ -52069,11 +53403,11 @@ var ts;
}
}
else if (sourceFile.languageVariant === 1) {
- if (kind === 25) {
+ if (kind === 26) {
isRightOfOpenTag = true;
location = contextToken;
}
- else if (kind === 39 && contextToken.parent.kind === 245) {
+ else if (kind === 40 && contextToken.parent.kind === 245) {
isStartingCloseTag = true;
location = contextToken;
}
@@ -52111,7 +53445,6 @@ var ts;
if (!tryGetGlobalSymbols()) {
return undefined;
}
- isGlobalCompletion = true;
}
log("getCompletionData: Semantic work: " + (ts.timestamp() - semanticStart));
return { symbols: symbols, isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), isJsDocTagName: isJsDocTagName };
@@ -52119,7 +53452,7 @@ var ts;
isGlobalCompletion = false;
isMemberCompletion = true;
isNewIdentifierLocation = false;
- if (node.kind === 69 || node.kind === 139 || node.kind === 172) {
+ if (node.kind === 70 || node.kind === 140 || node.kind === 173) {
var symbol = typeChecker.getSymbolAtLocation(node);
if (symbol && symbol.flags & 8388608) {
symbol = typeChecker.getAliasedSymbol(symbol);
@@ -52165,9 +53498,8 @@ var ts;
}
if (jsxContainer = tryGetContainingJsxElement(contextToken)) {
var attrsType = void 0;
- if ((jsxContainer.kind === 242) || (jsxContainer.kind === 243)) {
+ if ((jsxContainer.kind === 243) || (jsxContainer.kind === 244)) {
attrsType = typeChecker.getJsxElementAttributesType(jsxContainer);
- isGlobalCompletion = false;
if (attrsType) {
symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), jsxContainer.attributes);
isMemberCompletion = true;
@@ -52185,6 +53517,13 @@ var ts;
previousToken.getStart() :
position;
var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile;
+ if (scopeNode) {
+ isGlobalCompletion =
+ scopeNode.kind === 256 ||
+ scopeNode.kind === 190 ||
+ scopeNode.kind === 248 ||
+ ts.isStatement(scopeNode);
+ }
var symbolMeanings = 793064 | 107455 | 1920 | 8388608;
symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings);
return true;
@@ -52206,15 +53545,15 @@ var ts;
return result;
}
function isInJsxText(contextToken) {
- if (contextToken.kind === 244) {
+ if (contextToken.kind === 10) {
return true;
}
- if (contextToken.kind === 27 && contextToken.parent) {
- if (contextToken.parent.kind === 243) {
+ if (contextToken.kind === 28 && contextToken.parent) {
+ if (contextToken.parent.kind === 244) {
return true;
}
- if (contextToken.parent.kind === 245 || contextToken.parent.kind === 242) {
- return contextToken.parent.parent && contextToken.parent.parent.kind === 241;
+ if (contextToken.parent.kind === 245 || contextToken.parent.kind === 243) {
+ return contextToken.parent.parent && contextToken.parent.parent.kind === 242;
}
}
return false;
@@ -52223,41 +53562,41 @@ var ts;
if (previousToken) {
var containingNodeKind = previousToken.parent.kind;
switch (previousToken.kind) {
- case 24:
- return containingNodeKind === 174
- || containingNodeKind === 148
- || containingNodeKind === 175
- || containingNodeKind === 170
- || containingNodeKind === 187
- || containingNodeKind === 156;
- case 17:
- return containingNodeKind === 174
- || containingNodeKind === 148
- || containingNodeKind === 175
- || containingNodeKind === 178
- || containingNodeKind === 164;
- case 19:
- return containingNodeKind === 170
- || containingNodeKind === 153
- || containingNodeKind === 140;
- case 125:
+ case 25:
+ return containingNodeKind === 175
+ || containingNodeKind === 149
+ || containingNodeKind === 176
+ || containingNodeKind === 171
+ || containingNodeKind === 188
+ || containingNodeKind === 157;
+ case 18:
+ return containingNodeKind === 175
+ || containingNodeKind === 149
+ || containingNodeKind === 176
+ || containingNodeKind === 179
+ || containingNodeKind === 165;
+ case 20:
+ return containingNodeKind === 171
+ || containingNodeKind === 154
+ || containingNodeKind === 141;
case 126:
+ case 127:
return true;
- case 21:
- return containingNodeKind === 225;
- case 15:
- return containingNodeKind === 221;
- case 56:
- return containingNodeKind === 218
- || containingNodeKind === 187;
- case 12:
- return containingNodeKind === 189;
+ case 22:
+ return containingNodeKind === 226;
+ case 16:
+ return containingNodeKind === 222;
+ case 57:
+ return containingNodeKind === 219
+ || containingNodeKind === 188;
case 13:
- return containingNodeKind === 197;
- case 112:
- case 110:
+ return containingNodeKind === 190;
+ case 14:
+ return containingNodeKind === 198;
+ case 113:
case 111:
- return containingNodeKind === 145;
+ case 112:
+ return containingNodeKind === 146;
}
switch (previousToken.getText()) {
case "public":
@@ -52270,7 +53609,7 @@ var ts;
}
function isInStringOrRegularExpressionOrTemplateLiteral(contextToken) {
if (contextToken.kind === 9
- || contextToken.kind === 10
+ || contextToken.kind === 11
|| ts.isTemplateLiteralKind(contextToken.kind)) {
var start_3 = contextToken.getStart();
var end = contextToken.getEnd();
@@ -52279,7 +53618,7 @@ var ts;
}
if (position === end) {
return !!contextToken.isUnterminated
- || contextToken.kind === 10;
+ || contextToken.kind === 11;
}
}
return false;
@@ -52288,22 +53627,22 @@ var ts;
isMemberCompletion = true;
var typeForObject;
var existingMembers;
- if (objectLikeContainer.kind === 171) {
+ if (objectLikeContainer.kind === 172) {
isNewIdentifierLocation = true;
typeForObject = typeChecker.getContextualType(objectLikeContainer);
typeForObject = typeForObject && typeForObject.getNonNullableType();
existingMembers = objectLikeContainer.properties;
}
- else if (objectLikeContainer.kind === 167) {
+ else if (objectLikeContainer.kind === 168) {
isNewIdentifierLocation = false;
var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent);
if (ts.isVariableLike(rootDeclaration)) {
var canGetType = !!(rootDeclaration.initializer || rootDeclaration.type);
- if (!canGetType && rootDeclaration.kind === 142) {
+ if (!canGetType && rootDeclaration.kind === 143) {
if (ts.isExpression(rootDeclaration.parent)) {
canGetType = !!typeChecker.getContextualType(rootDeclaration.parent);
}
- else if (rootDeclaration.parent.kind === 147 || rootDeclaration.parent.kind === 150) {
+ else if (rootDeclaration.parent.kind === 148 || rootDeclaration.parent.kind === 151) {
canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent);
}
}
@@ -52329,9 +53668,9 @@ var ts;
return true;
}
function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) {
- var declarationKind = namedImportsOrExports.kind === 233 ?
- 230 :
- 236;
+ var declarationKind = namedImportsOrExports.kind === 234 ?
+ 231 :
+ 237;
var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind);
var moduleSpecifier = importOrExportDeclaration.moduleSpecifier;
if (!moduleSpecifier) {
@@ -52350,10 +53689,10 @@ var ts;
function tryGetObjectLikeCompletionContainer(contextToken) {
if (contextToken) {
switch (contextToken.kind) {
- case 15:
- case 24:
+ case 16:
+ case 25:
var parent_18 = contextToken.parent;
- if (parent_18 && (parent_18.kind === 171 || parent_18.kind === 167)) {
+ if (parent_18 && (parent_18.kind === 172 || parent_18.kind === 168)) {
return parent_18;
}
break;
@@ -52364,11 +53703,11 @@ var ts;
function tryGetNamedImportsOrExportsForCompletion(contextToken) {
if (contextToken) {
switch (contextToken.kind) {
- case 15:
- case 24:
+ case 16:
+ case 25:
switch (contextToken.parent.kind) {
- case 233:
- case 237:
+ case 234:
+ case 238:
return contextToken.parent;
}
}
@@ -52379,12 +53718,12 @@ var ts;
if (contextToken) {
var parent_19 = contextToken.parent;
switch (contextToken.kind) {
- case 26:
- case 39:
- case 69:
+ case 27:
+ case 40:
+ case 70:
case 246:
case 247:
- if (parent_19 && (parent_19.kind === 242 || parent_19.kind === 243)) {
+ if (parent_19 && (parent_19.kind === 243 || parent_19.kind === 244)) {
return parent_19;
}
else if (parent_19.kind === 246) {
@@ -52396,7 +53735,7 @@ var ts;
return parent_19.parent;
}
break;
- case 16:
+ case 17:
if (parent_19 &&
parent_19.kind === 248 &&
parent_19.parent &&
@@ -52413,16 +53752,16 @@ var ts;
}
function isFunction(kind) {
switch (kind) {
- case 179:
case 180:
- case 220:
+ case 181:
+ case 221:
+ case 148:
case 147:
- case 146:
- case 149:
case 150:
case 151:
case 152:
case 153:
+ case 154:
return true;
}
return false;
@@ -52430,67 +53769,67 @@ var ts;
function isSolelyIdentifierDefinitionLocation(contextToken) {
var containingNodeKind = contextToken.parent.kind;
switch (contextToken.kind) {
- case 24:
- return containingNodeKind === 218 ||
- containingNodeKind === 219 ||
- containingNodeKind === 200 ||
- containingNodeKind === 224 ||
+ case 25:
+ return containingNodeKind === 219 ||
+ containingNodeKind === 220 ||
+ containingNodeKind === 201 ||
+ containingNodeKind === 225 ||
isFunction(containingNodeKind) ||
- containingNodeKind === 221 ||
- containingNodeKind === 192 ||
containingNodeKind === 222 ||
- containingNodeKind === 168 ||
- containingNodeKind === 223;
- case 21:
- return containingNodeKind === 168;
- case 54:
+ containingNodeKind === 193 ||
+ containingNodeKind === 223 ||
+ containingNodeKind === 169 ||
+ containingNodeKind === 224;
+ case 22:
return containingNodeKind === 169;
- case 19:
- return containingNodeKind === 168;
- case 17:
+ case 55:
+ return containingNodeKind === 170;
+ case 20:
+ return containingNodeKind === 169;
+ case 18:
return containingNodeKind === 252 ||
isFunction(containingNodeKind);
- case 15:
- return containingNodeKind === 224 ||
- containingNodeKind === 222 ||
- containingNodeKind === 159;
- case 23:
- return containingNodeKind === 144 &&
- contextToken.parent && contextToken.parent.parent &&
- (contextToken.parent.parent.kind === 222 ||
- contextToken.parent.parent.kind === 159);
- case 25:
- return containingNodeKind === 221 ||
- containingNodeKind === 192 ||
- containingNodeKind === 222 ||
+ case 16:
+ return containingNodeKind === 225 ||
containingNodeKind === 223 ||
+ containingNodeKind === 160;
+ case 24:
+ return containingNodeKind === 145 &&
+ contextToken.parent && contextToken.parent.parent &&
+ (contextToken.parent.parent.kind === 223 ||
+ contextToken.parent.parent.kind === 160);
+ case 26:
+ return containingNodeKind === 222 ||
+ containingNodeKind === 193 ||
+ containingNodeKind === 223 ||
+ containingNodeKind === 224 ||
isFunction(containingNodeKind);
- case 113:
- return containingNodeKind === 145;
- case 22:
- return containingNodeKind === 142 ||
- (contextToken.parent && contextToken.parent.parent &&
- contextToken.parent.parent.kind === 168);
- case 112:
- case 110:
- case 111:
- return containingNodeKind === 142;
- case 116:
- return containingNodeKind === 234 ||
- containingNodeKind === 238 ||
- containingNodeKind === 232;
- case 73:
- case 81:
- case 107:
- case 87:
- case 102:
- case 123:
- case 131:
- case 89:
- case 108:
- case 74:
case 114:
- case 134:
+ return containingNodeKind === 146;
+ case 23:
+ return containingNodeKind === 143 ||
+ (contextToken.parent && contextToken.parent.parent &&
+ contextToken.parent.parent.kind === 169);
+ case 113:
+ case 111:
+ case 112:
+ return containingNodeKind === 143;
+ case 117:
+ return containingNodeKind === 235 ||
+ containingNodeKind === 239 ||
+ containingNodeKind === 233;
+ case 74:
+ case 82:
+ case 108:
+ case 88:
+ case 103:
+ case 124:
+ case 132:
+ case 90:
+ case 109:
+ case 75:
+ case 115:
+ case 135:
return true;
}
switch (contextToken.getText()) {
@@ -52527,8 +53866,8 @@ var ts;
if (element.getStart() <= position && position <= element.getEnd()) {
continue;
}
- var name_48 = element.propertyName || element.name;
- existingImportsOrExports[name_48.text] = true;
+ var name_47 = element.propertyName || element.name;
+ existingImportsOrExports[name_47.text] = true;
}
if (!ts.someProperties(existingImportsOrExports)) {
return ts.filter(exportsOfModule, function (e) { return e.name !== "default"; });
@@ -52544,16 +53883,16 @@ var ts;
var m = existingMembers_1[_i];
if (m.kind !== 253 &&
m.kind !== 254 &&
- m.kind !== 169 &&
- m.kind !== 147) {
+ m.kind !== 170 &&
+ m.kind !== 148) {
continue;
}
if (m.getStart() <= position && position <= m.getEnd()) {
continue;
}
var existingName = void 0;
- if (m.kind === 169 && m.propertyName) {
- if (m.propertyName.kind === 69) {
+ if (m.kind === 170 && m.propertyName) {
+ if (m.propertyName.kind === 70) {
existingName = m.propertyName.text;
}
}
@@ -52604,7 +53943,7 @@ var ts;
return name;
}
var keywordCompletions = [];
- for (var i = 70; i <= 138; i++) {
+ for (var i = 71; i <= 139; i++) {
keywordCompletions.push({
name: ts.tokenToString(i),
kind: ts.ScriptElementKind.keyword,
@@ -52666,10 +54005,10 @@ var ts;
};
}
function getSemanticDocumentHighlights(node) {
- if (node.kind === 69 ||
- node.kind === 97 ||
- node.kind === 165 ||
- node.kind === 95 ||
+ if (node.kind === 70 ||
+ node.kind === 98 ||
+ node.kind === 166 ||
+ node.kind === 96 ||
node.kind === 9 ||
ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) {
var referencedSymbols = ts.FindAllReferences.getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFilesToSearch, false, false, false);
@@ -52718,77 +54057,77 @@ var ts;
function getHighlightSpans(node) {
if (node) {
switch (node.kind) {
- case 88:
- case 80:
- if (hasKind(node.parent, 203)) {
+ case 89:
+ case 81:
+ if (hasKind(node.parent, 204)) {
return getIfElseOccurrences(node.parent);
}
break;
- case 94:
- if (hasKind(node.parent, 211)) {
+ case 95:
+ if (hasKind(node.parent, 212)) {
return getReturnOccurrences(node.parent);
}
break;
- case 98:
- if (hasKind(node.parent, 215)) {
+ case 99:
+ if (hasKind(node.parent, 216)) {
return getThrowOccurrences(node.parent);
}
break;
- case 72:
- if (hasKind(parent(parent(node)), 216)) {
+ case 73:
+ if (hasKind(parent(parent(node)), 217)) {
return getTryCatchFinallyOccurrences(node.parent.parent);
}
break;
- case 100:
- case 85:
- if (hasKind(parent(node), 216)) {
+ case 101:
+ case 86:
+ if (hasKind(parent(node), 217)) {
return getTryCatchFinallyOccurrences(node.parent);
}
break;
- case 96:
- if (hasKind(node.parent, 213)) {
+ case 97:
+ if (hasKind(node.parent, 214)) {
return getSwitchCaseDefaultOccurrences(node.parent);
}
break;
- case 71:
- case 77:
- if (hasKind(parent(parent(parent(node))), 213)) {
+ case 72:
+ case 78:
+ if (hasKind(parent(parent(parent(node))), 214)) {
return getSwitchCaseDefaultOccurrences(node.parent.parent.parent);
}
break;
- case 70:
- case 75:
- if (hasKind(node.parent, 210) || hasKind(node.parent, 209)) {
+ case 71:
+ case 76:
+ if (hasKind(node.parent, 211) || hasKind(node.parent, 210)) {
return getBreakOrContinueStatementOccurrences(node.parent);
}
break;
- case 86:
- if (hasKind(node.parent, 206) ||
- hasKind(node.parent, 207) ||
- hasKind(node.parent, 208)) {
+ case 87:
+ if (hasKind(node.parent, 207) ||
+ hasKind(node.parent, 208) ||
+ hasKind(node.parent, 209)) {
return getLoopBreakContinueOccurrences(node.parent);
}
break;
- case 104:
- case 79:
- if (hasKind(node.parent, 205) || hasKind(node.parent, 204)) {
+ case 105:
+ case 80:
+ if (hasKind(node.parent, 206) || hasKind(node.parent, 205)) {
return getLoopBreakContinueOccurrences(node.parent);
}
break;
- case 121:
- if (hasKind(node.parent, 148)) {
+ case 122:
+ if (hasKind(node.parent, 149)) {
return getConstructorOccurrences(node.parent);
}
break;
- case 123:
- case 131:
- if (hasKind(node.parent, 149) || hasKind(node.parent, 150)) {
+ case 124:
+ case 132:
+ if (hasKind(node.parent, 150) || hasKind(node.parent, 151)) {
return getGetAndSetOccurrences(node.parent);
}
break;
default:
if (ts.isModifierKind(node.kind) && node.parent &&
- (ts.isDeclaration(node.parent) || node.parent.kind === 200)) {
+ (ts.isDeclaration(node.parent) || node.parent.kind === 201)) {
return getModifierOccurrences(node.kind, node.parent);
}
}
@@ -52800,10 +54139,10 @@ var ts;
aggregate(node);
return statementAccumulator;
function aggregate(node) {
- if (node.kind === 215) {
+ if (node.kind === 216) {
statementAccumulator.push(node);
}
- else if (node.kind === 216) {
+ else if (node.kind === 217) {
var tryStatement = node;
if (tryStatement.catchClause) {
aggregate(tryStatement.catchClause);
@@ -52827,7 +54166,7 @@ var ts;
if (ts.isFunctionBlock(parent_20) || parent_20.kind === 256) {
return parent_20;
}
- if (parent_20.kind === 216) {
+ if (parent_20.kind === 217) {
var tryStatement = parent_20;
if (tryStatement.tryBlock === child && tryStatement.catchClause) {
return child;
@@ -52842,7 +54181,7 @@ var ts;
aggregate(node);
return statementAccumulator;
function aggregate(node) {
- if (node.kind === 210 || node.kind === 209) {
+ if (node.kind === 211 || node.kind === 210) {
statementAccumulator.push(node);
}
else if (!ts.isFunctionLike(node)) {
@@ -52857,15 +54196,15 @@ var ts;
function getBreakOrContinueOwner(statement) {
for (var node_1 = statement.parent; node_1; node_1 = node_1.parent) {
switch (node_1.kind) {
- case 213:
- if (statement.kind === 209) {
+ case 214:
+ if (statement.kind === 210) {
continue;
}
- case 206:
case 207:
case 208:
+ case 209:
+ case 206:
case 205:
- case 204:
if (!statement.label || isLabeledBy(node_1, statement.label.text)) {
return node_1;
}
@@ -52882,24 +54221,24 @@ var ts;
function getModifierOccurrences(modifier, declaration) {
var container = declaration.parent;
if (ts.isAccessibilityModifier(modifier)) {
- if (!(container.kind === 221 ||
- container.kind === 192 ||
- (declaration.kind === 142 && hasKind(container, 148)))) {
+ if (!(container.kind === 222 ||
+ container.kind === 193 ||
+ (declaration.kind === 143 && hasKind(container, 149)))) {
return undefined;
}
}
- else if (modifier === 113) {
- if (!(container.kind === 221 || container.kind === 192)) {
+ else if (modifier === 114) {
+ if (!(container.kind === 222 || container.kind === 193)) {
return undefined;
}
}
- else if (modifier === 82 || modifier === 122) {
- if (!(container.kind === 226 || container.kind === 256)) {
+ else if (modifier === 83 || modifier === 123) {
+ if (!(container.kind === 227 || container.kind === 256)) {
return undefined;
}
}
- else if (modifier === 115) {
- if (!(container.kind === 221 || declaration.kind === 221)) {
+ else if (modifier === 116) {
+ if (!(container.kind === 222 || declaration.kind === 222)) {
return undefined;
}
}
@@ -52910,7 +54249,7 @@ var ts;
var modifierFlag = getFlagFromModifier(modifier);
var nodes;
switch (container.kind) {
- case 226:
+ case 227:
case 256:
if (modifierFlag & 128) {
nodes = declaration.members.concat(declaration);
@@ -52919,15 +54258,15 @@ var ts;
nodes = container.statements;
}
break;
- case 148:
+ case 149:
nodes = container.parameters.concat(container.parent.members);
break;
- case 221:
- case 192:
+ case 222:
+ case 193:
nodes = container.members;
if (modifierFlag & 28) {
var constructor = ts.forEach(container.members, function (member) {
- return member.kind === 148 && member;
+ return member.kind === 149 && member;
});
if (constructor) {
nodes = nodes.concat(constructor.parameters);
@@ -52948,19 +54287,19 @@ var ts;
return ts.map(keywords, getHighlightSpanForNode);
function getFlagFromModifier(modifier) {
switch (modifier) {
- case 112:
- return 4;
- case 110:
- return 8;
- case 111:
- return 16;
case 113:
+ return 4;
+ case 111:
+ return 8;
+ case 112:
+ return 16;
+ case 114:
return 32;
- case 82:
+ case 83:
return 1;
- case 122:
+ case 123:
return 2;
- case 115:
+ case 116:
return 128;
default:
ts.Debug.fail();
@@ -52980,13 +54319,13 @@ var ts;
}
function getGetAndSetOccurrences(accessorDeclaration) {
var keywords = [];
- tryPushAccessorKeyword(accessorDeclaration.symbol, 149);
tryPushAccessorKeyword(accessorDeclaration.symbol, 150);
+ tryPushAccessorKeyword(accessorDeclaration.symbol, 151);
return ts.map(keywords, getHighlightSpanForNode);
function tryPushAccessorKeyword(accessorSymbol, accessorKind) {
var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind);
if (accessor) {
- ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 123, 131); });
+ ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 124, 132); });
}
}
}
@@ -52995,18 +54334,18 @@ var ts;
var keywords = [];
ts.forEach(declarations, function (declaration) {
ts.forEach(declaration.getChildren(), function (token) {
- return pushKeywordIf(keywords, token, 121);
+ return pushKeywordIf(keywords, token, 122);
});
});
return ts.map(keywords, getHighlightSpanForNode);
}
function getLoopBreakContinueOccurrences(loopNode) {
var keywords = [];
- if (pushKeywordIf(keywords, loopNode.getFirstToken(), 86, 104, 79)) {
- if (loopNode.kind === 204) {
+ if (pushKeywordIf(keywords, loopNode.getFirstToken(), 87, 105, 80)) {
+ if (loopNode.kind === 205) {
var loopTokens = loopNode.getChildren();
for (var i = loopTokens.length - 1; i >= 0; i--) {
- if (pushKeywordIf(keywords, loopTokens[i], 104)) {
+ if (pushKeywordIf(keywords, loopTokens[i], 105)) {
break;
}
}
@@ -53015,7 +54354,7 @@ var ts;
var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement);
ts.forEach(breaksAndContinues, function (statement) {
if (ownsBreakOrContinueStatement(loopNode, statement)) {
- pushKeywordIf(keywords, statement.getFirstToken(), 70, 75);
+ pushKeywordIf(keywords, statement.getFirstToken(), 71, 76);
}
});
return ts.map(keywords, getHighlightSpanForNode);
@@ -53024,13 +54363,13 @@ var ts;
var owner = getBreakOrContinueOwner(breakOrContinueStatement);
if (owner) {
switch (owner.kind) {
- case 206:
case 207:
case 208:
- case 204:
+ case 209:
case 205:
+ case 206:
return getLoopBreakContinueOccurrences(owner);
- case 213:
+ case 214:
return getSwitchCaseDefaultOccurrences(owner);
}
}
@@ -53038,13 +54377,13 @@ var ts;
}
function getSwitchCaseDefaultOccurrences(switchStatement) {
var keywords = [];
- pushKeywordIf(keywords, switchStatement.getFirstToken(), 96);
+ pushKeywordIf(keywords, switchStatement.getFirstToken(), 97);
ts.forEach(switchStatement.caseBlock.clauses, function (clause) {
- pushKeywordIf(keywords, clause.getFirstToken(), 71, 77);
+ pushKeywordIf(keywords, clause.getFirstToken(), 72, 78);
var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause);
ts.forEach(breaksAndContinues, function (statement) {
if (ownsBreakOrContinueStatement(switchStatement, statement)) {
- pushKeywordIf(keywords, statement.getFirstToken(), 70);
+ pushKeywordIf(keywords, statement.getFirstToken(), 71);
}
});
});
@@ -53052,13 +54391,13 @@ var ts;
}
function getTryCatchFinallyOccurrences(tryStatement) {
var keywords = [];
- pushKeywordIf(keywords, tryStatement.getFirstToken(), 100);
+ pushKeywordIf(keywords, tryStatement.getFirstToken(), 101);
if (tryStatement.catchClause) {
- pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 72);
+ pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 73);
}
if (tryStatement.finallyBlock) {
- var finallyKeyword = ts.findChildOfKind(tryStatement, 85, sourceFile);
- pushKeywordIf(keywords, finallyKeyword, 85);
+ var finallyKeyword = ts.findChildOfKind(tryStatement, 86, sourceFile);
+ pushKeywordIf(keywords, finallyKeyword, 86);
}
return ts.map(keywords, getHighlightSpanForNode);
}
@@ -53069,50 +54408,50 @@ var ts;
}
var keywords = [];
ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) {
- pushKeywordIf(keywords, throwStatement.getFirstToken(), 98);
+ pushKeywordIf(keywords, throwStatement.getFirstToken(), 99);
});
if (ts.isFunctionBlock(owner)) {
ts.forEachReturnStatement(owner, function (returnStatement) {
- pushKeywordIf(keywords, returnStatement.getFirstToken(), 94);
+ pushKeywordIf(keywords, returnStatement.getFirstToken(), 95);
});
}
return ts.map(keywords, getHighlightSpanForNode);
}
function getReturnOccurrences(returnStatement) {
var func = ts.getContainingFunction(returnStatement);
- if (!(func && hasKind(func.body, 199))) {
+ if (!(func && hasKind(func.body, 200))) {
return undefined;
}
var keywords = [];
ts.forEachReturnStatement(func.body, function (returnStatement) {
- pushKeywordIf(keywords, returnStatement.getFirstToken(), 94);
+ pushKeywordIf(keywords, returnStatement.getFirstToken(), 95);
});
ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) {
- pushKeywordIf(keywords, throwStatement.getFirstToken(), 98);
+ pushKeywordIf(keywords, throwStatement.getFirstToken(), 99);
});
return ts.map(keywords, getHighlightSpanForNode);
}
function getIfElseOccurrences(ifStatement) {
var keywords = [];
- while (hasKind(ifStatement.parent, 203) && ifStatement.parent.elseStatement === ifStatement) {
+ while (hasKind(ifStatement.parent, 204) && ifStatement.parent.elseStatement === ifStatement) {
ifStatement = ifStatement.parent;
}
while (ifStatement) {
var children = ifStatement.getChildren();
- pushKeywordIf(keywords, children[0], 88);
+ pushKeywordIf(keywords, children[0], 89);
for (var i = children.length - 1; i >= 0; i--) {
- if (pushKeywordIf(keywords, children[i], 80)) {
+ if (pushKeywordIf(keywords, children[i], 81)) {
break;
}
}
- if (!hasKind(ifStatement.elseStatement, 203)) {
+ if (!hasKind(ifStatement.elseStatement, 204)) {
break;
}
ifStatement = ifStatement.elseStatement;
}
var result = [];
for (var i = 0; i < keywords.length; i++) {
- if (keywords[i].kind === 80 && i < keywords.length - 1) {
+ if (keywords[i].kind === 81 && i < keywords.length - 1) {
var elseKeyword = keywords[i];
var ifKeyword = keywords[i + 1];
var shouldCombindElseAndIf = true;
@@ -53140,7 +54479,7 @@ var ts;
}
DocumentHighlights.getDocumentHighlights = getDocumentHighlights;
function isLabeledBy(node, labelName) {
- for (var owner = node.parent; owner.kind === 214; owner = owner.parent) {
+ for (var owner = node.parent; owner.kind === 215; owner = owner.parent) {
if (owner.label.text === labelName) {
return true;
}
@@ -53265,9 +54604,9 @@ var ts;
if (!ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) {
break;
}
- case 69:
- case 97:
- case 121:
+ case 70:
+ case 98:
+ case 122:
case 9:
return getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, findInStrings, findInComments, false);
}
@@ -53288,7 +54627,7 @@ var ts;
if (ts.isThis(node)) {
return getReferencesForThisKeyword(node, sourceFiles);
}
- if (node.kind === 95) {
+ if (node.kind === 96) {
return getReferencesForSuperKeyword(node);
}
}
@@ -53313,7 +54652,7 @@ var ts;
getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex);
}
else {
- var internedName = getInternedName(symbol, node, declarations);
+ var internedName = getInternedName(symbol, node);
for (var _i = 0, sourceFiles_8 = sourceFiles; _i < sourceFiles_8.length; _i++) {
var sourceFile = sourceFiles_8[_i];
cancellationToken.throwIfCancellationRequested();
@@ -53344,16 +54683,16 @@ var ts;
}
function getAliasSymbolForPropertyNameSymbol(symbol, location) {
if (symbol.flags & 8388608) {
- var defaultImport = ts.getDeclarationOfKind(symbol, 231);
+ var defaultImport = ts.getDeclarationOfKind(symbol, 232);
if (defaultImport) {
return typeChecker.getAliasedSymbol(symbol);
}
- var importOrExportSpecifier = ts.forEach(symbol.declarations, function (declaration) { return (declaration.kind === 234 ||
- declaration.kind === 238) ? declaration : undefined; });
+ var importOrExportSpecifier = ts.forEach(symbol.declarations, function (declaration) { return (declaration.kind === 235 ||
+ declaration.kind === 239) ? declaration : undefined; });
if (importOrExportSpecifier &&
(!importOrExportSpecifier.propertyName ||
importOrExportSpecifier.propertyName === location)) {
- return importOrExportSpecifier.kind === 234 ?
+ return importOrExportSpecifier.kind === 235 ?
typeChecker.getAliasedSymbol(symbol) :
typeChecker.getExportSpecifierLocalTargetSymbol(importOrExportSpecifier);
}
@@ -53368,20 +54707,20 @@ var ts;
typeChecker.getPropertySymbolOfDestructuringAssignment(location);
}
function isObjectBindingPatternElementWithoutPropertyName(symbol) {
- var bindingElement = ts.getDeclarationOfKind(symbol, 169);
+ var bindingElement = ts.getDeclarationOfKind(symbol, 170);
return bindingElement &&
- bindingElement.parent.kind === 167 &&
+ bindingElement.parent.kind === 168 &&
!bindingElement.propertyName;
}
function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol) {
if (isObjectBindingPatternElementWithoutPropertyName(symbol)) {
- var bindingElement = ts.getDeclarationOfKind(symbol, 169);
+ var bindingElement = ts.getDeclarationOfKind(symbol, 170);
var typeOfPattern = typeChecker.getTypeAtLocation(bindingElement.parent);
return typeOfPattern && typeChecker.getPropertyOfType(typeOfPattern, bindingElement.name.text);
}
return undefined;
}
- function getInternedName(symbol, location, declarations) {
+ function getInternedName(symbol, location) {
if (ts.isImportOrExportSpecifierName(location)) {
return location.getText();
}
@@ -53391,13 +54730,13 @@ var ts;
}
function getSymbolScope(symbol) {
var valueDeclaration = symbol.valueDeclaration;
- if (valueDeclaration && (valueDeclaration.kind === 179 || valueDeclaration.kind === 192)) {
+ if (valueDeclaration && (valueDeclaration.kind === 180 || valueDeclaration.kind === 193)) {
return valueDeclaration;
}
if (symbol.flags & (4 | 8192)) {
var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (ts.getModifierFlags(d) & 8) ? d : undefined; });
if (privateDeclaration) {
- return ts.getAncestor(privateDeclaration, 221);
+ return ts.getAncestor(privateDeclaration, 222);
}
}
if (symbol.flags & 8388608) {
@@ -53443,8 +54782,8 @@ var ts;
if (position > end)
break;
var endPosition = position + symbolNameLength;
- if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) &&
- (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) {
+ if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 4)) &&
+ (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 4))) {
positions.push(position);
}
position = text.indexOf(symbolName, position + symbolNameLength + 1);
@@ -53481,7 +54820,7 @@ var ts;
function isValidReferencePosition(node, searchSymbolName) {
if (node) {
switch (node.kind) {
- case 69:
+ case 70:
return node.getWidth() === searchSymbolName.length;
case 9:
if (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) ||
@@ -53531,14 +54870,14 @@ var ts;
if (referenceSymbol) {
var referenceSymbolDeclaration = referenceSymbol.valueDeclaration;
var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
- var relatedSymbol = getRelatedSymbol(searchSymbols_1, referenceSymbol, referenceLocation, searchLocation.kind === 121, parents, inheritsFromCache);
+ var relatedSymbol = getRelatedSymbol(searchSymbols_1, referenceSymbol, referenceLocation, searchLocation.kind === 122, parents, inheritsFromCache);
if (relatedSymbol) {
addReferenceToRelatedSymbol(referenceLocation, relatedSymbol);
}
else if (!(referenceSymbol.flags & 67108864) && searchSymbols_1.indexOf(shorthandValueSymbol) >= 0) {
addReferenceToRelatedSymbol(referenceSymbolDeclaration.name, shorthandValueSymbol);
}
- else if (searchLocation.kind === 121) {
+ else if (searchLocation.kind === 122) {
findAdditionalConstructorReferences(referenceSymbol, referenceLocation);
}
}
@@ -53588,17 +54927,17 @@ var ts;
var result = [];
for (var _i = 0, _a = classSymbol.members["__constructor"].declarations; _i < _a.length; _i++) {
var decl = _a[_i];
- ts.Debug.assert(decl.kind === 148);
+ ts.Debug.assert(decl.kind === 149);
var ctrKeyword = decl.getChildAt(0);
- ts.Debug.assert(ctrKeyword.kind === 121);
+ ts.Debug.assert(ctrKeyword.kind === 122);
result.push(ctrKeyword);
}
ts.forEachProperty(classSymbol.exports, function (member) {
var decl = member.valueDeclaration;
- if (decl && decl.kind === 147) {
+ if (decl && decl.kind === 148) {
var body = decl.body;
if (body) {
- forEachDescendantOfKind(body, 97, function (thisKeyword) {
+ forEachDescendantOfKind(body, 98, function (thisKeyword) {
if (ts.isNewExpressionTarget(thisKeyword)) {
result.push(thisKeyword);
}
@@ -53617,10 +54956,10 @@ var ts;
var result = [];
for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) {
var decl = _a[_i];
- ts.Debug.assert(decl.kind === 148);
+ ts.Debug.assert(decl.kind === 149);
var body = decl.body;
if (body) {
- forEachDescendantOfKind(body, 95, function (node) {
+ forEachDescendantOfKind(body, 96, function (node) {
if (ts.isCallExpressionTarget(node)) {
result.push(node);
}
@@ -53657,7 +54996,7 @@ var ts;
if (ts.isDeclarationName(refNode) && isImplementation(refNode.parent)) {
result.push(getReferenceEntryFromNode(refNode.parent));
}
- else if (refNode.kind === 69) {
+ else if (refNode.kind === 70) {
if (refNode.parent.kind === 254) {
getReferenceEntriesForShorthandPropertyAssignment(refNode, typeChecker, result);
}
@@ -53673,7 +55012,7 @@ var ts;
maybeAdd(getReferenceEntryFromNode(parent_21.initializer));
}
else if (ts.isFunctionLike(parent_21) && parent_21.type === containingTypeReference && parent_21.body) {
- if (parent_21.body.kind === 199) {
+ if (parent_21.body.kind === 200) {
ts.forEachReturnStatement(parent_21.body, function (returnStatement) {
if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) {
maybeAdd(getReferenceEntryFromNode(returnStatement.expression));
@@ -53720,26 +55059,26 @@ var ts;
}
function getContainingClassIfInHeritageClause(node) {
if (node && node.parent) {
- if (node.kind === 194
+ if (node.kind === 195
&& node.parent.kind === 251
&& ts.isClassLike(node.parent.parent)) {
return node.parent.parent;
}
- else if (node.kind === 69 || node.kind === 172) {
+ else if (node.kind === 70 || node.kind === 173) {
return getContainingClassIfInHeritageClause(node.parent);
}
}
return undefined;
}
function isImplementationExpression(node) {
- if (node.kind === 178) {
+ if (node.kind === 179) {
return isImplementationExpression(node.expression);
}
- return node.kind === 180 ||
- node.kind === 179 ||
- node.kind === 171 ||
- node.kind === 192 ||
- node.kind === 170;
+ return node.kind === 181 ||
+ node.kind === 180 ||
+ node.kind === 172 ||
+ node.kind === 193 ||
+ node.kind === 171;
}
function explicitlyInheritsFrom(child, parent, cachedResults) {
var parentIsInterface = parent.getFlags() & 64;
@@ -53768,7 +55107,7 @@ var ts;
}
return searchTypeReference(ts.getClassExtendsHeritageClauseElement(declaration));
}
- else if (declaration.kind === 222) {
+ else if (declaration.kind === 223) {
if (parentIsInterface) {
return ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), searchTypeReference);
}
@@ -53795,13 +55134,13 @@ var ts;
}
var staticFlag = 32;
switch (searchSpaceNode.kind) {
- case 145:
- case 144:
- case 147:
case 146:
+ case 145:
case 148:
+ case 147:
case 149:
case 150:
+ case 151:
staticFlag &= ts.getModifierFlags(searchSpaceNode);
searchSpaceNode = searchSpaceNode.parent;
break;
@@ -53814,7 +55153,7 @@ var ts;
ts.forEach(possiblePositions, function (position) {
cancellationToken.throwIfCancellationRequested();
var node = ts.getTouchingWord(sourceFile, position);
- if (!node || node.kind !== 95) {
+ if (!node || node.kind !== 96) {
return;
}
var container = ts.getSuperContainer(node, false);
@@ -53829,16 +55168,16 @@ var ts;
var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false);
var staticFlag = 32;
switch (searchSpaceNode.kind) {
+ case 148:
case 147:
- case 146:
if (ts.isObjectLiteralMethod(searchSpaceNode)) {
break;
}
+ case 146:
case 145:
- case 144:
- case 148:
case 149:
case 150:
+ case 151:
staticFlag &= ts.getModifierFlags(searchSpaceNode);
searchSpaceNode = searchSpaceNode.parent;
break;
@@ -53846,8 +55185,8 @@ var ts;
if (ts.isExternalModule(searchSpaceNode)) {
return undefined;
}
- case 220:
- case 179:
+ case 221:
+ case 180:
break;
default:
return undefined;
@@ -53888,20 +55227,20 @@ var ts;
}
var container = ts.getThisContainer(node, false);
switch (searchSpaceNode.kind) {
- case 179:
- case 220:
+ case 180:
+ case 221:
if (searchSpaceNode.symbol === container.symbol) {
result.push(getReferenceEntryFromNode(node));
}
break;
+ case 148:
case 147:
- case 146:
if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) {
result.push(getReferenceEntryFromNode(node));
}
break;
- case 192:
- case 221:
+ case 193:
+ case 222:
if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32) === staticFlag) {
result.push(getReferenceEntryFromNode(node));
}
@@ -53975,7 +55314,7 @@ var ts;
result.push(shorthandValueSymbol);
}
}
- if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 142 &&
+ if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 143 &&
ts.isParameterPropertyDeclaration(symbol.valueDeclaration)) {
result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name));
}
@@ -54006,7 +55345,7 @@ var ts;
getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration));
ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference);
}
- else if (declaration.kind === 222) {
+ else if (declaration.kind === 223) {
ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference);
}
});
@@ -54069,7 +55408,7 @@ var ts;
});
}
function getNameFromObjectLiteralElement(node) {
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
var nameExpression = node.name.expression;
if (ts.isStringOrNumericLiteral(nameExpression.kind)) {
return nameExpression.text;
@@ -54138,7 +55477,7 @@ var ts;
if (node.initializer) {
return true;
}
- else if (node.kind === 218) {
+ else if (node.kind === 219) {
var parentStatement = getParentStatementOfVariableDeclaration(node);
return parentStatement && ts.hasModifier(parentStatement, 2);
}
@@ -54148,18 +55487,18 @@ var ts;
}
else {
switch (node.kind) {
- case 221:
- case 192:
- case 224:
+ case 222:
+ case 193:
case 225:
+ case 226:
return true;
}
}
return false;
}
function getParentStatementOfVariableDeclaration(node) {
- if (node.parent && node.parent.parent && node.parent.parent.kind === 200) {
- ts.Debug.assert(node.parent.kind === 219);
+ if (node.parent && node.parent.parent && node.parent.parent.kind === 201) {
+ ts.Debug.assert(node.parent.kind === 220);
return node.parent.parent;
}
}
@@ -54192,17 +55531,17 @@ var ts;
}
FindAllReferences.getReferenceEntryFromNode = getReferenceEntryFromNode;
function isWriteAccess(node) {
- if (node.kind === 69 && ts.isDeclarationName(node)) {
+ if (node.kind === 70 && ts.isDeclarationName(node)) {
return true;
}
var parent = node.parent;
if (parent) {
- if (parent.kind === 186 || parent.kind === 185) {
+ if (parent.kind === 187 || parent.kind === 186) {
return true;
}
- else if (parent.kind === 187 && parent.left === node) {
+ else if (parent.kind === 188 && parent.left === node) {
var operator = parent.operatorToken.kind;
- return 56 <= operator && operator <= 68;
+ return 57 <= operator && operator <= 69;
}
}
return false;
@@ -54219,10 +55558,10 @@ var ts;
switch (node.kind) {
case 9:
case 8:
- if (node.parent.kind === 140) {
+ if (node.parent.kind === 141) {
return isObjectLiteralPropertyDeclaration(node.parent.parent) ? node.parent.parent : undefined;
}
- case 69:
+ case 70:
return isObjectLiteralPropertyDeclaration(node.parent) && node.parent.name === node ? node.parent : undefined;
}
return undefined;
@@ -54231,9 +55570,9 @@ var ts;
switch (node.kind) {
case 253:
case 254:
- case 147:
- case 149:
+ case 148:
case 150:
+ case 151:
return true;
}
return false;
@@ -54290,9 +55629,9 @@ var ts;
}
if (symbol.flags & 8388608) {
var declaration = symbol.declarations[0];
- if (node.kind === 69 &&
+ if (node.kind === 70 &&
(node.parent === declaration ||
- (declaration.kind === 234 && declaration.parent && declaration.parent.kind === 233))) {
+ (declaration.kind === 235 && declaration.parent && declaration.parent.kind === 234))) {
symbol = typeChecker.getAliasedSymbol(symbol);
}
}
@@ -54350,7 +55689,7 @@ var ts;
}
return result;
function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) {
- if (ts.isNewExpressionTarget(location) || location.kind === 121) {
+ if (ts.isNewExpressionTarget(location) || location.kind === 122) {
if (symbol.flags & 32) {
for (var _i = 0, _a = symbol.getDeclarations(); _i < _a.length; _i++) {
var declaration = _a[_i];
@@ -54373,8 +55712,8 @@ var ts;
var declarations = [];
var definition;
ts.forEach(signatureDeclarations, function (d) {
- if ((selectConstructors && d.kind === 148) ||
- (!selectConstructors && (d.kind === 220 || d.kind === 147 || d.kind === 146))) {
+ if ((selectConstructors && d.kind === 149) ||
+ (!selectConstructors && (d.kind === 221 || d.kind === 148 || d.kind === 147))) {
declarations.push(d);
if (d.body)
definition = d;
@@ -54455,7 +55794,7 @@ var ts;
ts.FindAllReferences.getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result);
return result.length > 0 ? result : undefined;
}
- else if (node.kind === 95 || ts.isSuperProperty(node.parent)) {
+ else if (node.kind === 96 || ts.isSuperProperty(node.parent)) {
var symbol = typeChecker.getSymbolAtLocation(node);
return symbol.valueDeclaration && [ts.FindAllReferences.getReferenceEntryFromNode(symbol.valueDeclaration)];
}
@@ -54519,7 +55858,7 @@ var ts;
"version"
];
var jsDocCompletionEntries;
- function getJsDocCommentsFromDeclarations(declarations, name, canUseParsedParamTagComments) {
+ function getJsDocCommentsFromDeclarations(declarations) {
var documentationComment = [];
forEachUnique(declarations, function (declaration) {
var comments = ts.getJSDocComments(declaration, true);
@@ -54558,7 +55897,7 @@ var ts;
name: tagName,
kind: ts.ScriptElementKind.keyword,
kindModifiers: "",
- sortText: "0"
+ sortText: "0",
};
}));
}
@@ -54575,16 +55914,16 @@ var ts;
var commentOwner;
findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) {
switch (commentOwner.kind) {
- case 220:
- case 147:
- case 148:
case 221:
- case 200:
+ case 148:
+ case 149:
+ case 222:
+ case 201:
break findOwner;
case 256:
return undefined;
- case 225:
- if (commentOwner.parent.kind === 225) {
+ case 226:
+ if (commentOwner.parent.kind === 226) {
return undefined;
}
break findOwner;
@@ -54600,7 +55939,7 @@ var ts;
var docParams = "";
for (var i = 0, numParams = parameters.length; i < numParams; i++) {
var currentName = parameters[i].name;
- var paramName = currentName.kind === 69 ?
+ var paramName = currentName.kind === 70 ?
currentName.text :
"param" + i;
docParams += indentationStr + " * @param " + paramName + newLine;
@@ -54618,7 +55957,7 @@ var ts;
if (ts.isFunctionLike(commentOwner)) {
return commentOwner.parameters;
}
- if (commentOwner.kind === 200) {
+ if (commentOwner.kind === 201) {
var varStatement = commentOwner;
var varDeclarations = varStatement.declarationList.declarations;
if (varDeclarations.length === 1 && varDeclarations[0].initializer) {
@@ -54628,17 +55967,17 @@ var ts;
return ts.emptyArray;
}
function getParametersFromRightHandSideOfAssignment(rightHandSide) {
- while (rightHandSide.kind === 178) {
+ while (rightHandSide.kind === 179) {
rightHandSide = rightHandSide.expression;
}
switch (rightHandSide.kind) {
- case 179:
case 180:
+ case 181:
return rightHandSide.parameters;
- case 192:
+ case 193:
for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind === 148) {
+ if (member.kind === 149) {
return member.parameters;
}
}
@@ -54649,13 +55988,153 @@ var ts;
})(JsDoc = ts.JsDoc || (ts.JsDoc = {}));
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ var JsTyping;
+ (function (JsTyping) {
+ ;
+ ;
+ var safeList;
+ var EmptySafeList = ts.createMap();
+ function discoverTypings(host, fileNames, projectRootPath, safeListPath, packageNameToTypingLocation, typingOptions) {
+ var inferredTypings = ts.createMap();
+ if (!typingOptions || !typingOptions.enableAutoDiscovery) {
+ return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] };
+ }
+ fileNames = ts.filter(ts.map(fileNames, ts.normalizePath), function (f) {
+ var kind = ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f));
+ return kind === 1 || kind === 2;
+ });
+ if (!safeList) {
+ var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); });
+ safeList = result.config ? ts.createMap(result.config) : EmptySafeList;
+ }
+ var filesToWatch = [];
+ var searchDirs = [];
+ var exclude = [];
+ mergeTypings(typingOptions.include);
+ exclude = typingOptions.exclude || [];
+ var possibleSearchDirs = ts.map(fileNames, ts.getDirectoryPath);
+ if (projectRootPath !== undefined) {
+ possibleSearchDirs.push(projectRootPath);
+ }
+ searchDirs = ts.deduplicate(possibleSearchDirs);
+ for (var _i = 0, searchDirs_1 = searchDirs; _i < searchDirs_1.length; _i++) {
+ var searchDir = searchDirs_1[_i];
+ var packageJsonPath = ts.combinePaths(searchDir, "package.json");
+ getTypingNamesFromJson(packageJsonPath, filesToWatch);
+ var bowerJsonPath = ts.combinePaths(searchDir, "bower.json");
+ getTypingNamesFromJson(bowerJsonPath, filesToWatch);
+ var nodeModulesPath = ts.combinePaths(searchDir, "node_modules");
+ getTypingNamesFromNodeModuleFolder(nodeModulesPath);
+ }
+ getTypingNamesFromSourceFileNames(fileNames);
+ for (var name_48 in packageNameToTypingLocation) {
+ if (name_48 in inferredTypings && !inferredTypings[name_48]) {
+ inferredTypings[name_48] = packageNameToTypingLocation[name_48];
+ }
+ }
+ for (var _a = 0, exclude_1 = exclude; _a < exclude_1.length; _a++) {
+ var excludeTypingName = exclude_1[_a];
+ delete inferredTypings[excludeTypingName];
+ }
+ var newTypingNames = [];
+ var cachedTypingPaths = [];
+ for (var typing in inferredTypings) {
+ if (inferredTypings[typing] !== undefined) {
+ cachedTypingPaths.push(inferredTypings[typing]);
+ }
+ else {
+ newTypingNames.push(typing);
+ }
+ }
+ return { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };
+ function mergeTypings(typingNames) {
+ if (!typingNames) {
+ return;
+ }
+ for (var _i = 0, typingNames_1 = typingNames; _i < typingNames_1.length; _i++) {
+ var typing = typingNames_1[_i];
+ if (!(typing in inferredTypings)) {
+ inferredTypings[typing] = undefined;
+ }
+ }
+ }
+ function getTypingNamesFromJson(jsonPath, filesToWatch) {
+ var result = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); });
+ if (result.config) {
+ var jsonConfig = result.config;
+ filesToWatch.push(jsonPath);
+ if (jsonConfig.dependencies) {
+ mergeTypings(ts.getOwnKeys(jsonConfig.dependencies));
+ }
+ if (jsonConfig.devDependencies) {
+ mergeTypings(ts.getOwnKeys(jsonConfig.devDependencies));
+ }
+ if (jsonConfig.optionalDependencies) {
+ mergeTypings(ts.getOwnKeys(jsonConfig.optionalDependencies));
+ }
+ if (jsonConfig.peerDependencies) {
+ mergeTypings(ts.getOwnKeys(jsonConfig.peerDependencies));
+ }
+ }
+ }
+ function getTypingNamesFromSourceFileNames(fileNames) {
+ var jsFileNames = ts.filter(fileNames, ts.hasJavaScriptFileExtension);
+ var inferredTypingNames = ts.map(jsFileNames, function (f) { return ts.removeFileExtension(ts.getBaseFileName(f.toLowerCase())); });
+ var cleanedTypingNames = ts.map(inferredTypingNames, function (f) { return f.replace(/((?:\.|-)min(?=\.|$))|((?:-|\.)\d+)/g, ""); });
+ if (safeList !== EmptySafeList) {
+ mergeTypings(ts.filter(cleanedTypingNames, function (f) { return f in safeList; }));
+ }
+ var hasJsxFile = ts.forEach(fileNames, function (f) { return ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)) === 2; });
+ if (hasJsxFile) {
+ mergeTypings(["react"]);
+ }
+ }
+ function getTypingNamesFromNodeModuleFolder(nodeModulesPath) {
+ if (!host.directoryExists(nodeModulesPath)) {
+ return;
+ }
+ var typingNames = [];
+ var fileNames = host.readDirectory(nodeModulesPath, [".json"], undefined, undefined, 2);
+ for (var _i = 0, fileNames_2 = fileNames; _i < fileNames_2.length; _i++) {
+ var fileName = fileNames_2[_i];
+ var normalizedFileName = ts.normalizePath(fileName);
+ if (ts.getBaseFileName(normalizedFileName) !== "package.json") {
+ continue;
+ }
+ var result = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); });
+ if (!result.config) {
+ continue;
+ }
+ var packageJson = result.config;
+ if (packageJson._requiredBy &&
+ ts.filter(packageJson._requiredBy, function (r) { return r[0] === "#" || r === "/"; }).length === 0) {
+ continue;
+ }
+ if (!packageJson.name) {
+ continue;
+ }
+ if (packageJson.typings) {
+ var absolutePath = ts.getNormalizedAbsolutePath(packageJson.typings, ts.getDirectoryPath(normalizedFileName));
+ inferredTypings[packageJson.name] = absolutePath;
+ }
+ else {
+ typingNames.push(packageJson.name);
+ }
+ }
+ mergeTypings(typingNames);
+ }
+ }
+ JsTyping.discoverTypings = discoverTypings;
+ })(JsTyping = ts.JsTyping || (ts.JsTyping = {}));
+})(ts || (ts = {}));
+var ts;
(function (ts) {
var NavigateTo;
(function (NavigateTo) {
function getNavigateToItems(sourceFiles, checker, cancellationToken, searchValue, maxResultCount, excludeDtsFiles) {
var patternMatcher = ts.createPatternMatcher(searchValue);
var rawItems = [];
- var baseSensitivity = { sensitivity: "base" };
ts.forEach(sourceFiles, function (sourceFile) {
cancellationToken.throwIfCancellationRequested();
if (excludeDtsFiles && ts.fileExtensionIs(sourceFile.fileName, ".d.ts")) {
@@ -54690,7 +56169,7 @@ var ts;
});
rawItems = ts.filter(rawItems, function (item) {
var decl = item.declaration;
- if (decl.kind === 231 || decl.kind === 234 || decl.kind === 229) {
+ if (decl.kind === 232 || decl.kind === 235 || decl.kind === 230) {
var importer = checker.getSymbolAtLocation(decl.name);
var imported = checker.getAliasedSymbol(importer);
return importer.name !== imported.name;
@@ -54717,7 +56196,7 @@ var ts;
}
function getTextOfIdentifierOrLiteral(node) {
if (node) {
- if (node.kind === 69 ||
+ if (node.kind === 70 ||
node.kind === 9 ||
node.kind === 8) {
return node.text;
@@ -54731,7 +56210,7 @@ var ts;
if (text !== undefined) {
containers.unshift(text);
}
- else if (declaration.name.kind === 140) {
+ else if (declaration.name.kind === 141) {
return tryAddComputedPropertyName(declaration.name.expression, containers, true);
}
else {
@@ -54748,7 +56227,7 @@ var ts;
}
return true;
}
- if (expression.kind === 172) {
+ if (expression.kind === 173) {
var propertyAccess = expression;
if (includeLastPortion) {
containers.unshift(propertyAccess.name.text);
@@ -54759,7 +56238,7 @@ var ts;
}
function getContainers(declaration) {
var containers = [];
- if (declaration.name.kind === 140) {
+ if (declaration.name.kind === 141) {
if (!tryAddComputedPropertyName(declaration.name.expression, containers, false)) {
return undefined;
}
@@ -54787,8 +56266,8 @@ var ts;
}
function compareNavigateToItems(i1, i2) {
return i1.matchKind - i2.matchKind ||
- i1.name.localeCompare(i2.name, undefined, baseSensitivity) ||
- i1.name.localeCompare(i2.name);
+ ts.compareStringsCaseInsensitive(i1.name, i2.name) ||
+ ts.compareStrings(i1.name, i2.name);
}
function createNavigateToItem(rawItem) {
var declaration = rawItem.declaration;
@@ -54891,7 +56370,7 @@ var ts;
return;
}
switch (node.kind) {
- case 148:
+ case 149:
var ctr = node;
addNodeWithRecursiveChild(ctr, ctr.body);
for (var _i = 0, _a = ctr.parameters; _i < _a.length; _i++) {
@@ -54901,28 +56380,28 @@ var ts;
}
}
break;
- case 147:
- case 149:
+ case 148:
case 150:
- case 146:
+ case 151:
+ case 147:
if (!ts.hasDynamicName(node)) {
addNodeWithRecursiveChild(node, node.body);
}
break;
+ case 146:
case 145:
- case 144:
if (!ts.hasDynamicName(node)) {
addLeafNode(node);
}
break;
- case 231:
+ case 232:
var importClause = node;
if (importClause.name) {
addLeafNode(importClause);
}
var namedBindings = importClause.namedBindings;
if (namedBindings) {
- if (namedBindings.kind === 232) {
+ if (namedBindings.kind === 233) {
addLeafNode(namedBindings);
}
else {
@@ -54933,8 +56412,8 @@ var ts;
}
}
break;
- case 169:
- case 218:
+ case 170:
+ case 219:
var decl = node;
var name_50 = decl.name;
if (ts.isBindingPattern(name_50)) {
@@ -54947,12 +56426,12 @@ var ts;
addNodeWithRecursiveChild(decl, decl.initializer);
}
break;
+ case 181:
+ case 221:
case 180:
- case 220:
- case 179:
addNodeWithRecursiveChild(node, node.body);
break;
- case 224:
+ case 225:
startNode(node);
for (var _d = 0, _e = node.members; _d < _e.length; _d++) {
var member = _e[_d];
@@ -54962,9 +56441,9 @@ var ts;
}
endNode();
break;
- case 221:
- case 192:
case 222:
+ case 193:
+ case 223:
startNode(node);
for (var _f = 0, _g = node.members; _f < _g.length; _f++) {
var member = _g[_f];
@@ -54972,15 +56451,15 @@ var ts;
}
endNode();
break;
- case 225:
+ case 226:
addNodeWithRecursiveChild(node, getInteriorModule(node).body);
break;
- case 238:
- case 229:
- case 153:
- case 151:
+ case 239:
+ case 230:
+ case 154:
case 152:
- case 223:
+ case 153:
+ case 224:
addLeafNode(node);
break;
default:
@@ -55034,12 +56513,12 @@ var ts;
}
});
function shouldReallyMerge(a, b) {
- return a.kind === b.kind && (a.kind !== 225 || areSameModule(a, b));
+ return a.kind === b.kind && (a.kind !== 226 || areSameModule(a, b));
function areSameModule(a, b) {
if (a.body.kind !== b.body.kind) {
return false;
}
- if (a.body.kind !== 225) {
+ if (a.body.kind !== 226) {
return true;
}
return areSameModule(a.body, b.body);
@@ -55072,9 +56551,8 @@ var ts;
return name1 ? 1 : name2 ? -1 : navigationBarNodeKind(child1) - navigationBarNodeKind(child2);
}
}
- var collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined;
- var localeCompareIsCorrect = collator && collator.compare("a", "B") < 0;
- var localeCompareFix = localeCompareIsCorrect ? collator.compare : function (a, b) {
+ var localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0;
+ var localeCompareFix = localeCompareIsCorrect ? ts.collator.compare : function (a, b) {
for (var i = 0; i < Math.min(a.length, b.length); i++) {
var chA = a.charAt(i), chB = b.charAt(i);
if (chA === "\"" && chB === "'") {
@@ -55083,7 +56561,7 @@ var ts;
if (chA === "'" && chB === "\"") {
return -1;
}
- var cmp = chA.toLocaleLowerCase().localeCompare(chB.toLocaleLowerCase());
+ var cmp = ts.compareStrings(chA.toLocaleLowerCase(), chB.toLocaleLowerCase());
if (cmp !== 0) {
return cmp;
}
@@ -55091,7 +56569,7 @@ var ts;
return a.length - b.length;
};
function tryGetName(node) {
- if (node.kind === 225) {
+ if (node.kind === 226) {
return getModuleName(node);
}
var decl = node;
@@ -55099,9 +56577,9 @@ var ts;
return ts.getPropertyNameForPropertyNameNode(decl.name);
}
switch (node.kind) {
- case 179:
case 180:
- case 192:
+ case 181:
+ case 193:
return getFunctionOrClassName(node);
case 279:
return getJSDocTypedefTagName(node);
@@ -55110,7 +56588,7 @@ var ts;
}
}
function getItemName(node) {
- if (node.kind === 225) {
+ if (node.kind === 226) {
return getModuleName(node);
}
var name = node.name;
@@ -55126,22 +56604,22 @@ var ts;
return ts.isExternalModule(sourceFile)
? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\""
: "";
- case 180:
- case 220:
- case 179:
+ case 181:
case 221:
- case 192:
+ case 180:
+ case 222:
+ case 193:
if (ts.getModifierFlags(node) & 512) {
return "default";
}
return getFunctionOrClassName(node);
- case 148:
+ case 149:
return "constructor";
- case 152:
- return "new()";
- case 151:
- return "()";
case 153:
+ return "new()";
+ case 152:
+ return "()";
+ case 154:
return "[]";
case 279:
return getJSDocTypedefTagName(node);
@@ -55155,10 +56633,10 @@ var ts;
}
else {
var parentNode = node.parent && node.parent.parent;
- if (parentNode && parentNode.kind === 200) {
+ if (parentNode && parentNode.kind === 201) {
if (parentNode.declarationList.declarations.length > 0) {
var nameIdentifier = parentNode.declarationList.declarations[0].name;
- if (nameIdentifier.kind === 69) {
+ if (nameIdentifier.kind === 70) {
return nameIdentifier.text;
}
}
@@ -55183,24 +56661,24 @@ var ts;
return topLevel;
function isTopLevel(item) {
switch (navigationBarNodeKind(item)) {
- case 221:
- case 192:
- case 224:
case 222:
+ case 193:
case 225:
- case 256:
case 223:
+ case 226:
+ case 256:
+ case 224:
case 279:
return true;
- case 148:
- case 147:
case 149:
+ case 148:
case 150:
- case 218:
+ case 151:
+ case 219:
return hasSomeImportantChild(item);
+ case 181:
+ case 221:
case 180:
- case 220:
- case 179:
return isTopLevelFunctionDeclaration(item);
default:
return false;
@@ -55210,10 +56688,10 @@ var ts;
return false;
}
switch (navigationBarNodeKind(item.parent)) {
- case 226:
+ case 227:
case 256:
- case 147:
case 148:
+ case 149:
return true;
default:
return hasSomeImportantChild(item);
@@ -55222,7 +56700,7 @@ var ts;
function hasSomeImportantChild(item) {
return ts.forEach(item.children, function (child) {
var childKind = navigationBarNodeKind(child);
- return childKind !== 218 && childKind !== 169;
+ return childKind !== 219 && childKind !== 170;
});
}
}
@@ -55277,17 +56755,17 @@ var ts;
}
var result = [];
result.push(moduleDeclaration.name.text);
- while (moduleDeclaration.body && moduleDeclaration.body.kind === 225) {
+ while (moduleDeclaration.body && moduleDeclaration.body.kind === 226) {
moduleDeclaration = moduleDeclaration.body;
result.push(moduleDeclaration.name.text);
}
return result.join(".");
}
function getInteriorModule(decl) {
- return decl.body.kind === 225 ? getInteriorModule(decl.body) : decl;
+ return decl.body.kind === 226 ? getInteriorModule(decl.body) : decl;
}
function isComputedProperty(member) {
- return !member.name || member.name.kind === 140;
+ return !member.name || member.name.kind === 141;
}
function getNodeSpan(node) {
return node.kind === 256
@@ -55298,11 +56776,11 @@ var ts;
if (node.name && ts.getFullWidth(node.name) > 0) {
return ts.declarationNameToString(node.name);
}
- else if (node.parent.kind === 218) {
+ else if (node.parent.kind === 219) {
return ts.declarationNameToString(node.parent.name);
}
- else if (node.parent.kind === 187 &&
- node.parent.operatorToken.kind === 56) {
+ else if (node.parent.kind === 188 &&
+ node.parent.operatorToken.kind === 57) {
return nodeText(node.parent.left);
}
else if (node.parent.kind === 253 && node.parent.name) {
@@ -55316,7 +56794,7 @@ var ts;
}
}
function isFunctionOrClassExpression(node) {
- return node.kind === 179 || node.kind === 180 || node.kind === 192;
+ return node.kind === 180 || node.kind === 181 || node.kind === 193;
}
})(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {}));
})(ts || (ts = {}));
@@ -55388,7 +56866,7 @@ var ts;
}
}
function autoCollapse(node) {
- return ts.isFunctionBlock(node) && node.parent.kind !== 180;
+ return ts.isFunctionBlock(node) && node.parent.kind !== 181;
}
var depth = 0;
var maxDepth = 20;
@@ -55400,30 +56878,30 @@ var ts;
addOutliningForLeadingCommentsForNode(n);
}
switch (n.kind) {
- case 199:
+ case 200:
if (!ts.isFunctionBlock(n)) {
var parent_22 = n.parent;
- var openBrace = ts.findChildOfKind(n, 15, sourceFile);
- var closeBrace = ts.findChildOfKind(n, 16, sourceFile);
- if (parent_22.kind === 204 ||
- parent_22.kind === 207 ||
+ var openBrace = ts.findChildOfKind(n, 16, sourceFile);
+ var closeBrace = ts.findChildOfKind(n, 17, sourceFile);
+ if (parent_22.kind === 205 ||
parent_22.kind === 208 ||
+ parent_22.kind === 209 ||
+ parent_22.kind === 207 ||
+ parent_22.kind === 204 ||
parent_22.kind === 206 ||
- parent_22.kind === 203 ||
- parent_22.kind === 205 ||
- parent_22.kind === 212 ||
+ parent_22.kind === 213 ||
parent_22.kind === 252) {
addOutliningSpan(parent_22, openBrace, closeBrace, autoCollapse(n));
break;
}
- if (parent_22.kind === 216) {
+ if (parent_22.kind === 217) {
var tryStatement = parent_22;
if (tryStatement.tryBlock === n) {
addOutliningSpan(parent_22, openBrace, closeBrace, autoCollapse(n));
break;
}
else if (tryStatement.finallyBlock === n) {
- var finallyKeyword = ts.findChildOfKind(tryStatement, 85, sourceFile);
+ var finallyKeyword = ts.findChildOfKind(tryStatement, 86, sourceFile);
if (finallyKeyword) {
addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n));
break;
@@ -55439,25 +56917,25 @@ var ts;
});
break;
}
- case 226: {
- var openBrace = ts.findChildOfKind(n, 15, sourceFile);
- var closeBrace = ts.findChildOfKind(n, 16, sourceFile);
+ case 227: {
+ var openBrace = ts.findChildOfKind(n, 16, sourceFile);
+ var closeBrace = ts.findChildOfKind(n, 17, sourceFile);
addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n));
break;
}
- case 221:
case 222:
- case 224:
- case 171:
- case 227: {
- var openBrace = ts.findChildOfKind(n, 15, sourceFile);
- var closeBrace = ts.findChildOfKind(n, 16, sourceFile);
+ case 223:
+ case 225:
+ case 172:
+ case 228: {
+ var openBrace = ts.findChildOfKind(n, 16, sourceFile);
+ var closeBrace = ts.findChildOfKind(n, 17, sourceFile);
addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n));
break;
}
- case 170:
- var openBracket = ts.findChildOfKind(n, 19, sourceFile);
- var closeBracket = ts.findChildOfKind(n, 20, sourceFile);
+ case 171:
+ var openBracket = ts.findChildOfKind(n, 20, sourceFile);
+ var closeBracket = ts.findChildOfKind(n, 21, sourceFile);
addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n));
break;
}
@@ -55700,7 +57178,7 @@ var ts;
if (ch >= 65 && ch <= 90) {
return true;
}
- if (ch < 127 || !ts.isUnicodeIdentifierStart(ch, 2)) {
+ if (ch < 127 || !ts.isUnicodeIdentifierStart(ch, 4)) {
return false;
}
var str = String.fromCharCode(ch);
@@ -55710,7 +57188,7 @@ var ts;
if (ch >= 97 && ch <= 122) {
return true;
}
- if (ch < 127 || !ts.isUnicodeIdentifierStart(ch, 2)) {
+ if (ch < 127 || !ts.isUnicodeIdentifierStart(ch, 4)) {
return false;
}
var str = String.fromCharCode(ch);
@@ -55893,10 +57371,10 @@ var ts;
var externalModule = false;
function nextToken() {
var token = ts.scanner.scan();
- if (token === 15) {
+ if (token === 16) {
braceNesting++;
}
- else if (token === 16) {
+ else if (token === 17) {
braceNesting--;
}
return token;
@@ -55944,9 +57422,9 @@ var ts;
}
function tryConsumeDeclare() {
var token = ts.scanner.getToken();
- if (token === 122) {
+ if (token === 123) {
token = nextToken();
- if (token === 125) {
+ if (token === 126) {
token = nextToken();
if (token === 9) {
recordAmbientExternalModule();
@@ -55958,42 +57436,42 @@ var ts;
}
function tryConsumeImport() {
var token = ts.scanner.getToken();
- if (token === 89) {
+ if (token === 90) {
token = nextToken();
if (token === 9) {
recordModuleName();
return true;
}
else {
- if (token === 69 || ts.isKeyword(token)) {
+ if (token === 70 || ts.isKeyword(token)) {
token = nextToken();
- if (token === 136) {
+ if (token === 137) {
token = nextToken();
if (token === 9) {
recordModuleName();
return true;
}
}
- else if (token === 56) {
+ else if (token === 57) {
if (tryConsumeRequireCall(true)) {
return true;
}
}
- else if (token === 24) {
+ else if (token === 25) {
token = nextToken();
}
else {
return true;
}
}
- if (token === 15) {
+ if (token === 16) {
token = nextToken();
- while (token !== 16 && token !== 1) {
+ while (token !== 17 && token !== 1) {
token = nextToken();
}
- if (token === 16) {
+ if (token === 17) {
token = nextToken();
- if (token === 136) {
+ if (token === 137) {
token = nextToken();
if (token === 9) {
recordModuleName();
@@ -56001,13 +57479,13 @@ var ts;
}
}
}
- else if (token === 37) {
+ else if (token === 38) {
token = nextToken();
- if (token === 116) {
+ if (token === 117) {
token = nextToken();
- if (token === 69 || ts.isKeyword(token)) {
+ if (token === 70 || ts.isKeyword(token)) {
token = nextToken();
- if (token === 136) {
+ if (token === 137) {
token = nextToken();
if (token === 9) {
recordModuleName();
@@ -56023,17 +57501,17 @@ var ts;
}
function tryConsumeExport() {
var token = ts.scanner.getToken();
- if (token === 82) {
+ if (token === 83) {
markAsExternalModuleIfTopLevel();
token = nextToken();
- if (token === 15) {
+ if (token === 16) {
token = nextToken();
- while (token !== 16 && token !== 1) {
+ while (token !== 17 && token !== 1) {
token = nextToken();
}
- if (token === 16) {
+ if (token === 17) {
token = nextToken();
- if (token === 136) {
+ if (token === 137) {
token = nextToken();
if (token === 9) {
recordModuleName();
@@ -56041,20 +57519,20 @@ var ts;
}
}
}
- else if (token === 37) {
+ else if (token === 38) {
token = nextToken();
- if (token === 136) {
+ if (token === 137) {
token = nextToken();
if (token === 9) {
recordModuleName();
}
}
}
- else if (token === 89) {
+ else if (token === 90) {
token = nextToken();
- if (token === 69 || ts.isKeyword(token)) {
+ if (token === 70 || ts.isKeyword(token)) {
token = nextToken();
- if (token === 56) {
+ if (token === 57) {
if (tryConsumeRequireCall(true)) {
return true;
}
@@ -56067,9 +57545,9 @@ var ts;
}
function tryConsumeRequireCall(skipCurrentToken) {
var token = skipCurrentToken ? nextToken() : ts.scanner.getToken();
- if (token === 129) {
+ if (token === 130) {
token = nextToken();
- if (token === 17) {
+ if (token === 18) {
token = nextToken();
if (token === 9) {
recordModuleName();
@@ -56081,27 +57559,27 @@ var ts;
}
function tryConsumeDefine() {
var token = ts.scanner.getToken();
- if (token === 69 && ts.scanner.getTokenValue() === "define") {
+ if (token === 70 && ts.scanner.getTokenValue() === "define") {
token = nextToken();
- if (token !== 17) {
+ if (token !== 18) {
return true;
}
token = nextToken();
if (token === 9) {
token = nextToken();
- if (token === 24) {
+ if (token === 25) {
token = nextToken();
}
else {
return true;
}
}
- if (token !== 19) {
+ if (token !== 20) {
return true;
}
token = nextToken();
var i = 0;
- while (token !== 20 && token !== 1) {
+ while (token !== 21 && token !== 1) {
if (token === 9) {
recordModuleName();
i++;
@@ -56173,7 +57651,7 @@ var ts;
var canonicalDefaultLibName = getCanonicalFileName(ts.normalizePath(defaultLibFileName));
var node = ts.getTouchingWord(sourceFile, position, true);
if (node) {
- if (node.kind === 69 ||
+ if (node.kind === 70 ||
node.kind === 9 ||
ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) ||
ts.isThis(node)) {
@@ -56261,6 +57739,12 @@ var ts;
var SignatureHelp;
(function (SignatureHelp) {
var emptyArray = [];
+ (function (ArgumentListKind) {
+ ArgumentListKind[ArgumentListKind["TypeArguments"] = 0] = "TypeArguments";
+ ArgumentListKind[ArgumentListKind["CallArguments"] = 1] = "CallArguments";
+ ArgumentListKind[ArgumentListKind["TaggedTemplateArguments"] = 2] = "TaggedTemplateArguments";
+ })(SignatureHelp.ArgumentListKind || (SignatureHelp.ArgumentListKind = {}));
+ var ArgumentListKind = SignatureHelp.ArgumentListKind;
function getSignatureHelpItems(program, sourceFile, position, cancellationToken) {
var typeChecker = program.getTypeChecker();
var startingToken = ts.findTokenOnLeftOfPosition(sourceFile, position);
@@ -56286,14 +57770,14 @@ var ts;
}
SignatureHelp.getSignatureHelpItems = getSignatureHelpItems;
function createJavaScriptSignatureHelpItems(argumentInfo, program) {
- if (argumentInfo.invocation.kind !== 174) {
+ if (argumentInfo.invocation.kind !== 175) {
return undefined;
}
var callExpression = argumentInfo.invocation;
var expression = callExpression.expression;
- var name = expression.kind === 69
+ var name = expression.kind === 70
? expression
- : expression.kind === 172
+ : expression.kind === 173
? expression.name
: undefined;
if (!name || !name.text) {
@@ -56322,10 +57806,10 @@ var ts;
}
}
function getImmediatelyContainingArgumentInfo(node, position, sourceFile) {
- if (node.parent.kind === 174 || node.parent.kind === 175) {
+ if (node.parent.kind === 175 || node.parent.kind === 176) {
var callExpression = node.parent;
- if (node.kind === 25 ||
- node.kind === 17) {
+ if (node.kind === 26 ||
+ node.kind === 18) {
var list = getChildListThatStartsWithOpenerToken(callExpression, node, sourceFile);
var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos;
ts.Debug.assert(list !== undefined);
@@ -56354,24 +57838,24 @@ var ts;
}
return undefined;
}
- else if (node.kind === 11 && node.parent.kind === 176) {
+ else if (node.kind === 12 && node.parent.kind === 177) {
if (ts.isInsideTemplateLiteral(node, position)) {
return getArgumentListInfoForTemplate(node.parent, 0, sourceFile);
}
}
- else if (node.kind === 12 && node.parent.parent.kind === 176) {
+ else if (node.kind === 13 && node.parent.parent.kind === 177) {
var templateExpression = node.parent;
var tagExpression = templateExpression.parent;
- ts.Debug.assert(templateExpression.kind === 189);
+ ts.Debug.assert(templateExpression.kind === 190);
var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1;
return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile);
}
- else if (node.parent.kind === 197 && node.parent.parent.parent.kind === 176) {
+ else if (node.parent.kind === 198 && node.parent.parent.parent.kind === 177) {
var templateSpan = node.parent;
var templateExpression = templateSpan.parent;
var tagExpression = templateExpression.parent;
- ts.Debug.assert(templateExpression.kind === 189);
- if (node.kind === 14 && !ts.isInsideTemplateLiteral(node, position)) {
+ ts.Debug.assert(templateExpression.kind === 190);
+ if (node.kind === 15 && !ts.isInsideTemplateLiteral(node, position)) {
return undefined;
}
var spanIndex = templateExpression.templateSpans.indexOf(templateSpan);
@@ -56388,7 +57872,7 @@ var ts;
if (child === node) {
break;
}
- if (child.kind !== 24) {
+ if (child.kind !== 25) {
argumentIndex++;
}
}
@@ -56396,8 +57880,8 @@ var ts;
}
function getArgumentCount(argumentsList) {
var listChildren = argumentsList.getChildren();
- var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 24; });
- if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 24) {
+ var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 25; });
+ if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 25) {
argumentCount++;
}
return argumentCount;
@@ -56413,7 +57897,7 @@ var ts;
return spanIndex + 1;
}
function getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile) {
- var argumentCount = tagExpression.template.kind === 11
+ var argumentCount = tagExpression.template.kind === 12
? 1
: tagExpression.template.templateSpans.length + 1;
ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex);
@@ -56434,7 +57918,7 @@ var ts;
var template = taggedTemplate.template;
var applicableSpanStart = template.getStart();
var applicableSpanEnd = template.getEnd();
- if (template.kind === 189) {
+ if (template.kind === 190) {
var lastSpan = ts.lastOrUndefined(template.templateSpans);
if (lastSpan.literal.getFullWidth() === 0) {
applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false);
@@ -56494,10 +57978,10 @@ var ts;
ts.addRange(prefixDisplayParts, callTargetDisplayParts);
}
if (isTypeParameterList) {
- prefixDisplayParts.push(ts.punctuationPart(25));
+ prefixDisplayParts.push(ts.punctuationPart(26));
var typeParameters = candidateSignature.typeParameters;
signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray;
- suffixDisplayParts.push(ts.punctuationPart(27));
+ suffixDisplayParts.push(ts.punctuationPart(28));
var parameterParts = ts.mapToDisplayParts(function (writer) {
return typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.thisParameter, candidateSignature.parameters, writer, invocation);
});
@@ -56508,10 +57992,10 @@ var ts;
return typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation);
});
ts.addRange(prefixDisplayParts, typeParameterParts);
- prefixDisplayParts.push(ts.punctuationPart(17));
+ prefixDisplayParts.push(ts.punctuationPart(18));
var parameters = candidateSignature.parameters;
signatureHelpParameters = parameters.length > 0 ? ts.map(parameters, createSignatureHelpParameterForParameter) : emptyArray;
- suffixDisplayParts.push(ts.punctuationPart(18));
+ suffixDisplayParts.push(ts.punctuationPart(19));
}
var returnTypeParts = ts.mapToDisplayParts(function (writer) {
return typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation);
@@ -56521,7 +58005,7 @@ var ts;
isVariadic: candidateSignature.hasRestParameter,
prefixDisplayParts: prefixDisplayParts,
suffixDisplayParts: suffixDisplayParts,
- separatorDisplayParts: [ts.punctuationPart(24), ts.spacePart()],
+ separatorDisplayParts: [ts.punctuationPart(25), ts.spacePart()],
parameters: signatureHelpParameters,
documentation: candidateSignature.getDocumentationComment()
};
@@ -56572,7 +58056,7 @@ var ts;
function getSymbolKind(typeChecker, symbol, location) {
var flags = symbol.getFlags();
if (flags & 32)
- return ts.getDeclarationOfKind(symbol, 192) ?
+ return ts.getDeclarationOfKind(symbol, 193) ?
ts.ScriptElementKind.localClassElement : ts.ScriptElementKind.classElement;
if (flags & 384)
return ts.ScriptElementKind.enumElement;
@@ -56603,7 +58087,7 @@ var ts;
if (typeChecker.isArgumentsSymbol(symbol)) {
return ts.ScriptElementKind.localVariableElement;
}
- if (location.kind === 97 && ts.isExpression(location)) {
+ if (location.kind === 98 && ts.isExpression(location)) {
return ts.ScriptElementKind.parameterElement;
}
if (flags & 3) {
@@ -56663,7 +58147,7 @@ var ts;
var symbolFlags = symbol.flags;
var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, symbolFlags, location);
var hasAddedSymbolInfo;
- var isThisExpression = location.kind === 97 && ts.isExpression(location);
+ var isThisExpression = location.kind === 98 && ts.isExpression(location);
var type;
if (symbolKind !== ts.ScriptElementKind.unknown || symbolFlags & 32 || symbolFlags & 8388608) {
if (symbolKind === ts.ScriptElementKind.memberGetAccessorElement || symbolKind === ts.ScriptElementKind.memberSetAccessorElement) {
@@ -56672,14 +58156,14 @@ var ts;
var signature = void 0;
type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location);
if (type) {
- if (location.parent && location.parent.kind === 172) {
+ if (location.parent && location.parent.kind === 173) {
var right = location.parent.name;
if (right === location || (right && right.getFullWidth() === 0)) {
location = location.parent;
}
}
var callExpression = void 0;
- if (location.kind === 174 || location.kind === 175) {
+ if (location.kind === 175 || location.kind === 176) {
callExpression = location;
}
else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) {
@@ -56691,7 +58175,7 @@ var ts;
if (!signature && candidateSignatures.length) {
signature = candidateSignatures[0];
}
- var useConstructSignatures = callExpression.kind === 175 || callExpression.expression.kind === 95;
+ var useConstructSignatures = callExpression.kind === 176 || callExpression.expression.kind === 96;
var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures();
if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) {
signature = allSignatures.length ? allSignatures[0] : undefined;
@@ -56706,7 +58190,7 @@ var ts;
pushTypePart(symbolKind);
displayParts.push(ts.spacePart());
if (useConstructSignatures) {
- displayParts.push(ts.keywordPart(92));
+ displayParts.push(ts.keywordPart(93));
displayParts.push(ts.spacePart());
}
addFullSymbolName(symbol);
@@ -56721,10 +58205,10 @@ var ts;
case ts.ScriptElementKind.letElement:
case ts.ScriptElementKind.parameterElement:
case ts.ScriptElementKind.localVariableElement:
- displayParts.push(ts.punctuationPart(54));
+ displayParts.push(ts.punctuationPart(55));
displayParts.push(ts.spacePart());
if (useConstructSignatures) {
- displayParts.push(ts.keywordPart(92));
+ displayParts.push(ts.keywordPart(93));
displayParts.push(ts.spacePart());
}
if (!(type.flags & 2097152) && type.symbol) {
@@ -56739,21 +58223,21 @@ var ts;
}
}
else if ((ts.isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) ||
- (location.kind === 121 && location.parent.kind === 148)) {
+ (location.kind === 122 && location.parent.kind === 149)) {
var functionDeclaration = location.parent;
- var allSignatures = functionDeclaration.kind === 148 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures();
+ var allSignatures = functionDeclaration.kind === 149 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures();
if (!typeChecker.isImplementationOfOverload(functionDeclaration)) {
signature = typeChecker.getSignatureFromDeclaration(functionDeclaration);
}
else {
signature = allSignatures[0];
}
- if (functionDeclaration.kind === 148) {
+ if (functionDeclaration.kind === 149) {
symbolKind = ts.ScriptElementKind.constructorImplementationElement;
addPrefixForAnyFunctionOrVar(type.symbol, symbolKind);
}
else {
- addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 151 &&
+ addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 152 &&
!(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind);
}
addSignatureDisplayParts(signature, allSignatures);
@@ -56762,11 +58246,11 @@ var ts;
}
}
if (symbolFlags & 32 && !hasAddedSymbolInfo && !isThisExpression) {
- if (ts.getDeclarationOfKind(symbol, 192)) {
+ if (ts.getDeclarationOfKind(symbol, 193)) {
pushTypePart(ts.ScriptElementKind.localClassElement);
}
else {
- displayParts.push(ts.keywordPart(73));
+ displayParts.push(ts.keywordPart(74));
}
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
@@ -56774,72 +58258,72 @@ var ts;
}
if ((symbolFlags & 64) && (semanticMeaning & 2)) {
addNewLineIfDisplayPartsExist();
- displayParts.push(ts.keywordPart(107));
+ displayParts.push(ts.keywordPart(108));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
writeTypeParametersOfSymbol(symbol, sourceFile);
}
if (symbolFlags & 524288) {
addNewLineIfDisplayPartsExist();
- displayParts.push(ts.keywordPart(134));
+ displayParts.push(ts.keywordPart(135));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
writeTypeParametersOfSymbol(symbol, sourceFile);
displayParts.push(ts.spacePart());
- displayParts.push(ts.operatorPart(56));
+ displayParts.push(ts.operatorPart(57));
displayParts.push(ts.spacePart());
ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 512));
}
if (symbolFlags & 384) {
addNewLineIfDisplayPartsExist();
if (ts.forEach(symbol.declarations, ts.isConstEnumDeclaration)) {
- displayParts.push(ts.keywordPart(74));
+ displayParts.push(ts.keywordPart(75));
displayParts.push(ts.spacePart());
}
- displayParts.push(ts.keywordPart(81));
+ displayParts.push(ts.keywordPart(82));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
}
if (symbolFlags & 1536) {
addNewLineIfDisplayPartsExist();
- var declaration = ts.getDeclarationOfKind(symbol, 225);
- var isNamespace = declaration && declaration.name && declaration.name.kind === 69;
- displayParts.push(ts.keywordPart(isNamespace ? 126 : 125));
+ var declaration = ts.getDeclarationOfKind(symbol, 226);
+ var isNamespace = declaration && declaration.name && declaration.name.kind === 70;
+ displayParts.push(ts.keywordPart(isNamespace ? 127 : 126));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
}
if ((symbolFlags & 262144) && (semanticMeaning & 2)) {
addNewLineIfDisplayPartsExist();
- displayParts.push(ts.punctuationPart(17));
- displayParts.push(ts.textPart("type parameter"));
displayParts.push(ts.punctuationPart(18));
+ displayParts.push(ts.textPart("type parameter"));
+ displayParts.push(ts.punctuationPart(19));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
displayParts.push(ts.spacePart());
- displayParts.push(ts.keywordPart(90));
+ displayParts.push(ts.keywordPart(91));
displayParts.push(ts.spacePart());
if (symbol.parent) {
addFullSymbolName(symbol.parent, enclosingDeclaration);
writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration);
}
else {
- var declaration = ts.getDeclarationOfKind(symbol, 141);
+ var declaration = ts.getDeclarationOfKind(symbol, 142);
ts.Debug.assert(declaration !== undefined);
declaration = declaration.parent;
if (declaration) {
if (ts.isFunctionLikeKind(declaration.kind)) {
var signature = typeChecker.getSignatureFromDeclaration(declaration);
- if (declaration.kind === 152) {
- displayParts.push(ts.keywordPart(92));
+ if (declaration.kind === 153) {
+ displayParts.push(ts.keywordPart(93));
displayParts.push(ts.spacePart());
}
- else if (declaration.kind !== 151 && declaration.name) {
+ else if (declaration.kind !== 152 && declaration.name) {
addFullSymbolName(declaration.symbol);
}
ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32));
}
else {
- displayParts.push(ts.keywordPart(134));
+ displayParts.push(ts.keywordPart(135));
displayParts.push(ts.spacePart());
addFullSymbolName(declaration.symbol);
writeTypeParametersOfSymbol(declaration.symbol, sourceFile);
@@ -56854,7 +58338,7 @@ var ts;
var constantValue = typeChecker.getConstantValue(declaration);
if (constantValue !== undefined) {
displayParts.push(ts.spacePart());
- displayParts.push(ts.operatorPart(56));
+ displayParts.push(ts.operatorPart(57));
displayParts.push(ts.spacePart());
displayParts.push(ts.displayPart(constantValue.toString(), ts.SymbolDisplayPartKind.numericLiteral));
}
@@ -56862,33 +58346,33 @@ var ts;
}
if (symbolFlags & 8388608) {
addNewLineIfDisplayPartsExist();
- if (symbol.declarations[0].kind === 228) {
- displayParts.push(ts.keywordPart(82));
+ if (symbol.declarations[0].kind === 229) {
+ displayParts.push(ts.keywordPart(83));
displayParts.push(ts.spacePart());
- displayParts.push(ts.keywordPart(126));
+ displayParts.push(ts.keywordPart(127));
}
else {
- displayParts.push(ts.keywordPart(89));
+ displayParts.push(ts.keywordPart(90));
}
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
ts.forEach(symbol.declarations, function (declaration) {
- if (declaration.kind === 229) {
+ if (declaration.kind === 230) {
var importEqualsDeclaration = declaration;
if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) {
displayParts.push(ts.spacePart());
- displayParts.push(ts.operatorPart(56));
+ displayParts.push(ts.operatorPart(57));
displayParts.push(ts.spacePart());
- displayParts.push(ts.keywordPart(129));
- displayParts.push(ts.punctuationPart(17));
- displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral));
+ displayParts.push(ts.keywordPart(130));
displayParts.push(ts.punctuationPart(18));
+ displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral));
+ displayParts.push(ts.punctuationPart(19));
}
else {
var internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference);
if (internalAliasSymbol) {
displayParts.push(ts.spacePart());
- displayParts.push(ts.operatorPart(56));
+ displayParts.push(ts.operatorPart(57));
displayParts.push(ts.spacePart());
addFullSymbolName(internalAliasSymbol, enclosingDeclaration);
}
@@ -56902,7 +58386,7 @@ var ts;
if (type) {
if (isThisExpression) {
addNewLineIfDisplayPartsExist();
- displayParts.push(ts.keywordPart(97));
+ displayParts.push(ts.keywordPart(98));
}
else {
addPrefixForAnyFunctionOrVar(symbol, symbolKind);
@@ -56911,7 +58395,7 @@ var ts;
symbolFlags & 3 ||
symbolKind === ts.ScriptElementKind.localVariableElement ||
isThisExpression) {
- displayParts.push(ts.punctuationPart(54));
+ displayParts.push(ts.punctuationPart(55));
displayParts.push(ts.spacePart());
if (type.symbol && type.symbol.flags & 262144) {
var typeParameterParts = ts.mapToDisplayParts(function (writer) {
@@ -56944,7 +58428,7 @@ var ts;
if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 256; })) {
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (!declaration.parent || declaration.parent.kind !== 187) {
+ if (!declaration.parent || declaration.parent.kind !== 188) {
continue;
}
var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right);
@@ -56987,9 +58471,9 @@ var ts;
displayParts.push(ts.textOrKeywordPart(symbolKind));
return;
default:
- displayParts.push(ts.punctuationPart(17));
- displayParts.push(ts.textOrKeywordPart(symbolKind));
displayParts.push(ts.punctuationPart(18));
+ displayParts.push(ts.textOrKeywordPart(symbolKind));
+ displayParts.push(ts.punctuationPart(19));
return;
}
}
@@ -56997,12 +58481,12 @@ var ts;
ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32));
if (allSignatures.length > 1) {
displayParts.push(ts.spacePart());
- displayParts.push(ts.punctuationPart(17));
- displayParts.push(ts.operatorPart(35));
+ displayParts.push(ts.punctuationPart(18));
+ displayParts.push(ts.operatorPart(36));
displayParts.push(ts.displayPart((allSignatures.length - 1).toString(), ts.SymbolDisplayPartKind.numericLiteral));
displayParts.push(ts.spacePart());
displayParts.push(ts.textPart(allSignatures.length === 2 ? "overload" : "overloads"));
- displayParts.push(ts.punctuationPart(18));
+ displayParts.push(ts.punctuationPart(19));
}
documentation = signature.getDocumentationComment();
}
@@ -57019,14 +58503,14 @@ var ts;
return false;
}
return ts.forEach(symbol.declarations, function (declaration) {
- if (declaration.kind === 179) {
+ if (declaration.kind === 180) {
return true;
}
- if (declaration.kind !== 218 && declaration.kind !== 220) {
+ if (declaration.kind !== 219 && declaration.kind !== 221) {
return false;
}
for (var parent_23 = declaration.parent; !ts.isFunctionBlock(parent_23); parent_23 = parent_23.parent) {
- if (parent_23.kind === 256 || parent_23.kind === 226) {
+ if (parent_23.kind === 256 || parent_23.kind === 227) {
return false;
}
}
@@ -57067,8 +58551,8 @@ var ts;
var outputText;
var sourceMapText;
var compilerHost = {
- getSourceFile: function (fileName, target) { return fileName === ts.normalizePath(inputFileName) ? sourceFile : undefined; },
- writeFile: function (name, text, writeByteOrderMark) {
+ getSourceFile: function (fileName) { return fileName === ts.normalizePath(inputFileName) ? sourceFile : undefined; },
+ writeFile: function (name, text) {
if (ts.fileExtensionIs(name, ".map")) {
ts.Debug.assert(sourceMapText === undefined, "Unexpected multiple source map outputs for the file '" + name + "'");
sourceMapText = text;
@@ -57084,9 +58568,9 @@ var ts;
getCurrentDirectory: function () { return ""; },
getNewLine: function () { return newLine; },
fileExists: function (fileName) { return fileName === inputFileName; },
- readFile: function (fileName) { return ""; },
- directoryExists: function (directoryExists) { return true; },
- getDirectories: function (path) { return []; }
+ readFile: function () { return ""; },
+ directoryExists: function () { return true; },
+ getDirectories: function () { return []; }
};
var program = ts.createProgram([inputFileName], options, compilerHost);
if (transpileOptions.reportDiagnostics) {
@@ -57135,11 +58619,20 @@ var ts;
(function (ts) {
var formatting;
(function (formatting) {
- var standardScanner = ts.createScanner(2, false, 0);
- var jsxScanner = ts.createScanner(2, false, 1);
+ var standardScanner = ts.createScanner(4, false, 0);
+ var jsxScanner = ts.createScanner(4, false, 1);
var scanner;
+ var ScanAction;
+ (function (ScanAction) {
+ ScanAction[ScanAction["Scan"] = 0] = "Scan";
+ ScanAction[ScanAction["RescanGreaterThanToken"] = 1] = "RescanGreaterThanToken";
+ ScanAction[ScanAction["RescanSlashToken"] = 2] = "RescanSlashToken";
+ ScanAction[ScanAction["RescanTemplateToken"] = 3] = "RescanTemplateToken";
+ ScanAction[ScanAction["RescanJsxIdentifier"] = 4] = "RescanJsxIdentifier";
+ ScanAction[ScanAction["RescanJsxText"] = 5] = "RescanJsxText";
+ })(ScanAction || (ScanAction = {}));
function getFormattingScanner(sourceFile, startPos, endPos) {
- ts.Debug.assert(scanner === undefined);
+ ts.Debug.assert(scanner === undefined, "Scanner should be undefined");
scanner = sourceFile.languageVariant === 1 ? jsxScanner : standardScanner;
scanner.setText(sourceFile.text);
scanner.setTextPos(startPos);
@@ -57164,7 +58657,7 @@ var ts;
}
};
function advance() {
- ts.Debug.assert(scanner !== undefined);
+ ts.Debug.assert(scanner !== undefined, "Scanner should be present");
lastTokenInfo = undefined;
var isStarted = scanner.getStartPos() !== startPos;
if (isStarted) {
@@ -57204,11 +58697,11 @@ var ts;
function shouldRescanGreaterThanToken(node) {
if (node) {
switch (node.kind) {
- case 29:
- case 64:
+ case 30:
case 65:
+ case 66:
+ case 46:
case 45:
- case 44:
return true;
}
}
@@ -57218,26 +58711,26 @@ var ts;
if (node.parent) {
switch (node.parent.kind) {
case 246:
- case 243:
+ case 244:
case 245:
- case 242:
- return node.kind === 69;
+ case 243:
+ return node.kind === 70;
}
}
return false;
}
function shouldRescanJsxText(node) {
- return node && node.kind === 244;
+ return node && node.kind === 10;
}
function shouldRescanSlashToken(container) {
- return container.kind === 10;
+ return container.kind === 11;
}
function shouldRescanTemplateToken(container) {
- return container.kind === 13 ||
- container.kind === 14;
+ return container.kind === 14 ||
+ container.kind === 15;
}
function startsWithSlashToken(t) {
- return t === 39 || t === 61;
+ return t === 40 || t === 62;
}
function readTokenInfo(n) {
ts.Debug.assert(scanner !== undefined);
@@ -57268,7 +58761,7 @@ var ts;
scanner.scan();
}
var currentToken = scanner.getToken();
- if (expectedScanAction === 1 && currentToken === 27) {
+ if (expectedScanAction === 1 && currentToken === 28) {
currentToken = scanner.reScanGreaterToken();
ts.Debug.assert(n.kind === currentToken);
lastScanAction = 1;
@@ -57278,11 +58771,11 @@ var ts;
ts.Debug.assert(n.kind === currentToken);
lastScanAction = 2;
}
- else if (expectedScanAction === 3 && currentToken === 16) {
+ else if (expectedScanAction === 3 && currentToken === 17) {
currentToken = scanner.reScanTemplateToken();
lastScanAction = 3;
}
- else if (expectedScanAction === 4 && currentToken === 69) {
+ else if (expectedScanAction === 4 && currentToken === 70) {
currentToken = scanner.scanJsxIdentifier();
lastScanAction = 4;
}
@@ -57416,8 +58909,8 @@ var ts;
return startLine === endLine;
};
FormattingContext.prototype.BlockIsOnOneLine = function (node) {
- var openBrace = ts.findChildOfKind(node, 15, this.sourceFile);
- var closeBrace = ts.findChildOfKind(node, 16, this.sourceFile);
+ var openBrace = ts.findChildOfKind(node, 16, this.sourceFile);
+ var closeBrace = ts.findChildOfKind(node, 17, this.sourceFile);
if (openBrace && closeBrace) {
var startLine = this.sourceFile.getLineAndCharacterOfPosition(openBrace.getEnd()).line;
var endLine = this.sourceFile.getLineAndCharacterOfPosition(closeBrace.getStart(this.sourceFile)).line;
@@ -57431,6 +58924,20 @@ var ts;
})(formatting = ts.formatting || (ts.formatting = {}));
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ var formatting;
+ (function (formatting) {
+ (function (FormattingRequestKind) {
+ FormattingRequestKind[FormattingRequestKind["FormatDocument"] = 0] = "FormatDocument";
+ FormattingRequestKind[FormattingRequestKind["FormatSelection"] = 1] = "FormatSelection";
+ FormattingRequestKind[FormattingRequestKind["FormatOnEnter"] = 2] = "FormatOnEnter";
+ FormattingRequestKind[FormattingRequestKind["FormatOnSemicolon"] = 3] = "FormatOnSemicolon";
+ FormattingRequestKind[FormattingRequestKind["FormatOnClosingCurlyBrace"] = 4] = "FormatOnClosingCurlyBrace";
+ })(formatting.FormattingRequestKind || (formatting.FormattingRequestKind = {}));
+ var FormattingRequestKind = formatting.FormattingRequestKind;
+ })(formatting = ts.formatting || (ts.formatting = {}));
+})(ts || (ts = {}));
+var ts;
(function (ts) {
var formatting;
(function (formatting) {
@@ -57452,6 +58959,19 @@ var ts;
})(formatting = ts.formatting || (ts.formatting = {}));
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ var formatting;
+ (function (formatting) {
+ (function (RuleAction) {
+ RuleAction[RuleAction["Ignore"] = 1] = "Ignore";
+ RuleAction[RuleAction["Space"] = 2] = "Space";
+ RuleAction[RuleAction["NewLine"] = 4] = "NewLine";
+ RuleAction[RuleAction["Delete"] = 8] = "Delete";
+ })(formatting.RuleAction || (formatting.RuleAction = {}));
+ var RuleAction = formatting.RuleAction;
+ })(formatting = ts.formatting || (ts.formatting = {}));
+})(ts || (ts = {}));
+var ts;
(function (ts) {
var formatting;
(function (formatting) {
@@ -57482,6 +59002,17 @@ var ts;
})(formatting = ts.formatting || (ts.formatting = {}));
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ var formatting;
+ (function (formatting) {
+ (function (RuleFlags) {
+ RuleFlags[RuleFlags["None"] = 0] = "None";
+ RuleFlags[RuleFlags["CanDeleteNewLines"] = 1] = "CanDeleteNewLines";
+ })(formatting.RuleFlags || (formatting.RuleFlags = {}));
+ var RuleFlags = formatting.RuleFlags;
+ })(formatting = ts.formatting || (ts.formatting = {}));
+})(ts || (ts = {}));
+var ts;
(function (ts) {
var formatting;
(function (formatting) {
@@ -57546,88 +59077,88 @@ var ts;
function Rules() {
this.IgnoreBeforeComment = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.Comments), formatting.RuleOperation.create1(1));
this.IgnoreAfterLineComment = new formatting.Rule(formatting.RuleDescriptor.create3(2, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create1(1));
- this.NoSpaceBeforeSemicolon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 23), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeColon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 54), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8));
- this.NoSpaceBeforeQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 53), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8));
- this.SpaceAfterColon = new formatting.Rule(formatting.RuleDescriptor.create3(54, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 2));
- this.SpaceAfterQuestionMarkInConditionalOperator = new formatting.Rule(formatting.RuleDescriptor.create3(53, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsConditionalOperatorContext), 2));
- this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(53, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2));
- this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(16, 80), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(16, 104), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.FromTokens([18, 20, 24, 23])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 21), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(21, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(20, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBeforeBlockInFunctionDeclarationContext), 8));
+ this.NoSpaceBeforeSemicolon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeColon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 55), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8));
+ this.NoSpaceBeforeQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 54), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8));
+ this.SpaceAfterColon = new formatting.Rule(formatting.RuleDescriptor.create3(55, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 2));
+ this.SpaceAfterQuestionMarkInConditionalOperator = new formatting.Rule(formatting.RuleDescriptor.create3(54, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsConditionalOperatorContext), 2));
+ this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(54, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2));
+ this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(17, 81), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(17, 105), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.FromTokens([19, 21, 25, 24])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(22, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(21, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBeforeBlockInFunctionDeclarationContext), 8));
this.FunctionOpenBraceLeftTokenRange = formatting.Shared.TokenRange.AnyIncludingMultilineComments;
- this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1);
- this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([69, 3, 73, 82, 89]);
- this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1);
- this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([18, 3, 79, 100, 85, 80]);
- this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1);
- this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2));
- this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2));
- this.NoSpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8));
- this.NoSpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8));
- this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(15, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectContext), 8));
- this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4));
- this.NewLineBeforeCloseBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.AnyIncludingMultilineComments, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4));
+ this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1);
+ this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([70, 3, 74, 83, 90]);
+ this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1);
+ this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([19, 3, 80, 101, 86, 81]);
+ this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1);
+ this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2));
+ this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2));
+ this.NoSpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8));
+ this.NoSpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8));
+ this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(16, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectContext), 8));
+ this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4));
+ this.NewLineBeforeCloseBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.AnyIncludingMultilineComments, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4));
this.NoSpaceAfterUnaryPrefixOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.UnaryPrefixOperators, formatting.Shared.TokenRange.UnaryPrefixExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8));
- this.NoSpaceAfterUnaryPreincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(41, formatting.Shared.TokenRange.UnaryPreincrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterUnaryPredecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(42, formatting.Shared.TokenRange.UnaryPredecrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeUnaryPostincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostincrementExpressions, 41), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeUnaryPostdecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 42), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceAfterPostincrementWhenFollowedByAdd = new formatting.Rule(formatting.RuleDescriptor.create1(41, 35), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
- this.SpaceAfterAddWhenFollowedByUnaryPlus = new formatting.Rule(formatting.RuleDescriptor.create1(35, 35), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
- this.SpaceAfterAddWhenFollowedByPreincrement = new formatting.Rule(formatting.RuleDescriptor.create1(35, 41), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
- this.SpaceAfterPostdecrementWhenFollowedBySubtract = new formatting.Rule(formatting.RuleDescriptor.create1(42, 36), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
- this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(36, 36), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
- this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(36, 42), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
- this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([102, 98, 92, 78, 94, 101, 119]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([108, 74]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2));
- this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8));
- this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(87, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2));
- this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 8));
- this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(103, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsVoidOpContext), 2));
- this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(94, 23), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([18, 79, 80, 71]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNotForContext), 2));
- this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([100, 85]), 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([123, 131]), 69), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2));
+ this.NoSpaceAfterUnaryPreincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(42, formatting.Shared.TokenRange.UnaryPreincrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterUnaryPredecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(43, formatting.Shared.TokenRange.UnaryPredecrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeUnaryPostincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostincrementExpressions, 42), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeUnaryPostdecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 43), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceAfterPostincrementWhenFollowedByAdd = new formatting.Rule(formatting.RuleDescriptor.create1(42, 36), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
+ this.SpaceAfterAddWhenFollowedByUnaryPlus = new formatting.Rule(formatting.RuleDescriptor.create1(36, 36), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
+ this.SpaceAfterAddWhenFollowedByPreincrement = new formatting.Rule(formatting.RuleDescriptor.create1(36, 42), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
+ this.SpaceAfterPostdecrementWhenFollowedBySubtract = new formatting.Rule(formatting.RuleDescriptor.create1(43, 37), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
+ this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(37, 37), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
+ this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(37, 43), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
+ this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 25), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([103, 99, 93, 79, 95, 102, 120]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([109, 75]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2));
+ this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8));
+ this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(88, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2));
+ this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 8));
+ this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(104, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsVoidOpContext), 2));
+ this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(95, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([19, 80, 81, 72]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNotForContext), 2));
+ this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([101, 86]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([124, 132]), 70), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2));
this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
- this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(121, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([125, 129]), 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([115, 73, 122, 77, 81, 82, 83, 123, 106, 89, 107, 125, 126, 110, 112, 111, 131, 113, 134, 136]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([83, 106, 136])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(9, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2));
- this.SpaceBeforeArrow = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 34), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(34, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(22, 69), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(53, formatting.Shared.TokenRange.FromTokens([18, 24])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8));
- this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 25), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
- this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(18, 25), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
- this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
- this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 27), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
- this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(27, formatting.Shared.TokenRange.FromTokens([17, 19, 27, 24])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
- this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(15, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectTypeContext), 8));
- this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 55), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(55, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([115, 69, 82, 77, 73, 113, 112, 110, 111, 123, 131, 19, 37])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2));
- this.NoSpaceBetweenFunctionKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(87, 37), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 8));
- this.SpaceAfterStarInGeneratorDeclaration = new formatting.Rule(formatting.RuleDescriptor.create3(37, formatting.Shared.TokenRange.FromTokens([69, 17])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 2));
- this.NoSpaceBetweenYieldKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(114, 37), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 8));
- this.SpaceBetweenYieldOrYieldStarAndOperand = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([114, 37]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 2));
- this.SpaceBetweenAsyncAndOpenParen = new formatting.Rule(formatting.RuleDescriptor.create1(118, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsArrowFunctionContext, Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceBetweenAsyncAndFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(118, 87), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(69, formatting.Shared.TokenRange.FromTokens([11, 12])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceBeforeJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 69), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNextTokenParentJsxAttribute, Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceBeforeSlashInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 39), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceBeforeGreaterThanTokenInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create1(39, 27), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 56), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create3(56, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(122, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([126, 130]), 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([116, 74, 123, 78, 82, 83, 84, 124, 107, 90, 108, 126, 127, 111, 113, 112, 132, 114, 135, 137]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([84, 107, 137])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(9, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2));
+ this.SpaceBeforeArrow = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 35), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(35, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(23, 70), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(54, formatting.Shared.TokenRange.FromTokens([19, 25])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8));
+ this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 26), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
+ this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(19, 26), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
+ this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(26, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
+ this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 28), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
+ this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(28, formatting.Shared.TokenRange.FromTokens([18, 20, 28, 25])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
+ this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(16, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectTypeContext), 8));
+ this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 56), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(56, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([116, 70, 83, 78, 74, 114, 113, 111, 112, 124, 132, 20, 38])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2));
+ this.NoSpaceBetweenFunctionKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(88, 38), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 8));
+ this.SpaceAfterStarInGeneratorDeclaration = new formatting.Rule(formatting.RuleDescriptor.create3(38, formatting.Shared.TokenRange.FromTokens([70, 18])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 2));
+ this.NoSpaceBetweenYieldKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(115, 38), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 8));
+ this.SpaceBetweenYieldOrYieldStarAndOperand = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([115, 38]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 2));
+ this.SpaceBetweenAsyncAndOpenParen = new formatting.Rule(formatting.RuleDescriptor.create1(119, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsArrowFunctionContext, Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceBetweenAsyncAndFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(119, 88), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(70, formatting.Shared.TokenRange.FromTokens([12, 13])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceBeforeJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 70), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNextTokenParentJsxAttribute, Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceBeforeSlashInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 40), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceBeforeGreaterThanTokenInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create1(40, 28), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 57), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create3(57, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8));
this.HighPriorityCommonRules = [
this.IgnoreBeforeComment, this.IgnoreAfterLineComment,
this.NoSpaceBeforeColon, this.SpaceAfterColon, this.NoSpaceBeforeQuestionMark, this.SpaceAfterQuestionMarkInConditionalOperator,
@@ -57682,41 +59213,41 @@ var ts;
this.NoSpaceBeforeOpenParenInFuncDecl,
this.SpaceBetweenStatements, this.SpaceAfterTryFinally
];
- this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNextTokenNotCloseBracket), 2));
- this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext), 8));
+ this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNextTokenNotCloseBracket), 2));
+ this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext), 8));
this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
this.SpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
this.NoSpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 8));
this.NoSpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 8));
- this.SpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 2));
- this.NoSpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 8));
- this.NewLineBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 4), 1);
- this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 4), 1);
- this.NewLineBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 4), 1);
- this.SpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsForContext), 2));
- this.NoSpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsForContext), 8));
- this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(17, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceBetweenBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(19, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([12, 13]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([12, 13]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([13, 14])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([13, 14])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceAfterOpenBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 8));
- this.SpaceAfterOpenBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 2));
- this.NoSpaceBeforeCloseBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 8));
- this.SpaceBeforeCloseBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 2));
- this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(87, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2));
- this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(87, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8));
- this.NoSpaceAfterTypeAssertion = new formatting.Rule(formatting.RuleDescriptor.create3(27, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeAssertionContext), 8));
- this.SpaceAfterTypeAssertion = new formatting.Rule(formatting.RuleDescriptor.create3(27, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeAssertionContext), 2));
+ this.SpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 2));
+ this.NoSpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 8));
+ this.NewLineBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 4), 1);
+ this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 4), 1);
+ this.NewLineBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 4), 1);
+ this.SpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsForContext), 2));
+ this.NoSpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsForContext), 8));
+ this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(18, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(18, 19), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(18, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(20, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 21), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceBetweenBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(20, 21), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(20, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 21), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([13, 14]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([13, 14]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([14, 15])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([14, 15])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceAfterOpenBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 8));
+ this.SpaceAfterOpenBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 2));
+ this.NoSpaceBeforeCloseBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 8));
+ this.SpaceBeforeCloseBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 2));
+ this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(88, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2));
+ this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(88, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8));
+ this.NoSpaceAfterTypeAssertion = new formatting.Rule(formatting.RuleDescriptor.create3(28, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeAssertionContext), 8));
+ this.SpaceAfterTypeAssertion = new formatting.Rule(formatting.RuleDescriptor.create3(28, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeAssertionContext), 2));
}
Rules.prototype.getRuleName = function (rule) {
var o = this;
@@ -57728,35 +59259,35 @@ var ts;
throw new Error("Unknown rule");
};
Rules.IsForContext = function (context) {
- return context.contextNode.kind === 206;
+ return context.contextNode.kind === 207;
};
Rules.IsNotForContext = function (context) {
return !Rules.IsForContext(context);
};
Rules.IsBinaryOpContext = function (context) {
switch (context.contextNode.kind) {
- case 187:
case 188:
- case 195:
- case 238:
- case 234:
- case 154:
- case 162:
+ case 189:
+ case 196:
+ case 239:
+ case 235:
+ case 155:
case 163:
+ case 164:
return true;
- case 169:
- case 223:
- case 229:
- case 218:
- case 142:
+ case 170:
+ case 224:
+ case 230:
+ case 219:
+ case 143:
case 255:
+ case 146:
case 145:
- case 144:
- return context.currentTokenSpan.kind === 56 || context.nextTokenSpan.kind === 56;
- case 207:
- return context.currentTokenSpan.kind === 90 || context.nextTokenSpan.kind === 90;
+ return context.currentTokenSpan.kind === 57 || context.nextTokenSpan.kind === 57;
case 208:
- return context.currentTokenSpan.kind === 138 || context.nextTokenSpan.kind === 138;
+ return context.currentTokenSpan.kind === 91 || context.nextTokenSpan.kind === 91;
+ case 209:
+ return context.currentTokenSpan.kind === 139 || context.nextTokenSpan.kind === 139;
}
return false;
};
@@ -57764,7 +59295,7 @@ var ts;
return !Rules.IsBinaryOpContext(context);
};
Rules.IsConditionalOperatorContext = function (context) {
- return context.contextNode.kind === 188;
+ return context.contextNode.kind === 189;
};
Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) {
return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context);
@@ -57789,76 +59320,76 @@ var ts;
return true;
}
switch (node.kind) {
- case 199:
+ case 200:
+ case 228:
+ case 172:
case 227:
- case 171:
- case 226:
return true;
}
return false;
};
Rules.IsFunctionDeclContext = function (context) {
switch (context.contextNode.kind) {
- case 220:
+ case 221:
+ case 148:
case 147:
- case 146:
- case 149:
case 150:
case 151:
- case 179:
- case 148:
+ case 152:
case 180:
- case 222:
+ case 149:
+ case 181:
+ case 223:
return true;
}
return false;
};
Rules.IsFunctionDeclarationOrFunctionExpressionContext = function (context) {
- return context.contextNode.kind === 220 || context.contextNode.kind === 179;
+ return context.contextNode.kind === 221 || context.contextNode.kind === 180;
};
Rules.IsTypeScriptDeclWithBlockContext = function (context) {
return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode);
};
Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) {
switch (node.kind) {
- case 221:
- case 192:
case 222:
- case 224:
- case 159:
+ case 193:
+ case 223:
case 225:
- case 236:
+ case 160:
+ case 226:
case 237:
- case 230:
- case 233:
+ case 238:
+ case 231:
+ case 234:
return true;
}
return false;
};
Rules.IsAfterCodeBlockContext = function (context) {
switch (context.currentTokenParent.kind) {
- case 221:
- case 225:
- case 224:
- case 199:
- case 252:
+ case 222:
case 226:
- case 213:
+ case 225:
+ case 200:
+ case 252:
+ case 227:
+ case 214:
return true;
}
return false;
};
Rules.IsControlDeclContext = function (context) {
switch (context.contextNode.kind) {
- case 203:
- case 213:
- case 206:
+ case 204:
+ case 214:
case 207:
case 208:
+ case 209:
+ case 206:
+ case 217:
case 205:
- case 216:
- case 204:
- case 212:
+ case 213:
case 252:
return true;
default:
@@ -57866,31 +59397,31 @@ var ts;
}
};
Rules.IsObjectContext = function (context) {
- return context.contextNode.kind === 171;
+ return context.contextNode.kind === 172;
};
Rules.IsFunctionCallContext = function (context) {
- return context.contextNode.kind === 174;
+ return context.contextNode.kind === 175;
};
Rules.IsNewContext = function (context) {
- return context.contextNode.kind === 175;
+ return context.contextNode.kind === 176;
};
Rules.IsFunctionCallOrNewContext = function (context) {
return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context);
};
Rules.IsPreviousTokenNotComma = function (context) {
- return context.currentTokenSpan.kind !== 24;
+ return context.currentTokenSpan.kind !== 25;
};
Rules.IsNextTokenNotCloseBracket = function (context) {
- return context.nextTokenSpan.kind !== 20;
+ return context.nextTokenSpan.kind !== 21;
};
Rules.IsArrowFunctionContext = function (context) {
- return context.contextNode.kind === 180;
+ return context.contextNode.kind === 181;
};
Rules.IsNonJsxSameLineTokenContext = function (context) {
- return context.TokensAreOnSameLine() && context.contextNode.kind !== 244;
+ return context.TokensAreOnSameLine() && context.contextNode.kind !== 10;
};
Rules.IsNonJsxElementContext = function (context) {
- return context.contextNode.kind !== 241;
+ return context.contextNode.kind !== 242;
};
Rules.IsJsxExpressionContext = function (context) {
return context.contextNode.kind === 248;
@@ -57902,7 +59433,7 @@ var ts;
return context.contextNode.kind === 246;
};
Rules.IsJsxSelfClosingElementContext = function (context) {
- return context.contextNode.kind === 242;
+ return context.contextNode.kind === 243;
};
Rules.IsNotBeforeBlockInFunctionDeclarationContext = function (context) {
return !Rules.IsFunctionDeclContext(context) && !Rules.IsBeforeBlockContext(context);
@@ -57917,41 +59448,41 @@ var ts;
while (ts.isPartOfExpression(node)) {
node = node.parent;
}
- return node.kind === 143;
+ return node.kind === 144;
};
Rules.IsStartOfVariableDeclarationList = function (context) {
- return context.currentTokenParent.kind === 219 &&
+ return context.currentTokenParent.kind === 220 &&
context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos;
};
Rules.IsNotFormatOnEnter = function (context) {
return context.formattingRequestKind !== 2;
};
Rules.IsModuleDeclContext = function (context) {
- return context.contextNode.kind === 225;
+ return context.contextNode.kind === 226;
};
Rules.IsObjectTypeContext = function (context) {
- return context.contextNode.kind === 159;
+ return context.contextNode.kind === 160;
};
Rules.IsTypeArgumentOrParameterOrAssertion = function (token, parent) {
- if (token.kind !== 25 && token.kind !== 27) {
+ if (token.kind !== 26 && token.kind !== 28) {
return false;
}
switch (parent.kind) {
- case 155:
- case 177:
- case 221:
- case 192:
+ case 156:
+ case 178:
case 222:
- case 220:
- case 179:
+ case 193:
+ case 223:
+ case 221:
case 180:
+ case 181:
+ case 148:
case 147:
- case 146:
- case 151:
case 152:
- case 174:
+ case 153:
case 175:
- case 194:
+ case 176:
+ case 195:
return true;
default:
return false;
@@ -57962,13 +59493,13 @@ var ts;
Rules.IsTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent);
};
Rules.IsTypeAssertionContext = function (context) {
- return context.contextNode.kind === 177;
+ return context.contextNode.kind === 178;
};
Rules.IsVoidOpContext = function (context) {
- return context.currentTokenSpan.kind === 103 && context.currentTokenParent.kind === 183;
+ return context.currentTokenSpan.kind === 104 && context.currentTokenParent.kind === 184;
};
Rules.IsYieldOrYieldStarWithOperand = function (context) {
- return context.contextNode.kind === 190 && context.contextNode.expression !== undefined;
+ return context.contextNode.kind === 191 && context.contextNode.expression !== undefined;
};
return Rules;
}());
@@ -57990,7 +59521,7 @@ var ts;
return result;
};
RulesMap.prototype.Initialize = function (rules) {
- this.mapRowLength = 138 + 1;
+ this.mapRowLength = 139 + 1;
this.map = new Array(this.mapRowLength * this.mapRowLength);
var rulesBucketConstructionStateList = new Array(this.map.length);
this.FillRules(rules, rulesBucketConstructionStateList);
@@ -58003,6 +59534,7 @@ var ts;
});
};
RulesMap.prototype.GetRuleBucketIndex = function (row, column) {
+ ts.Debug.assert(row <= 139 && column <= 139, "Must compute formatting context from tokens");
var rulesBucketIndex = (row * this.mapRowLength) + column;
return rulesBucketIndex;
};
@@ -58166,12 +59698,12 @@ var ts;
}
TokenAllAccess.prototype.GetTokens = function () {
var result = [];
- for (var token = 0; token <= 138; token++) {
+ for (var token = 0; token <= 139; token++) {
result.push(token);
}
return result;
};
- TokenAllAccess.prototype.Contains = function (tokenValue) {
+ TokenAllAccess.prototype.Contains = function () {
return true;
};
TokenAllAccess.prototype.toString = function () {
@@ -58210,17 +59742,17 @@ var ts;
}());
TokenRange.Any = TokenRange.AllTokens();
TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3]));
- TokenRange.Keywords = TokenRange.FromRange(70, 138);
- TokenRange.BinaryOperators = TokenRange.FromRange(25, 68);
- TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([90, 91, 138, 116, 124]);
- TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([41, 42, 50, 49]);
- TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([8, 69, 17, 19, 15, 97, 92]);
- TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([69, 17, 97, 92]);
- TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([69, 18, 20, 92]);
- TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([69, 17, 97, 92]);
- TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([69, 18, 20, 92]);
+ TokenRange.Keywords = TokenRange.FromRange(71, 139);
+ TokenRange.BinaryOperators = TokenRange.FromRange(26, 69);
+ TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([91, 92, 139, 117, 125]);
+ TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([42, 43, 51, 50]);
+ TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([8, 70, 18, 20, 16, 98, 93]);
+ TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([70, 18, 98, 93]);
+ TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([70, 19, 21, 93]);
+ TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([70, 18, 98, 93]);
+ TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([70, 19, 21, 93]);
TokenRange.Comments = TokenRange.FromTokens([2, 3]);
- TokenRange.TypeNames = TokenRange.FromTokens([69, 130, 132, 120, 133, 103, 117]);
+ TokenRange.TypeNames = TokenRange.FromTokens([70, 131, 133, 121, 134, 104, 118]);
Shared.TokenRange = TokenRange;
})(Shared = formatting.Shared || (formatting.Shared = {}));
})(formatting = ts.formatting || (ts.formatting = {}));
@@ -58356,6 +59888,10 @@ var ts;
(function (ts) {
var formatting;
(function (formatting) {
+ var Constants;
+ (function (Constants) {
+ Constants[Constants["Unknown"] = -1] = "Unknown";
+ })(Constants || (Constants = {}));
function formatOnEnter(position, sourceFile, rulesProvider, options) {
var line = sourceFile.getLineAndCharacterOfPosition(position).line;
if (line === 0) {
@@ -58376,11 +59912,11 @@ var ts;
}
formatting.formatOnEnter = formatOnEnter;
function formatOnSemicolon(position, sourceFile, rulesProvider, options) {
- return formatOutermostParent(position, 23, sourceFile, options, rulesProvider, 3);
+ return formatOutermostParent(position, 24, sourceFile, options, rulesProvider, 3);
}
formatting.formatOnSemicolon = formatOnSemicolon;
function formatOnClosingCurly(position, sourceFile, rulesProvider, options) {
- return formatOutermostParent(position, 16, sourceFile, options, rulesProvider, 4);
+ return formatOutermostParent(position, 17, sourceFile, options, rulesProvider, 4);
}
formatting.formatOnClosingCurly = formatOnClosingCurly;
function formatDocument(sourceFile, rulesProvider, options) {
@@ -58428,15 +59964,15 @@ var ts;
}
function isListElement(parent, node) {
switch (parent.kind) {
- case 221:
case 222:
+ case 223:
return ts.rangeContainsRange(parent.members, node);
- case 225:
- var body = parent.body;
- return body && body.kind === 226 && ts.rangeContainsRange(body.statements, node);
- case 256:
- case 199:
case 226:
+ var body = parent.body;
+ return body && body.kind === 227 && ts.rangeContainsRange(body.statements, node);
+ case 256:
+ case 200:
+ case 227:
return ts.rangeContainsRange(parent.statements, node);
case 252:
return ts.rangeContainsRange(parent.block.statements, node);
@@ -58482,7 +60018,7 @@ var ts;
index++;
}
};
- function rangeHasNoErrors(r) {
+ function rangeHasNoErrors() {
return false;
}
}
@@ -58594,18 +60130,18 @@ var ts;
return node.modifiers[0].kind;
}
switch (node.kind) {
- case 221: return 73;
- case 222: return 107;
- case 220: return 87;
- case 224: return 224;
- case 149: return 123;
- case 150: return 131;
- case 147:
+ case 222: return 74;
+ case 223: return 108;
+ case 221: return 88;
+ case 225: return 225;
+ case 150: return 124;
+ case 151: return 132;
+ case 148:
if (node.asteriskToken) {
- return 37;
+ return 38;
}
- case 145:
- case 142:
+ case 146:
+ case 143:
return node.name.kind;
}
}
@@ -58613,9 +60149,9 @@ var ts;
return {
getIndentationForComment: function (kind, tokenIndentation, container) {
switch (kind) {
- case 16:
- case 20:
- case 18:
+ case 17:
+ case 21:
+ case 19:
return indentation + getEffectiveDelta(delta, container);
}
return tokenIndentation !== -1 ? tokenIndentation : indentation;
@@ -58627,15 +60163,15 @@ var ts;
}
}
switch (kind) {
- case 15:
case 16:
- case 19:
- case 20:
case 17:
+ case 20:
+ case 21:
case 18:
- case 80:
- case 104:
- case 55:
+ case 19:
+ case 81:
+ case 105:
+ case 56:
return indentation;
default:
return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation;
@@ -58715,17 +60251,17 @@ var ts;
if (!formattingScanner.isOnToken()) {
return inheritedIndentation;
}
- if (ts.isToken(child)) {
+ if (ts.isToken(child) && child.kind !== 10) {
var tokenInfo = formattingScanner.readTokenInfo(child);
- ts.Debug.assert(tokenInfo.token.end === child.end);
+ ts.Debug.assert(tokenInfo.token.end === child.end, "Token end is child end");
consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child);
return inheritedIndentation;
}
- var effectiveParentStartLine = child.kind === 143 ? childStartLine : undecoratedParentStartLine;
+ var effectiveParentStartLine = child.kind === 144 ? childStartLine : undecoratedParentStartLine;
var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine);
processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta);
childContextNode = node;
- if (isFirstListItem && parent.kind === 170 && inheritedIndentation === -1) {
+ if (isFirstListItem && parent.kind === 171 && inheritedIndentation === -1) {
inheritedIndentation = childIndentation.indentation;
}
return inheritedIndentation;
@@ -59029,41 +60565,41 @@ var ts;
}
function getOpenTokenForList(node, list) {
switch (node.kind) {
- case 148:
- case 220:
- case 179:
- case 147:
- case 146:
+ case 149:
+ case 221:
case 180:
+ case 148:
+ case 147:
+ case 181:
if (node.typeParameters === list) {
- return 25;
+ return 26;
}
else if (node.parameters === list) {
- return 17;
+ return 18;
}
break;
- case 174:
case 175:
+ case 176:
if (node.typeArguments === list) {
- return 25;
+ return 26;
}
else if (node.arguments === list) {
- return 17;
+ return 18;
}
break;
- case 155:
+ case 156:
if (node.typeArguments === list) {
- return 25;
+ return 26;
}
}
return 0;
}
function getCloseTokenForOpenToken(kind) {
switch (kind) {
- case 17:
- return 18;
- case 25:
- return 27;
+ case 18:
+ return 19;
+ case 26:
+ return 28;
}
return 0;
}
@@ -59124,6 +60660,10 @@ var ts;
(function (formatting) {
var SmartIndenter;
(function (SmartIndenter) {
+ var Value;
+ (function (Value) {
+ Value[Value["Unknown"] = -1] = "Unknown";
+ })(Value || (Value = {}));
function getIndentation(position, sourceFile, options) {
if (position > sourceFile.text.length) {
return getBaseIndentation(options);
@@ -59152,7 +60692,7 @@ var ts;
var lineStart = ts.getLineStartPositionForPosition(current_1, sourceFile);
return SmartIndenter.findFirstNonWhitespaceColumn(lineStart, current_1, sourceFile, options);
}
- if (precedingToken.kind === 24 && precedingToken.parent.kind !== 187) {
+ if (precedingToken.kind === 25 && precedingToken.parent.kind !== 188) {
var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options);
if (actualIndentation !== -1) {
return actualIndentation;
@@ -59265,10 +60805,10 @@ var ts;
if (!nextToken) {
return false;
}
- if (nextToken.kind === 15) {
+ if (nextToken.kind === 16) {
return true;
}
- else if (nextToken.kind === 16) {
+ else if (nextToken.kind === 17) {
var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line;
return lineAtPosition === nextTokenStartLine;
}
@@ -59278,8 +60818,8 @@ var ts;
return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile));
}
function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) {
- if (parent.kind === 203 && parent.elseStatement === child) {
- var elseKeyword = ts.findChildOfKind(parent, 80, sourceFile);
+ if (parent.kind === 204 && parent.elseStatement === child) {
+ var elseKeyword = ts.findChildOfKind(parent, 81, sourceFile);
ts.Debug.assert(elseKeyword !== undefined);
var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line;
return elseKeywordStartLine === childStartLine;
@@ -59290,23 +60830,23 @@ var ts;
function getContainingList(node, sourceFile) {
if (node.parent) {
switch (node.parent.kind) {
- case 155:
+ case 156:
if (node.parent.typeArguments &&
ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) {
return node.parent.typeArguments;
}
break;
- case 171:
+ case 172:
return node.parent.properties;
- case 170:
+ case 171:
return node.parent.elements;
- case 220:
- case 179:
+ case 221:
case 180:
+ case 181:
+ case 148:
case 147:
- case 146:
- case 151:
- case 152: {
+ case 152:
+ case 153: {
var start = node.getStart(sourceFile);
if (node.parent.typeParameters &&
ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) {
@@ -59317,8 +60857,8 @@ var ts;
}
break;
}
- case 175:
- case 174: {
+ case 176:
+ case 175: {
var start = node.getStart(sourceFile);
if (node.parent.typeArguments &&
ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) {
@@ -59343,11 +60883,11 @@ var ts;
}
}
function getLineIndentationWhenExpressionIsInMultiLine(node, sourceFile, options) {
- if (node.kind === 18) {
+ if (node.kind === 19) {
return -1;
}
- if (node.parent && (node.parent.kind === 174 ||
- node.parent.kind === 175) &&
+ if (node.parent && (node.parent.kind === 175 ||
+ node.parent.kind === 176) &&
node.parent.expression !== node) {
var fullCallOrNewExpression = node.parent.expression;
var startingExpression = getStartingExpression(fullCallOrNewExpression);
@@ -59365,10 +60905,10 @@ var ts;
function getStartingExpression(node) {
while (true) {
switch (node.kind) {
- case 174:
case 175:
- case 172:
+ case 176:
case 173:
+ case 174:
node = node.expression;
break;
default:
@@ -59382,7 +60922,7 @@ var ts;
var node = list[index];
var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile);
for (var i = index - 1; i >= 0; i--) {
- if (list[i].kind === 24) {
+ if (list[i].kind === 25) {
continue;
}
var prevEndLine = sourceFile.getLineAndCharacterOfPosition(list[i].end).line;
@@ -59422,48 +60962,48 @@ var ts;
SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn;
function nodeContentIsAlwaysIndented(kind) {
switch (kind) {
- case 202:
- case 221:
- case 192:
+ case 203:
case 222:
- case 224:
+ case 193:
case 223:
- case 170:
- case 199:
- case 226:
+ case 225:
+ case 224:
case 171:
- case 159:
- case 161:
+ case 200:
case 227:
+ case 172:
+ case 160:
+ case 162:
+ case 228:
case 250:
case 249:
- case 178:
- case 172:
- case 174:
+ case 179:
+ case 173:
case 175:
- case 200:
- case 218:
- case 235:
- case 211:
- case 188:
- case 168:
- case 167:
- case 243:
- case 242:
- case 248:
- case 146:
- case 151:
- case 152:
- case 142:
- case 156:
- case 157:
- case 164:
case 176:
- case 184:
- case 237:
- case 233:
+ case 201:
+ case 219:
+ case 236:
+ case 212:
+ case 189:
+ case 169:
+ case 168:
+ case 244:
+ case 243:
+ case 248:
+ case 147:
+ case 152:
+ case 153:
+ case 143:
+ case 157:
+ case 158:
+ case 165:
+ case 177:
+ case 185:
case 238:
case 234:
+ case 239:
+ case 235:
return true;
}
return false;
@@ -59471,26 +61011,26 @@ var ts;
function nodeWillIndentChild(parent, child, indentByDefault) {
var childKind = child ? child.kind : 0;
switch (parent.kind) {
- case 204:
case 205:
- case 207:
- case 208:
case 206:
- case 203:
- case 220:
- case 179:
- case 147:
+ case 208:
+ case 209:
+ case 207:
+ case 204:
+ case 221:
case 180:
case 148:
+ case 181:
case 149:
case 150:
- return childKind !== 199;
- case 236:
- return childKind !== 237;
- case 230:
- return childKind !== 231 ||
- (child.namedBindings && child.namedBindings.kind !== 233);
- case 241:
+ case 151:
+ return childKind !== 200;
+ case 237:
+ return childKind !== 238;
+ case 231:
+ return childKind !== 232 ||
+ (child.namedBindings && child.namedBindings.kind !== 234);
+ case 242:
return childKind !== 245;
}
return indentByDefault;
@@ -59549,7 +61089,7 @@ var ts;
getCodeActions: function (context) {
var sourceFile = context.sourceFile;
var token = ts.getTokenAtPosition(sourceFile, context.span.start);
- if (token.kind !== 121) {
+ if (token.kind !== 122) {
return undefined;
}
var newPosition = getOpenBraceEnd(token.parent, sourceFile);
@@ -59564,7 +61104,7 @@ var ts;
getCodeActions: function (context) {
var sourceFile = context.sourceFile;
var token = ts.getTokenAtPosition(sourceFile, context.span.start);
- if (token.kind !== 97) {
+ if (token.kind !== 98) {
return undefined;
}
var constructor = ts.getContainingFunction(token);
@@ -59572,7 +61112,7 @@ var ts;
if (!superCall) {
return undefined;
}
- if (superCall.expression && superCall.expression.kind == 174) {
+ if (superCall.expression && superCall.expression.kind == 175) {
var arguments_1 = superCall.expression.arguments;
for (var i = 0; i < arguments_1.length; i++) {
if (arguments_1[i].expression === token) {
@@ -59596,7 +61136,7 @@ var ts;
changes: changes
}];
function findSuperCall(n) {
- if (n.kind === 202 && ts.isSuperCall(n.expression)) {
+ if (n.kind === 203 && ts.isSuperCall(n.expression)) {
return n;
}
if (ts.isFunctionLike(n)) {
@@ -59612,8 +61152,8 @@ var ts;
(function (ts) {
ts.servicesVersion = "0.5";
function createNode(kind, pos, end, parent) {
- var node = kind >= 139 ? new NodeObject(kind, pos, end) :
- kind === 69 ? new IdentifierObject(69, pos, end) :
+ var node = kind >= 140 ? new NodeObject(kind, pos, end) :
+ kind === 70 ? new IdentifierObject(70, pos, end) :
new TokenObject(kind, pos, end);
node.parent = parent;
return node;
@@ -59690,7 +61230,7 @@ var ts;
NodeObject.prototype.createChildren = function (sourceFile) {
var _this = this;
var children;
- if (this.kind >= 139) {
+ if (this.kind >= 140) {
ts.scanner.setText((sourceFile || this.getSourceFile()).text);
children = [];
var pos_3 = this.pos;
@@ -59748,7 +61288,7 @@ var ts;
return undefined;
}
var child = children[0];
- return child.kind < 139 ? child : child.getFirstToken(sourceFile);
+ return child.kind < 140 ? child : child.getFirstToken(sourceFile);
};
NodeObject.prototype.getLastToken = function (sourceFile) {
var children = this.getChildren(sourceFile);
@@ -59756,7 +61296,7 @@ var ts;
if (!child) {
return undefined;
}
- return child.kind < 139 ? child : child.getLastToken(sourceFile);
+ return child.kind < 140 ? child : child.getLastToken(sourceFile);
};
return NodeObject;
}());
@@ -59794,19 +61334,19 @@ var ts;
TokenOrIdentifierObject.prototype.getText = function (sourceFile) {
return (sourceFile || this.getSourceFile()).text.substring(this.getStart(), this.getEnd());
};
- TokenOrIdentifierObject.prototype.getChildCount = function (sourceFile) {
+ TokenOrIdentifierObject.prototype.getChildCount = function () {
return 0;
};
- TokenOrIdentifierObject.prototype.getChildAt = function (index, sourceFile) {
+ TokenOrIdentifierObject.prototype.getChildAt = function () {
return undefined;
};
- TokenOrIdentifierObject.prototype.getChildren = function (sourceFile) {
+ TokenOrIdentifierObject.prototype.getChildren = function () {
return ts.emptyArray;
};
- TokenOrIdentifierObject.prototype.getFirstToken = function (sourceFile) {
+ TokenOrIdentifierObject.prototype.getFirstToken = function () {
return undefined;
};
- TokenOrIdentifierObject.prototype.getLastToken = function (sourceFile) {
+ TokenOrIdentifierObject.prototype.getLastToken = function () {
return undefined;
};
return TokenOrIdentifierObject;
@@ -59827,7 +61367,7 @@ var ts;
};
SymbolObject.prototype.getDocumentationComment = function () {
if (this.documentationComment === undefined) {
- this.documentationComment = ts.JsDoc.getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & 4));
+ this.documentationComment = ts.JsDoc.getJsDocCommentsFromDeclarations(this.declarations);
}
return this.documentationComment;
};
@@ -59844,12 +61384,12 @@ var ts;
}(TokenOrIdentifierObject));
var IdentifierObject = (function (_super) {
__extends(IdentifierObject, _super);
- function IdentifierObject(kind, pos, end) {
+ function IdentifierObject(_kind, pos, end) {
return _super.call(this, pos, end) || this;
}
return IdentifierObject;
}(TokenOrIdentifierObject));
- IdentifierObject.prototype.kind = 69;
+ IdentifierObject.prototype.kind = 70;
var TypeObject = (function () {
function TypeObject(checker, flags) {
this.checker = checker;
@@ -59910,7 +61450,7 @@ var ts;
};
SignatureObject.prototype.getDocumentationComment = function () {
if (this.documentationComment === undefined) {
- this.documentationComment = this.declaration ? ts.JsDoc.getJsDocCommentsFromDeclarations([this.declaration], undefined, false) : [];
+ this.documentationComment = this.declaration ? ts.JsDoc.getJsDocCommentsFromDeclarations([this.declaration]) : [];
}
return this.documentationComment;
};
@@ -59958,9 +61498,9 @@ var ts;
if (result_6 !== undefined) {
return result_6;
}
- if (declaration.name.kind === 140) {
+ if (declaration.name.kind === 141) {
var expr = declaration.name.expression;
- if (expr.kind === 172) {
+ if (expr.kind === 173) {
return expr.name.text;
}
return getTextOfIdentifierOrLiteral(expr);
@@ -59970,7 +61510,7 @@ var ts;
}
function getTextOfIdentifierOrLiteral(node) {
if (node) {
- if (node.kind === 69 ||
+ if (node.kind === 70 ||
node.kind === 9 ||
node.kind === 8) {
return node.text;
@@ -59980,10 +61520,10 @@ var ts;
}
function visit(node) {
switch (node.kind) {
- case 220:
- case 179:
+ case 221:
+ case 180:
+ case 148:
case 147:
- case 146:
var functionDeclaration = node;
var declarationName = getDeclarationName(functionDeclaration);
if (declarationName) {
@@ -60000,30 +61540,30 @@ var ts;
ts.forEachChild(node, visit);
}
break;
- case 221:
- case 192:
case 222:
+ case 193:
case 223:
case 224:
case 225:
- case 229:
- case 238:
- case 234:
- case 229:
- case 231:
+ case 226:
+ case 230:
+ case 239:
+ case 235:
+ case 230:
case 232:
- case 149:
+ case 233:
case 150:
- case 159:
+ case 151:
+ case 160:
addDeclaration(node);
ts.forEachChild(node, visit);
break;
- case 142:
+ case 143:
if (!ts.hasModifier(node, 92)) {
break;
}
- case 218:
- case 169: {
+ case 219:
+ case 170: {
var decl = node;
if (ts.isBindingPattern(decl.name)) {
ts.forEachChild(decl.name, visit);
@@ -60033,23 +61573,23 @@ var ts;
visit(decl.initializer);
}
case 255:
+ case 146:
case 145:
- case 144:
addDeclaration(node);
break;
- case 236:
+ case 237:
if (node.exportClause) {
ts.forEach(node.exportClause.elements, visit);
}
break;
- case 230:
+ case 231:
var importClause = node.importClause;
if (importClause) {
if (importClause.name) {
addDeclaration(importClause);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 232) {
+ if (importClause.namedBindings.kind === 233) {
addDeclaration(importClause.namedBindings);
}
else {
@@ -60073,7 +61613,7 @@ var ts;
getSourceFileConstructor: function () { return SourceFileObject; },
getSymbolConstructor: function () { return SymbolObject; },
getTypeConstructor: function () { return TypeObject; },
- getSignatureConstructor: function () { return SignatureObject; }
+ getSignatureConstructor: function () { return SignatureObject; },
};
}
function toEditorSettings(optionsAsMap) {
@@ -60165,7 +61705,7 @@ var ts;
};
HostCache.prototype.getRootFileNames = function () {
var fileNames = [];
- this.fileNameToEntry.forEachValue(function (path, value) {
+ this.fileNameToEntry.forEachValue(function (_path, value) {
if (value) {
fileNames.push(value.hostFileName);
}
@@ -60195,7 +61735,7 @@ var ts;
var version = this.host.getScriptVersion(fileName);
var sourceFile;
if (this.currentFileName !== fileName) {
- sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, version, true, scriptKind);
+ sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 4, version, true, scriptKind);
}
else if (this.currentFileVersion !== version) {
var editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot);
@@ -60348,7 +61888,7 @@ var ts;
useCaseSensitiveFileNames: function () { return useCaseSensitivefileNames; },
getNewLine: function () { return ts.getNewLineOrDefaultFromHost(host); },
getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); },
- writeFile: function (fileName, data, writeByteOrderMark) { },
+ writeFile: function () { },
getCurrentDirectory: function () { return currentDirectory; },
fileExists: function (fileName) {
return hostCache.getOrCreateEntry(fileName) !== undefined;
@@ -60490,12 +62030,12 @@ var ts;
var symbol = typeChecker.getSymbolAtLocation(node);
if (!symbol || typeChecker.isUnknownSymbol(symbol)) {
switch (node.kind) {
- case 69:
- case 172:
- case 139:
- case 97:
- case 165:
- case 95:
+ case 70:
+ case 173:
+ case 140:
+ case 98:
+ case 166:
+ case 96:
var type = typeChecker.getTypeAtLocation(node);
if (type) {
return {
@@ -60616,23 +62156,23 @@ var ts;
function getSourceFile(fileName) {
return getNonBoundSourceFile(fileName);
}
- function getNameOrDottedNameSpan(fileName, startPos, endPos) {
+ function getNameOrDottedNameSpan(fileName, startPos, _endPos) {
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
var node = ts.getTouchingPropertyName(sourceFile, startPos);
if (node === sourceFile) {
return;
}
switch (node.kind) {
- case 172:
- case 139:
+ case 173:
+ case 140:
case 9:
- case 84:
- case 99:
- case 93:
- case 95:
- case 97:
- case 165:
- case 69:
+ case 85:
+ case 100:
+ case 94:
+ case 96:
+ case 98:
+ case 166:
+ case 70:
break;
default:
return;
@@ -60643,7 +62183,7 @@ var ts;
nodeForStartPos = nodeForStartPos.parent;
}
else if (ts.isNameOfModuleDeclaration(nodeForStartPos)) {
- if (nodeForStartPos.parent.parent.kind === 225 &&
+ if (nodeForStartPos.parent.parent.kind === 226 &&
nodeForStartPos.parent.parent.body === nodeForStartPos.parent) {
nodeForStartPos = nodeForStartPos.parent.parent.name;
}
@@ -60723,14 +62263,14 @@ var ts;
return result;
function getMatchingTokenKind(token) {
switch (token.kind) {
- case 15: return 16;
- case 17: return 18;
- case 19: return 20;
- case 25: return 27;
- case 16: return 15;
- case 18: return 17;
- case 20: return 19;
- case 27: return 25;
+ case 16: return 17;
+ case 18: return 19;
+ case 20: return 21;
+ case 26: return 28;
+ case 17: return 16;
+ case 19: return 18;
+ case 21: return 20;
+ case 28: return 26;
}
return undefined;
}
@@ -60933,13 +62473,13 @@ var ts;
sourceFile.nameTable = nameTable;
function walk(node) {
switch (node.kind) {
- case 69:
+ case 70:
nameTable[node.text] = nameTable[node.text] === undefined ? node.pos : -1;
break;
case 9:
case 8:
if (ts.isDeclarationName(node) ||
- node.parent.kind === 240 ||
+ node.parent.kind === 241 ||
isArgumentOfElementAccessExpression(node) ||
ts.isLiteralComputedPropertyDeclarationName(node)) {
nameTable[node.text] = nameTable[node.text] === undefined ? node.pos : -1;
@@ -60959,7 +62499,7 @@ var ts;
function isArgumentOfElementAccessExpression(node) {
return node &&
node.parent &&
- node.parent.kind === 173 &&
+ node.parent.kind === 174 &&
node.parent.argumentExpression === node;
}
function getDefaultLibFilePath(options) {
@@ -60974,6 +62514,933 @@ var ts;
}
initializeServices();
})(ts || (ts = {}));
+var debugObjectHost = (function () { return this; })();
+var ts;
+(function (ts) {
+ function logInternalError(logger, err) {
+ if (logger) {
+ logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message);
+ }
+ }
+ var ScriptSnapshotShimAdapter = (function () {
+ function ScriptSnapshotShimAdapter(scriptSnapshotShim) {
+ this.scriptSnapshotShim = scriptSnapshotShim;
+ }
+ ScriptSnapshotShimAdapter.prototype.getText = function (start, end) {
+ return this.scriptSnapshotShim.getText(start, end);
+ };
+ ScriptSnapshotShimAdapter.prototype.getLength = function () {
+ return this.scriptSnapshotShim.getLength();
+ };
+ ScriptSnapshotShimAdapter.prototype.getChangeRange = function (oldSnapshot) {
+ var oldSnapshotShim = oldSnapshot;
+ var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim);
+ if (encoded == null) {
+ return null;
+ }
+ var decoded = JSON.parse(encoded);
+ return ts.createTextChangeRange(ts.createTextSpan(decoded.span.start, decoded.span.length), decoded.newLength);
+ };
+ ScriptSnapshotShimAdapter.prototype.dispose = function () {
+ if ("dispose" in this.scriptSnapshotShim) {
+ this.scriptSnapshotShim.dispose();
+ }
+ };
+ return ScriptSnapshotShimAdapter;
+ }());
+ var LanguageServiceShimHostAdapter = (function () {
+ function LanguageServiceShimHostAdapter(shimHost) {
+ var _this = this;
+ this.shimHost = shimHost;
+ this.loggingEnabled = false;
+ this.tracingEnabled = false;
+ if ("getModuleResolutionsForFile" in this.shimHost) {
+ this.resolveModuleNames = function (moduleNames, containingFile) {
+ var resolutionsInFile = JSON.parse(_this.shimHost.getModuleResolutionsForFile(containingFile));
+ return ts.map(moduleNames, function (name) {
+ var result = ts.getProperty(resolutionsInFile, name);
+ return result ? { resolvedFileName: result } : undefined;
+ });
+ };
+ }
+ if ("directoryExists" in this.shimHost) {
+ this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); };
+ }
+ if ("getTypeReferenceDirectiveResolutionsForFile" in this.shimHost) {
+ this.resolveTypeReferenceDirectives = function (typeDirectiveNames, containingFile) {
+ var typeDirectivesForFile = JSON.parse(_this.shimHost.getTypeReferenceDirectiveResolutionsForFile(containingFile));
+ return ts.map(typeDirectiveNames, function (name) { return ts.getProperty(typeDirectivesForFile, name); });
+ };
+ }
+ }
+ LanguageServiceShimHostAdapter.prototype.log = function (s) {
+ if (this.loggingEnabled) {
+ this.shimHost.log(s);
+ }
+ };
+ LanguageServiceShimHostAdapter.prototype.trace = function (s) {
+ if (this.tracingEnabled) {
+ this.shimHost.trace(s);
+ }
+ };
+ LanguageServiceShimHostAdapter.prototype.error = function (s) {
+ this.shimHost.error(s);
+ };
+ LanguageServiceShimHostAdapter.prototype.getProjectVersion = function () {
+ if (!this.shimHost.getProjectVersion) {
+ return undefined;
+ }
+ return this.shimHost.getProjectVersion();
+ };
+ LanguageServiceShimHostAdapter.prototype.getTypeRootsVersion = function () {
+ if (!this.shimHost.getTypeRootsVersion) {
+ return 0;
+ }
+ return this.shimHost.getTypeRootsVersion();
+ };
+ LanguageServiceShimHostAdapter.prototype.useCaseSensitiveFileNames = function () {
+ return this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false;
+ };
+ LanguageServiceShimHostAdapter.prototype.getCompilationSettings = function () {
+ var settingsJson = this.shimHost.getCompilationSettings();
+ if (settingsJson == null || settingsJson == "") {
+ throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");
+ }
+ return JSON.parse(settingsJson);
+ };
+ LanguageServiceShimHostAdapter.prototype.getScriptFileNames = function () {
+ var encoded = this.shimHost.getScriptFileNames();
+ return this.files = JSON.parse(encoded);
+ };
+ LanguageServiceShimHostAdapter.prototype.getScriptSnapshot = function (fileName) {
+ var scriptSnapshot = this.shimHost.getScriptSnapshot(fileName);
+ return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot);
+ };
+ LanguageServiceShimHostAdapter.prototype.getScriptKind = function (fileName) {
+ if ("getScriptKind" in this.shimHost) {
+ return this.shimHost.getScriptKind(fileName);
+ }
+ else {
+ return 0;
+ }
+ };
+ LanguageServiceShimHostAdapter.prototype.getScriptVersion = function (fileName) {
+ return this.shimHost.getScriptVersion(fileName);
+ };
+ LanguageServiceShimHostAdapter.prototype.getLocalizedDiagnosticMessages = function () {
+ var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages();
+ if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") {
+ return null;
+ }
+ try {
+ return JSON.parse(diagnosticMessagesJson);
+ }
+ catch (e) {
+ this.log(e.description || "diagnosticMessages.generated.json has invalid JSON format");
+ return null;
+ }
+ };
+ LanguageServiceShimHostAdapter.prototype.getCancellationToken = function () {
+ var hostCancellationToken = this.shimHost.getCancellationToken();
+ return new ThrottledCancellationToken(hostCancellationToken);
+ };
+ LanguageServiceShimHostAdapter.prototype.getCurrentDirectory = function () {
+ return this.shimHost.getCurrentDirectory();
+ };
+ LanguageServiceShimHostAdapter.prototype.getDirectories = function (path) {
+ return JSON.parse(this.shimHost.getDirectories(path));
+ };
+ LanguageServiceShimHostAdapter.prototype.getDefaultLibFileName = function (options) {
+ return this.shimHost.getDefaultLibFileName(JSON.stringify(options));
+ };
+ LanguageServiceShimHostAdapter.prototype.readDirectory = function (path, extensions, exclude, include, depth) {
+ var pattern = ts.getFileMatcherPatterns(path, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory());
+ return JSON.parse(this.shimHost.readDirectory(path, JSON.stringify(extensions), JSON.stringify(pattern.basePaths), pattern.excludePattern, pattern.includeFilePattern, pattern.includeDirectoryPattern, depth));
+ };
+ LanguageServiceShimHostAdapter.prototype.readFile = function (path, encoding) {
+ return this.shimHost.readFile(path, encoding);
+ };
+ LanguageServiceShimHostAdapter.prototype.fileExists = function (path) {
+ return this.shimHost.fileExists(path);
+ };
+ return LanguageServiceShimHostAdapter;
+ }());
+ ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter;
+ var ThrottledCancellationToken = (function () {
+ function ThrottledCancellationToken(hostCancellationToken) {
+ this.hostCancellationToken = hostCancellationToken;
+ this.lastCancellationCheckTime = 0;
+ }
+ ThrottledCancellationToken.prototype.isCancellationRequested = function () {
+ var time = ts.timestamp();
+ var duration = Math.abs(time - this.lastCancellationCheckTime);
+ if (duration > 10) {
+ this.lastCancellationCheckTime = time;
+ return this.hostCancellationToken.isCancellationRequested();
+ }
+ return false;
+ };
+ return ThrottledCancellationToken;
+ }());
+ var CoreServicesShimHostAdapter = (function () {
+ function CoreServicesShimHostAdapter(shimHost) {
+ var _this = this;
+ this.shimHost = shimHost;
+ this.useCaseSensitiveFileNames = this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false;
+ if ("directoryExists" in this.shimHost) {
+ this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); };
+ }
+ if ("realpath" in this.shimHost) {
+ this.realpath = function (path) { return _this.shimHost.realpath(path); };
+ }
+ }
+ CoreServicesShimHostAdapter.prototype.readDirectory = function (rootDir, extensions, exclude, include, depth) {
+ try {
+ var pattern = ts.getFileMatcherPatterns(rootDir, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory());
+ return JSON.parse(this.shimHost.readDirectory(rootDir, JSON.stringify(extensions), JSON.stringify(pattern.basePaths), pattern.excludePattern, pattern.includeFilePattern, pattern.includeDirectoryPattern, depth));
+ }
+ catch (e) {
+ var results = [];
+ for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) {
+ var extension = extensions_2[_i];
+ for (var _a = 0, _b = this.readDirectoryFallback(rootDir, extension, exclude); _a < _b.length; _a++) {
+ var file = _b[_a];
+ if (!ts.contains(results, file)) {
+ results.push(file);
+ }
+ }
+ }
+ return results;
+ }
+ };
+ CoreServicesShimHostAdapter.prototype.fileExists = function (fileName) {
+ return this.shimHost.fileExists(fileName);
+ };
+ CoreServicesShimHostAdapter.prototype.readFile = function (fileName) {
+ return this.shimHost.readFile(fileName);
+ };
+ CoreServicesShimHostAdapter.prototype.readDirectoryFallback = function (rootDir, extension, exclude) {
+ return JSON.parse(this.shimHost.readDirectory(rootDir, extension, JSON.stringify(exclude)));
+ };
+ CoreServicesShimHostAdapter.prototype.getDirectories = function (path) {
+ return JSON.parse(this.shimHost.getDirectories(path));
+ };
+ return CoreServicesShimHostAdapter;
+ }());
+ ts.CoreServicesShimHostAdapter = CoreServicesShimHostAdapter;
+ function simpleForwardCall(logger, actionDescription, action, logPerformance) {
+ var start;
+ if (logPerformance) {
+ logger.log(actionDescription);
+ start = ts.timestamp();
+ }
+ var result = action();
+ if (logPerformance) {
+ var end = ts.timestamp();
+ logger.log(actionDescription + " completed in " + (end - start) + " msec");
+ if (typeof result === "string") {
+ var str = result;
+ if (str.length > 128) {
+ str = str.substring(0, 128) + "...";
+ }
+ logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'");
+ }
+ }
+ return result;
+ }
+ function forwardJSONCall(logger, actionDescription, action, logPerformance) {
+ return forwardCall(logger, actionDescription, true, action, logPerformance);
+ }
+ function forwardCall(logger, actionDescription, returnJson, action, logPerformance) {
+ try {
+ var result = simpleForwardCall(logger, actionDescription, action, logPerformance);
+ return returnJson ? JSON.stringify({ result: result }) : result;
+ }
+ catch (err) {
+ if (err instanceof ts.OperationCanceledException) {
+ return JSON.stringify({ canceled: true });
+ }
+ logInternalError(logger, err);
+ err.description = actionDescription;
+ return JSON.stringify({ error: err });
+ }
+ }
+ var ShimBase = (function () {
+ function ShimBase(factory) {
+ this.factory = factory;
+ factory.registerShim(this);
+ }
+ ShimBase.prototype.dispose = function (_dummy) {
+ this.factory.unregisterShim(this);
+ };
+ return ShimBase;
+ }());
+ function realizeDiagnostics(diagnostics, newLine) {
+ return diagnostics.map(function (d) { return realizeDiagnostic(d, newLine); });
+ }
+ ts.realizeDiagnostics = realizeDiagnostics;
+ function realizeDiagnostic(diagnostic, newLine) {
+ return {
+ message: ts.flattenDiagnosticMessageText(diagnostic.messageText, newLine),
+ start: diagnostic.start,
+ length: diagnostic.length,
+ category: ts.DiagnosticCategory[diagnostic.category].toLowerCase(),
+ code: diagnostic.code
+ };
+ }
+ var LanguageServiceShimObject = (function (_super) {
+ __extends(LanguageServiceShimObject, _super);
+ function LanguageServiceShimObject(factory, host, languageService) {
+ var _this = _super.call(this, factory) || this;
+ _this.host = host;
+ _this.languageService = languageService;
+ _this.logPerformance = false;
+ _this.logger = _this.host;
+ return _this;
+ }
+ LanguageServiceShimObject.prototype.forwardJSONCall = function (actionDescription, action) {
+ return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance);
+ };
+ LanguageServiceShimObject.prototype.dispose = function (dummy) {
+ this.logger.log("dispose()");
+ this.languageService.dispose();
+ this.languageService = null;
+ if (debugObjectHost && debugObjectHost.CollectGarbage) {
+ debugObjectHost.CollectGarbage();
+ this.logger.log("CollectGarbage()");
+ }
+ this.logger = null;
+ _super.prototype.dispose.call(this, dummy);
+ };
+ LanguageServiceShimObject.prototype.refresh = function (throwOnError) {
+ this.forwardJSONCall("refresh(" + throwOnError + ")", function () { return null; });
+ };
+ LanguageServiceShimObject.prototype.cleanupSemanticCache = function () {
+ var _this = this;
+ this.forwardJSONCall("cleanupSemanticCache()", function () {
+ _this.languageService.cleanupSemanticCache();
+ return null;
+ });
+ };
+ LanguageServiceShimObject.prototype.realizeDiagnostics = function (diagnostics) {
+ var newLine = ts.getNewLineOrDefaultFromHost(this.host);
+ return ts.realizeDiagnostics(diagnostics, newLine);
+ };
+ LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) {
+ var _this = this;
+ return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); });
+ };
+ LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) {
+ var _this = this;
+ return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); });
+ };
+ LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) {
+ var _this = this;
+ return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); });
+ };
+ LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) {
+ var _this = this;
+ return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); });
+ };
+ LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) {
+ var _this = this;
+ return this.forwardJSONCall("getSyntacticDiagnostics('" + fileName + "')", function () {
+ var diagnostics = _this.languageService.getSyntacticDiagnostics(fileName);
+ return _this.realizeDiagnostics(diagnostics);
+ });
+ };
+ LanguageServiceShimObject.prototype.getSemanticDiagnostics = function (fileName) {
+ var _this = this;
+ return this.forwardJSONCall("getSemanticDiagnostics('" + fileName + "')", function () {
+ var diagnostics = _this.languageService.getSemanticDiagnostics(fileName);
+ return _this.realizeDiagnostics(diagnostics);
+ });
+ };
+ LanguageServiceShimObject.prototype.getCompilerOptionsDiagnostics = function () {
+ var _this = this;
+ return this.forwardJSONCall("getCompilerOptionsDiagnostics()", function () {
+ var diagnostics = _this.languageService.getCompilerOptionsDiagnostics();
+ return _this.realizeDiagnostics(diagnostics);
+ });
+ };
+ LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) {
+ var _this = this;
+ return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); });
+ };
+ LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { return _this.languageService.getSignatureHelpItems(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getImplementationAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getImplementationAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getImplementationAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments) {
+ var _this = this;
+ return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); });
+ };
+ LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.isValidBraceCompletionAtPosition = function (fileName, position, openingBrace) {
+ var _this = this;
+ return this.forwardJSONCall("isValidBraceCompletionAtPosition('" + fileName + "', " + position + ", " + openingBrace + ")", function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); });
+ };
+ LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options) {
+ var _this = this;
+ return this.forwardJSONCall("getIndentationAtPosition('" + fileName + "', " + position + ")", function () {
+ var localOptions = JSON.parse(options);
+ return _this.languageService.getIndentationAtPosition(fileName, position, localOptions);
+ });
+ };
+ LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getReferencesAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.findReferences = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { return _this.languageService.findReferences(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) {
+ var _this = this;
+ return this.forwardJSONCall("getDocumentHighlights('" + fileName + "', " + position + ")", function () {
+ var results = _this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
+ var normalizedName = ts.normalizeSlashes(fileName).toLowerCase();
+ return ts.filter(results, function (r) { return ts.normalizeSlashes(r.fileName).toLowerCase() === normalizedName; });
+ });
+ };
+ LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName) {
+ var _this = this;
+ return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () { return _this.languageService.getCompletionEntryDetails(fileName, position, entryName); });
+ };
+ LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options) {
+ var _this = this;
+ return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () {
+ var localOptions = JSON.parse(options);
+ return _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions);
+ });
+ };
+ LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options) {
+ var _this = this;
+ return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () {
+ var localOptions = JSON.parse(options);
+ return _this.languageService.getFormattingEditsForDocument(fileName, localOptions);
+ });
+ };
+ LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options) {
+ var _this = this;
+ return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () {
+ var localOptions = JSON.parse(options);
+ return _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions);
+ });
+ };
+ LanguageServiceShimObject.prototype.getDocCommentTemplateAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getDocCommentTemplateAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDocCommentTemplateAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount, fileName) {
+ var _this = this;
+ return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ", " + fileName + ")", function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); });
+ };
+ LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) {
+ var _this = this;
+ return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { return _this.languageService.getNavigationBarItems(fileName); });
+ };
+ LanguageServiceShimObject.prototype.getNavigationTree = function (fileName) {
+ var _this = this;
+ return this.forwardJSONCall("getNavigationTree('" + fileName + "')", function () { return _this.languageService.getNavigationTree(fileName); });
+ };
+ LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) {
+ var _this = this;
+ return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { return _this.languageService.getOutliningSpans(fileName); });
+ };
+ LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) {
+ var _this = this;
+ return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); });
+ };
+ LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) {
+ var _this = this;
+ return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () { return _this.languageService.getEmitOutput(fileName); });
+ };
+ LanguageServiceShimObject.prototype.getEmitOutputObject = function (fileName) {
+ var _this = this;
+ return forwardCall(this.logger, "getEmitOutput('" + fileName + "')", false, function () { return _this.languageService.getEmitOutput(fileName); }, this.logPerformance);
+ };
+ return LanguageServiceShimObject;
+ }(ShimBase));
+ function convertClassifications(classifications) {
+ return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState };
+ }
+ var ClassifierShimObject = (function (_super) {
+ __extends(ClassifierShimObject, _super);
+ function ClassifierShimObject(factory, logger) {
+ var _this = _super.call(this, factory) || this;
+ _this.logger = logger;
+ _this.logPerformance = false;
+ _this.classifier = ts.createClassifier();
+ return _this;
+ }
+ ClassifierShimObject.prototype.getEncodedLexicalClassifications = function (text, lexState, syntacticClassifierAbsent) {
+ var _this = this;
+ return forwardJSONCall(this.logger, "getEncodedLexicalClassifications", function () { return convertClassifications(_this.classifier.getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent)); }, this.logPerformance);
+ };
+ ClassifierShimObject.prototype.getClassificationsForLine = function (text, lexState, classifyKeywordsInGenerics) {
+ var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics);
+ var result = "";
+ for (var _i = 0, _a = classification.entries; _i < _a.length; _i++) {
+ var item = _a[_i];
+ result += item.length + "\n";
+ result += item.classification + "\n";
+ }
+ result += classification.finalLexState;
+ return result;
+ };
+ return ClassifierShimObject;
+ }(ShimBase));
+ var CoreServicesShimObject = (function (_super) {
+ __extends(CoreServicesShimObject, _super);
+ function CoreServicesShimObject(factory, logger, host) {
+ var _this = _super.call(this, factory) || this;
+ _this.logger = logger;
+ _this.host = host;
+ _this.logPerformance = false;
+ return _this;
+ }
+ CoreServicesShimObject.prototype.forwardJSONCall = function (actionDescription, action) {
+ return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance);
+ };
+ CoreServicesShimObject.prototype.resolveModuleName = function (fileName, moduleName, compilerOptionsJson) {
+ var _this = this;
+ return this.forwardJSONCall("resolveModuleName('" + fileName + "')", function () {
+ var compilerOptions = JSON.parse(compilerOptionsJson);
+ var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
+ return {
+ resolvedFileName: result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined,
+ failedLookupLocations: result.failedLookupLocations
+ };
+ });
+ };
+ CoreServicesShimObject.prototype.resolveTypeReferenceDirective = function (fileName, typeReferenceDirective, compilerOptionsJson) {
+ var _this = this;
+ return this.forwardJSONCall("resolveTypeReferenceDirective(" + fileName + ")", function () {
+ var compilerOptions = JSON.parse(compilerOptionsJson);
+ var result = ts.resolveTypeReferenceDirective(typeReferenceDirective, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
+ return {
+ resolvedFileName: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.resolvedFileName : undefined,
+ primary: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.primary : true,
+ failedLookupLocations: result.failedLookupLocations
+ };
+ });
+ };
+ CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) {
+ var _this = this;
+ return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () {
+ var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()), true, true);
+ return {
+ referencedFiles: _this.convertFileReferences(result.referencedFiles),
+ importedFiles: _this.convertFileReferences(result.importedFiles),
+ ambientExternalModules: result.ambientExternalModules,
+ isLibFile: result.isLibFile,
+ typeReferenceDirectives: _this.convertFileReferences(result.typeReferenceDirectives)
+ };
+ });
+ };
+ CoreServicesShimObject.prototype.getAutomaticTypeDirectiveNames = function (compilerOptionsJson) {
+ var _this = this;
+ return this.forwardJSONCall("getAutomaticTypeDirectiveNames('" + compilerOptionsJson + "')", function () {
+ var compilerOptions = JSON.parse(compilerOptionsJson);
+ return ts.getAutomaticTypeDirectiveNames(compilerOptions, _this.host);
+ });
+ };
+ CoreServicesShimObject.prototype.convertFileReferences = function (refs) {
+ if (!refs) {
+ return undefined;
+ }
+ var result = [];
+ for (var _i = 0, refs_2 = refs; _i < refs_2.length; _i++) {
+ var ref = refs_2[_i];
+ result.push({
+ path: ts.normalizeSlashes(ref.fileName),
+ position: ref.pos,
+ length: ref.end - ref.pos
+ });
+ }
+ return result;
+ };
+ CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) {
+ var _this = this;
+ return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () {
+ var text = sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength());
+ var result = ts.parseConfigFileTextToJson(fileName, text);
+ if (result.error) {
+ return {
+ options: {},
+ typingOptions: {},
+ files: [],
+ raw: {},
+ errors: [realizeDiagnostic(result.error, "\r\n")]
+ };
+ }
+ var normalizedFileName = ts.normalizeSlashes(fileName);
+ var configFile = ts.parseJsonConfigFileContent(result.config, _this.host, ts.getDirectoryPath(normalizedFileName), {}, normalizedFileName);
+ return {
+ options: configFile.options,
+ typingOptions: configFile.typingOptions,
+ files: configFile.fileNames,
+ raw: configFile.raw,
+ errors: realizeDiagnostics(configFile.errors, "\r\n")
+ };
+ });
+ };
+ CoreServicesShimObject.prototype.getDefaultCompilationSettings = function () {
+ return this.forwardJSONCall("getDefaultCompilationSettings()", function () { return ts.getDefaultCompilerOptions(); });
+ };
+ CoreServicesShimObject.prototype.discoverTypings = function (discoverTypingsJson) {
+ var _this = this;
+ var getCanonicalFileName = ts.createGetCanonicalFileName(false);
+ return this.forwardJSONCall("discoverTypings()", function () {
+ var info = JSON.parse(discoverTypingsJson);
+ return ts.JsTyping.discoverTypings(_this.host, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), ts.toPath(info.safeListPath, info.safeListPath, getCanonicalFileName), info.packageNameToTypingLocation, info.typingOptions);
+ });
+ };
+ return CoreServicesShimObject;
+ }(ShimBase));
+ var TypeScriptServicesFactory = (function () {
+ function TypeScriptServicesFactory() {
+ this._shims = [];
+ }
+ TypeScriptServicesFactory.prototype.getServicesVersion = function () {
+ return ts.servicesVersion;
+ };
+ TypeScriptServicesFactory.prototype.createLanguageServiceShim = function (host) {
+ try {
+ if (this.documentRegistry === undefined) {
+ this.documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory());
+ }
+ var hostAdapter = new LanguageServiceShimHostAdapter(host);
+ var languageService = ts.createLanguageService(hostAdapter, this.documentRegistry);
+ return new LanguageServiceShimObject(this, host, languageService);
+ }
+ catch (err) {
+ logInternalError(host, err);
+ throw err;
+ }
+ };
+ TypeScriptServicesFactory.prototype.createClassifierShim = function (logger) {
+ try {
+ return new ClassifierShimObject(this, logger);
+ }
+ catch (err) {
+ logInternalError(logger, err);
+ throw err;
+ }
+ };
+ TypeScriptServicesFactory.prototype.createCoreServicesShim = function (host) {
+ try {
+ var adapter = new CoreServicesShimHostAdapter(host);
+ return new CoreServicesShimObject(this, host, adapter);
+ }
+ catch (err) {
+ logInternalError(host, err);
+ throw err;
+ }
+ };
+ TypeScriptServicesFactory.prototype.close = function () {
+ this._shims = [];
+ this.documentRegistry = undefined;
+ };
+ TypeScriptServicesFactory.prototype.registerShim = function (shim) {
+ this._shims.push(shim);
+ };
+ TypeScriptServicesFactory.prototype.unregisterShim = function (shim) {
+ for (var i = 0, n = this._shims.length; i < n; i++) {
+ if (this._shims[i] === shim) {
+ delete this._shims[i];
+ return;
+ }
+ }
+ throw new Error("Invalid operation");
+ };
+ return TypeScriptServicesFactory;
+ }());
+ ts.TypeScriptServicesFactory = TypeScriptServicesFactory;
+ if (typeof module !== "undefined" && module.exports) {
+ module.exports = ts;
+ }
+})(ts || (ts = {}));
+var TypeScript;
+(function (TypeScript) {
+ var Services;
+ (function (Services) {
+ Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory;
+ })(Services = TypeScript.Services || (TypeScript.Services = {}));
+})(TypeScript || (TypeScript = {}));
+var toolsVersion = "2.1";
+var ts;
+(function (ts) {
+ var server;
+ (function (server) {
+ (function (LogLevel) {
+ LogLevel[LogLevel["terse"] = 0] = "terse";
+ LogLevel[LogLevel["normal"] = 1] = "normal";
+ LogLevel[LogLevel["requestTime"] = 2] = "requestTime";
+ LogLevel[LogLevel["verbose"] = 3] = "verbose";
+ })(server.LogLevel || (server.LogLevel = {}));
+ var LogLevel = server.LogLevel;
+ server.emptyArray = [];
+ var Msg;
+ (function (Msg) {
+ Msg.Err = "Err";
+ Msg.Info = "Info";
+ Msg.Perf = "Perf";
+ })(Msg = server.Msg || (server.Msg = {}));
+ function getProjectRootPath(project) {
+ switch (project.projectKind) {
+ case server.ProjectKind.Configured:
+ return ts.getDirectoryPath(project.getProjectName());
+ case server.ProjectKind.Inferred:
+ return "";
+ case server.ProjectKind.External:
+ var projectName = ts.normalizeSlashes(project.getProjectName());
+ return project.projectService.host.fileExists(projectName) ? ts.getDirectoryPath(projectName) : projectName;
+ }
+ }
+ function createInstallTypingsRequest(project, typingOptions, cachePath) {
+ return {
+ projectName: project.getProjectName(),
+ fileNames: project.getFileNames(),
+ compilerOptions: project.getCompilerOptions(),
+ typingOptions: typingOptions,
+ projectRootPath: getProjectRootPath(project),
+ cachePath: cachePath,
+ kind: "discover"
+ };
+ }
+ server.createInstallTypingsRequest = createInstallTypingsRequest;
+ var Errors;
+ (function (Errors) {
+ function ThrowNoProject() {
+ throw new Error("No Project.");
+ }
+ Errors.ThrowNoProject = ThrowNoProject;
+ function ThrowProjectLanguageServiceDisabled() {
+ throw new Error("The project's language service is disabled.");
+ }
+ Errors.ThrowProjectLanguageServiceDisabled = ThrowProjectLanguageServiceDisabled;
+ function ThrowProjectDoesNotContainDocument(fileName, project) {
+ throw new Error("Project '" + project.getProjectName() + "' does not contain document '" + fileName + "'");
+ }
+ Errors.ThrowProjectDoesNotContainDocument = ThrowProjectDoesNotContainDocument;
+ })(Errors = server.Errors || (server.Errors = {}));
+ function getDefaultFormatCodeSettings(host) {
+ return {
+ indentSize: 4,
+ tabSize: 4,
+ newLineCharacter: host.newLine || "\n",
+ convertTabsToSpaces: true,
+ indentStyle: ts.IndentStyle.Smart,
+ insertSpaceAfterCommaDelimiter: true,
+ insertSpaceAfterSemicolonInForStatements: true,
+ insertSpaceBeforeAndAfterBinaryOperators: true,
+ insertSpaceAfterKeywordsInControlFlowStatements: true,
+ insertSpaceAfterFunctionKeywordForAnonymousFunctions: false,
+ insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false,
+ insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false,
+ insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false,
+ insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false,
+ placeOpenBraceOnNewLineForFunctions: false,
+ placeOpenBraceOnNewLineForControlBlocks: false,
+ };
+ }
+ server.getDefaultFormatCodeSettings = getDefaultFormatCodeSettings;
+ function mergeMaps(target, source) {
+ for (var key in source) {
+ if (ts.hasProperty(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
+ server.mergeMaps = mergeMaps;
+ function removeItemFromSet(items, itemToRemove) {
+ if (items.length === 0) {
+ return;
+ }
+ var index = items.indexOf(itemToRemove);
+ if (index < 0) {
+ return;
+ }
+ if (index === items.length - 1) {
+ items.pop();
+ }
+ else {
+ items[index] = items.pop();
+ }
+ }
+ server.removeItemFromSet = removeItemFromSet;
+ function toNormalizedPath(fileName) {
+ return ts.normalizePath(fileName);
+ }
+ server.toNormalizedPath = toNormalizedPath;
+ function normalizedPathToPath(normalizedPath, currentDirectory, getCanonicalFileName) {
+ var f = ts.isRootedDiskPath(normalizedPath) ? normalizedPath : ts.getNormalizedAbsolutePath(normalizedPath, currentDirectory);
+ return getCanonicalFileName(f);
+ }
+ server.normalizedPathToPath = normalizedPathToPath;
+ function asNormalizedPath(fileName) {
+ return fileName;
+ }
+ server.asNormalizedPath = asNormalizedPath;
+ function createNormalizedPathMap() {
+ var map = Object.create(null);
+ return {
+ get: function (path) {
+ return map[path];
+ },
+ set: function (path, value) {
+ map[path] = value;
+ },
+ contains: function (path) {
+ return ts.hasProperty(map, path);
+ },
+ remove: function (path) {
+ delete map[path];
+ }
+ };
+ }
+ server.createNormalizedPathMap = createNormalizedPathMap;
+ function throwLanguageServiceIsDisabledError() {
+ throw new Error("LanguageService is disabled");
+ }
+ server.nullLanguageService = {
+ cleanupSemanticCache: throwLanguageServiceIsDisabledError,
+ getSyntacticDiagnostics: throwLanguageServiceIsDisabledError,
+ getSemanticDiagnostics: throwLanguageServiceIsDisabledError,
+ getCompilerOptionsDiagnostics: throwLanguageServiceIsDisabledError,
+ getSyntacticClassifications: throwLanguageServiceIsDisabledError,
+ getEncodedSyntacticClassifications: throwLanguageServiceIsDisabledError,
+ getSemanticClassifications: throwLanguageServiceIsDisabledError,
+ getEncodedSemanticClassifications: throwLanguageServiceIsDisabledError,
+ getCompletionsAtPosition: throwLanguageServiceIsDisabledError,
+ findReferences: throwLanguageServiceIsDisabledError,
+ getCompletionEntryDetails: throwLanguageServiceIsDisabledError,
+ getQuickInfoAtPosition: throwLanguageServiceIsDisabledError,
+ findRenameLocations: throwLanguageServiceIsDisabledError,
+ getNameOrDottedNameSpan: throwLanguageServiceIsDisabledError,
+ getBreakpointStatementAtPosition: throwLanguageServiceIsDisabledError,
+ getBraceMatchingAtPosition: throwLanguageServiceIsDisabledError,
+ getSignatureHelpItems: throwLanguageServiceIsDisabledError,
+ getDefinitionAtPosition: throwLanguageServiceIsDisabledError,
+ getRenameInfo: throwLanguageServiceIsDisabledError,
+ getTypeDefinitionAtPosition: throwLanguageServiceIsDisabledError,
+ getReferencesAtPosition: throwLanguageServiceIsDisabledError,
+ getDocumentHighlights: throwLanguageServiceIsDisabledError,
+ getOccurrencesAtPosition: throwLanguageServiceIsDisabledError,
+ getNavigateToItems: throwLanguageServiceIsDisabledError,
+ getNavigationBarItems: throwLanguageServiceIsDisabledError,
+ getNavigationTree: throwLanguageServiceIsDisabledError,
+ getOutliningSpans: throwLanguageServiceIsDisabledError,
+ getTodoComments: throwLanguageServiceIsDisabledError,
+ getIndentationAtPosition: throwLanguageServiceIsDisabledError,
+ getFormattingEditsForRange: throwLanguageServiceIsDisabledError,
+ getFormattingEditsForDocument: throwLanguageServiceIsDisabledError,
+ getFormattingEditsAfterKeystroke: throwLanguageServiceIsDisabledError,
+ getDocCommentTemplateAtPosition: throwLanguageServiceIsDisabledError,
+ isValidBraceCompletionAtPosition: throwLanguageServiceIsDisabledError,
+ getEmitOutput: throwLanguageServiceIsDisabledError,
+ getProgram: throwLanguageServiceIsDisabledError,
+ getNonBoundSourceFile: throwLanguageServiceIsDisabledError,
+ dispose: throwLanguageServiceIsDisabledError,
+ getCompletionEntrySymbol: throwLanguageServiceIsDisabledError,
+ getImplementationAtPosition: throwLanguageServiceIsDisabledError,
+ getSourceFile: throwLanguageServiceIsDisabledError,
+ getCodeFixesAtPosition: throwLanguageServiceIsDisabledError
+ };
+ server.nullLanguageServiceHost = {
+ setCompilationSettings: function () { return undefined; },
+ notifyFileRemoved: function () { return undefined; }
+ };
+ function isInferredProjectName(name) {
+ return /dev\/null\/inferredProject\d+\*/.test(name);
+ }
+ server.isInferredProjectName = isInferredProjectName;
+ function makeInferredProjectName(counter) {
+ return "/dev/null/inferredProject" + counter + "*";
+ }
+ server.makeInferredProjectName = makeInferredProjectName;
+ var ThrottledOperations = (function () {
+ function ThrottledOperations(host) {
+ this.host = host;
+ this.pendingTimeouts = ts.createMap();
+ }
+ ThrottledOperations.prototype.schedule = function (operationId, delay, cb) {
+ if (ts.hasProperty(this.pendingTimeouts, operationId)) {
+ this.host.clearTimeout(this.pendingTimeouts[operationId]);
+ }
+ this.pendingTimeouts[operationId] = this.host.setTimeout(ThrottledOperations.run, delay, this, operationId, cb);
+ };
+ ThrottledOperations.run = function (self, operationId, cb) {
+ delete self.pendingTimeouts[operationId];
+ cb();
+ };
+ return ThrottledOperations;
+ }());
+ server.ThrottledOperations = ThrottledOperations;
+ var GcTimer = (function () {
+ function GcTimer(host, delay, logger) {
+ this.host = host;
+ this.delay = delay;
+ this.logger = logger;
+ }
+ GcTimer.prototype.scheduleCollect = function () {
+ if (!this.host.gc || this.timerId != undefined) {
+ return;
+ }
+ this.timerId = this.host.setTimeout(GcTimer.run, this.delay, this);
+ };
+ GcTimer.run = function (self) {
+ self.timerId = undefined;
+ var log = self.logger.hasLevel(LogLevel.requestTime);
+ var before = log && self.host.getMemoryUsage();
+ self.host.gc();
+ if (log) {
+ var after = self.host.getMemoryUsage();
+ self.logger.perftrc("GC::before " + before + ", after " + after);
+ }
+ };
+ return GcTimer;
+ }());
+ server.GcTimer = GcTimer;
+ })(server = ts.server || (ts.server = {}));
+})(ts || (ts = {}));
var ts;
(function (ts) {
var server;
@@ -61045,7 +63512,6 @@ var ts;
if (this.containingProjects.length === 0) {
return server.Errors.ThrowNoProject();
}
- ts.Debug.assert(this.containingProjects.length !== 0);
return this.containingProjects[0];
};
ScriptInfo.prototype.setFormatOptions = function (formatSettings) {
@@ -61077,12 +63543,12 @@ var ts;
var snap = this.snap();
this.host.writeFile(fileName, snap.getText(0, snap.getLength()));
};
- ScriptInfo.prototype.reloadFromFile = function () {
+ ScriptInfo.prototype.reloadFromFile = function (tempFileName) {
if (this.hasMixedContent) {
this.reload("");
}
else {
- this.svc.reloadFromFile(this.fileName);
+ this.svc.reloadFromFile(tempFileName || this.fileName);
this.markContainingProjectsAsDirty();
}
};
@@ -61294,8 +63760,8 @@ var ts;
(function (server) {
server.nullTypingsInstaller = {
enqueueInstallTypingsRequest: function () { },
- attach: function (projectService) { },
- onProjectClosed: function (p) { },
+ attach: function () { },
+ onProjectClosed: function () { },
globalTypingsCacheLocation: undefined
};
var TypingsCacheEntry = (function () {
@@ -61411,7 +63877,7 @@ var ts;
BuilderFileInfo.prototype.containsOnlyAmbientModules = function (sourceFile) {
for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
var statement = _a[_i];
- if (statement.kind !== 225 || statement.name.kind !== 9) {
+ if (statement.kind !== 226 || statement.name.kind !== 9) {
return false;
}
}
@@ -61473,7 +63939,7 @@ var ts;
this.fileInfos.remove(path);
};
AbstractBuilder.prototype.forEachFileInfo = function (action) {
- this.fileInfos.forEachValue(function (path, value) { return action(value); });
+ this.fileInfos.forEachValue(function (_path, value) { return action(value); });
};
AbstractBuilder.prototype.emitFile = function (scriptInfo, writeFile) {
var fileInfo = this.getFileInfo(scriptInfo.path);
@@ -62037,11 +64503,11 @@ var ts;
this.markAsDirty();
}
};
- Project.prototype.reloadScript = function (filename) {
+ Project.prototype.reloadScript = function (filename, tempFileName) {
var script = this.projectService.getScriptInfoForNormalizedPath(filename);
if (script) {
ts.Debug.assert(script.isAttached(this));
- script.reloadFromFile();
+ script.reloadFromFile(tempFileName);
return true;
}
return false;
@@ -62332,6 +64798,66 @@ var ts;
var server;
(function (server) {
server.maxProgramSizeForNonTsFiles = 20 * 1024 * 1024;
+ function prepareConvertersForEnumLikeCompilerOptions(commandLineOptions) {
+ var map = ts.createMap();
+ for (var _i = 0, commandLineOptions_1 = commandLineOptions; _i < commandLineOptions_1.length; _i++) {
+ var option = commandLineOptions_1[_i];
+ if (typeof option.type === "object") {
+ var optionMap = option.type;
+ for (var id in optionMap) {
+ ts.Debug.assert(typeof optionMap[id] === "number");
+ }
+ map[option.name] = optionMap;
+ }
+ }
+ return map;
+ }
+ var compilerOptionConverters = prepareConvertersForEnumLikeCompilerOptions(ts.optionDeclarations);
+ var indentStyle = ts.createMap({
+ "none": ts.IndentStyle.None,
+ "block": ts.IndentStyle.Block,
+ "smart": ts.IndentStyle.Smart
+ });
+ function convertFormatOptions(protocolOptions) {
+ if (typeof protocolOptions.indentStyle === "string") {
+ protocolOptions.indentStyle = indentStyle[protocolOptions.indentStyle.toLowerCase()];
+ ts.Debug.assert(protocolOptions.indentStyle !== undefined);
+ }
+ return protocolOptions;
+ }
+ server.convertFormatOptions = convertFormatOptions;
+ function convertCompilerOptions(protocolOptions) {
+ for (var id in compilerOptionConverters) {
+ var propertyValue = protocolOptions[id];
+ if (typeof propertyValue === "string") {
+ var mappedValues = compilerOptionConverters[id];
+ protocolOptions[id] = mappedValues[propertyValue.toLowerCase()];
+ }
+ }
+ return protocolOptions;
+ }
+ server.convertCompilerOptions = convertCompilerOptions;
+ function tryConvertScriptKindName(scriptKindName) {
+ return typeof scriptKindName === "string"
+ ? convertScriptKindName(scriptKindName)
+ : scriptKindName;
+ }
+ server.tryConvertScriptKindName = tryConvertScriptKindName;
+ function convertScriptKindName(scriptKindName) {
+ switch (scriptKindName) {
+ case "JS":
+ return 1;
+ case "JSX":
+ return 2;
+ case "TS":
+ return 3;
+ case "TSX":
+ return 4;
+ default:
+ return 0;
+ }
+ }
+ server.convertScriptKindName = convertScriptKindName;
function combineProjectOutput(projects, action, comparer, areEqual) {
var result = projects.reduce(function (previous, current) { return ts.concatenate(previous, action(current)); }, []).sort(comparer);
return projects.length > 1 ? ts.deduplicate(result, areEqual) : result;
@@ -62344,7 +64870,7 @@ var ts;
};
var externalFilePropertyReader = {
getFileName: function (x) { return x.fileName; },
- getScriptKind: function (x) { return x.scriptKind; },
+ getScriptKind: function (x) { return tryConvertScriptKindName(x.scriptKind); },
hasMixedContent: function (x) { return x.hasMixedContent; }
};
function findProjectByName(projectName, projects) {
@@ -62429,6 +64955,9 @@ var ts;
ProjectService.prototype.ensureInferredProjectsUpToDate_TestOnly = function () {
this.ensureInferredProjectsUpToDate();
};
+ ProjectService.prototype.getCompilerOptionsForInferredProjects = function () {
+ return this.compilerOptionsForInferredProjects;
+ };
ProjectService.prototype.updateTypingsForProject = function (response) {
var project = this.findProject(response.projectName);
if (!project) {
@@ -62445,11 +64974,11 @@ var ts;
}
};
ProjectService.prototype.setCompilerOptionsForInferredProjects = function (projectCompilerOptions) {
- this.compilerOptionsForInferredProjects = projectCompilerOptions;
+ this.compilerOptionsForInferredProjects = convertCompilerOptions(projectCompilerOptions);
this.compileOnSaveForInferredProjects = projectCompilerOptions.compileOnSave;
for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) {
var proj = _a[_i];
- proj.setCompilerOptions(projectCompilerOptions);
+ proj.setCompilerOptions(this.compilerOptionsForInferredProjects);
proj.compileOnSaveEnabled = projectCompilerOptions.compileOnSave;
}
this.updateProjectGraphs(this.inferredProjects);
@@ -62573,12 +65102,12 @@ var ts;
return;
}
this.logger.info("Detected source file changes: " + fileName);
- this.throttledOperations.schedule(project.configFileName, 250, function () { return _this.handleChangeInSourceFileForConfiguredProject(project); });
+ this.throttledOperations.schedule(project.configFileName, 250, function () { return _this.handleChangeInSourceFileForConfiguredProject(project, fileName); });
};
- ProjectService.prototype.handleChangeInSourceFileForConfiguredProject = function (project) {
+ ProjectService.prototype.handleChangeInSourceFileForConfiguredProject = function (project, triggerFile) {
var _this = this;
var _a = this.convertConfigFileContentToProjectOptions(project.configFileName), projectOptions = _a.projectOptions, configFileErrors = _a.configFileErrors;
- this.reportConfigFileDiagnostics(project.getProjectName(), configFileErrors);
+ this.reportConfigFileDiagnostics(project.getProjectName(), configFileErrors, triggerFile);
var newRootFiles = projectOptions.files.map((function (f) { return _this.getCanonicalFileName(f); }));
var currentRootFiles = project.getRootFiles().map((function (f) { return _this.getCanonicalFileName(f); }));
if (!ts.arrayIsEqualTo(currentRootFiles.sort(), newRootFiles.sort())) {
@@ -62598,7 +65127,7 @@ var ts;
return;
}
var configFileErrors = this.convertConfigFileContentToProjectOptions(fileName).configFileErrors;
- this.reportConfigFileDiagnostics(fileName, configFileErrors);
+ this.reportConfigFileDiagnostics(fileName, configFileErrors, fileName);
this.logger.info("Detected newly added tsconfig file: " + fileName);
this.reloadProjects();
};
@@ -62829,7 +65358,8 @@ var ts;
return false;
};
ProjectService.prototype.createAndAddExternalProject = function (projectFileName, files, options, typingOptions) {
- var project = new server.ExternalProject(projectFileName, this, this.documentRegistry, options, !this.exceededTotalSizeLimitForNonTsFiles(options, files, externalFilePropertyReader), options.compileOnSave === undefined ? true : options.compileOnSave);
+ var compilerOptions = convertCompilerOptions(options);
+ var project = new server.ExternalProject(projectFileName, this, this.documentRegistry, compilerOptions, !this.exceededTotalSizeLimitForNonTsFiles(compilerOptions, files, externalFilePropertyReader), options.compileOnSave === undefined ? true : options.compileOnSave);
this.addFilesToProjectAndUpdateGraph(project, files, externalFilePropertyReader, undefined, typingOptions, undefined);
this.externalProjects.push(project);
return project;
@@ -63051,7 +65581,7 @@ var ts;
if (args.file) {
var info = this.getScriptInfoForNormalizedPath(server.toNormalizedPath(args.file));
if (info) {
- info.setFormatOptions(args.formatOptions);
+ info.setFormatOptions(convertFormatOptions(args.formatOptions));
this.logger.info("Host configuration update for file " + args.file);
}
}
@@ -63061,7 +65591,7 @@ var ts;
this.logger.info("Host information " + args.hostInfo);
}
if (args.formatOptions) {
- server.mergeMaps(this.hostConfiguration.formatCodeOptions, args.formatOptions);
+ server.mergeMaps(this.hostConfiguration.formatCodeOptions, convertFormatOptions(args.formatOptions));
this.logger.info("Format host information updated");
}
}
@@ -63152,7 +65682,7 @@ var ts;
var scriptInfo = this.getScriptInfo(file.fileName);
ts.Debug.assert(!scriptInfo || !scriptInfo.isOpen);
var normalizedPath = scriptInfo ? scriptInfo.fileName : server.toNormalizedPath(file.fileName);
- this.openClientFileWithNormalizedPath(normalizedPath, file.content, file.scriptKind, file.hasMixedContent);
+ this.openClientFileWithNormalizedPath(normalizedPath, file.content, tryConvertScriptKindName(file.scriptKind), file.hasMixedContent);
}
}
if (changedFiles) {
@@ -63237,7 +65767,7 @@ var ts;
var exisingConfigFiles;
if (externalProject) {
if (!tsConfigFiles) {
- this.updateNonInferredProject(externalProject, proj.rootFiles, externalFilePropertyReader, proj.options, proj.typingOptions, proj.options.compileOnSave, undefined);
+ this.updateNonInferredProject(externalProject, proj.rootFiles, externalFilePropertyReader, convertCompilerOptions(proj.options), proj.typingOptions, proj.options.compileOnSave, undefined);
return;
}
this.closeExternalProject(proj.projectFileName, true);
@@ -63523,23 +66053,7 @@ var ts;
return _this.requiredResponse(_this.getRenameInfo(request.arguments));
},
_a[CommandNames.Open] = function (request) {
- var openArgs = request.arguments;
- var scriptKind;
- switch (openArgs.scriptKindName) {
- case "TS":
- scriptKind = 3;
- break;
- case "JS":
- scriptKind = 1;
- break;
- case "TSX":
- scriptKind = 4;
- break;
- case "JSX":
- scriptKind = 2;
- break;
- }
- _this.openClientFile(server.toNormalizedPath(openArgs.file), openArgs.fileContent, scriptKind);
+ _this.openClientFile(server.toNormalizedPath(request.arguments.file), request.arguments.fileContent, server.convertScriptKindName(request.arguments.scriptKindName));
return _this.notRequired();
},
_a[CommandNames.Quickinfo] = function (request) {
@@ -63611,7 +66125,7 @@ var ts;
_a[CommandNames.EncodedSemanticClassificationsFull] = function (request) {
return _this.requiredResponse(_this.getEncodedSemanticClassifications(request.arguments));
},
- _a[CommandNames.Cleanup] = function (request) {
+ _a[CommandNames.Cleanup] = function () {
_this.cleanup();
return _this.requiredResponse(true);
},
@@ -63686,12 +66200,13 @@ var ts;
return _this.requiredResponse(_this.getDocumentHighlights(request.arguments, false));
},
_a[CommandNames.CompilerOptionsForInferredProjects] = function (request) {
- return _this.requiredResponse(_this.setCompilerOptionsForInferredProjects(request.arguments));
+ _this.setCompilerOptionsForInferredProjects(request.arguments);
+ return _this.requiredResponse(true);
},
_a[CommandNames.ProjectInfo] = function (request) {
return _this.requiredResponse(_this.getProjectInfo(request.arguments));
},
- _a[CommandNames.ReloadProjects] = function (request) {
+ _a[CommandNames.ReloadProjects] = function () {
_this.projectService.reloadProjects();
return _this.notRequired();
},
@@ -63701,7 +66216,7 @@ var ts;
_a[CommandNames.GetCodeFixesFull] = function (request) {
return _this.requiredResponse(_this.getCodeFixes(request.arguments, false));
},
- _a[CommandNames.GetSupportedCodeFixes] = function (request) {
+ _a[CommandNames.GetSupportedCodeFixes] = function () {
return _this.requiredResponse(_this.getSupportedCodeFixes());
},
_a));
@@ -63763,7 +66278,7 @@ var ts;
seq: 0,
type: "event",
event: eventName,
- body: info
+ body: info,
};
this.send(ev);
};
@@ -63774,7 +66289,7 @@ var ts;
type: "response",
command: cmdName,
request_seq: reqSeq,
- success: !errorMsg
+ success: !errorMsg,
};
if (!errorMsg) {
res.body = info;
@@ -63899,9 +66414,9 @@ var ts;
endLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start + d.length)
}); });
};
- Session.prototype.getDiagnosticsWorker = function (args, selector, includeLinePosition) {
+ Session.prototype.getDiagnosticsWorker = function (args, isSemantic, selector, includeLinePosition) {
var _a = this.getFileAndProject(args), project = _a.project, file = _a.file;
- if (shouldSkipSematicCheck(project)) {
+ if (isSemantic && shouldSkipSematicCheck(project)) {
return [];
}
var scriptInfo = project.getScriptInfoForNormalizedPath(file);
@@ -63985,15 +66500,15 @@ var ts;
start: start,
end: end,
file: fileName,
- isWriteAccess: isWriteAccess
+ isWriteAccess: isWriteAccess,
};
});
};
Session.prototype.getSyntacticDiagnosticsSync = function (args) {
- return this.getDiagnosticsWorker(args, function (project, file) { return project.getLanguageService().getSyntacticDiagnostics(file); }, args.includeLinePosition);
+ return this.getDiagnosticsWorker(args, false, function (project, file) { return project.getLanguageService().getSyntacticDiagnostics(file); }, args.includeLinePosition);
};
Session.prototype.getSemanticDiagnosticsSync = function (args) {
- return this.getDiagnosticsWorker(args, function (project, file) { return project.getLanguageService().getSemanticDiagnostics(file); }, args.includeLinePosition);
+ return this.getDiagnosticsWorker(args, true, function (project, file) { return project.getLanguageService().getSemanticDiagnostics(file); }, args.includeLinePosition);
};
Session.prototype.getDocumentHighlights = function (args, simplifiedResult) {
var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
@@ -64090,7 +66605,7 @@ var ts;
return {
file: location.fileName,
start: locationScriptInfo.positionToLineOffset(location.textSpan.start),
- end: locationScriptInfo.positionToLineOffset(ts.textSpanEnd(location.textSpan))
+ end: locationScriptInfo.positionToLineOffset(ts.textSpanEnd(location.textSpan)),
};
});
}, compareRenameLocation, function (a, b) { return a.file === b.file && a.start.line === b.start.line && a.start.offset === b.start.offset; });
@@ -64204,7 +66719,7 @@ var ts;
if (this.eventHander) {
this.eventHander({
eventName: "configFileDiag",
- data: { fileName: fileName, configFileName: configFileName, diagnostics: configFileErrors || [] }
+ data: { triggerFile: fileName, configFileName: configFileName, diagnostics: configFileErrors || [] }
});
}
};
@@ -64244,7 +66759,7 @@ var ts;
Session.prototype.getIndentation = function (args) {
var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project;
var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file));
- var options = args.options || this.projectService.getFormatCodeOptions(file);
+ var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file);
var indentation = project.getLanguageService(false).getIndentationAtPosition(file, position, options);
return { position: position, indentation: indentation };
};
@@ -64279,7 +66794,7 @@ var ts;
start: scriptInfo.positionToLineOffset(quickInfo.textSpan.start),
end: scriptInfo.positionToLineOffset(ts.textSpanEnd(quickInfo.textSpan)),
displayString: displayString,
- documentation: docString
+ documentation: docString,
};
}
else {
@@ -64300,17 +66815,17 @@ var ts;
};
Session.prototype.getFormattingEditsForRangeFull = function (args) {
var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project;
- var options = args.options || this.projectService.getFormatCodeOptions(file);
+ var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file);
return project.getLanguageService(false).getFormattingEditsForRange(file, args.position, args.endPosition, options);
};
Session.prototype.getFormattingEditsForDocumentFull = function (args) {
var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project;
- var options = args.options || this.projectService.getFormatCodeOptions(file);
+ var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file);
return project.getLanguageService(false).getFormattingEditsForDocument(file, options);
};
Session.prototype.getFormattingEditsAfterKeystrokeFull = function (args) {
var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project;
- var options = args.options || this.projectService.getFormatCodeOptions(file);
+ var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file);
return project.getLanguageService(false).getFormattingEditsAfterKeystroke(file, args.position, args.key, options);
};
Session.prototype.getFormattingEditsAfterKeystroke = function (args) {
@@ -64377,7 +66892,7 @@ var ts;
result.push({ name: name_53, kind: kind, kindModifiers: kindModifiers, sortText: sortText, replacementSpan: convertedSpan });
}
return result;
- }, []).sort(function (a, b) { return a.name.localeCompare(b.name); });
+ }, []).sort(function (a, b) { return ts.compareStrings(a.name, b.name); });
}
else {
return completions;
@@ -64440,7 +66955,7 @@ var ts;
},
selectedItemIndex: helpItems.selectedItemIndex,
argumentIndex: helpItems.argumentIndex,
- argumentCount: helpItems.argumentCount
+ argumentCount: helpItems.argumentCount,
};
}
else {
@@ -64477,10 +66992,11 @@ var ts;
};
Session.prototype.reload = function (args, reqSeq) {
var file = server.toNormalizedPath(args.file);
+ var tempFileName = args.tmpfile && server.toNormalizedPath(args.tmpfile);
var project = this.projectService.getDefaultProjectForFile(file, true);
if (project) {
this.changeSeq++;
- if (project.reloadScript(file)) {
+ if (project.reloadScript(file, tempFileName)) {
this.output(undefined, CommandNames.Reload, reqSeq);
}
}
@@ -64561,7 +67077,7 @@ var ts;
kind: navItem.kind,
file: navItem.fileName,
start: start,
- end: end
+ end: end,
};
if (navItem.kindModifiers && (navItem.kindModifiers !== "")) {
bakedItem.kindModifiers = navItem.kindModifiers;
@@ -64670,7 +67186,7 @@ var ts;
if (languageServiceDisabled) {
return;
}
- var fileNamesInProject = fileNames.filter(function (value, index, array) { return value.indexOf("lib.d.ts") < 0; });
+ var fileNamesInProject = fileNames.filter(function (value) { return value.indexOf("lib.d.ts") < 0; });
var highPriorityFiles = [];
var mediumPriorityFiles = [];
var lowPriorityFiles = [];
@@ -64790,7 +67306,7 @@ var ts;
this.goSubtree = true;
this.done = false;
}
- BaseLineIndexWalker.prototype.leaf = function (rangeStart, rangeLength, ll) {
+ BaseLineIndexWalker.prototype.leaf = function (_rangeStart, _rangeLength, _ll) {
};
return BaseLineIndexWalker;
}());
@@ -64885,14 +67401,14 @@ var ts;
}
return this.lineIndex;
};
- EditWalker.prototype.post = function (relativeStart, relativeLength, lineCollection, parent, nodeType) {
+ EditWalker.prototype.post = function (_relativeStart, _relativeLength, lineCollection) {
if (lineCollection === this.lineCollectionAtBranch) {
this.state = CharRangeSection.End;
}
this.stack.length--;
return undefined;
};
- EditWalker.prototype.pre = function (relativeStart, relativeLength, lineCollection, parent, nodeType) {
+ EditWalker.prototype.pre = function (_relativeStart, _relativeLength, lineCollection, _parent, nodeType) {
var currentNode = this.stack[this.stack.length - 1];
if ((this.state === CharRangeSection.Entire) && (nodeType === CharRangeSection.Start)) {
this.state = CharRangeSection.Start;
@@ -65117,7 +67633,7 @@ var ts;
var starts = [-1];
var count = 1;
var pos = 0;
- this.index.every(function (ll, s, len) {
+ this.index.every(function (ll) {
starts[count] = pos;
count++;
pos += ll.text.length;
@@ -65411,7 +67927,7 @@ var ts;
if (!childInfo.child) {
return {
line: lineNumber,
- offset: charOffset
+ offset: charOffset,
};
}
else if (childInfo.childIndex < this.children.length) {
@@ -65645,7 +68161,7 @@ var ts;
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
- terminal: false
+ terminal: false,
});
var Logger = (function () {
function Logger(logFilename, traceToConsole, level) {
@@ -65722,7 +68238,6 @@ var ts;
function NodeTypingsInstaller(logger, eventPort, globalTypingsCacheLocation, newLine) {
var _this = this;
this.logger = logger;
- this.eventPort = eventPort;
this.globalTypingsCacheLocation = globalTypingsCacheLocation;
this.newLine = newLine;
if (eventPort) {
@@ -65784,8 +68299,10 @@ var ts;
}());
var IOSession = (function (_super) {
__extends(IOSession, _super);
- function IOSession(host, cancellationToken, installerEventPort, canUseEvents, useSingleInferredProject, globalTypingsCacheLocation, logger) {
- return _super.call(this, host, cancellationToken, useSingleInferredProject, new NodeTypingsInstaller(logger, installerEventPort, globalTypingsCacheLocation, host.newLine), Buffer.byteLength, process.hrtime, logger, canUseEvents) || this;
+ function IOSession(host, cancellationToken, installerEventPort, canUseEvents, useSingleInferredProject, disableAutomaticTypingAcquisition, globalTypingsCacheLocation, logger) {
+ return _super.call(this, host, cancellationToken, useSingleInferredProject, disableAutomaticTypingAcquisition
+ ? server.nullTypingsInstaller
+ : new NodeTypingsInstaller(logger, installerEventPort, globalTypingsCacheLocation, host.newLine), Buffer.byteLength, process.hrtime, logger, canUseEvents) || this;
}
IOSession.prototype.exit = function () {
this.logger.info("Exiting...");
@@ -65974,7 +68491,8 @@ var ts;
}
}
var useSingleInferredProject = sys.args.indexOf("--useSingleInferredProject") >= 0;
- var ioSession = new IOSession(sys, cancellationToken, eventPort, eventPort === undefined, useSingleInferredProject, getGlobalTypingsCacheLocation(), logger);
+ var disableAutomaticTypingAcquisition = sys.args.indexOf("--disableAutomaticTypingAcquisition") >= 0;
+ var ioSession = new IOSession(sys, cancellationToken, eventPort, eventPort === undefined, useSingleInferredProject, disableAutomaticTypingAcquisition, getGlobalTypingsCacheLocation(), logger);
process.on("uncaughtException", function (err) {
ioSession.logError(err, "unknown");
});
@@ -65982,694 +68500,5 @@ var ts;
ioSession.listen();
})(server = ts.server || (ts.server = {}));
})(ts || (ts = {}));
-var debugObjectHost = (function () { return this; })();
-var ts;
-(function (ts) {
- function logInternalError(logger, err) {
- if (logger) {
- logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message);
- }
- }
- var ScriptSnapshotShimAdapter = (function () {
- function ScriptSnapshotShimAdapter(scriptSnapshotShim) {
- this.scriptSnapshotShim = scriptSnapshotShim;
- }
- ScriptSnapshotShimAdapter.prototype.getText = function (start, end) {
- return this.scriptSnapshotShim.getText(start, end);
- };
- ScriptSnapshotShimAdapter.prototype.getLength = function () {
- return this.scriptSnapshotShim.getLength();
- };
- ScriptSnapshotShimAdapter.prototype.getChangeRange = function (oldSnapshot) {
- var oldSnapshotShim = oldSnapshot;
- var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim);
- if (encoded == null) {
- return null;
- }
- var decoded = JSON.parse(encoded);
- return ts.createTextChangeRange(ts.createTextSpan(decoded.span.start, decoded.span.length), decoded.newLength);
- };
- ScriptSnapshotShimAdapter.prototype.dispose = function () {
- if ("dispose" in this.scriptSnapshotShim) {
- this.scriptSnapshotShim.dispose();
- }
- };
- return ScriptSnapshotShimAdapter;
- }());
- var LanguageServiceShimHostAdapter = (function () {
- function LanguageServiceShimHostAdapter(shimHost) {
- var _this = this;
- this.shimHost = shimHost;
- this.loggingEnabled = false;
- this.tracingEnabled = false;
- if ("getModuleResolutionsForFile" in this.shimHost) {
- this.resolveModuleNames = function (moduleNames, containingFile) {
- var resolutionsInFile = JSON.parse(_this.shimHost.getModuleResolutionsForFile(containingFile));
- return ts.map(moduleNames, function (name) {
- var result = ts.getProperty(resolutionsInFile, name);
- return result ? { resolvedFileName: result } : undefined;
- });
- };
- }
- if ("directoryExists" in this.shimHost) {
- this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); };
- }
- if ("getTypeReferenceDirectiveResolutionsForFile" in this.shimHost) {
- this.resolveTypeReferenceDirectives = function (typeDirectiveNames, containingFile) {
- var typeDirectivesForFile = JSON.parse(_this.shimHost.getTypeReferenceDirectiveResolutionsForFile(containingFile));
- return ts.map(typeDirectiveNames, function (name) { return ts.getProperty(typeDirectivesForFile, name); });
- };
- }
- }
- LanguageServiceShimHostAdapter.prototype.log = function (s) {
- if (this.loggingEnabled) {
- this.shimHost.log(s);
- }
- };
- LanguageServiceShimHostAdapter.prototype.trace = function (s) {
- if (this.tracingEnabled) {
- this.shimHost.trace(s);
- }
- };
- LanguageServiceShimHostAdapter.prototype.error = function (s) {
- this.shimHost.error(s);
- };
- LanguageServiceShimHostAdapter.prototype.getProjectVersion = function () {
- if (!this.shimHost.getProjectVersion) {
- return undefined;
- }
- return this.shimHost.getProjectVersion();
- };
- LanguageServiceShimHostAdapter.prototype.getTypeRootsVersion = function () {
- if (!this.shimHost.getTypeRootsVersion) {
- return 0;
- }
- return this.shimHost.getTypeRootsVersion();
- };
- LanguageServiceShimHostAdapter.prototype.useCaseSensitiveFileNames = function () {
- return this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false;
- };
- LanguageServiceShimHostAdapter.prototype.getCompilationSettings = function () {
- var settingsJson = this.shimHost.getCompilationSettings();
- if (settingsJson == null || settingsJson == "") {
- throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");
- }
- return JSON.parse(settingsJson);
- };
- LanguageServiceShimHostAdapter.prototype.getScriptFileNames = function () {
- var encoded = this.shimHost.getScriptFileNames();
- return this.files = JSON.parse(encoded);
- };
- LanguageServiceShimHostAdapter.prototype.getScriptSnapshot = function (fileName) {
- var scriptSnapshot = this.shimHost.getScriptSnapshot(fileName);
- return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot);
- };
- LanguageServiceShimHostAdapter.prototype.getScriptKind = function (fileName) {
- if ("getScriptKind" in this.shimHost) {
- return this.shimHost.getScriptKind(fileName);
- }
- else {
- return 0;
- }
- };
- LanguageServiceShimHostAdapter.prototype.getScriptVersion = function (fileName) {
- return this.shimHost.getScriptVersion(fileName);
- };
- LanguageServiceShimHostAdapter.prototype.getLocalizedDiagnosticMessages = function () {
- var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages();
- if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") {
- return null;
- }
- try {
- return JSON.parse(diagnosticMessagesJson);
- }
- catch (e) {
- this.log(e.description || "diagnosticMessages.generated.json has invalid JSON format");
- return null;
- }
- };
- LanguageServiceShimHostAdapter.prototype.getCancellationToken = function () {
- var hostCancellationToken = this.shimHost.getCancellationToken();
- return new ThrottledCancellationToken(hostCancellationToken);
- };
- LanguageServiceShimHostAdapter.prototype.getCurrentDirectory = function () {
- return this.shimHost.getCurrentDirectory();
- };
- LanguageServiceShimHostAdapter.prototype.getDirectories = function (path) {
- return JSON.parse(this.shimHost.getDirectories(path));
- };
- LanguageServiceShimHostAdapter.prototype.getDefaultLibFileName = function (options) {
- return this.shimHost.getDefaultLibFileName(JSON.stringify(options));
- };
- LanguageServiceShimHostAdapter.prototype.readDirectory = function (path, extensions, exclude, include, depth) {
- var pattern = ts.getFileMatcherPatterns(path, extensions, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory());
- return JSON.parse(this.shimHost.readDirectory(path, JSON.stringify(extensions), JSON.stringify(pattern.basePaths), pattern.excludePattern, pattern.includeFilePattern, pattern.includeDirectoryPattern, depth));
- };
- LanguageServiceShimHostAdapter.prototype.readFile = function (path, encoding) {
- return this.shimHost.readFile(path, encoding);
- };
- LanguageServiceShimHostAdapter.prototype.fileExists = function (path) {
- return this.shimHost.fileExists(path);
- };
- return LanguageServiceShimHostAdapter;
- }());
- ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter;
- var ThrottledCancellationToken = (function () {
- function ThrottledCancellationToken(hostCancellationToken) {
- this.hostCancellationToken = hostCancellationToken;
- this.lastCancellationCheckTime = 0;
- }
- ThrottledCancellationToken.prototype.isCancellationRequested = function () {
- var time = ts.timestamp();
- var duration = Math.abs(time - this.lastCancellationCheckTime);
- if (duration > 10) {
- this.lastCancellationCheckTime = time;
- return this.hostCancellationToken.isCancellationRequested();
- }
- return false;
- };
- return ThrottledCancellationToken;
- }());
- var CoreServicesShimHostAdapter = (function () {
- function CoreServicesShimHostAdapter(shimHost) {
- var _this = this;
- this.shimHost = shimHost;
- this.useCaseSensitiveFileNames = this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false;
- if ("directoryExists" in this.shimHost) {
- this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); };
- }
- if ("realpath" in this.shimHost) {
- this.realpath = function (path) { return _this.shimHost.realpath(path); };
- }
- }
- CoreServicesShimHostAdapter.prototype.readDirectory = function (rootDir, extensions, exclude, include, depth) {
- try {
- var pattern = ts.getFileMatcherPatterns(rootDir, extensions, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory());
- return JSON.parse(this.shimHost.readDirectory(rootDir, JSON.stringify(extensions), JSON.stringify(pattern.basePaths), pattern.excludePattern, pattern.includeFilePattern, pattern.includeDirectoryPattern, depth));
- }
- catch (e) {
- var results = [];
- for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) {
- var extension = extensions_2[_i];
- for (var _a = 0, _b = this.readDirectoryFallback(rootDir, extension, exclude); _a < _b.length; _a++) {
- var file = _b[_a];
- if (!ts.contains(results, file)) {
- results.push(file);
- }
- }
- }
- return results;
- }
- };
- CoreServicesShimHostAdapter.prototype.fileExists = function (fileName) {
- return this.shimHost.fileExists(fileName);
- };
- CoreServicesShimHostAdapter.prototype.readFile = function (fileName) {
- return this.shimHost.readFile(fileName);
- };
- CoreServicesShimHostAdapter.prototype.readDirectoryFallback = function (rootDir, extension, exclude) {
- return JSON.parse(this.shimHost.readDirectory(rootDir, extension, JSON.stringify(exclude)));
- };
- CoreServicesShimHostAdapter.prototype.getDirectories = function (path) {
- return JSON.parse(this.shimHost.getDirectories(path));
- };
- return CoreServicesShimHostAdapter;
- }());
- ts.CoreServicesShimHostAdapter = CoreServicesShimHostAdapter;
- function simpleForwardCall(logger, actionDescription, action, logPerformance) {
- var start;
- if (logPerformance) {
- logger.log(actionDescription);
- start = ts.timestamp();
- }
- var result = action();
- if (logPerformance) {
- var end = ts.timestamp();
- logger.log(actionDescription + " completed in " + (end - start) + " msec");
- if (typeof result === "string") {
- var str = result;
- if (str.length > 128) {
- str = str.substring(0, 128) + "...";
- }
- logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'");
- }
- }
- return result;
- }
- function forwardJSONCall(logger, actionDescription, action, logPerformance) {
- return forwardCall(logger, actionDescription, true, action, logPerformance);
- }
- function forwardCall(logger, actionDescription, returnJson, action, logPerformance) {
- try {
- var result = simpleForwardCall(logger, actionDescription, action, logPerformance);
- return returnJson ? JSON.stringify({ result: result }) : result;
- }
- catch (err) {
- if (err instanceof ts.OperationCanceledException) {
- return JSON.stringify({ canceled: true });
- }
- logInternalError(logger, err);
- err.description = actionDescription;
- return JSON.stringify({ error: err });
- }
- }
- var ShimBase = (function () {
- function ShimBase(factory) {
- this.factory = factory;
- factory.registerShim(this);
- }
- ShimBase.prototype.dispose = function (dummy) {
- this.factory.unregisterShim(this);
- };
- return ShimBase;
- }());
- function realizeDiagnostics(diagnostics, newLine) {
- return diagnostics.map(function (d) { return realizeDiagnostic(d, newLine); });
- }
- ts.realizeDiagnostics = realizeDiagnostics;
- function realizeDiagnostic(diagnostic, newLine) {
- return {
- message: ts.flattenDiagnosticMessageText(diagnostic.messageText, newLine),
- start: diagnostic.start,
- length: diagnostic.length,
- category: ts.DiagnosticCategory[diagnostic.category].toLowerCase(),
- code: diagnostic.code
- };
- }
- var LanguageServiceShimObject = (function (_super) {
- __extends(LanguageServiceShimObject, _super);
- function LanguageServiceShimObject(factory, host, languageService) {
- var _this = _super.call(this, factory) || this;
- _this.host = host;
- _this.languageService = languageService;
- _this.logPerformance = false;
- _this.logger = _this.host;
- return _this;
- }
- LanguageServiceShimObject.prototype.forwardJSONCall = function (actionDescription, action) {
- return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance);
- };
- LanguageServiceShimObject.prototype.dispose = function (dummy) {
- this.logger.log("dispose()");
- this.languageService.dispose();
- this.languageService = null;
- if (debugObjectHost && debugObjectHost.CollectGarbage) {
- debugObjectHost.CollectGarbage();
- this.logger.log("CollectGarbage()");
- }
- this.logger = null;
- _super.prototype.dispose.call(this, dummy);
- };
- LanguageServiceShimObject.prototype.refresh = function (throwOnError) {
- this.forwardJSONCall("refresh(" + throwOnError + ")", function () { return null; });
- };
- LanguageServiceShimObject.prototype.cleanupSemanticCache = function () {
- var _this = this;
- this.forwardJSONCall("cleanupSemanticCache()", function () {
- _this.languageService.cleanupSemanticCache();
- return null;
- });
- };
- LanguageServiceShimObject.prototype.realizeDiagnostics = function (diagnostics) {
- var newLine = ts.getNewLineOrDefaultFromHost(this.host);
- return ts.realizeDiagnostics(diagnostics, newLine);
- };
- LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) {
- var _this = this;
- return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); });
- };
- LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) {
- var _this = this;
- return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); });
- };
- LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) {
- var _this = this;
- return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); });
- };
- LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) {
- var _this = this;
- return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); });
- };
- LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) {
- var _this = this;
- return this.forwardJSONCall("getSyntacticDiagnostics('" + fileName + "')", function () {
- var diagnostics = _this.languageService.getSyntacticDiagnostics(fileName);
- return _this.realizeDiagnostics(diagnostics);
- });
- };
- LanguageServiceShimObject.prototype.getSemanticDiagnostics = function (fileName) {
- var _this = this;
- return this.forwardJSONCall("getSemanticDiagnostics('" + fileName + "')", function () {
- var diagnostics = _this.languageService.getSemanticDiagnostics(fileName);
- return _this.realizeDiagnostics(diagnostics);
- });
- };
- LanguageServiceShimObject.prototype.getCompilerOptionsDiagnostics = function () {
- var _this = this;
- return this.forwardJSONCall("getCompilerOptionsDiagnostics()", function () {
- var diagnostics = _this.languageService.getCompilerOptionsDiagnostics();
- return _this.realizeDiagnostics(diagnostics);
- });
- };
- LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) {
- var _this = this;
- return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); });
- };
- LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { return _this.languageService.getSignatureHelpItems(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getImplementationAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getImplementationAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getImplementationAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position); });
- };
- LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments) {
- var _this = this;
- return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); });
- };
- LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.isValidBraceCompletionAtPosition = function (fileName, position, openingBrace) {
- var _this = this;
- return this.forwardJSONCall("isValidBraceCompletionAtPosition('" + fileName + "', " + position + ", " + openingBrace + ")", function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); });
- };
- LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options) {
- var _this = this;
- return this.forwardJSONCall("getIndentationAtPosition('" + fileName + "', " + position + ")", function () {
- var localOptions = JSON.parse(options);
- return _this.languageService.getIndentationAtPosition(fileName, position, localOptions);
- });
- };
- LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getReferencesAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.findReferences = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { return _this.languageService.findReferences(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) {
- var _this = this;
- return this.forwardJSONCall("getDocumentHighlights('" + fileName + "', " + position + ")", function () {
- var results = _this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
- var normalizedName = ts.normalizeSlashes(fileName).toLowerCase();
- return ts.filter(results, function (r) { return ts.normalizeSlashes(r.fileName).toLowerCase() === normalizedName; });
- });
- };
- LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName) {
- var _this = this;
- return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () { return _this.languageService.getCompletionEntryDetails(fileName, position, entryName); });
- };
- LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options) {
- var _this = this;
- return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () {
- var localOptions = JSON.parse(options);
- return _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions);
- });
- };
- LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options) {
- var _this = this;
- return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () {
- var localOptions = JSON.parse(options);
- return _this.languageService.getFormattingEditsForDocument(fileName, localOptions);
- });
- };
- LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options) {
- var _this = this;
- return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () {
- var localOptions = JSON.parse(options);
- return _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions);
- });
- };
- LanguageServiceShimObject.prototype.getDocCommentTemplateAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getDocCommentTemplateAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDocCommentTemplateAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount, fileName) {
- var _this = this;
- return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ", " + fileName + ")", function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); });
- };
- LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) {
- var _this = this;
- return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { return _this.languageService.getNavigationBarItems(fileName); });
- };
- LanguageServiceShimObject.prototype.getNavigationTree = function (fileName) {
- var _this = this;
- return this.forwardJSONCall("getNavigationTree('" + fileName + "')", function () { return _this.languageService.getNavigationTree(fileName); });
- };
- LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) {
- var _this = this;
- return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { return _this.languageService.getOutliningSpans(fileName); });
- };
- LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) {
- var _this = this;
- return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); });
- };
- LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) {
- var _this = this;
- return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () { return _this.languageService.getEmitOutput(fileName); });
- };
- LanguageServiceShimObject.prototype.getEmitOutputObject = function (fileName) {
- var _this = this;
- return forwardCall(this.logger, "getEmitOutput('" + fileName + "')", false, function () { return _this.languageService.getEmitOutput(fileName); }, this.logPerformance);
- };
- return LanguageServiceShimObject;
- }(ShimBase));
- function convertClassifications(classifications) {
- return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState };
- }
- var ClassifierShimObject = (function (_super) {
- __extends(ClassifierShimObject, _super);
- function ClassifierShimObject(factory, logger) {
- var _this = _super.call(this, factory) || this;
- _this.logger = logger;
- _this.logPerformance = false;
- _this.classifier = ts.createClassifier();
- return _this;
- }
- ClassifierShimObject.prototype.getEncodedLexicalClassifications = function (text, lexState, syntacticClassifierAbsent) {
- var _this = this;
- return forwardJSONCall(this.logger, "getEncodedLexicalClassifications", function () { return convertClassifications(_this.classifier.getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent)); }, this.logPerformance);
- };
- ClassifierShimObject.prototype.getClassificationsForLine = function (text, lexState, classifyKeywordsInGenerics) {
- var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics);
- var result = "";
- for (var _i = 0, _a = classification.entries; _i < _a.length; _i++) {
- var item = _a[_i];
- result += item.length + "\n";
- result += item.classification + "\n";
- }
- result += classification.finalLexState;
- return result;
- };
- return ClassifierShimObject;
- }(ShimBase));
- var CoreServicesShimObject = (function (_super) {
- __extends(CoreServicesShimObject, _super);
- function CoreServicesShimObject(factory, logger, host) {
- var _this = _super.call(this, factory) || this;
- _this.logger = logger;
- _this.host = host;
- _this.logPerformance = false;
- return _this;
- }
- CoreServicesShimObject.prototype.forwardJSONCall = function (actionDescription, action) {
- return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance);
- };
- CoreServicesShimObject.prototype.resolveModuleName = function (fileName, moduleName, compilerOptionsJson) {
- var _this = this;
- return this.forwardJSONCall("resolveModuleName('" + fileName + "')", function () {
- var compilerOptions = JSON.parse(compilerOptionsJson);
- var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
- return {
- resolvedFileName: result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined,
- failedLookupLocations: result.failedLookupLocations
- };
- });
- };
- CoreServicesShimObject.prototype.resolveTypeReferenceDirective = function (fileName, typeReferenceDirective, compilerOptionsJson) {
- var _this = this;
- return this.forwardJSONCall("resolveTypeReferenceDirective(" + fileName + ")", function () {
- var compilerOptions = JSON.parse(compilerOptionsJson);
- var result = ts.resolveTypeReferenceDirective(typeReferenceDirective, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
- return {
- resolvedFileName: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.resolvedFileName : undefined,
- primary: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.primary : true,
- failedLookupLocations: result.failedLookupLocations
- };
- });
- };
- CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) {
- var _this = this;
- return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () {
- var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()), true, true);
- return {
- referencedFiles: _this.convertFileReferences(result.referencedFiles),
- importedFiles: _this.convertFileReferences(result.importedFiles),
- ambientExternalModules: result.ambientExternalModules,
- isLibFile: result.isLibFile,
- typeReferenceDirectives: _this.convertFileReferences(result.typeReferenceDirectives)
- };
- });
- };
- CoreServicesShimObject.prototype.getAutomaticTypeDirectiveNames = function (compilerOptionsJson) {
- var _this = this;
- return this.forwardJSONCall("getAutomaticTypeDirectiveNames('" + compilerOptionsJson + "')", function () {
- var compilerOptions = JSON.parse(compilerOptionsJson);
- return ts.getAutomaticTypeDirectiveNames(compilerOptions, _this.host);
- });
- };
- CoreServicesShimObject.prototype.convertFileReferences = function (refs) {
- if (!refs) {
- return undefined;
- }
- var result = [];
- for (var _i = 0, refs_2 = refs; _i < refs_2.length; _i++) {
- var ref = refs_2[_i];
- result.push({
- path: ts.normalizeSlashes(ref.fileName),
- position: ref.pos,
- length: ref.end - ref.pos
- });
- }
- return result;
- };
- CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) {
- var _this = this;
- return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () {
- var text = sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength());
- var result = ts.parseConfigFileTextToJson(fileName, text);
- if (result.error) {
- return {
- options: {},
- typingOptions: {},
- files: [],
- raw: {},
- errors: [realizeDiagnostic(result.error, "\r\n")]
- };
- }
- var normalizedFileName = ts.normalizeSlashes(fileName);
- var configFile = ts.parseJsonConfigFileContent(result.config, _this.host, ts.getDirectoryPath(normalizedFileName), {}, normalizedFileName);
- return {
- options: configFile.options,
- typingOptions: configFile.typingOptions,
- files: configFile.fileNames,
- raw: configFile.raw,
- errors: realizeDiagnostics(configFile.errors, "\r\n")
- };
- });
- };
- CoreServicesShimObject.prototype.getDefaultCompilationSettings = function () {
- return this.forwardJSONCall("getDefaultCompilationSettings()", function () { return ts.getDefaultCompilerOptions(); });
- };
- CoreServicesShimObject.prototype.discoverTypings = function (discoverTypingsJson) {
- var _this = this;
- var getCanonicalFileName = ts.createGetCanonicalFileName(false);
- return this.forwardJSONCall("discoverTypings()", function () {
- var info = JSON.parse(discoverTypingsJson);
- return ts.JsTyping.discoverTypings(_this.host, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), ts.toPath(info.safeListPath, info.safeListPath, getCanonicalFileName), info.packageNameToTypingLocation, info.typingOptions, info.compilerOptions);
- });
- };
- return CoreServicesShimObject;
- }(ShimBase));
- var TypeScriptServicesFactory = (function () {
- function TypeScriptServicesFactory() {
- this._shims = [];
- }
- TypeScriptServicesFactory.prototype.getServicesVersion = function () {
- return ts.servicesVersion;
- };
- TypeScriptServicesFactory.prototype.createLanguageServiceShim = function (host) {
- try {
- if (this.documentRegistry === undefined) {
- this.documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory());
- }
- var hostAdapter = new LanguageServiceShimHostAdapter(host);
- var languageService = ts.createLanguageService(hostAdapter, this.documentRegistry);
- return new LanguageServiceShimObject(this, host, languageService);
- }
- catch (err) {
- logInternalError(host, err);
- throw err;
- }
- };
- TypeScriptServicesFactory.prototype.createClassifierShim = function (logger) {
- try {
- return new ClassifierShimObject(this, logger);
- }
- catch (err) {
- logInternalError(logger, err);
- throw err;
- }
- };
- TypeScriptServicesFactory.prototype.createCoreServicesShim = function (host) {
- try {
- var adapter = new CoreServicesShimHostAdapter(host);
- return new CoreServicesShimObject(this, host, adapter);
- }
- catch (err) {
- logInternalError(host, err);
- throw err;
- }
- };
- TypeScriptServicesFactory.prototype.close = function () {
- this._shims = [];
- this.documentRegistry = undefined;
- };
- TypeScriptServicesFactory.prototype.registerShim = function (shim) {
- this._shims.push(shim);
- };
- TypeScriptServicesFactory.prototype.unregisterShim = function (shim) {
- for (var i = 0, n = this._shims.length; i < n; i++) {
- if (this._shims[i] === shim) {
- delete this._shims[i];
- return;
- }
- }
- throw new Error("Invalid operation");
- };
- return TypeScriptServicesFactory;
- }());
- ts.TypeScriptServicesFactory = TypeScriptServicesFactory;
- if (typeof module !== "undefined" && module.exports) {
- module.exports = ts;
- }
-})(ts || (ts = {}));
-var TypeScript;
-(function (TypeScript) {
- var Services;
- (function (Services) {
- Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory;
- })(Services = TypeScript.Services || (TypeScript.Services = {}));
-})(TypeScript || (TypeScript = {}));
-var toolsVersion = "2.1";
+
+//# sourceMappingURL=tsserver.js.map
diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts
index c23bccf0a68..63580ce8dcd 100644
--- a/lib/tsserverlibrary.d.ts
+++ b/lib/tsserverlibrary.d.ts
@@ -1,700 +1,20 @@
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+
///
///
-declare namespace ts.server.protocol {
- namespace CommandTypes {
- type Brace = "brace";
- type BraceFull = "brace-full";
- type BraceCompletion = "braceCompletion";
- type Change = "change";
- type Close = "close";
- type Completions = "completions";
- type CompletionsFull = "completions-full";
- type CompletionDetails = "completionEntryDetails";
- type CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList";
- type CompileOnSaveEmitFile = "compileOnSaveEmitFile";
- type Configure = "configure";
- type Definition = "definition";
- type DefinitionFull = "definition-full";
- type Implementation = "implementation";
- type ImplementationFull = "implementation-full";
- type Exit = "exit";
- type Format = "format";
- type Formatonkey = "formatonkey";
- type FormatFull = "format-full";
- type FormatonkeyFull = "formatonkey-full";
- type FormatRangeFull = "formatRange-full";
- type Geterr = "geterr";
- type GeterrForProject = "geterrForProject";
- type SemanticDiagnosticsSync = "semanticDiagnosticsSync";
- type SyntacticDiagnosticsSync = "syntacticDiagnosticsSync";
- type NavBar = "navbar";
- type NavBarFull = "navbar-full";
- type Navto = "navto";
- type NavtoFull = "navto-full";
- type NavTree = "navtree";
- type NavTreeFull = "navtree-full";
- type Occurrences = "occurrences";
- type DocumentHighlights = "documentHighlights";
- type DocumentHighlightsFull = "documentHighlights-full";
- type Open = "open";
- type Quickinfo = "quickinfo";
- type QuickinfoFull = "quickinfo-full";
- type References = "references";
- type ReferencesFull = "references-full";
- type Reload = "reload";
- type Rename = "rename";
- type RenameInfoFull = "rename-full";
- type RenameLocationsFull = "renameLocations-full";
- type Saveto = "saveto";
- type SignatureHelp = "signatureHelp";
- type SignatureHelpFull = "signatureHelp-full";
- type TypeDefinition = "typeDefinition";
- type ProjectInfo = "projectInfo";
- type ReloadProjects = "reloadProjects";
- type Unknown = "unknown";
- type OpenExternalProject = "openExternalProject";
- type OpenExternalProjects = "openExternalProjects";
- type CloseExternalProject = "closeExternalProject";
- type SynchronizeProjectList = "synchronizeProjectList";
- type ApplyChangedToOpenFiles = "applyChangedToOpenFiles";
- type EncodedSemanticClassificationsFull = "encodedSemanticClassifications-full";
- type Cleanup = "cleanup";
- type OutliningSpans = "outliningSpans";
- type TodoComments = "todoComments";
- type Indentation = "indentation";
- type DocCommentTemplate = "docCommentTemplate";
- type CompilerOptionsDiagnosticsFull = "compilerOptionsDiagnostics-full";
- type NameOrDottedNameSpan = "nameOrDottedNameSpan";
- type BreakpointStatement = "breakpointStatement";
- type CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects";
- type GetCodeFixes = "getCodeFixes";
- type GetCodeFixesFull = "getCodeFixes-full";
- type GetSupportedCodeFixes = "getSupportedCodeFixes";
- }
- interface Message {
- seq: number;
- type: string;
- }
- interface Request extends Message {
- command: string;
- arguments?: any;
- }
- interface ReloadProjectsRequest extends Message {
- command: CommandTypes.ReloadProjects;
- }
- interface Event extends Message {
- event: string;
- body?: any;
- }
- interface Response extends Message {
- request_seq: number;
- success: boolean;
- command: string;
- message?: string;
- body?: any;
- }
- interface FileRequestArgs {
- file: string;
- projectFileName?: string;
- }
- interface DocCommentTemplateRequest extends FileLocationRequest {
- command: CommandTypes.DocCommentTemplate;
- }
- interface DocCommandTemplateResponse extends Response {
- body?: TextInsertion;
- }
- interface TodoCommentRequest extends FileRequest {
- command: CommandTypes.TodoComments;
- arguments: TodoCommentRequestArgs;
- }
- interface TodoCommentRequestArgs extends FileRequestArgs {
- descriptors: TodoCommentDescriptor[];
- }
- interface TodoCommentsResponse extends Response {
- body?: TodoComment[];
- }
- interface OutliningSpansRequest extends FileRequest {
- command: CommandTypes.OutliningSpans;
- }
- interface OutliningSpansResponse extends Response {
- body?: OutliningSpan[];
- }
- interface IndentationRequest extends FileLocationRequest {
- command: CommandTypes.Indentation;
- arguments: IndentationRequestArgs;
- }
- interface IndentationResponse extends Response {
- body?: IndentationResult;
- }
- interface IndentationResult {
- position: number;
- indentation: number;
- }
- interface IndentationRequestArgs extends FileLocationRequestArgs {
- options?: EditorSettings;
- }
- interface ProjectInfoRequestArgs extends FileRequestArgs {
- needFileNameList: boolean;
- }
- interface ProjectInfoRequest extends Request {
- command: CommandTypes.ProjectInfo;
- arguments: ProjectInfoRequestArgs;
- }
- interface CompilerOptionsDiagnosticsRequest extends Request {
- arguments: CompilerOptionsDiagnosticsRequestArgs;
- }
- interface CompilerOptionsDiagnosticsRequestArgs {
- projectFileName: string;
- }
- interface ProjectInfo {
- configFileName: string;
- fileNames?: string[];
- languageServiceDisabled?: boolean;
- }
- interface DiagnosticWithLinePosition {
- message: string;
- start: number;
- length: number;
- startLocation: Location;
- endLocation: Location;
- category: string;
- code: number;
- }
- interface ProjectInfoResponse extends Response {
- body?: ProjectInfo;
- }
- interface FileRequest extends Request {
- arguments: FileRequestArgs;
- }
- interface FileLocationRequestArgs extends FileRequestArgs {
- line: number;
- offset: number;
- position?: number;
- }
- interface CodeFixRequest extends Request {
- command: CommandTypes.GetCodeFixes;
- arguments: CodeFixRequestArgs;
- }
- interface CodeFixRequestArgs extends FileRequestArgs {
- startLine: number;
- startOffset: number;
- startPosition?: number;
- endLine: number;
- endOffset: number;
- endPosition?: number;
- errorCodes?: number[];
- }
- interface GetCodeFixesResponse extends Response {
- body?: CodeAction[];
- }
- interface FileLocationRequest extends FileRequest {
- arguments: FileLocationRequestArgs;
- }
- interface GetSupportedCodeFixesRequest extends Request {
- command: CommandTypes.GetSupportedCodeFixes;
- }
- interface GetSupportedCodeFixesResponse extends Response {
- body?: string[];
- }
- interface EncodedSemanticClassificationsRequest extends FileRequest {
- arguments: EncodedSemanticClassificationsRequestArgs;
- }
- interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs {
- start: number;
- length: number;
- }
- interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs {
- filesToSearch: string[];
- }
- interface DefinitionRequest extends FileLocationRequest {
- command: CommandTypes.Definition;
- }
- interface TypeDefinitionRequest extends FileLocationRequest {
- command: CommandTypes.TypeDefinition;
- }
- interface ImplementationRequest extends FileLocationRequest {
- command: CommandTypes.Implementation;
- }
- interface Location {
- line: number;
- offset: number;
- }
- interface TextSpan {
- start: Location;
- end: Location;
- }
- interface FileSpan extends TextSpan {
- file: string;
- }
- interface DefinitionResponse extends Response {
- body?: FileSpan[];
- }
- interface TypeDefinitionResponse extends Response {
- body?: FileSpan[];
- }
- interface ImplementationResponse extends Response {
- body?: FileSpan[];
- }
- interface BraceCompletionRequest extends FileLocationRequest {
- command: CommandTypes.BraceCompletion;
- arguments: BraceCompletionRequestArgs;
- }
- interface BraceCompletionRequestArgs extends FileLocationRequestArgs {
- openingBrace: string;
- }
- interface OccurrencesRequest extends FileLocationRequest {
- command: CommandTypes.Occurrences;
- }
- interface OccurrencesResponseItem extends FileSpan {
- isWriteAccess: boolean;
- }
- interface OccurrencesResponse extends Response {
- body?: OccurrencesResponseItem[];
- }
- interface DocumentHighlightsRequest extends FileLocationRequest {
- command: CommandTypes.DocumentHighlights;
- arguments: DocumentHighlightsRequestArgs;
- }
- interface HighlightSpan extends TextSpan {
- kind: string;
- }
- interface DocumentHighlightsItem {
- file: string;
- highlightSpans: HighlightSpan[];
- }
- interface DocumentHighlightsResponse extends Response {
- body?: DocumentHighlightsItem[];
- }
- interface ReferencesRequest extends FileLocationRequest {
- command: CommandTypes.References;
- }
- interface ReferencesResponseItem extends FileSpan {
- lineText: string;
- isWriteAccess: boolean;
- isDefinition: boolean;
- }
- interface ReferencesResponseBody {
- refs: ReferencesResponseItem[];
- symbolName: string;
- symbolStartOffset: number;
- symbolDisplayString: string;
- }
- interface ReferencesResponse extends Response {
- body?: ReferencesResponseBody;
- }
- interface RenameRequestArgs extends FileLocationRequestArgs {
- findInComments?: boolean;
- findInStrings?: boolean;
- }
- interface RenameRequest extends FileLocationRequest {
- command: CommandTypes.Rename;
- arguments: RenameRequestArgs;
- }
- interface RenameInfo {
- canRename: boolean;
- localizedErrorMessage?: string;
- displayName: string;
- fullDisplayName: string;
- kind: string;
- kindModifiers: string;
- }
- interface SpanGroup {
- file: string;
- locs: TextSpan[];
- }
- interface RenameResponseBody {
- info: RenameInfo;
- locs: SpanGroup[];
- }
- interface RenameResponse extends Response {
- body?: RenameResponseBody;
- }
- interface ExternalFile {
- fileName: string;
- scriptKind?: ScriptKind;
- hasMixedContent?: boolean;
- content?: string;
- }
- interface ExternalProject {
- projectFileName: string;
- rootFiles: ExternalFile[];
- options: ExternalProjectCompilerOptions;
- typingOptions?: TypingOptions;
- }
- interface ExternalProjectCompilerOptions extends CompilerOptions {
- compileOnSave?: boolean;
- }
- interface ProjectVersionInfo {
- projectName: string;
- isInferred: boolean;
- version: number;
- options: CompilerOptions;
- }
- interface ProjectChanges {
- added: string[];
- removed: string[];
- }
- interface ProjectFiles {
- info?: ProjectVersionInfo;
- files?: string[];
- changes?: ProjectChanges;
- }
- interface ProjectFilesWithDiagnostics extends ProjectFiles {
- projectErrors: DiagnosticWithLinePosition[];
- }
- interface ChangedOpenFile {
- fileName: string;
- changes: ts.TextChange[];
- }
- interface ConfigureRequestArguments {
- hostInfo?: string;
- file?: string;
- formatOptions?: FormatCodeSettings;
- }
- interface ConfigureRequest extends Request {
- command: CommandTypes.Configure;
- arguments: ConfigureRequestArguments;
- }
- interface ConfigureResponse extends Response {
- }
- interface OpenRequestArgs extends FileRequestArgs {
- fileContent?: string;
- scriptKindName?: "TS" | "JS" | "TSX" | "JSX";
- }
- interface OpenRequest extends Request {
- command: CommandTypes.Open;
- arguments: OpenRequestArgs;
- }
- interface OpenExternalProjectRequest extends Request {
- command: CommandTypes.OpenExternalProject;
- arguments: OpenExternalProjectArgs;
- }
- type OpenExternalProjectArgs = ExternalProject;
- interface OpenExternalProjectsRequest extends Request {
- command: CommandTypes.OpenExternalProjects;
- arguments: OpenExternalProjectsArgs;
- }
- interface OpenExternalProjectsArgs {
- projects: ExternalProject[];
- }
- interface OpenExternalProjectResponse extends Response {
- }
- interface OpenExternalProjectsResponse extends Response {
- }
- interface CloseExternalProjectRequest extends Request {
- command: CommandTypes.CloseExternalProject;
- arguments: CloseExternalProjectRequestArgs;
- }
- interface CloseExternalProjectRequestArgs {
- projectFileName: string;
- }
- interface CloseExternalProjectResponse extends Response {
- }
- interface SynchronizeProjectListRequest extends Request {
- arguments: SynchronizeProjectListRequestArgs;
- }
- interface SynchronizeProjectListRequestArgs {
- knownProjects: protocol.ProjectVersionInfo[];
- }
- interface ApplyChangedToOpenFilesRequest extends Request {
- arguments: ApplyChangedToOpenFilesRequestArgs;
- }
- interface ApplyChangedToOpenFilesRequestArgs {
- openFiles?: ExternalFile[];
- changedFiles?: ChangedOpenFile[];
- closedFiles?: string[];
- }
- interface SetCompilerOptionsForInferredProjectsRequest extends Request {
- command: CommandTypes.CompilerOptionsForInferredProjects;
- arguments: SetCompilerOptionsForInferredProjectsArgs;
- }
- interface SetCompilerOptionsForInferredProjectsArgs {
- options: ExternalProjectCompilerOptions;
- }
- interface SetCompilerOptionsForInferredProjectsResponse extends Response {
- }
- interface ExitRequest extends Request {
- command: CommandTypes.Exit;
- }
- interface CloseRequest extends FileRequest {
- command: CommandTypes.Close;
- }
- interface CompileOnSaveAffectedFileListRequest extends FileRequest {
- command: CommandTypes.CompileOnSaveAffectedFileList;
- }
- interface CompileOnSaveAffectedFileListSingleProject {
- projectFileName: string;
- fileNames: string[];
- }
- interface CompileOnSaveAffectedFileListResponse extends Response {
- body: CompileOnSaveAffectedFileListSingleProject[];
- }
- interface CompileOnSaveEmitFileRequest extends FileRequest {
- command: CommandTypes.CompileOnSaveEmitFile;
- arguments: CompileOnSaveEmitFileRequestArgs;
- }
- interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs {
- forced?: boolean;
- }
- interface QuickInfoRequest extends FileLocationRequest {
- command: CommandTypes.Quickinfo;
- }
- interface QuickInfoResponseBody {
- kind: string;
- kindModifiers: string;
- start: Location;
- end: Location;
- displayString: string;
- documentation: string;
- }
- interface QuickInfoResponse extends Response {
- body?: QuickInfoResponseBody;
- }
- interface FormatRequestArgs extends FileLocationRequestArgs {
- endLine: number;
- endOffset: number;
- endPosition?: number;
- options?: FormatCodeSettings;
- }
- interface FormatRequest extends FileLocationRequest {
- command: CommandTypes.Format;
- arguments: FormatRequestArgs;
- }
- interface CodeEdit {
- start: Location;
- end: Location;
- newText: string;
- }
- interface FileCodeEdits {
- fileName: string;
- textChanges: CodeEdit[];
- }
- interface CodeFixResponse extends Response {
- body?: CodeAction[];
- }
- interface CodeAction {
- description: string;
- changes: FileCodeEdits[];
- }
- interface FormatResponse extends Response {
- body?: CodeEdit[];
- }
- interface FormatOnKeyRequestArgs extends FileLocationRequestArgs {
- key: string;
- options?: FormatCodeSettings;
- }
- interface FormatOnKeyRequest extends FileLocationRequest {
- command: CommandTypes.Formatonkey;
- arguments: FormatOnKeyRequestArgs;
- }
- interface CompletionsRequestArgs extends FileLocationRequestArgs {
- prefix?: string;
- }
- interface CompletionsRequest extends FileLocationRequest {
- command: CommandTypes.Completions;
- arguments: CompletionsRequestArgs;
- }
- interface CompletionDetailsRequestArgs extends FileLocationRequestArgs {
- entryNames: string[];
- }
- interface CompletionDetailsRequest extends FileLocationRequest {
- command: CommandTypes.CompletionDetails;
- arguments: CompletionDetailsRequestArgs;
- }
- interface SymbolDisplayPart {
- text: string;
- kind: string;
- }
- interface CompletionEntry {
- name: string;
- kind: string;
- kindModifiers: string;
- sortText: string;
- replacementSpan?: TextSpan;
- }
- interface CompletionEntryDetails {
- name: string;
- kind: string;
- kindModifiers: string;
- displayParts: SymbolDisplayPart[];
- documentation: SymbolDisplayPart[];
- }
- interface CompletionsResponse extends Response {
- body?: CompletionEntry[];
- }
- interface CompletionDetailsResponse extends Response {
- body?: CompletionEntryDetails[];
- }
- interface SignatureHelpParameter {
- name: string;
- documentation: SymbolDisplayPart[];
- displayParts: SymbolDisplayPart[];
- isOptional: boolean;
- }
- interface SignatureHelpItem {
- isVariadic: boolean;
- prefixDisplayParts: SymbolDisplayPart[];
- suffixDisplayParts: SymbolDisplayPart[];
- separatorDisplayParts: SymbolDisplayPart[];
- parameters: SignatureHelpParameter[];
- documentation: SymbolDisplayPart[];
- }
- interface SignatureHelpItems {
- items: SignatureHelpItem[];
- applicableSpan: TextSpan;
- selectedItemIndex: number;
- argumentIndex: number;
- argumentCount: number;
- }
- interface SignatureHelpRequestArgs extends FileLocationRequestArgs {
- }
- interface SignatureHelpRequest extends FileLocationRequest {
- command: CommandTypes.SignatureHelp;
- arguments: SignatureHelpRequestArgs;
- }
- interface SignatureHelpResponse extends Response {
- body?: SignatureHelpItems;
- }
- interface SemanticDiagnosticsSyncRequest extends FileRequest {
- command: CommandTypes.SemanticDiagnosticsSync;
- arguments: SemanticDiagnosticsSyncRequestArgs;
- }
- interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs {
- includeLinePosition?: boolean;
- }
- interface SemanticDiagnosticsSyncResponse extends Response {
- body?: Diagnostic[] | DiagnosticWithLinePosition[];
- }
- interface SyntacticDiagnosticsSyncRequest extends FileRequest {
- command: CommandTypes.SyntacticDiagnosticsSync;
- arguments: SyntacticDiagnosticsSyncRequestArgs;
- }
- interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs {
- includeLinePosition?: boolean;
- }
- interface SyntacticDiagnosticsSyncResponse extends Response {
- body?: Diagnostic[] | DiagnosticWithLinePosition[];
- }
- interface GeterrForProjectRequestArgs {
- file: string;
- delay: number;
- }
- interface GeterrForProjectRequest extends Request {
- command: CommandTypes.GeterrForProject;
- arguments: GeterrForProjectRequestArgs;
- }
- interface GeterrRequestArgs {
- files: string[];
- delay: number;
- }
- interface GeterrRequest extends Request {
- command: CommandTypes.Geterr;
- arguments: GeterrRequestArgs;
- }
- interface Diagnostic {
- start: Location;
- end: Location;
- text: string;
- code?: number;
- }
- interface DiagnosticEventBody {
- file: string;
- diagnostics: Diagnostic[];
- }
- interface DiagnosticEvent extends Event {
- body?: DiagnosticEventBody;
- }
- interface ConfigFileDiagnosticEventBody {
- triggerFile: string;
- configFile: string;
- diagnostics: Diagnostic[];
- }
- interface ConfigFileDiagnosticEvent extends Event {
- body?: ConfigFileDiagnosticEventBody;
- event: "configFileDiag";
- }
- interface ReloadRequestArgs extends FileRequestArgs {
- tmpfile: string;
- }
- interface ReloadRequest extends FileRequest {
- command: CommandTypes.Reload;
- arguments: ReloadRequestArgs;
- }
- interface ReloadResponse extends Response {
- }
- interface SavetoRequestArgs extends FileRequestArgs {
- tmpfile: string;
- }
- interface SavetoRequest extends FileRequest {
- command: CommandTypes.Saveto;
- arguments: SavetoRequestArgs;
- }
- interface NavtoRequestArgs extends FileRequestArgs {
- searchValue: string;
- maxResultCount?: number;
- currentFileOnly?: boolean;
- projectFileName?: string;
- }
- interface NavtoRequest extends FileRequest {
- command: CommandTypes.Navto;
- arguments: NavtoRequestArgs;
- }
- interface NavtoItem {
- name: string;
- kind: string;
- matchKind?: string;
- isCaseSensitive?: boolean;
- kindModifiers?: string;
- file: string;
- start: Location;
- end: Location;
- containerName?: string;
- containerKind?: string;
- }
- interface NavtoResponse extends Response {
- body?: NavtoItem[];
- }
- interface ChangeRequestArgs extends FormatRequestArgs {
- insertString?: string;
- }
- interface ChangeRequest extends FileLocationRequest {
- command: CommandTypes.Change;
- arguments: ChangeRequestArgs;
- }
- interface BraceResponse extends Response {
- body?: TextSpan[];
- }
- interface BraceRequest extends FileLocationRequest {
- command: CommandTypes.Brace;
- }
- interface NavBarRequest extends FileRequest {
- command: CommandTypes.NavBar;
- }
- interface NavTreeRequest extends FileRequest {
- command: CommandTypes.NavTree;
- }
- interface NavigationBarItem {
- text: string;
- kind: string;
- kindModifiers?: string;
- spans: TextSpan[];
- childItems?: NavigationBarItem[];
- indent: number;
- }
- interface NavigationTree {
- text: string;
- kind: string;
- kindModifiers: string;
- spans: TextSpan[];
- childItems?: NavigationTree[];
- }
- interface NavBarResponse extends Response {
- body?: NavigationBarItem[];
- }
- interface NavTreeResponse extends Response {
- body?: NavigationTree;
- }
-}
declare namespace ts {
interface MapLike {
[index: string]: T;
@@ -729,241 +49,241 @@ declare namespace ts {
ConflictMarkerTrivia = 7,
NumericLiteral = 8,
StringLiteral = 9,
- RegularExpressionLiteral = 10,
- NoSubstitutionTemplateLiteral = 11,
- TemplateHead = 12,
- TemplateMiddle = 13,
- TemplateTail = 14,
- OpenBraceToken = 15,
- CloseBraceToken = 16,
- OpenParenToken = 17,
- CloseParenToken = 18,
- OpenBracketToken = 19,
- CloseBracketToken = 20,
- DotToken = 21,
- DotDotDotToken = 22,
- SemicolonToken = 23,
- CommaToken = 24,
- LessThanToken = 25,
- LessThanSlashToken = 26,
- GreaterThanToken = 27,
- LessThanEqualsToken = 28,
- GreaterThanEqualsToken = 29,
- EqualsEqualsToken = 30,
- ExclamationEqualsToken = 31,
- EqualsEqualsEqualsToken = 32,
- ExclamationEqualsEqualsToken = 33,
- EqualsGreaterThanToken = 34,
- PlusToken = 35,
- MinusToken = 36,
- AsteriskToken = 37,
- AsteriskAsteriskToken = 38,
- SlashToken = 39,
- PercentToken = 40,
- PlusPlusToken = 41,
- MinusMinusToken = 42,
- LessThanLessThanToken = 43,
- GreaterThanGreaterThanToken = 44,
- GreaterThanGreaterThanGreaterThanToken = 45,
- AmpersandToken = 46,
- BarToken = 47,
- CaretToken = 48,
- ExclamationToken = 49,
- TildeToken = 50,
- AmpersandAmpersandToken = 51,
- BarBarToken = 52,
- QuestionToken = 53,
- ColonToken = 54,
- AtToken = 55,
- EqualsToken = 56,
- PlusEqualsToken = 57,
- MinusEqualsToken = 58,
- AsteriskEqualsToken = 59,
- AsteriskAsteriskEqualsToken = 60,
- SlashEqualsToken = 61,
- PercentEqualsToken = 62,
- LessThanLessThanEqualsToken = 63,
- GreaterThanGreaterThanEqualsToken = 64,
- GreaterThanGreaterThanGreaterThanEqualsToken = 65,
- AmpersandEqualsToken = 66,
- BarEqualsToken = 67,
- CaretEqualsToken = 68,
- Identifier = 69,
- BreakKeyword = 70,
- CaseKeyword = 71,
- CatchKeyword = 72,
- ClassKeyword = 73,
- ConstKeyword = 74,
- ContinueKeyword = 75,
- DebuggerKeyword = 76,
- DefaultKeyword = 77,
- DeleteKeyword = 78,
- DoKeyword = 79,
- ElseKeyword = 80,
- EnumKeyword = 81,
- ExportKeyword = 82,
- ExtendsKeyword = 83,
- FalseKeyword = 84,
- FinallyKeyword = 85,
- ForKeyword = 86,
- FunctionKeyword = 87,
- IfKeyword = 88,
- ImportKeyword = 89,
- InKeyword = 90,
- InstanceOfKeyword = 91,
- NewKeyword = 92,
- NullKeyword = 93,
- ReturnKeyword = 94,
- SuperKeyword = 95,
- SwitchKeyword = 96,
- ThisKeyword = 97,
- ThrowKeyword = 98,
- TrueKeyword = 99,
- TryKeyword = 100,
- TypeOfKeyword = 101,
- VarKeyword = 102,
- VoidKeyword = 103,
- WhileKeyword = 104,
- WithKeyword = 105,
- ImplementsKeyword = 106,
- InterfaceKeyword = 107,
- LetKeyword = 108,
- PackageKeyword = 109,
- PrivateKeyword = 110,
- ProtectedKeyword = 111,
- PublicKeyword = 112,
- StaticKeyword = 113,
- YieldKeyword = 114,
- AbstractKeyword = 115,
- AsKeyword = 116,
- AnyKeyword = 117,
- AsyncKeyword = 118,
- AwaitKeyword = 119,
- BooleanKeyword = 120,
- ConstructorKeyword = 121,
- DeclareKeyword = 122,
- GetKeyword = 123,
- IsKeyword = 124,
- ModuleKeyword = 125,
- NamespaceKeyword = 126,
- NeverKeyword = 127,
- ReadonlyKeyword = 128,
- RequireKeyword = 129,
- NumberKeyword = 130,
- SetKeyword = 131,
- StringKeyword = 132,
- SymbolKeyword = 133,
- TypeKeyword = 134,
- UndefinedKeyword = 135,
- FromKeyword = 136,
- GlobalKeyword = 137,
- OfKeyword = 138,
- QualifiedName = 139,
- ComputedPropertyName = 140,
- TypeParameter = 141,
- Parameter = 142,
- Decorator = 143,
- PropertySignature = 144,
- PropertyDeclaration = 145,
- MethodSignature = 146,
- MethodDeclaration = 147,
- Constructor = 148,
- GetAccessor = 149,
- SetAccessor = 150,
- CallSignature = 151,
- ConstructSignature = 152,
- IndexSignature = 153,
- TypePredicate = 154,
- TypeReference = 155,
- FunctionType = 156,
- ConstructorType = 157,
- TypeQuery = 158,
- TypeLiteral = 159,
- ArrayType = 160,
- TupleType = 161,
- UnionType = 162,
- IntersectionType = 163,
- ParenthesizedType = 164,
- ThisType = 165,
- LiteralType = 166,
- ObjectBindingPattern = 167,
- ArrayBindingPattern = 168,
- BindingElement = 169,
- ArrayLiteralExpression = 170,
- ObjectLiteralExpression = 171,
- PropertyAccessExpression = 172,
- ElementAccessExpression = 173,
- CallExpression = 174,
- NewExpression = 175,
- TaggedTemplateExpression = 176,
- TypeAssertionExpression = 177,
- ParenthesizedExpression = 178,
- FunctionExpression = 179,
- ArrowFunction = 180,
- DeleteExpression = 181,
- TypeOfExpression = 182,
- VoidExpression = 183,
- AwaitExpression = 184,
- PrefixUnaryExpression = 185,
- PostfixUnaryExpression = 186,
- BinaryExpression = 187,
- ConditionalExpression = 188,
- TemplateExpression = 189,
- YieldExpression = 190,
- SpreadElementExpression = 191,
- ClassExpression = 192,
- OmittedExpression = 193,
- ExpressionWithTypeArguments = 194,
- AsExpression = 195,
- NonNullExpression = 196,
- TemplateSpan = 197,
- SemicolonClassElement = 198,
- Block = 199,
- VariableStatement = 200,
- EmptyStatement = 201,
- ExpressionStatement = 202,
- IfStatement = 203,
- DoStatement = 204,
- WhileStatement = 205,
- ForStatement = 206,
- ForInStatement = 207,
- ForOfStatement = 208,
- ContinueStatement = 209,
- BreakStatement = 210,
- ReturnStatement = 211,
- WithStatement = 212,
- SwitchStatement = 213,
- LabeledStatement = 214,
- ThrowStatement = 215,
- TryStatement = 216,
- DebuggerStatement = 217,
- VariableDeclaration = 218,
- VariableDeclarationList = 219,
- FunctionDeclaration = 220,
- ClassDeclaration = 221,
- InterfaceDeclaration = 222,
- TypeAliasDeclaration = 223,
- EnumDeclaration = 224,
- ModuleDeclaration = 225,
- ModuleBlock = 226,
- CaseBlock = 227,
- NamespaceExportDeclaration = 228,
- ImportEqualsDeclaration = 229,
- ImportDeclaration = 230,
- ImportClause = 231,
- NamespaceImport = 232,
- NamedImports = 233,
- ImportSpecifier = 234,
- ExportAssignment = 235,
- ExportDeclaration = 236,
- NamedExports = 237,
- ExportSpecifier = 238,
- MissingDeclaration = 239,
- ExternalModuleReference = 240,
- JsxElement = 241,
- JsxSelfClosingElement = 242,
- JsxOpeningElement = 243,
- JsxText = 244,
+ JsxText = 10,
+ RegularExpressionLiteral = 11,
+ NoSubstitutionTemplateLiteral = 12,
+ TemplateHead = 13,
+ TemplateMiddle = 14,
+ TemplateTail = 15,
+ OpenBraceToken = 16,
+ CloseBraceToken = 17,
+ OpenParenToken = 18,
+ CloseParenToken = 19,
+ OpenBracketToken = 20,
+ CloseBracketToken = 21,
+ DotToken = 22,
+ DotDotDotToken = 23,
+ SemicolonToken = 24,
+ CommaToken = 25,
+ LessThanToken = 26,
+ LessThanSlashToken = 27,
+ GreaterThanToken = 28,
+ LessThanEqualsToken = 29,
+ GreaterThanEqualsToken = 30,
+ EqualsEqualsToken = 31,
+ ExclamationEqualsToken = 32,
+ EqualsEqualsEqualsToken = 33,
+ ExclamationEqualsEqualsToken = 34,
+ EqualsGreaterThanToken = 35,
+ PlusToken = 36,
+ MinusToken = 37,
+ AsteriskToken = 38,
+ AsteriskAsteriskToken = 39,
+ SlashToken = 40,
+ PercentToken = 41,
+ PlusPlusToken = 42,
+ MinusMinusToken = 43,
+ LessThanLessThanToken = 44,
+ GreaterThanGreaterThanToken = 45,
+ GreaterThanGreaterThanGreaterThanToken = 46,
+ AmpersandToken = 47,
+ BarToken = 48,
+ CaretToken = 49,
+ ExclamationToken = 50,
+ TildeToken = 51,
+ AmpersandAmpersandToken = 52,
+ BarBarToken = 53,
+ QuestionToken = 54,
+ ColonToken = 55,
+ AtToken = 56,
+ EqualsToken = 57,
+ PlusEqualsToken = 58,
+ MinusEqualsToken = 59,
+ AsteriskEqualsToken = 60,
+ AsteriskAsteriskEqualsToken = 61,
+ SlashEqualsToken = 62,
+ PercentEqualsToken = 63,
+ LessThanLessThanEqualsToken = 64,
+ GreaterThanGreaterThanEqualsToken = 65,
+ GreaterThanGreaterThanGreaterThanEqualsToken = 66,
+ AmpersandEqualsToken = 67,
+ BarEqualsToken = 68,
+ CaretEqualsToken = 69,
+ Identifier = 70,
+ BreakKeyword = 71,
+ CaseKeyword = 72,
+ CatchKeyword = 73,
+ ClassKeyword = 74,
+ ConstKeyword = 75,
+ ContinueKeyword = 76,
+ DebuggerKeyword = 77,
+ DefaultKeyword = 78,
+ DeleteKeyword = 79,
+ DoKeyword = 80,
+ ElseKeyword = 81,
+ EnumKeyword = 82,
+ ExportKeyword = 83,
+ ExtendsKeyword = 84,
+ FalseKeyword = 85,
+ FinallyKeyword = 86,
+ ForKeyword = 87,
+ FunctionKeyword = 88,
+ IfKeyword = 89,
+ ImportKeyword = 90,
+ InKeyword = 91,
+ InstanceOfKeyword = 92,
+ NewKeyword = 93,
+ NullKeyword = 94,
+ ReturnKeyword = 95,
+ SuperKeyword = 96,
+ SwitchKeyword = 97,
+ ThisKeyword = 98,
+ ThrowKeyword = 99,
+ TrueKeyword = 100,
+ TryKeyword = 101,
+ TypeOfKeyword = 102,
+ VarKeyword = 103,
+ VoidKeyword = 104,
+ WhileKeyword = 105,
+ WithKeyword = 106,
+ ImplementsKeyword = 107,
+ InterfaceKeyword = 108,
+ LetKeyword = 109,
+ PackageKeyword = 110,
+ PrivateKeyword = 111,
+ ProtectedKeyword = 112,
+ PublicKeyword = 113,
+ StaticKeyword = 114,
+ YieldKeyword = 115,
+ AbstractKeyword = 116,
+ AsKeyword = 117,
+ AnyKeyword = 118,
+ AsyncKeyword = 119,
+ AwaitKeyword = 120,
+ BooleanKeyword = 121,
+ ConstructorKeyword = 122,
+ DeclareKeyword = 123,
+ GetKeyword = 124,
+ IsKeyword = 125,
+ ModuleKeyword = 126,
+ NamespaceKeyword = 127,
+ NeverKeyword = 128,
+ ReadonlyKeyword = 129,
+ RequireKeyword = 130,
+ NumberKeyword = 131,
+ SetKeyword = 132,
+ StringKeyword = 133,
+ SymbolKeyword = 134,
+ TypeKeyword = 135,
+ UndefinedKeyword = 136,
+ FromKeyword = 137,
+ GlobalKeyword = 138,
+ OfKeyword = 139,
+ QualifiedName = 140,
+ ComputedPropertyName = 141,
+ TypeParameter = 142,
+ Parameter = 143,
+ Decorator = 144,
+ PropertySignature = 145,
+ PropertyDeclaration = 146,
+ MethodSignature = 147,
+ MethodDeclaration = 148,
+ Constructor = 149,
+ GetAccessor = 150,
+ SetAccessor = 151,
+ CallSignature = 152,
+ ConstructSignature = 153,
+ IndexSignature = 154,
+ TypePredicate = 155,
+ TypeReference = 156,
+ FunctionType = 157,
+ ConstructorType = 158,
+ TypeQuery = 159,
+ TypeLiteral = 160,
+ ArrayType = 161,
+ TupleType = 162,
+ UnionType = 163,
+ IntersectionType = 164,
+ ParenthesizedType = 165,
+ ThisType = 166,
+ LiteralType = 167,
+ ObjectBindingPattern = 168,
+ ArrayBindingPattern = 169,
+ BindingElement = 170,
+ ArrayLiteralExpression = 171,
+ ObjectLiteralExpression = 172,
+ PropertyAccessExpression = 173,
+ ElementAccessExpression = 174,
+ CallExpression = 175,
+ NewExpression = 176,
+ TaggedTemplateExpression = 177,
+ TypeAssertionExpression = 178,
+ ParenthesizedExpression = 179,
+ FunctionExpression = 180,
+ ArrowFunction = 181,
+ DeleteExpression = 182,
+ TypeOfExpression = 183,
+ VoidExpression = 184,
+ AwaitExpression = 185,
+ PrefixUnaryExpression = 186,
+ PostfixUnaryExpression = 187,
+ BinaryExpression = 188,
+ ConditionalExpression = 189,
+ TemplateExpression = 190,
+ YieldExpression = 191,
+ SpreadElementExpression = 192,
+ ClassExpression = 193,
+ OmittedExpression = 194,
+ ExpressionWithTypeArguments = 195,
+ AsExpression = 196,
+ NonNullExpression = 197,
+ TemplateSpan = 198,
+ SemicolonClassElement = 199,
+ Block = 200,
+ VariableStatement = 201,
+ EmptyStatement = 202,
+ ExpressionStatement = 203,
+ IfStatement = 204,
+ DoStatement = 205,
+ WhileStatement = 206,
+ ForStatement = 207,
+ ForInStatement = 208,
+ ForOfStatement = 209,
+ ContinueStatement = 210,
+ BreakStatement = 211,
+ ReturnStatement = 212,
+ WithStatement = 213,
+ SwitchStatement = 214,
+ LabeledStatement = 215,
+ ThrowStatement = 216,
+ TryStatement = 217,
+ DebuggerStatement = 218,
+ VariableDeclaration = 219,
+ VariableDeclarationList = 220,
+ FunctionDeclaration = 221,
+ ClassDeclaration = 222,
+ InterfaceDeclaration = 223,
+ TypeAliasDeclaration = 224,
+ EnumDeclaration = 225,
+ ModuleDeclaration = 226,
+ ModuleBlock = 227,
+ CaseBlock = 228,
+ NamespaceExportDeclaration = 229,
+ ImportEqualsDeclaration = 230,
+ ImportDeclaration = 231,
+ ImportClause = 232,
+ NamespaceImport = 233,
+ NamedImports = 234,
+ ImportSpecifier = 235,
+ ExportAssignment = 236,
+ ExportDeclaration = 237,
+ NamedExports = 238,
+ ExportSpecifier = 239,
+ MissingDeclaration = 240,
+ ExternalModuleReference = 241,
+ JsxElement = 242,
+ JsxSelfClosingElement = 243,
+ JsxOpeningElement = 244,
JsxClosingElement = 245,
JsxAttribute = 246,
JsxSpreadAttribute = 247,
@@ -1009,31 +329,31 @@ declare namespace ts {
NotEmittedStatement = 287,
PartiallyEmittedExpression = 288,
Count = 289,
- FirstAssignment = 56,
- LastAssignment = 68,
- FirstCompoundAssignment = 57,
- LastCompoundAssignment = 68,
- FirstReservedWord = 70,
- LastReservedWord = 105,
- FirstKeyword = 70,
- LastKeyword = 138,
- FirstFutureReservedWord = 106,
- LastFutureReservedWord = 114,
- FirstTypeNode = 154,
- LastTypeNode = 166,
- FirstPunctuation = 15,
- LastPunctuation = 68,
+ FirstAssignment = 57,
+ LastAssignment = 69,
+ FirstCompoundAssignment = 58,
+ LastCompoundAssignment = 69,
+ FirstReservedWord = 71,
+ LastReservedWord = 106,
+ FirstKeyword = 71,
+ LastKeyword = 139,
+ FirstFutureReservedWord = 107,
+ LastFutureReservedWord = 115,
+ FirstTypeNode = 155,
+ LastTypeNode = 167,
+ FirstPunctuation = 16,
+ LastPunctuation = 69,
FirstToken = 0,
- LastToken = 138,
+ LastToken = 139,
FirstTriviaToken = 2,
LastTriviaToken = 7,
FirstLiteralToken = 8,
- LastLiteralToken = 11,
- FirstTemplateToken = 11,
- LastTemplateToken = 14,
- FirstBinaryOperator = 25,
- LastBinaryOperator = 68,
- FirstNode = 139,
+ LastLiteralToken = 12,
+ FirstTemplateToken = 12,
+ LastTemplateToken = 15,
+ FirstBinaryOperator = 26,
+ LastBinaryOperator = 69,
+ FirstNode = 140,
FirstJSDocNode = 257,
LastJSDocNode = 282,
FirstJSDocTagNode = 273,
@@ -1088,6 +408,7 @@ declare namespace ts {
AccessibilityModifier = 28,
ParameterPropertyModifier = 92,
NonPublicAccessibilityModifier = 24,
+ TypeScriptModifier = 2270,
}
const enum JsxFlags {
None = 0,
@@ -1095,29 +416,12 @@ declare namespace ts {
IntrinsicIndexedElement = 2,
IntrinsicElement = 3,
}
- const enum RelationComparisonResult {
- Succeeded = 1,
- Failed = 2,
- FailedAndReported = 3,
- }
interface Node extends TextRange {
kind: SyntaxKind;
flags: NodeFlags;
- modifierFlagsCache?: ModifierFlags;
- transformFlags?: TransformFlags;
decorators?: NodeArray;
modifiers?: ModifiersArray;
- id?: number;
parent?: Node;
- original?: Node;
- startsOnNewLine?: boolean;
- jsDocComments?: JSDoc[];
- symbol?: Symbol;
- locals?: SymbolTable;
- nextContainer?: Node;
- localSymbol?: Symbol;
- flowNode?: FlowNode;
- emitNode?: EmitNode;
}
interface NodeArray extends Array, TextRange {
hasTrailingComma?: boolean;
@@ -1135,19 +439,10 @@ declare namespace ts {
type AtToken = Token;
type Modifier = Token | Token | Token | Token | Token | Token | Token | Token | Token | Token | Token;
type ModifiersArray = NodeArray;
- const enum GeneratedIdentifierKind {
- None = 0,
- Auto = 1,
- Loop = 2,
- Unique = 3,
- Node = 4,
- }
interface Identifier extends PrimaryExpression {
kind: SyntaxKind.Identifier;
text: string;
originalKeywordKind?: SyntaxKind;
- autoGenerateKind?: GeneratedIdentifierKind;
- autoGenerateId?: number;
}
interface TransientIdentifier extends Identifier {
resolvedSymbol: Symbol;
@@ -1380,7 +675,6 @@ declare namespace ts {
}
interface StringLiteral extends LiteralExpression {
kind: SyntaxKind.StringLiteral;
- textSourceNode?: Identifier | StringLiteral;
}
interface Expression extends Node {
_expressionBrand: any;
@@ -1389,10 +683,6 @@ declare namespace ts {
interface OmittedExpression extends Expression {
kind: SyntaxKind.OmittedExpression;
}
- interface PartiallyEmittedExpression extends LeftHandSideExpression {
- kind: SyntaxKind.PartiallyEmittedExpression;
- expression: Expression;
- }
interface UnaryExpression extends Expression {
_unaryExpressionBrand: any;
}
@@ -1506,7 +796,6 @@ declare namespace ts {
text: string;
isUnterminated?: boolean;
hasExtendedUnicodeEscape?: boolean;
- isOctalLiteral?: boolean;
}
interface LiteralExpression extends LiteralLikeNode, PrimaryExpression {
_literalExpressionBrand: any;
@@ -1548,7 +837,6 @@ declare namespace ts {
interface ArrayLiteralExpression extends PrimaryExpression {
kind: SyntaxKind.ArrayLiteralExpression;
elements: NodeArray;
- multiLine?: boolean;
}
interface SpreadElementExpression extends Expression {
kind: SyntaxKind.SpreadElementExpression;
@@ -1559,7 +847,6 @@ declare namespace ts {
}
interface ObjectLiteralExpression extends ObjectLiteralExpressionBase {
kind: SyntaxKind.ObjectLiteralExpression;
- multiLine?: boolean;
}
type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression;
type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression;
@@ -1668,9 +955,6 @@ declare namespace ts {
interface Statement extends Node {
_statementBrand: any;
}
- interface NotEmittedStatement extends Statement {
- kind: SyntaxKind.NotEmittedStatement;
- }
interface EmptyStatement extends Statement {
kind: SyntaxKind.EmptyStatement;
}
@@ -1685,7 +969,6 @@ declare namespace ts {
interface Block extends Statement {
kind: SyntaxKind.Block;
statements: NodeArray;
- multiLine?: boolean;
}
interface VariableStatement extends Statement {
kind: SyntaxKind.VariableStatement;
@@ -2051,8 +1334,9 @@ declare namespace ts {
TrueCondition = 32,
FalseCondition = 64,
SwitchClause = 128,
- Referenced = 256,
- Shared = 512,
+ ArrayMutation = 256,
+ Referenced = 512,
+ Shared = 1024,
Label = 12,
Condition = 96,
}
@@ -2080,6 +1364,10 @@ declare namespace ts {
clauseEnd: number;
antecedent: FlowNode;
}
+ interface FlowArrayMutation extends FlowNode {
+ node: CallExpression | BinaryExpression;
+ antecedent: FlowNode;
+ }
type FlowType = Type | IncompleteType;
interface IncompleteType {
flags: TypeFlags;
@@ -2102,26 +1390,8 @@ declare namespace ts {
typeReferenceDirectives: FileReference[];
languageVariant: LanguageVariant;
isDeclarationFile: boolean;
- renamedDependencies?: Map;
hasNoDefaultLib: boolean;
languageVersion: ScriptTarget;
- scriptKind: ScriptKind;
- externalModuleIndicator: Node;
- commonJsModuleIndicator: Node;
- identifiers: Map;
- nodeCount: number;
- identifierCount: number;
- symbolCount: number;
- parseDiagnostics: Diagnostic[];
- bindDiagnostics: Diagnostic[];
- lineMap: number[];
- classifiableNames?: Map;
- resolvedModules: Map;
- resolvedTypeReferenceDirectiveNames: Map;
- imports: LiteralExpression[];
- moduleAugmentations: LiteralExpression[];
- patternAmbientModules?: PatternAmbientModule[];
- externalHelpersModuleName?: Identifier;
}
interface ScriptReferenceHost {
getCompilerOptions(): CompilerOptions;
@@ -2154,17 +1424,6 @@ declare namespace ts {
getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[];
getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[];
getTypeChecker(): TypeChecker;
- getCommonSourceDirectory(): string;
- getDiagnosticsProducingTypeChecker(): TypeChecker;
- dropDiagnosticsProducingTypeChecker(): void;
- getClassifiableNames(): Map;
- getNodeCount(): number;
- getIdentifierCount(): number;
- getSymbolCount(): number;
- getTypeCount(): number;
- getFileProcessingDiagnostics(): DiagnosticCollection;
- getResolvedTypeReferenceDirectives(): Map;
- structureIsReused?: boolean;
}
interface SourceMapSpan {
emittedLine: number;
@@ -2195,13 +1454,6 @@ declare namespace ts {
emitSkipped: boolean;
diagnostics: Diagnostic[];
emittedFiles: string[];
- sourceMaps: SourceMapData[];
- }
- interface TypeCheckerHost {
- getCompilerOptions(): CompilerOptions;
- getSourceFiles(): SourceFile[];
- getSourceFile(fileName: string): SourceFile;
- getResolvedTypeReferenceDirectives(): Map;
}
interface TypeChecker {
getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type;
@@ -2241,13 +1493,6 @@ declare namespace ts {
getJsxIntrinsicTagNames(): Symbol[];
isOptionalParameter(node: ParameterDeclaration): boolean;
getAmbientModules(): Symbol[];
- getDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[];
- getGlobalDiagnostics(): Diagnostic[];
- getEmitResolver(sourceFile?: SourceFile, cancellationToken?: CancellationToken): EmitResolver;
- getNodeCount(): number;
- getIdentifierCount(): number;
- getSymbolCount(): number;
- getTypeCount(): number;
}
interface SymbolDisplayBuilder {
buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
@@ -2295,11 +1540,6 @@ declare namespace ts {
WriteTypeParametersOrArguments = 1,
UseOnlyExternalAliasing = 2,
}
- const enum SymbolAccessibility {
- Accessible = 0,
- NotAccessible = 1,
- CannotBeNamed = 2,
- }
const enum TypePredicateKind {
This = 0,
Identifier = 1,
@@ -2317,60 +1557,6 @@ declare namespace ts {
parameterIndex: number;
}
type TypePredicate = IdentifierTypePredicate | ThisTypePredicate;
- type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration;
- interface SymbolVisibilityResult {
- accessibility: SymbolAccessibility;
- aliasesToMakeVisible?: AnyImportSyntax[];
- errorSymbolName?: string;
- errorNode?: Node;
- }
- interface SymbolAccessibilityResult extends SymbolVisibilityResult {
- errorModuleName?: string;
- }
- enum TypeReferenceSerializationKind {
- Unknown = 0,
- TypeWithConstructSignatureAndValue = 1,
- VoidNullableOrNeverType = 2,
- NumberLikeType = 3,
- StringLikeType = 4,
- BooleanType = 5,
- ArrayLikeType = 6,
- ESSymbolType = 7,
- Promise = 8,
- TypeWithCallSignature = 9,
- ObjectType = 10,
- }
- interface EmitResolver {
- hasGlobalName(name: string): boolean;
- getReferencedExportContainer(node: Identifier, prefixLocals?: boolean): SourceFile | ModuleDeclaration | EnumDeclaration;
- getReferencedImportDeclaration(node: Identifier): Declaration;
- getReferencedDeclarationWithCollidingName(node: Identifier): Declaration;
- isDeclarationWithCollidingName(node: Declaration): boolean;
- isValueAliasDeclaration(node: Node): boolean;
- isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean;
- isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
- getNodeCheckFlags(node: Node): NodeCheckFlags;
- isDeclarationVisible(node: Declaration): boolean;
- collectLinkedAliases(node: Identifier): Node[];
- isImplementationOfOverload(node: FunctionLikeDeclaration): boolean;
- writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
- writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
- writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
- writeBaseConstructorTypeOfClass(node: ClassLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
- isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags, shouldComputeAliasToMarkVisible: boolean): SymbolAccessibilityResult;
- isEntityNameVisible(entityName: EntityNameOrEntityNameExpression, enclosingDeclaration: Node): SymbolVisibilityResult;
- getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
- getReferencedValueDeclaration(reference: Identifier): Declaration;
- getTypeReferenceSerializationKind(typeName: EntityName, location?: Node): TypeReferenceSerializationKind;
- isOptionalParameter(node: ParameterDeclaration): boolean;
- moduleExportsSomeValue(moduleReferenceExpression: Expression): boolean;
- isArgumentsLocalBinding(node: Identifier): boolean;
- getExternalModuleFileFromDeclaration(declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration | ModuleDeclaration): SourceFile;
- getTypeReferenceDirectivesForEntityName(name: EntityNameOrEntityNameExpression): string[];
- getTypeReferenceDirectivesForSymbol(symbol: Symbol, meaning?: SymbolFlags): string[];
- isLiteralConstDeclaration(node: VariableDeclaration | PropertyDeclaration | PropertySignature | ParameterDeclaration): boolean;
- writeLiteralConstValue(node: VariableDeclaration | PropertyDeclaration | PropertySignature | ParameterDeclaration, writer: SymbolWriter): void;
- }
const enum SymbolFlags {
None = 0,
FunctionScopedVariable = 1,
@@ -2437,7 +1623,6 @@ declare namespace ts {
PropertyOrAccessor = 98308,
Export = 7340032,
ClassMember = 106500,
- Classifiable = 788448,
}
interface Symbol {
flags: SymbolFlags;
@@ -2447,83 +1632,8 @@ declare namespace ts {
members?: SymbolTable;
exports?: SymbolTable;
globalExports?: SymbolTable;
- isReadonly?: boolean;
- id?: number;
- mergeId?: number;
- parent?: Symbol;
- exportSymbol?: Symbol;
- constEnumOnlyModule?: boolean;
- isReferenced?: boolean;
- isReplaceableByMethod?: boolean;
- isAssigned?: boolean;
- }
- interface SymbolLinks {
- target?: Symbol;
- type?: Type;
- declaredType?: Type;
- typeParameters?: TypeParameter[];
- inferredClassType?: Type;
- instantiations?: Map;
- mapper?: TypeMapper;
- referenced?: boolean;
- containingType?: UnionOrIntersectionType;
- hasNonUniformType?: boolean;
- isPartial?: boolean;
- isDiscriminantProperty?: boolean;
- resolvedExports?: SymbolTable;
- exportsChecked?: boolean;
- isDeclarationWithCollidingName?: boolean;
- bindingElement?: BindingElement;
- exportsSomeValue?: boolean;
- }
- interface TransientSymbol extends Symbol, SymbolLinks {
}
type SymbolTable = Map;
- interface Pattern {
- prefix: string;
- suffix: string;
- }
- interface PatternAmbientModule {
- pattern: Pattern;
- symbol: Symbol;
- }
- const enum NodeCheckFlags {
- TypeChecked = 1,
- LexicalThis = 2,
- CaptureThis = 4,
- SuperInstance = 256,
- SuperStatic = 512,
- ContextChecked = 1024,
- AsyncMethodWithSuper = 2048,
- AsyncMethodWithSuperBinding = 4096,
- CaptureArguments = 8192,
- EnumValuesComputed = 16384,
- LexicalModuleMergesWithClass = 32768,
- LoopWithCapturedBlockScopedBinding = 65536,
- CapturedBlockScopedBinding = 131072,
- BlockScopedBindingInLoop = 262144,
- ClassWithBodyScopedClassBinding = 524288,
- BodyScopedClassBinding = 1048576,
- NeedsLoopOutParameter = 2097152,
- AssignmentsMarked = 4194304,
- ClassWithConstructorReference = 8388608,
- ConstructorReferenceInClass = 16777216,
- }
- interface NodeLinks {
- flags?: NodeCheckFlags;
- resolvedType?: Type;
- resolvedSignature?: Signature;
- resolvedSymbol?: Symbol;
- resolvedIndexInfo?: IndexInfo;
- enumMemberValue?: number;
- isVisible?: boolean;
- hasReportedStatementInAmbientContext?: boolean;
- jsxFlags?: JsxFlags;
- resolvedJsxType?: Type;
- hasSuperCall?: boolean;
- superCall?: ExpressionStatement;
- switchTypes?: Type[];
- }
const enum TypeFlags {
Any = 1,
String = 2,
@@ -2548,18 +1658,9 @@ declare namespace ts {
Intersection = 1048576,
Anonymous = 2097152,
Instantiated = 4194304,
- ObjectLiteral = 8388608,
- FreshLiteral = 16777216,
- ContainsWideningType = 33554432,
- ContainsObjectLiteral = 67108864,
- ContainsAnyFunctionType = 134217728,
- Nullable = 6144,
Literal = 480,
StringOrNumberLiteral = 96,
- DefinitelyFalsy = 7392,
PossiblyFalsy = 7406,
- Intrinsic = 16015,
- Primitive = 8190,
StringLike = 34,
NumberLike = 340,
BooleanLike = 136,
@@ -2570,21 +1671,15 @@ declare namespace ts {
StructuredOrTypeParameter = 4177920,
Narrowable = 4178943,
NotUnionOrUnit = 2589185,
- RequiresWidening = 100663296,
- PropagatingFlags = 234881024,
}
type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression;
interface Type {
flags: TypeFlags;
- id: number;
symbol?: Symbol;
pattern?: DestructuringPattern;
aliasSymbol?: Symbol;
aliasTypeArguments?: Type[];
}
- interface IntrinsicType extends Type {
- intrinsicName: string;
- }
interface LiteralType extends Type {
text: string;
freshType?: LiteralType;
@@ -2604,8 +1699,6 @@ declare namespace ts {
outerTypeParameters: TypeParameter[];
localTypeParameters: TypeParameter[];
thisType: TypeParameter;
- resolvedBaseConstructorType?: Type;
- resolvedBaseTypes: ObjectType[];
}
interface InterfaceTypeWithDeclaredMembers extends InterfaceType {
declaredProperties: Symbol[];
@@ -2619,42 +1712,16 @@ declare namespace ts {
typeArguments: Type[];
}
interface GenericType extends InterfaceType, TypeReference {
- instantiations: Map;
}
interface UnionOrIntersectionType extends Type {
types: Type[];
- resolvedProperties: SymbolTable;
- couldContainTypeParameters: boolean;
}
interface UnionType extends UnionOrIntersectionType {
}
interface IntersectionType extends UnionOrIntersectionType {
}
- interface AnonymousType extends ObjectType {
- target?: AnonymousType;
- mapper?: TypeMapper;
- }
- interface ResolvedType extends ObjectType, UnionOrIntersectionType {
- members: SymbolTable;
- properties: Symbol[];
- callSignatures: Signature[];
- constructSignatures: Signature[];
- stringIndexInfo?: IndexInfo;
- numberIndexInfo?: IndexInfo;
- }
- interface FreshObjectLiteralType extends ResolvedType {
- regularType: ResolvedType;
- }
- interface IterableOrIteratorType extends ObjectType, UnionType {
- iterableElementType?: Type;
- iteratorElementType?: Type;
- }
interface TypeParameter extends Type {
constraint: Type;
- target?: TypeParameter;
- mapper?: TypeMapper;
- resolvedApparentType: Type;
- isThisType?: boolean;
}
const enum SignatureKind {
Call = 0,
@@ -2664,17 +1731,6 @@ declare namespace ts {
declaration: SignatureDeclaration;
typeParameters: TypeParameter[];
parameters: Symbol[];
- thisParameter?: Symbol;
- resolvedReturnType: Type;
- minArgumentCount: number;
- hasRestParameter: boolean;
- hasLiteralTypes: boolean;
- target?: Signature;
- mapper?: TypeMapper;
- unionSignatures?: Signature[];
- erasedSignatureCache?: Signature;
- isolatedSignatureType?: ObjectType;
- typePredicate?: TypePredicate;
}
const enum IndexKind {
String = 0,
@@ -2685,34 +1741,6 @@ declare namespace ts {
isReadonly: boolean;
declaration?: SignatureDeclaration;
}
- interface TypeMapper {
- (t: TypeParameter): Type;
- mappedTypes?: Type[];
- targetTypes?: Type[];
- instantiations?: Type[];
- context?: InferenceContext;
- }
- interface TypeInferences {
- primary: Type[];
- secondary: Type[];
- topLevel: boolean;
- isFixed: boolean;
- }
- interface InferenceContext {
- signature: Signature;
- inferUnionTypes: boolean;
- inferences: TypeInferences[];
- inferredTypes: Type[];
- mapper?: TypeMapper;
- failedTypeParameterIndex?: number;
- }
- const enum SpecialPropertyAssignmentKind {
- None = 0,
- ExportsProperty = 1,
- ModuleExports = 2,
- PrototypeProperty = 3,
- ThisProperty = 4,
- }
interface DiagnosticMessage {
key: string;
category: DiagnosticCategory;
@@ -2745,33 +1773,25 @@ declare namespace ts {
type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike;
interface CompilerOptions {
allowJs?: boolean;
- allowNonTsExtensions?: boolean;
allowSyntheticDefaultImports?: boolean;
allowUnreachableCode?: boolean;
allowUnusedLabels?: boolean;
alwaysStrict?: boolean;
baseUrl?: string;
charset?: string;
- configFilePath?: string;
declaration?: boolean;
declarationDir?: string;
- diagnostics?: boolean;
- extendedDiagnostics?: boolean;
disableSizeLimit?: boolean;
emitBOM?: boolean;
emitDecoratorMetadata?: boolean;
experimentalDecorators?: boolean;
forceConsistentCasingInFileNames?: boolean;
- help?: boolean;
importHelpers?: boolean;
- init?: boolean;
inlineSourceMap?: boolean;
inlineSources?: boolean;
isolatedModules?: boolean;
jsx?: JsxEmit;
lib?: string[];
- listEmittedFiles?: boolean;
- listFiles?: boolean;
locale?: string;
mapRoot?: string;
maxNodeModuleJsDepth?: number;
@@ -2797,7 +1817,6 @@ declare namespace ts {
paths?: MapLike;
preserveConstEnums?: boolean;
project?: string;
- pretty?: DiagnosticStyle;
reactNamespace?: string;
removeComments?: boolean;
rootDir?: string;
@@ -2807,16 +1826,12 @@ declare namespace ts {
sourceMap?: boolean;
sourceRoot?: string;
strictNullChecks?: boolean;
- stripInternal?: boolean;
suppressExcessPropertyErrors?: boolean;
suppressImplicitAnyIndexErrors?: boolean;
- suppressOutputPathCheck?: boolean;
target?: ScriptTarget;
traceResolution?: boolean;
types?: string[];
typeRoots?: string[];
- version?: boolean;
- watch?: boolean;
[option: string]: CompilerOptionsValue | undefined;
}
interface TypingOptions {
@@ -2839,7 +1854,6 @@ declare namespace ts {
AMD = 2,
UMD = 3,
System = 4,
- ES6 = 5,
ES2015 = 5,
}
const enum JsxEmit {
@@ -2865,18 +1879,15 @@ declare namespace ts {
const enum ScriptTarget {
ES3 = 0,
ES5 = 1,
- ES6 = 2,
ES2015 = 2,
- Latest = 2,
+ ES2016 = 3,
+ ES2017 = 4,
+ Latest = 4,
}
const enum LanguageVariant {
Standard = 0,
JSX = 1,
}
- const enum DiagnosticStyle {
- Simple = 0,
- Pretty = 1,
- }
interface ParsedCommandLine {
options: CompilerOptions;
typingOptions?: TypingOptions;
@@ -2894,156 +1905,6 @@ declare namespace ts {
fileNames: string[];
wildcardDirectories: MapLike;
}
- interface CommandLineOptionBase {
- name: string;
- type: "string" | "number" | "boolean" | "object" | "list" | Map;
- isFilePath?: boolean;
- shortName?: string;
- description?: DiagnosticMessage;
- paramType?: DiagnosticMessage;
- experimental?: boolean;
- isTSConfigOnly?: boolean;
- }
- interface CommandLineOptionOfPrimitiveType extends CommandLineOptionBase {
- type: "string" | "number" | "boolean";
- }
- interface CommandLineOptionOfCustomType extends CommandLineOptionBase {
- type: Map;
- }
- interface TsConfigOnlyOption extends CommandLineOptionBase {
- type: "object";
- }
- interface CommandLineOptionOfListType extends CommandLineOptionBase {
- type: "list";
- element: CommandLineOptionOfCustomType | CommandLineOptionOfPrimitiveType;
- }
- type CommandLineOption = CommandLineOptionOfCustomType | CommandLineOptionOfPrimitiveType | TsConfigOnlyOption | CommandLineOptionOfListType;
- const enum CharacterCodes {
- nullCharacter = 0,
- maxAsciiCharacter = 127,
- lineFeed = 10,
- carriageReturn = 13,
- lineSeparator = 8232,
- paragraphSeparator = 8233,
- nextLine = 133,
- space = 32,
- nonBreakingSpace = 160,
- enQuad = 8192,
- emQuad = 8193,
- enSpace = 8194,
- emSpace = 8195,
- threePerEmSpace = 8196,
- fourPerEmSpace = 8197,
- sixPerEmSpace = 8198,
- figureSpace = 8199,
- punctuationSpace = 8200,
- thinSpace = 8201,
- hairSpace = 8202,
- zeroWidthSpace = 8203,
- narrowNoBreakSpace = 8239,
- ideographicSpace = 12288,
- mathematicalSpace = 8287,
- ogham = 5760,
- _ = 95,
- $ = 36,
- _0 = 48,
- _1 = 49,
- _2 = 50,
- _3 = 51,
- _4 = 52,
- _5 = 53,
- _6 = 54,
- _7 = 55,
- _8 = 56,
- _9 = 57,
- a = 97,
- b = 98,
- c = 99,
- d = 100,
- e = 101,
- f = 102,
- g = 103,
- h = 104,
- i = 105,
- j = 106,
- k = 107,
- l = 108,
- m = 109,
- n = 110,
- o = 111,
- p = 112,
- q = 113,
- r = 114,
- s = 115,
- t = 116,
- u = 117,
- v = 118,
- w = 119,
- x = 120,
- y = 121,
- z = 122,
- A = 65,
- B = 66,
- C = 67,
- D = 68,
- E = 69,
- F = 70,
- G = 71,
- H = 72,
- I = 73,
- J = 74,
- K = 75,
- L = 76,
- M = 77,
- N = 78,
- O = 79,
- P = 80,
- Q = 81,
- R = 82,
- S = 83,
- T = 84,
- U = 85,
- V = 86,
- W = 87,
- X = 88,
- Y = 89,
- Z = 90,
- ampersand = 38,
- asterisk = 42,
- at = 64,
- backslash = 92,
- backtick = 96,
- bar = 124,
- caret = 94,
- closeBrace = 125,
- closeBracket = 93,
- closeParen = 41,
- colon = 58,
- comma = 44,
- dot = 46,
- doubleQuote = 34,
- equals = 61,
- exclamation = 33,
- greaterThan = 62,
- hash = 35,
- lessThan = 60,
- minus = 45,
- openBrace = 123,
- openBracket = 91,
- openParen = 40,
- percent = 37,
- plus = 43,
- question = 63,
- semicolon = 59,
- singleQuote = 39,
- slash = 47,
- tilde = 126,
- backspace = 8,
- formFeed = 12,
- byteOrderMark = 65279,
- tab = 9,
- verticalTab = 11,
- }
interface ModuleResolutionHost {
fileExists(fileName: string): boolean;
readFile(fileName: string): string;
@@ -3085,100 +1946,6 @@ declare namespace ts {
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[];
getEnvironmentVariable?(name: string): string;
}
- const enum TransformFlags {
- None = 0,
- TypeScript = 1,
- ContainsTypeScript = 2,
- Jsx = 4,
- ContainsJsx = 8,
- ES7 = 16,
- ContainsES7 = 32,
- ES6 = 64,
- ContainsES6 = 128,
- DestructuringAssignment = 256,
- Generator = 512,
- ContainsGenerator = 1024,
- ContainsDecorators = 2048,
- ContainsPropertyInitializer = 4096,
- ContainsLexicalThis = 8192,
- ContainsCapturedLexicalThis = 16384,
- ContainsLexicalThisInComputedPropertyName = 32768,
- ContainsDefaultValueAssignments = 65536,
- ContainsParameterPropertyAssignments = 131072,
- ContainsSpreadElementExpression = 262144,
- ContainsComputedPropertyName = 524288,
- ContainsBlockScopedBinding = 1048576,
- ContainsBindingPattern = 2097152,
- ContainsYield = 4194304,
- ContainsHoistedDeclarationOrCompletion = 8388608,
- HasComputedFlags = 536870912,
- AssertTypeScript = 3,
- AssertJsx = 12,
- AssertES7 = 48,
- AssertES6 = 192,
- AssertGenerator = 1536,
- NodeExcludes = 536871765,
- ArrowFunctionExcludes = 550710101,
- FunctionExcludes = 550726485,
- ConstructorExcludes = 550593365,
- MethodOrAccessorExcludes = 550593365,
- ClassExcludes = 537590613,
- ModuleExcludes = 546335573,
- TypeExcludes = -3,
- ObjectLiteralExcludes = 537430869,
- ArrayLiteralOrCallOrNewExcludes = 537133909,
- VariableDeclarationListExcludes = 538968917,
- ParameterExcludes = 538968917,
- TypeScriptClassSyntaxMask = 137216,
- ES6FunctionSyntaxMask = 81920,
- }
- interface EmitNode {
- flags?: EmitFlags;
- commentRange?: TextRange;
- sourceMapRange?: TextRange;
- tokenSourceMapRanges?: Map;
- annotatedNodes?: Node[];
- constantValue?: number;
- }
- const enum EmitFlags {
- EmitEmitHelpers = 1,
- EmitExportStar = 2,
- EmitSuperHelper = 4,
- EmitAdvancedSuperHelper = 8,
- UMDDefine = 16,
- SingleLine = 32,
- AdviseOnEmitNode = 64,
- NoSubstitution = 128,
- CapturesThis = 256,
- NoLeadingSourceMap = 512,
- NoTrailingSourceMap = 1024,
- NoSourceMap = 1536,
- NoNestedSourceMaps = 2048,
- NoTokenLeadingSourceMaps = 4096,
- NoTokenTrailingSourceMaps = 8192,
- NoTokenSourceMaps = 12288,
- NoLeadingComments = 16384,
- NoTrailingComments = 32768,
- NoComments = 49152,
- NoNestedComments = 65536,
- ExportName = 131072,
- LocalName = 262144,
- Indented = 524288,
- NoIndentation = 1048576,
- AsyncFunctionBody = 2097152,
- ReuseTempVariableScope = 4194304,
- CustomPrologue = 8388608,
- }
- const enum EmitContext {
- SourceFile = 0,
- Expression = 1,
- IdentifierName = 2,
- Unspecified = 3,
- }
- interface LexicalEnvironment {
- startLexicalEnvironment(): void;
- endLexicalEnvironment(): Statement[];
- }
interface TextSpan {
start: number;
length: number;
@@ -3187,211 +1954,10 @@ declare namespace ts {
span: TextSpan;
newLength: number;
}
- interface DiagnosticCollection {
- add(diagnostic: Diagnostic): void;
- getGlobalDiagnostics(): Diagnostic[];
- getDiagnostics(fileName?: string): Diagnostic[];
- getModificationCount(): number;
- reattachFileDiagnostics(newFile: SourceFile): void;
- }
interface SyntaxList extends Node {
_children: Node[];
}
}
-declare namespace ts {
- const timestamp: () => number;
-}
-declare namespace ts.performance {
- function mark(markName: string): void;
- function measure(measureName: string, startMarkName?: string, endMarkName?: string): void;
- function getCount(markName: string): number;
- function getDuration(measureName: string): number;
- function forEachMeasure(cb: (measureName: string, duration: number) => void): void;
- function enable(): void;
- function disable(): void;
-}
-declare namespace ts {
- const enum Ternary {
- False = 0,
- Maybe = 1,
- True = -1,
- }
- function createMap(template?: MapLike): Map;
- function createFileMap(keyMapper?: (key: string) => string): FileMap;
- function toPath(fileName: string, basePath: string, getCanonicalFileName: (path: string) => string): Path;
- const enum Comparison {
- LessThan = -1,
- EqualTo = 0,
- GreaterThan = 1,
- }
- function forEach(array: T[] | undefined, callback: (element: T, index: number) => U | undefined): U | undefined;
- function every(array: T[], callback: (element: T, index: number) => boolean): boolean;
- function find(array: T[], predicate: (element: T, index: number) => boolean): T | undefined;
- function findMap(array: T[], callback: (element: T, index: number) => U | undefined): U;
- function contains(array: T[], value: T): boolean;
- function indexOf(array: T[], value: T): number;
- function indexOfAnyCharCode(text: string, charCodes: number[], start?: number): number;
- function countWhere(array: T[], predicate: (x: T, i: number) => boolean): number;
- function filter(array: T[], f: (x: T) => x is U): U[];
- function filter(array: T[], f: (x: T) => boolean): T[];
- function removeWhere(array: T[], f: (x: T) => boolean): boolean;
- function filterMutate(array: T[], f: (x: T) => boolean): void;
- function map(array: T[], f: (x: T, i: number) => U): U[];
- function flatten(array: (T | T[])[]): T[];
- function flatMap(array: T[], mapfn: (x: T, i: number) => U | U[]): U[];
- function span(array: T[], f: (x: T, i: number) => boolean): [T[], T[]];
- function spanMap(array: T[], keyfn: (x: T, i: number) => K, mapfn: (chunk: T[], key: K, start: number, end: number) => U): U[];
- function mapObject(object: MapLike, f: (key: string, x: T) => [string, U]): MapLike;
- function concatenate(array1: T[], array2: T[]): T[];
- function deduplicate(array: T[], areEqual?: (a: T, b: T) => boolean): T[];
- function compact(array: T[]): T[];
- function sum(array: any[], prop: string): number;
- function addRange(to: T[], from: T[]): void;
- function rangeEquals(array1: T[], array2: T[], pos: number, end: number): boolean;
- function firstOrUndefined(array: T[]): T;
- function singleOrUndefined(array: T[]): T;
- function singleOrMany(array: T[]): T | T[];
- function lastOrUndefined(array: T[]): T;
- function binarySearch(array: T[], value: T, comparer?: (v1: T, v2: T) => number): number;
- function reduceLeft(array: T[], f: (memo: U, value: T, i: number) => U, initial: U, start?: number, count?: number): U;
- function reduceLeft(array: T[], f: (memo: T, value: T, i: number) => T): T;
- function reduceRight(array: T[], f: (memo: U, value: T, i: number) => U, initial: U, start?: number, count?: number): U;
- function reduceRight(array: T[], f: (memo: T, value: T, i: number) => T): T;
- function hasProperty(map: MapLike, key: string): boolean;
- function getProperty(map: MapLike, key: string): T | undefined;
- function getOwnKeys(map: MapLike): string[];
- function forEachProperty(map: Map, callback: (value: T, key: string) => U): U;
- function someProperties(map: Map, predicate?: (value: T, key: string) => boolean): boolean;
- function copyProperties(source: Map, target: MapLike): void;
- function assign, T2, T3>(t: T1, arg1: T2, arg2: T3): T1 & T2 & T3;
- function assign, T2>(t: T1, arg1: T2): T1 & T2;
- function assign>(t: T1, ...args: any[]): any;
- function reduceProperties(map: Map, callback: (aggregate: U, value: T, key: string) => U, initial: U): U;
- function reduceOwnProperties(map: MapLike, callback: (aggregate: U, value: T, key: string) => U, initial: U): U;
- function equalOwnProperties(left: MapLike, right: MapLike, equalityComparer?: (left: T, right: T) => boolean): boolean;
- function arrayToMap(array: T[], makeKey: (value: T) => string): Map;
- function arrayToMap(array: T[], makeKey: (value: T) => string, makeValue: (value: T) => U): Map;
- function isEmpty(map: Map): boolean;
- function cloneMap(map: Map): Map;
- function clone(object: T): T;
- function extend(first: T1, second: T2): T1 & T2;
- function multiMapAdd(map: Map, key: string, value: V): V[];
- function multiMapRemove(map: Map, key: string, value: V): void;
- function isArray(value: any): value is any[];
- function memoize(callback: () => T): () => T;
- function chain(...args: ((t: T) => (u: U) => U)[]): (t: T) => (u: U) => U;
- function compose(...args: ((t: T) => T)[]): (t: T) => T;
- let localizedDiagnosticMessages: Map;
- function getLocaleSpecificMessage(message: DiagnosticMessage): string;
- function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ...args: any[]): Diagnostic;
- function formatMessage(dummy: any, message: DiagnosticMessage): string;
- function createCompilerDiagnostic(message: DiagnosticMessage, ...args: any[]): Diagnostic;
- function chainDiagnosticMessages(details: DiagnosticMessageChain, message: DiagnosticMessage, ...args: any[]): DiagnosticMessageChain;
- function concatenateDiagnosticMessageChains(headChain: DiagnosticMessageChain, tailChain: DiagnosticMessageChain): DiagnosticMessageChain;
- function compareValues(a: T, b: T): Comparison;
- function compareStrings(a: string, b: string, ignoreCase?: boolean): Comparison;
- function compareStringsCaseInsensitive(a: string, b: string): Comparison;
- function compareDiagnostics(d1: Diagnostic, d2: Diagnostic): Comparison;
- function sortAndDeduplicateDiagnostics(diagnostics: Diagnostic[]): Diagnostic[];
- function deduplicateSortedDiagnostics(diagnostics: Diagnostic[]): Diagnostic[];
- function normalizeSlashes(path: string): string;
- function getRootLength(path: string): number;
- const directorySeparator = "/";
- function normalizePath(path: string): string;
- function pathEndsWithDirectorySeparator(path: string): boolean;
- function getDirectoryPath(path: Path): Path;
- function getDirectoryPath(path: string): string;
- function isUrl(path: string): boolean;
- function isExternalModuleNameRelative(moduleName: string): boolean;
- function getEmitScriptTarget(compilerOptions: CompilerOptions): ScriptTarget;
- function getEmitModuleKind(compilerOptions: CompilerOptions): ModuleKind;
- function hasZeroOrOneAsteriskCharacter(str: string): boolean;
- function isRootedDiskPath(path: string): boolean;
- function convertToRelativePath(absoluteOrRelativePath: string, basePath: string, getCanonicalFileName: (path: string) => string): string;
- function getNormalizedPathComponents(path: string, currentDirectory: string): string[];
- function getNormalizedAbsolutePath(fileName: string, currentDirectory: string): string;
- function getNormalizedPathFromPathComponents(pathComponents: string[]): string;
- function getRelativePathToDirectoryOrUrl(directoryPathOrUrl: string, relativeOrAbsolutePath: string, currentDirectory: string, getCanonicalFileName: (fileName: string) => string, isAbsolutePathAnUrl: boolean): string;
- function getBaseFileName(path: string): string;
- function combinePaths(path1: string, path2: string): string;
- function removeTrailingDirectorySeparator(path: string): string;
- function ensureTrailingDirectorySeparator(path: string): string;
- function comparePaths(a: string, b: string, currentDirectory: string, ignoreCase?: boolean): Comparison;
- function containsPath(parent: string, child: string, currentDirectory: string, ignoreCase?: boolean): boolean;
- function startsWith(str: string, prefix: string): boolean;
- function endsWith(str: string, suffix: string): boolean;
- function fileExtensionIs(path: string, extension: string): boolean;
- function fileExtensionIsAny(path: string, extensions: string[]): boolean;
- function getRegularExpressionForWildcard(specs: string[], basePath: string, usage: "files" | "directories" | "exclude"): string;
- interface FileSystemEntries {
- files: string[];
- directories: string[];
- }
- interface FileMatcherPatterns {
- includeFilePattern: string;
- includeDirectoryPattern: string;
- excludePattern: string;
- basePaths: string[];
- }
- function getFileMatcherPatterns(path: string, extensions: string[], excludes: string[], includes: string[], useCaseSensitiveFileNames: boolean, currentDirectory: string): FileMatcherPatterns;
- function matchFiles(path: string, extensions: string[], excludes: string[], includes: string[], useCaseSensitiveFileNames: boolean, currentDirectory: string, getFileSystemEntries: (path: string) => FileSystemEntries): string[];
- function ensureScriptKind(fileName: string, scriptKind?: ScriptKind): ScriptKind;
- function getScriptKindFromFileName(fileName: string): ScriptKind;
- const supportedTypeScriptExtensions: string[];
- const supportedTypescriptExtensionsForExtractExtension: string[];
- const supportedJavascriptExtensions: string[];
- function getSupportedExtensions(options?: CompilerOptions): string[];
- function hasJavaScriptFileExtension(fileName: string): boolean;
- function hasTypeScriptFileExtension(fileName: string): boolean;
- function isSupportedSourceFileName(fileName: string, compilerOptions?: CompilerOptions): boolean;
- const enum ExtensionPriority {
- TypeScriptFiles = 0,
- DeclarationAndJavaScriptFiles = 2,
- Limit = 5,
- Highest = 0,
- Lowest = 2,
- }
- function getExtensionPriority(path: string, supportedExtensions: string[]): ExtensionPriority;
- function adjustExtensionPriority(extensionPriority: ExtensionPriority): ExtensionPriority;
- function getNextLowestExtensionPriority(extensionPriority: ExtensionPriority): ExtensionPriority;
- function removeFileExtension(path: string): string;
- function tryRemoveExtension(path: string, extension: string): string | undefined;
- function removeExtension(path: string, extension: string): string;
- function isJsxOrTsxExtension(ext: string): boolean;
- function changeExtension(path: T, newExtension: string): T;
- interface ObjectAllocator {
- getNodeConstructor(): new (kind: SyntaxKind, pos?: number, end?: number) => Node;
- getTokenConstructor(): new (kind: TKind, pos?: number, end?: number) => Token;
- getIdentifierConstructor(): new (kind: SyntaxKind.Identifier, pos?: number, end?: number) => Identifier;
- getSourceFileConstructor(): new (kind: SyntaxKind.SourceFile, pos?: number, end?: number) => SourceFile;
- getSymbolConstructor(): new (flags: SymbolFlags, name: string) => Symbol;
- getTypeConstructor(): new (checker: TypeChecker, flags: TypeFlags) => Type;
- getSignatureConstructor(): new (checker: TypeChecker) => Signature;
- }
- let objectAllocator: ObjectAllocator;
- const enum AssertionLevel {
- None = 0,
- Normal = 1,
- Aggressive = 2,
- VeryAggressive = 3,
- }
- namespace Debug {
- let currentAssertionLevel: AssertionLevel;
- function shouldAssert(level: AssertionLevel): boolean;
- function assert(expression: boolean, message?: string, verboseDebugInfo?: () => string): void;
- function fail(message?: string): void;
- }
- function orderedRemoveItemAt(array: T[], index: number): void;
- function unorderedRemoveItemAt(array: T[], index: number): void;
- function unorderedRemoveItem(array: T[], item: T): void;
- function createGetCanonicalFileName(useCaseSensitiveFileNames: boolean): (fileName: string) => string;
- function matchPatternOrExact(patternStrings: string[], candidate: string): string | Pattern | undefined;
- function patternText({prefix, suffix}: Pattern): string;
- function matchedText(pattern: Pattern, candidate: string): string;
- function findBestPatternMatch(values: T[], getPattern: (value: T) => Pattern, candidate: string): T | undefined;
- function tryParsePattern(pattern: string): Pattern | undefined;
- function positionIsSynthesized(pos: number): boolean;
-}
declare namespace ts {
type FileWatcherCallback = (fileName: string, removed?: boolean) => void;
type DirectoryWatcherCallback = (fileName: string) => void;
@@ -3423,8 +1989,6 @@ declare namespace ts {
getMemoryUsage?(): number;
exit(exitCode?: number): void;
realpath?(path: string): string;
- getEnvironmentVariable(name: string): string;
- tryEnableSourceMapsForHost?(): void;
}
interface FileWatcher {
close(): void;
@@ -3436,4682 +2000,45 @@ declare namespace ts {
let sys: System;
}
declare namespace ts {
- const Diagnostics: {
- Unterminated_string_literal: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Identifier_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_file_cannot_have_a_reference_to_itself: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Trailing_comma_not_allowed: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Asterisk_Slash_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unexpected_token: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_rest_parameter_must_be_last_in_a_parameter_list: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_cannot_have_question_mark_and_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_required_parameter_cannot_follow_an_optional_parameter: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_index_signature_cannot_have_a_rest_parameter: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_index_signature_parameter_cannot_have_an_accessibility_modifier: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_index_signature_parameter_cannot_have_a_question_mark: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_index_signature_parameter_cannot_have_an_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_index_signature_must_have_a_type_annotation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_index_signature_parameter_must_have_a_type_annotation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_index_signature_parameter_type_must_be_string_or_number: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Accessibility_modifier_already_seen: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_modifier_must_precede_1_modifier: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_modifier_already_seen: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_modifier_cannot_appear_on_a_class_element: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- super_must_be_followed_by_an_argument_list_or_member_access: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Only_ambient_modules_can_use_quoted_names: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Statements_are_not_allowed_in_ambient_contexts: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_declare_modifier_cannot_be_used_in_an_already_ambient_context: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Initializers_are_not_allowed_in_ambient_contexts: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_modifier_cannot_be_used_in_an_ambient_context: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_modifier_cannot_be_used_with_a_class_declaration: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_modifier_cannot_be_used_here: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_modifier_cannot_appear_on_a_data_property: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_modifier_cannot_appear_on_a_module_or_namespace_element: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_0_modifier_cannot_be_used_with_an_interface_declaration: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_rest_parameter_cannot_be_optional: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_rest_parameter_cannot_have_an_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_set_accessor_must_have_exactly_one_parameter: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_set_accessor_cannot_have_an_optional_parameter: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_set_accessor_parameter_cannot_have_an_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_set_accessor_cannot_have_rest_parameter: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_get_accessor_cannot_have_parameters: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_0_is_not_a_valid_async_function_return_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_async_function_or_method_must_have_a_valid_awaitable_return_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Operand_for_await_does_not_have_a_valid_callable_then_member: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_expression_in_async_function_does_not_have_a_valid_callable_then_member: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Enum_member_must_have_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_export_assignment_cannot_be_used_in_a_namespace: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- In_ambient_enum_declarations_member_initializer_must_be_constant_expression: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unexpected_token_A_constructor_method_accessor_or_property_was_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_modifier_cannot_appear_on_a_type_member: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_modifier_cannot_appear_on_an_index_signature: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_0_modifier_cannot_be_used_with_an_import_declaration: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Invalid_reference_directive_syntax: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_accessor_cannot_be_declared_in_an_ambient_context: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_modifier_cannot_appear_on_a_constructor_declaration: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_modifier_cannot_appear_on_a_parameter: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_parameters_cannot_appear_on_a_constructor_declaration: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_annotation_cannot_appear_on_a_constructor_declaration: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_accessor_cannot_have_type_parameters: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_set_accessor_cannot_have_a_return_type_annotation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_index_signature_must_have_exactly_one_parameter: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_list_cannot_be_empty: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_parameter_list_cannot_be_empty: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_argument_list_cannot_be_empty: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Invalid_use_of_0_in_strict_mode: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- with_statements_are_not_allowed_in_strict_mode: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- delete_cannot_be_called_on_an_identifier_in_strict_mode: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Jump_target_cannot_cross_function_boundary: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_return_statement_can_only_be_used_within_a_function_body: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Expression_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Duplicate_label_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_object_literal_cannot_have_property_and_accessor_with_the_same_name: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_export_assignment_cannot_have_modifiers: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Octal_literals_are_not_allowed_in_strict_mode: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_tuple_type_element_list_cannot_be_empty: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Variable_declaration_list_cannot_be_empty: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Digit_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Hexadecimal_digit_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unexpected_end_of_text: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Invalid_character: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Declaration_or_statement_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Statement_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- case_or_default_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_or_signature_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Enum_member_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Variable_declaration_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Argument_expression_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_assignment_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Expression_or_comma_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_declaration_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_parameter_declaration_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_argument_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- String_literal_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Line_break_not_permitted_here: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- or_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Declaration_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Import_declarations_in_a_namespace_cannot_reference_a_module: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- File_name_0_differs_from_already_included_file_name_1_only_in_casing: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- const_declarations_must_be_initialized: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- const_declarations_can_only_be_declared_inside_a_block: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- let_declarations_can_only_be_declared_inside_a_block: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unterminated_template_literal: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unterminated_regular_expression_literal: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_object_member_cannot_be_declared_optional: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_yield_expression_is_only_allowed_in_a_generator_body: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Computed_property_names_are_not_allowed_in_enums: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_comma_expression_is_not_allowed_in_a_computed_property_name: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- extends_clause_already_seen: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- extends_clause_must_precede_implements_clause: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Classes_can_only_extend_a_single_class: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- implements_clause_already_seen: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Interface_declaration_cannot_have_implements_clause: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Binary_digit_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Octal_digit_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unexpected_token_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_destructuring_pattern_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Array_element_destructuring_pattern_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_destructuring_declaration_must_have_an_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_implementation_cannot_be_declared_in_ambient_contexts: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Modifiers_cannot_appear_here: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Merge_conflict_marker_encountered: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_rest_element_cannot_have_an_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_parameter_property_may_not_be_declared_using_a_binding_pattern: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_import_declaration_cannot_have_modifiers: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Module_0_has_no_default_export: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_export_declaration_cannot_have_modifiers: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Export_declarations_are_not_permitted_in_a_namespace: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Catch_clause_variable_name_must_be_an_identifier: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Catch_clause_variable_cannot_have_a_type_annotation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Catch_clause_variable_cannot_have_an_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unterminated_Unicode_escape_sequence: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Line_terminator_not_permitted_before_arrow: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Import_assignment_cannot_be_used_when_targeting_ECMAScript_2015_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Export_assignment_cannot_be_used_when_targeting_ECMAScript_2015_modules_Consider_using_export_default_or_another_module_format_instead: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Decorators_are_not_valid_here: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_class_declaration_without_the_default_modifier_must_have_a_name: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Identifier_expected_0_is_a_reserved_word_in_strict_mode: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Invalid_use_of_0_Modules_are_automatically_in_strict_mode: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Export_assignment_is_not_supported_when_module_flag_is_system: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Generators_are_not_allowed_in_an_ambient_context: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_overload_signature_cannot_be_declared_as_a_generator: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_tag_already_specified: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Signature_0_must_have_a_type_predicate: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_find_parameter_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_predicate_0_is_not_assignable_to_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_is_not_in_the_same_position_as_parameter_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_type_predicate_cannot_reference_a_rest_parameter: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_export_assignment_can_only_be_used_in_a_module: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_import_declaration_can_only_be_used_in_a_namespace_or_module: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_export_declaration_can_only_be_used_in_a_module: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_namespace_declaration_is_only_allowed_in_a_namespace_or_module: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_return_type_of_a_property_decorator_function_must_be_either_void_or_any: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_modifier_cannot_be_used_with_1_modifier: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Abstract_methods_can_only_appear_within_an_abstract_class: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Method_0_cannot_have_an_implementation_because_it_is_marked_abstract: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_interface_property_cannot_have_an_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_type_literal_property_cannot_have_an_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_class_member_cannot_have_the_0_keyword: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_decorator_can_only_decorate_a_method_implementation_not_an_overload: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_tag_cannot_be_used_independently_as_a_top_level_JSDoc_tag: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- with_statements_are_not_allowed_in_an_async_function_block: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- await_expression_is_only_allowed_within_an_async_function: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_body_of_an_if_statement_cannot_be_the_empty_statement: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Global_module_exports_may_only_appear_in_module_files: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Global_module_exports_may_only_appear_in_declaration_files: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Global_module_exports_may_only_appear_at_top_level: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_parameter_property_cannot_be_declared_using_a_rest_parameter: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Duplicate_identifier_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Static_members_cannot_reference_class_type_parameters: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Circular_definition_of_import_alias_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_find_name_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Module_0_has_no_exported_member_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- File_0_is_not_a_module: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_find_module_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_0_recursively_references_itself_as_a_base_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_class_may_only_extend_another_class: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_interface_may_only_extend_a_class_or_another_interface: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_parameter_0_has_a_circular_constraint: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Generic_type_0_requires_1_type_argument_s: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_0_is_not_generic: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Global_type_0_must_be_a_class_or_interface_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Global_type_0_must_have_1_type_parameter_s: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_find_global_type_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Named_property_0_of_types_1_and_2_are_not_identical: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Interface_0_cannot_simultaneously_extend_types_1_and_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Excessive_stack_depth_comparing_types_0_and_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_0_is_not_assignable_to_type_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_redeclare_exported_variable_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_is_missing_in_type_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_is_private_in_type_1_but_not_in_type_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Types_of_property_0_are_incompatible: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_is_optional_in_type_1_but_required_in_type_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Types_of_parameters_0_and_1_are_incompatible: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Index_signature_is_missing_in_type_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Index_signatures_are_incompatible: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- this_cannot_be_referenced_in_a_module_or_namespace_body: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- this_cannot_be_referenced_in_current_location: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- this_cannot_be_referenced_in_constructor_arguments: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- this_cannot_be_referenced_in_a_static_property_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- super_can_only_be_referenced_in_a_derived_class: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- super_cannot_be_referenced_in_constructor_arguments: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_does_not_exist_on_type_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_is_private_and_only_accessible_within_class_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_0_does_not_satisfy_the_constraint_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Supplied_parameters_do_not_match_any_signature_of_call_target: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Untyped_function_calls_may_not_accept_type_arguments: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Only_a_void_function_can_be_called_with_the_new_keyword: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_0_cannot_be_converted_to_type_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Invalid_left_hand_side_of_assignment_expression: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Operator_0_cannot_be_applied_to_types_1_and_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_parameter_name_cannot_be_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_parameter_property_is_only_allowed_in_a_constructor_implementation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_rest_parameter_must_be_of_an_array_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_cannot_be_referenced_in_its_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Duplicate_string_index_signature: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Duplicate_number_index_signature: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Constructors_for_derived_classes_must_contain_a_super_call: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_get_accessor_must_return_a_value: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Getter_and_setter_accessors_do_not_agree_in_visibility: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- get_and_set_accessor_must_have_the_same_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_signature_with_an_implementation_cannot_use_a_string_literal_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Overload_signatures_must_all_be_exported_or_non_exported: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Overload_signatures_must_all_be_ambient_or_non_ambient: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Overload_signatures_must_all_be_public_private_or_protected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Overload_signatures_must_all_be_optional_or_required: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Function_overload_must_be_static: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Function_overload_must_not_be_static: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Function_implementation_name_must_be_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Constructor_implementation_is_missing: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Function_implementation_is_missing_or_not_immediately_following_the_declaration: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Multiple_constructor_implementations_are_not_allowed: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Duplicate_function_implementation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Overload_signature_is_not_compatible_with_function_implementation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Declaration_name_conflicts_with_built_in_global_identifier_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Invalid_left_hand_side_in_for_in_statement: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Setters_cannot_return_a_value: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_of_type_1_is_not_assignable_to_string_index_type_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Numeric_index_type_0_is_not_assignable_to_string_index_type_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Class_name_cannot_be_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Class_0_incorrectly_extends_base_class_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Class_static_side_0_incorrectly_extends_base_class_static_side_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Class_0_incorrectly_implements_interface_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_class_may_only_implement_another_class_or_interface: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Interface_name_cannot_be_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- All_declarations_of_0_must_have_identical_type_parameters: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Interface_0_incorrectly_extends_interface_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Enum_name_cannot_be_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Ambient_module_declaration_cannot_specify_relative_module_name: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Module_0_is_hidden_by_a_local_declaration_with_the_same_name: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Import_name_cannot_be_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Import_declaration_conflicts_with_local_declaration_of_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Types_have_separate_declarations_of_a_private_property_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_is_protected_in_type_1_but_public_in_type_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Block_scoped_variable_0_used_before_its_declaration: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant_or_a_read_only_property: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Left_hand_side_of_assignment_expression_cannot_be_a_constant_or_a_read_only_property: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_redeclare_block_scoped_variable_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_enum_member_cannot_have_a_numeric_name: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Variable_0_is_used_before_being_assigned: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_alias_0_circularly_references_itself: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_alias_name_cannot_be_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_AMD_module_cannot_have_multiple_name_assignments: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_0_has_no_property_1_and_no_string_index_signature: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_0_has_no_property_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_0_is_not_an_array_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_rest_element_must_be_last_in_an_array_destructuring_pattern: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_computed_property_name_must_be_of_type_string_number_symbol_or_any: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- this_cannot_be_referenced_in_a_computed_property_name: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- super_cannot_be_referenced_in_a_computed_property_name: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_find_global_value_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_0_operator_cannot_be_applied_to_type_symbol: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_computed_property_name_of_the_form_0_must_be_of_type_symbol: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Enum_declarations_must_all_be_const_or_non_const: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- In_const_enum_declarations_member_initializer_must_be_constant_expression: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_const_enum_member_can_only_be_accessed_using_a_string_literal: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- const_enum_member_initializer_was_evaluated_to_a_non_finite_value: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_does_not_exist_on_const_enum_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Export_declaration_conflicts_with_exported_declaration_of_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_left_hand_side_of_a_for_of_statement_cannot_be_a_constant_or_a_read_only_property: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_left_hand_side_of_a_for_in_statement_cannot_be_a_constant_or_a_read_only_property: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Invalid_left_hand_side_in_for_of_statement: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_iterator_must_have_a_next_method: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_redeclare_identifier_0_in_catch_clause: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_0_is_not_an_array_type_or_a_string_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_rest_element_cannot_contain_a_binding_pattern: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_find_namespace_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_generator_cannot_have_a_void_type_annotation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_0_is_not_a_constructor_function_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- No_base_constructor_has_the_specified_number_of_type_arguments: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Base_constructor_return_type_0_is_not_a_class_or_interface_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Base_constructors_must_all_have_the_same_return_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_create_an_instance_of_the_abstract_class_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Overload_signatures_must_all_be_abstract_or_non_abstract: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Classes_containing_abstract_methods_must_be_marked_abstract: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- All_declarations_of_an_abstract_method_must_be_consecutive: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- yield_expressions_cannot_be_used_in_a_parameter_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- await_expressions_cannot_be_used_in_a_parameter_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_module_cannot_have_multiple_default_exports: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_is_incompatible_with_index_signature: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Object_is_possibly_null: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Object_is_possibly_undefined: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Object_is_possibly_null_or_undefined: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_function_returning_never_cannot_have_a_reachable_end_point: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Enum_type_0_has_members_with_initializers_that_are_not_literals: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- JSX_element_attributes_type_0_may_not_be_a_union_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_in_type_1_is_not_assignable_to_type_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- JSX_element_type_0_does_not_have_any_construct_or_call_signatures: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_global_type_JSX_0_may_not_have_more_than_one_property: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_emit_namespaced_JSX_elements_in_React: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- JSX_expressions_must_have_one_parent_element: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_0_provides_no_match_for_the_signature_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_find_name_0_Did_you_mean_the_static_member_1_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_find_name_0_Did_you_mean_the_instance_member_this_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Invalid_module_name_in_augmentation_module_0_cannot_be_found: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Exports_and_export_assignments_are_not_permitted_in_module_augmentations: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_assign_a_0_constructor_type_to_a_1_constructor_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_extend_a_class_0_Class_constructor_is_marked_as_private: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Accessors_must_both_be_abstract_or_non_abstract: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_0_is_not_comparable_to_type_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_this_parameter_must_be_the_first_parameter: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_constructor_cannot_have_a_this_parameter: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- get_and_set_accessor_must_have_the_same_this_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_this_types_of_each_signature_are_incompatible: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- All_declarations_of_0_must_have_identical_modifiers: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_find_type_definition_file_for_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_extend_an_interface_0_Did_you_mean_implements: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_class_must_be_declared_after_its_base_class: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Namespace_0_has_no_exported_member_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Left_side_of_comma_operator_is_unused_and_has_no_side_effects: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Import_declaration_0_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Exported_variable_0_has_or_is_using_name_1_from_private_module_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Exported_variable_0_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Public_property_0_of_exported_class_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_of_exported_interface_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Return_type_of_exported_function_has_or_is_using_private_name_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_of_exported_function_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Exported_type_alias_0_has_or_is_using_private_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Default_export_of_the_module_has_or_is_using_private_name_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_current_host_does_not_support_the_0_option: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_find_the_common_subdirectory_path_for_the_input_files: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_read_file_0_Colon_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unsupported_file_encoding: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Failed_to_parse_file_0_Colon_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unknown_compiler_option_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Compiler_option_0_requires_a_value_of_type_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Could_not_write_file_0_Colon_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Option_project_cannot_be_mixed_with_source_files_on_a_command_line: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Option_0_cannot_be_specified_without_specifying_option_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Option_0_cannot_be_specified_with_option_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_tsconfig_json_file_is_already_defined_at_Colon_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_write_file_0_because_it_would_overwrite_input_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_specified_path_does_not_exist_Colon_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Option_paths_cannot_be_used_without_specifying_baseUrl_option: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Pattern_0_can_have_at_most_one_Asterisk_character: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Substitutions_for_pattern_0_should_be_an_array: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Substitutions_for_pattern_0_shouldn_t_be_an_empty_array: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Concatenate_and_emit_output_to_single_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Generates_corresponding_d_ts_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Watch_input_files: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Redirect_output_structure_to_the_directory: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Do_not_erase_const_enum_declarations_in_generated_code: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Do_not_emit_outputs_if_any_errors_were_reported: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Do_not_emit_comments_to_output: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Do_not_emit_outputs: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Skip_type_checking_of_declaration_files: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Print_this_message: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Print_the_compiler_s_version: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Compile_the_project_in_the_given_directory: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Syntax_Colon_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- options: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Examples_Colon_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Options_Colon: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Version_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Insert_command_line_options_and_files_from_a_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- File_change_detected_Starting_incremental_compilation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- KIND: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- FILE: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- VERSION: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- LOCATION: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- DIRECTORY: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- STRATEGY: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Compilation_complete_Watching_for_file_changes: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Generates_corresponding_map_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Compiler_option_0_expects_an_argument: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unterminated_quoted_string_in_response_file_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Argument_for_0_option_must_be_Colon_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unsupported_locale_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unable_to_open_file_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Corrupted_locale_file_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Raise_error_on_expressions_and_declarations_with_an_implied_any_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- File_0_not_found: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- File_0_has_unsupported_extension_The_only_supported_extensions_are_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Do_not_emit_declarations_for_code_that_has_an_internal_annotation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- NEWLINE: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Option_0_can_only_be_specified_in_tsconfig_json_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Enables_experimental_support_for_ES7_decorators: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Enables_experimental_support_for_emitting_type_metadata_for_decorators: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Enables_experimental_support_for_ES7_async_functions: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Successfully_created_a_tsconfig_json_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Suppress_excess_property_checks_for_object_literals: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Stylize_errors_and_messages_using_color_and_context_experimental: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Do_not_report_errors_on_unused_labels: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Report_error_when_not_all_code_paths_in_function_return_a_value: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Report_errors_for_fallthrough_cases_in_switch_statement: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Do_not_report_errors_on_unreachable_code: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Disallow_inconsistently_cased_references_to_the_same_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Specify_library_files_to_be_included_in_the_compilation_Colon: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Specify_JSX_code_generation_Colon_preserve_or_react: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Only_amd_and_system_modules_are_supported_alongside_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Base_directory_to_resolve_non_absolute_module_names: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Enable_tracing_of_the_name_resolution_process: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Resolving_module_0_from_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Explicitly_specified_module_resolution_kind_Colon_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Module_resolution_kind_is_not_specified_using_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Module_name_0_was_successfully_resolved_to_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Module_name_0_was_not_resolved: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Module_name_0_matched_pattern_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Trying_substitution_0_candidate_module_location_Colon_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Resolving_module_name_0_relative_to_base_url_1_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Loading_module_as_file_Slash_folder_candidate_module_location_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- File_0_does_not_exist: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- File_0_exist_use_it_as_a_name_resolution_result: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Loading_module_0_from_node_modules_folder: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Found_package_json_at_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- package_json_does_not_have_types_field: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- package_json_has_0_field_1_that_references_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Allow_javascript_files_to_be_compiled: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Option_0_should_have_array_of_strings_as_a_value: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Checking_if_0_is_the_longest_matching_prefix_for_1_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Expected_type_of_0_field_in_package_json_to_be_string_got_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Longest_matching_prefix_for_0_is_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Loading_0_from_the_root_dir_1_candidate_location_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Trying_other_entries_in_rootDirs: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Module_resolution_using_rootDirs_has_failed: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Do_not_emit_use_strict_directives_in_module_output: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Enable_strict_null_checks: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unknown_option_excludes_Did_you_mean_exclude: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Raise_error_on_this_expressions_with_an_implied_any_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Resolving_type_reference_directive_0_containing_file_1_root_directory_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Resolving_using_primary_search_paths: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Resolving_from_node_modules_folder: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_reference_directive_0_was_not_resolved: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Resolving_with_primary_search_path_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Root_directory_cannot_be_determined_skipping_primary_search_paths: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Type_declaration_files_to_be_included_in_compilation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Looking_up_in_node_modules_folder_initial_location_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_config_file_0_found_doesn_t_contain_any_source_files: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Resolving_real_path_for_0_result_1: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- File_name_0_has_a_1_extension_stripping_it: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_is_declared_but_never_used: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Report_errors_on_unused_locals: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Report_errors_on_unused_parameters: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- No_types_specified_in_package_json_but_allowJs_is_set_so_returning_main_value_of_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_is_declared_but_never_used: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Import_emit_helpers_from_tslib: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Variable_0_implicitly_has_an_1_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Parameter_0_implicitly_has_an_1_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Member_0_implicitly_has_an_1_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Index_signature_of_object_type_implicitly_has_an_any_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Object_literal_s_property_0_implicitly_has_an_1_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Rest_parameter_0_implicitly_has_an_any_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _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: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- 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: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unreachable_code_detected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unused_label: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Fallthrough_case_in_switch: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Not_all_code_paths_return_a_value: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Binding_element_0_implicitly_has_an_1_type: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Variable_0_implicitly_has_type_any_in_some_locations_where_its_type_cannot_be_determined: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- You_cannot_rename_this_element: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- import_can_only_be_used_in_a_ts_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- export_can_only_be_used_in_a_ts_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- type_parameter_declarations_can_only_be_used_in_a_ts_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- implements_clauses_can_only_be_used_in_a_ts_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- interface_declarations_can_only_be_used_in_a_ts_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- module_declarations_can_only_be_used_in_a_ts_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- type_aliases_can_only_be_used_in_a_ts_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- _0_can_only_be_used_in_a_ts_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- types_can_only_be_used_in_a_ts_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- type_arguments_can_only_be_used_in_a_ts_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- parameter_modifiers_can_only_be_used_in_a_ts_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- enum_declarations_can_only_be_used_in_a_ts_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- type_assertion_expressions_can_only_be_used_in_a_ts_file: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- class_expressions_are_not_currently_supported: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- JSX_attributes_must_only_be_assigned_a_non_empty_expression: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- JSX_elements_cannot_have_multiple_attributes_with_the_same_name: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Expected_corresponding_JSX_closing_tag_for_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- JSX_attribute_expected: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Cannot_use_JSX_unless_the_jsx_flag_is_provided: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- JSX_element_0_has_no_corresponding_closing_tag: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Unknown_typing_option_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Circularity_detected_while_resolving_configuration_Colon_0: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- The_path_in_an_extends_options_must_be_relative_or_rooted: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Add_missing_super_call: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Make_super_call_the_first_statement_in_the_constructor: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Change_extends_to_implements: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Remove_unused_identifiers: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Implement_interface_on_reference: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Implement_interface_on_class: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- Implement_inherited_abstract_class: {
- code: number;
- category: DiagnosticCategory;
- key: string;
- message: string;
- };
- };
+ function getEffectiveTypeRoots(options: CompilerOptions, host: {
+ directoryExists?: (directoryName: string) => boolean;
+ getCurrentDirectory?: () => string;
+ }): string[] | undefined;
+ function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string, options: CompilerOptions, host: ModuleResolutionHost): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
+ function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[];
+ function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations;
+ function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations;
+ function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations;
+}
+declare namespace ts {
+ function getDefaultLibFileName(options: CompilerOptions): string;
+ function textSpanEnd(span: TextSpan): number;
+ function textSpanIsEmpty(span: TextSpan): boolean;
+ function textSpanContainsPosition(span: TextSpan, position: number): boolean;
+ function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean;
+ function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean;
+ function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan;
+ function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean;
+ function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean;
+ function decodedTextSpanIntersectsWith(start1: number, length1: number, start2: number, length2: number): boolean;
+ function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean;
+ function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan;
+ function createTextSpan(start: number, length: number): TextSpan;
+ function createTextSpanFromBounds(start: number, end: number): TextSpan;
+ function textChangeRangeNewSpan(range: TextChangeRange): TextSpan;
+ function textChangeRangeIsUnchanged(range: TextChangeRange): boolean;
+ function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange;
+ let unchangedTextChangeRange: TextChangeRange;
+ function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange;
+ function getTypeParameterOwner(d: Declaration): Declaration;
+ function isParameterPropertyDeclaration(node: ParameterDeclaration): boolean;
+ function getCombinedModifierFlags(node: Node): ModifierFlags;
+ function getCombinedNodeFlags(node: Node): NodeFlags;
}
declare namespace ts {
interface ErrorCallback {
(message: DiagnosticMessage, length: number): void;
}
- function tokenIsIdentifierOrKeyword(token: SyntaxKind): boolean;
interface Scanner {
getStartPos(): number;
getToken(): SyntaxKind;
@@ -8143,24 +2070,13 @@ declare namespace ts {
scanRange(start: number, length: number, callback: () => T): T;
tryScan(callback: () => T): T;
}
- function isUnicodeIdentifierStart(code: number, languageVersion: ScriptTarget): boolean;
function tokenToString(t: SyntaxKind): string;
- function stringToToken(s: string): SyntaxKind;
- function computeLineStarts(text: string): number[];
function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number;
- function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number;
- function getLineStarts(sourceFile: SourceFile): number[];
- function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): {
- line: number;
- character: number;
- };
function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter;
function isWhiteSpace(ch: number): boolean;
function isWhiteSpaceSingleLine(ch: number): boolean;
function isLineBreak(ch: number): boolean;
- function isOctalDigit(ch: number): boolean;
function couldStartTrivia(text: string, pos: number): boolean;
- function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean, stopAtComments?: boolean): number;
function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U;
function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U;
function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: SyntaxKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U;
@@ -8170,23 +2086,31 @@ declare namespace ts {
function getShebang(text: string): string;
function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean;
function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean;
- function isIdentifierText(name: string, languageVersion: ScriptTarget): boolean;
function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, text?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner;
}
declare namespace ts {
- const compileOnSaveCommandLineOption: CommandLineOption;
- const optionDeclarations: CommandLineOption[];
- let typingOptionDeclarations: CommandLineOption[];
- interface OptionNameMap {
- optionNameMap: Map;
- shortOptionNames: Map;
+ function createNode(kind: SyntaxKind, pos?: number, end?: number): Node;
+ function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T;
+ function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile;
+ function isExternalModule(file: SourceFile): boolean;
+ function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
+}
+declare namespace ts {
+ const version = "2.1.0";
+ function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string;
+ function resolveTripleslashReference(moduleName: string, containingFile: string): string;
+ function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
+ function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[];
+ interface FormatDiagnosticsHost {
+ getCurrentDirectory(): string;
+ getCanonicalFileName(fileName: string): string;
+ getNewLine(): string;
}
- const defaultInitCompilerOptions: CompilerOptions;
- function getOptionNameMap(): OptionNameMap;
- function createCompilerDiagnosticForInvalidCustomType(opt: CommandLineOptionOfCustomType): Diagnostic;
- function parseCustomTypeOption(opt: CommandLineOptionOfCustomType, value: string, errors: Diagnostic[]): string | number;
- function parseListTypeOption(opt: CommandLineOptionOfListType, value: string, errors: Diagnostic[]): (string | number)[] | undefined;
- function parseCommandLine(commandLine: string[], readFile?: (path: string) => string): ParsedCommandLine;
+ function formatDiagnostics(diagnostics: Diagnostic[], host: FormatDiagnosticsHost): string;
+ function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
+ function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program;
+}
+declare namespace ts {
function readConfigFile(fileName: string, readFile: (path: string) => string): {
config?: any;
error?: Diagnostic;
@@ -8195,9 +2119,6 @@ declare namespace ts {
config?: any;
error?: Diagnostic;
};
- function generateTSConfig(options: CompilerOptions, fileNames: string[]): {
- compilerOptions: Map;
- };
function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[]): ParsedCommandLine;
function convertCompileOnSaveOptionFromJson(jsonOption: any, basePath: string, errors: Diagnostic[]): boolean;
function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
@@ -8209,939 +2130,6 @@ declare namespace ts {
errors: Diagnostic[];
};
}
-declare namespace ts.JsTyping {
- interface TypingResolutionHost {
- directoryExists: (path: string) => boolean;
- fileExists: (fileName: string) => boolean;
- readFile: (path: string, encoding?: string) => string;
- readDirectory: (rootDir: string, extensions: string[], excludes: string[], includes: string[], depth?: number) => string[];
- }
- function discoverTypings(host: TypingResolutionHost, fileNames: string[], projectRootPath: Path, safeListPath: Path, packageNameToTypingLocation: Map, typingOptions: TypingOptions, compilerOptions: CompilerOptions): {
- cachedTypingPaths: string[];
- newTypingNames: string[];
- filesToWatch: string[];
- };
-}
-declare namespace ts.server {
- enum LogLevel {
- terse = 0,
- normal = 1,
- requestTime = 2,
- verbose = 3,
- }
- const emptyArray: ReadonlyArray;
- interface Logger {
- close(): void;
- hasLevel(level: LogLevel): boolean;
- loggingEnabled(): boolean;
- perftrc(s: string): void;
- info(s: string): void;
- startGroup(): void;
- endGroup(): void;
- msg(s: string, type?: Msg.Types): void;
- getLogFileName(): string;
- }
- namespace Msg {
- type Err = "Err";
- const Err: Err;
- type Info = "Info";
- const Info: Info;
- type Perf = "Perf";
- const Perf: Perf;
- type Types = Err | Info | Perf;
- }
- function createInstallTypingsRequest(project: Project, typingOptions: TypingOptions, cachePath?: string): DiscoverTypings;
- namespace Errors {
- function ThrowNoProject(): never;
- function ThrowProjectLanguageServiceDisabled(): never;
- function ThrowProjectDoesNotContainDocument(fileName: string, project: Project): never;
- }
- function getDefaultFormatCodeSettings(host: ServerHost): FormatCodeSettings;
- function mergeMaps(target: MapLike, source: MapLike): void;
- function removeItemFromSet(items: T[], itemToRemove: T): void;
- type NormalizedPath = string & {
- __normalizedPathTag: any;
- };
- function toNormalizedPath(fileName: string): NormalizedPath;
- function normalizedPathToPath(normalizedPath: NormalizedPath, currentDirectory: string, getCanonicalFileName: (f: string) => string): Path;
- function asNormalizedPath(fileName: string): NormalizedPath;
- interface NormalizedPathMap {
- get(path: NormalizedPath): T;
- set(path: NormalizedPath, value: T): void;
- contains(path: NormalizedPath): boolean;
- remove(path: NormalizedPath): void;
- }
- function createNormalizedPathMap(): NormalizedPathMap;
- const nullLanguageService: LanguageService;
- interface ServerLanguageServiceHost {
- setCompilationSettings(options: CompilerOptions): void;
- notifyFileRemoved(info: ScriptInfo): void;
- }
- const nullLanguageServiceHost: ServerLanguageServiceHost;
- interface ProjectOptions {
- configHasFilesProperty?: boolean;
- files?: string[];
- wildcardDirectories?: Map;
- compilerOptions?: CompilerOptions;
- typingOptions?: TypingOptions;
- compileOnSave?: boolean;
- }
- function isInferredProjectName(name: string): boolean;
- function makeInferredProjectName(counter: number): string;
- class ThrottledOperations {
- private readonly host;
- private pendingTimeouts;
- constructor(host: ServerHost);
- schedule(operationId: string, delay: number, cb: () => void): void;
- private static run(self, operationId, cb);
- }
- class GcTimer {
- private readonly host;
- private readonly delay;
- private readonly logger;
- private timerId;
- constructor(host: ServerHost, delay: number, logger: Logger);
- scheduleCollect(): void;
- private static run(self);
- }
-}
-declare namespace ts {
- function trace(host: ModuleResolutionHost, message: DiagnosticMessage, ...args: any[]): void;
- function isTraceEnabled(compilerOptions: CompilerOptions, host: ModuleResolutionHost): boolean;
- function createResolvedModule(resolvedFileName: string, isExternalLibraryImport: boolean, failedLookupLocations: string[]): ResolvedModuleWithFailedLookupLocations;
- interface ModuleResolutionState {
- host: ModuleResolutionHost;
- compilerOptions: CompilerOptions;
- traceEnabled: boolean;
- skipTsx: boolean;
- }
- function getEffectiveTypeRoots(options: CompilerOptions, host: {
- directoryExists?: (directoryName: string) => boolean;
- getCurrentDirectory?: () => string;
- }): string[] | undefined;
- function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string, options: CompilerOptions, host: ModuleResolutionHost): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
- function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[];
- function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations;
- function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations;
- function directoryProbablyExists(directoryName: string, host: {
- directoryExists?: (directoryName: string) => boolean;
- }): boolean;
- function loadModuleFromNodeModules(moduleName: string, directory: string, failedLookupLocations: string[], state: ModuleResolutionState, checkOneLevel: boolean): string;
- function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations;
-}
-declare namespace ts {
- const externalHelpersModuleNameText = "tslib";
- interface ReferencePathMatchResult {
- fileReference?: FileReference;
- diagnosticMessage?: DiagnosticMessage;
- isNoDefaultLib?: boolean;
- isTypeReferenceDirective?: boolean;
- }
- function getDeclarationOfKind(symbol: Symbol, kind: SyntaxKind): Declaration;
- interface StringSymbolWriter extends SymbolWriter {
- string(): string;
- }
- interface EmitHost extends ScriptReferenceHost {
- getSourceFiles(): SourceFile[];
- isSourceFileFromExternalLibrary(file: SourceFile): boolean;
- getCommonSourceDirectory(): string;
- getCanonicalFileName(fileName: string): string;
- getNewLine(): string;
- isEmitBlocked(emitFileName: string): boolean;
- writeFile: WriteFileCallback;
- }
- function getSingleLineStringWriter(): StringSymbolWriter;
- function releaseStringWriter(writer: StringSymbolWriter): void;
- function getFullWidth(node: Node): number;
- function arrayIsEqualTo(array1: ReadonlyArray, array2: ReadonlyArray, equaler?: (a: T, b: T) => boolean): boolean;
- function hasResolvedModule(sourceFile: SourceFile, moduleNameText: string): boolean;
- function getResolvedModule(sourceFile: SourceFile, moduleNameText: string): ResolvedModule;
- function setResolvedModule(sourceFile: SourceFile, moduleNameText: string, resolvedModule: ResolvedModule): void;
- function setResolvedTypeReferenceDirective(sourceFile: SourceFile, typeReferenceDirectiveName: string, resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective): void;
- function moduleResolutionIsEqualTo(oldResolution: ResolvedModule, newResolution: ResolvedModule): boolean;
- function typeDirectiveIsEqualTo(oldResolution: ResolvedTypeReferenceDirective, newResolution: ResolvedTypeReferenceDirective): boolean;
- function hasChangesInResolutions(names: string[], newResolutions: T[], oldResolutions: Map, comparer: (oldResolution: T, newResolution: T) => boolean): boolean;
- function containsParseError(node: Node): boolean;
- function getSourceFileOfNode(node: Node): SourceFile;
- function isStatementWithLocals(node: Node): boolean;
- function getStartPositionOfLine(line: number, sourceFile: SourceFile): number;
- function nodePosToString(node: Node): string;
- function getStartPosOfNode(node: Node): number;
- function isDefined(value: any): boolean;
- function getEndLinePosition(line: number, sourceFile: SourceFile): number;
- function nodeIsMissing(node: Node): boolean;
- function nodeIsPresent(node: Node): boolean;
- function getTokenPosOfNode(node: Node, sourceFile?: SourceFile, includeJsDocComment?: boolean): number;
- function isJSDocNode(node: Node): boolean;
- function isJSDocTag(node: Node): boolean;
- function getNonDecoratorTokenPosOfNode(node: Node, sourceFile?: SourceFile): number;
- function getSourceTextOfNodeFromSourceFile(sourceFile: SourceFile, node: Node, includeTrivia?: boolean): string;
- function getTextOfNodeFromSourceText(sourceText: string, node: Node): string;
- function getTextOfNode(node: Node, includeTrivia?: boolean): string;
- function getLiteralText(node: LiteralLikeNode, sourceFile: SourceFile, languageVersion: ScriptTarget): string;
- function isBinaryOrOctalIntegerLiteral(node: LiteralLikeNode, text: string): boolean;
- function escapeIdentifier(identifier: string): string;
- function unescapeIdentifier(identifier: string): string;
- function makeIdentifierFromModuleName(moduleName: string): string;
- function isBlockOrCatchScoped(declaration: Declaration): boolean;
- function isAmbientModule(node: Node): boolean;
- function isShorthandAmbientModuleSymbol(moduleSymbol: Symbol): boolean;
- function isBlockScopedContainerTopLevel(node: Node): boolean;
- function isGlobalScopeAugmentation(module: ModuleDeclaration): boolean;
- function isExternalModuleAugmentation(node: Node): boolean;
- function isBlockScope(node: Node, parentNode: Node): boolean;
- function getEnclosingBlockScopeContainer(node: Node): Node;
- function isCatchClauseVariableDeclaration(declaration: Declaration): boolean;
- function declarationNameToString(name: DeclarationName): string;
- function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): Diagnostic;
- function createDiagnosticForNodeFromMessageChain(node: Node, messageChain: DiagnosticMessageChain): Diagnostic;
- function getSpanOfTokenAtPosition(sourceFile: SourceFile, pos: number): TextSpan;
- function getErrorSpanForNode(sourceFile: SourceFile, node: Node): TextSpan;
- function isExternalOrCommonJsModule(file: SourceFile): boolean;
- function isDeclarationFile(file: SourceFile): boolean;
- function isConstEnumDeclaration(node: Node): boolean;
- function isConst(node: Node): boolean;
- function isLet(node: Node): boolean;
- function isSuperCall(n: Node): n is SuperCall;
- function isPrologueDirective(node: Node): boolean;
- function getLeadingCommentRangesOfNode(node: Node, sourceFileOfNode: SourceFile): CommentRange[];
- function getLeadingCommentRangesOfNodeFromText(node: Node, text: string): CommentRange[];
- function getJsDocComments(node: Node, sourceFileOfNode: SourceFile): CommentRange[];
- function getJsDocCommentsFromText(node: Node, text: string): CommentRange[];
- let fullTripleSlashReferencePathRegEx: RegExp;
- let fullTripleSlashReferenceTypeReferenceDirectiveRegEx: RegExp;
- let fullTripleSlashAMDReferencePathRegEx: RegExp;
- function isPartOfTypeNode(node: Node): boolean;
- function forEachReturnStatement(body: Block, visitor: (stmt: ReturnStatement) => T): T;
- function forEachYieldExpression(body: Block, visitor: (expr: YieldExpression) => void): void;
- function isVariableLike(node: Node): node is VariableLikeDeclaration;
- function isAccessor(node: Node): node is AccessorDeclaration;
- function isClassLike(node: Node): node is ClassLikeDeclaration;
- function isFunctionLike(node: Node): node is FunctionLikeDeclaration;
- function isFunctionLikeKind(kind: SyntaxKind): boolean;
- function introducesArgumentsExoticObject(node: Node): boolean;
- function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement;
- function isFunctionBlock(node: Node): boolean;
- function isObjectLiteralMethod(node: Node): node is MethodDeclaration;
- function isObjectLiteralOrClassExpressionMethod(node: Node): node is MethodDeclaration;
- function isIdentifierTypePredicate(predicate: TypePredicate): predicate is IdentifierTypePredicate;
- function isThisTypePredicate(predicate: TypePredicate): predicate is ThisTypePredicate;
- function getContainingFunction(node: Node): FunctionLikeDeclaration;
- function getContainingClass(node: Node): ClassLikeDeclaration;
- function getThisContainer(node: Node, includeArrowFunctions: boolean): Node;
- function getSuperContainer(node: Node, stopOnFunctions: boolean): Node;
- function getImmediatelyInvokedFunctionExpression(func: Node): CallExpression;
- function isSuperProperty(node: Node): node is SuperProperty;
- function getEntityNameFromTypeNode(node: TypeNode): EntityNameOrEntityNameExpression;
- function isCallLikeExpression(node: Node): node is CallLikeExpression;
- function getInvokedExpression(node: CallLikeExpression): Expression;
- function nodeCanBeDecorated(node: Node): boolean;
- function nodeIsDecorated(node: Node): boolean;
- function nodeOrChildIsDecorated(node: Node): boolean;
- function childIsDecorated(node: Node): boolean;
- function isJSXTagName(node: Node): boolean;
- function isPartOfExpression(node: Node): boolean;
- function isInstantiatedModule(node: ModuleDeclaration, preserveConstEnums: boolean): boolean;
- function isExternalModuleImportEqualsDeclaration(node: Node): boolean;
- function getExternalModuleImportEqualsDeclarationExpression(node: Node): Expression;
- function isInternalModuleImportEqualsDeclaration(node: Node): node is ImportEqualsDeclaration;
- function isSourceFileJavaScript(file: SourceFile): boolean;
- function isInJavaScriptFile(node: Node): boolean;
- function isRequireCall(expression: Node, checkArgumentIsStringLiteral: boolean): expression is CallExpression;
- function isSingleOrDoubleQuote(charCode: number): boolean;
- function isDeclarationOfFunctionExpression(s: Symbol): boolean;
- function getSpecialPropertyAssignmentKind(expression: Node): SpecialPropertyAssignmentKind;
- function getExternalModuleName(node: Node): Expression;
- function getNamespaceDeclarationNode(node: ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration): ImportEqualsDeclaration | NamespaceImport;
- function isDefaultImport(node: ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration): boolean;
- function hasQuestionToken(node: Node): boolean;
- function isJSDocConstructSignature(node: Node): boolean;
- function getJSDocComments(node: Node, checkParentVariableStatement: boolean): string[];
- function getJSDocTypeTag(node: Node): JSDocTypeTag;
- function getJSDocReturnTag(node: Node): JSDocReturnTag;
- function getJSDocTemplateTag(node: Node): JSDocTemplateTag;
- function getCorrespondingJSDocParameterTag(parameter: ParameterDeclaration): JSDocParameterTag;
- function hasRestParameter(s: SignatureDeclaration): boolean;
- function hasDeclaredRestParameter(s: SignatureDeclaration): boolean;
- function isRestParameter(node: ParameterDeclaration): boolean;
- function isDeclaredRestParam(node: ParameterDeclaration): boolean;
- function isAssignmentTarget(node: Node): boolean;
- function isNodeDescendantOf(node: Node, ancestor: Node): boolean;
- function isInAmbientContext(node: Node): boolean;
- function isDeclarationName(name: Node): boolean;
- function isLiteralComputedPropertyDeclarationName(node: Node): boolean;
- function isIdentifierName(node: Identifier): boolean;
- function isAliasSymbolDeclaration(node: Node): boolean;
- function exportAssignmentIsAlias(node: ExportAssignment): boolean;
- function getClassExtendsHeritageClauseElement(node: ClassLikeDeclaration | InterfaceDeclaration): ExpressionWithTypeArguments;
- function getClassImplementsHeritageClauseElements(node: ClassLikeDeclaration): NodeArray;
- function getInterfaceBaseTypeNodes(node: InterfaceDeclaration): NodeArray;
- function getHeritageClause(clauses: NodeArray, kind: SyntaxKind): HeritageClause;
- function tryResolveScriptReference(host: ScriptReferenceHost, sourceFile: SourceFile, reference: FileReference): SourceFile;
- function getAncestor(node: Node, kind: SyntaxKind): Node;
- function getFileReferenceFromReferencePath(comment: string, commentRange: CommentRange): ReferencePathMatchResult;
- function isKeyword(token: SyntaxKind): boolean;
- function isTrivia(token: SyntaxKind): boolean;
- function isAsyncFunctionLike(node: Node): boolean;
- function isStringOrNumericLiteral(kind: SyntaxKind): boolean;
- function hasDynamicName(declaration: Declaration): boolean;
- function isDynamicName(name: DeclarationName): boolean;
- function isWellKnownSymbolSyntactically(node: Expression): boolean;
- function getPropertyNameForPropertyNameNode(name: DeclarationName): string;
- function getPropertyNameForKnownSymbolName(symbolName: string): string;
- function isESSymbolIdentifier(node: Node): boolean;
- function isModifierKind(token: SyntaxKind): boolean;
- function isParameterDeclaration(node: VariableLikeDeclaration): boolean;
- function getRootDeclaration(node: Node): Node;
- function nodeStartsNewLexicalEnvironment(node: Node): boolean;
- function nodeIsSynthesized(node: TextRange): boolean;
- function getOriginalNode(node: Node): Node;
- function isParseTreeNode(node: Node): boolean;
- function getParseTreeNode(node: Node): Node;
- function getParseTreeNode(node: Node, nodeTest?: (node: Node) => node is T): T;
- function getOriginalSourceFiles(sourceFiles: SourceFile[]): SourceFile[];
- function getOriginalNodeId(node: Node): number;
- const enum Associativity {
- Left = 0,
- Right = 1,
- }
- function getExpressionAssociativity(expression: Expression): Associativity;
- function getOperatorAssociativity(kind: SyntaxKind, operator: SyntaxKind, hasArguments?: boolean): Associativity;
- function getExpressionPrecedence(expression: Expression): 0 | 1 | -1 | 2 | 4 | 3 | 16 | 10 | 5 | 6 | 11 | 8 | 19 | 18 | 17 | 15 | 14 | 13 | 12 | 9 | 7;
- function getOperator(expression: Expression): SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.NumericLiteral | SyntaxKind.StringLiteral | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral | SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken | SyntaxKind.Identifier | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.LetKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.StaticKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AbstractKeyword | SyntaxKind.AsKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.GetKeyword | SyntaxKind.IsKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.NumberKeyword | SyntaxKind.SetKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.TypeKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.FromKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.OfKeyword | SyntaxKind.QualifiedName | SyntaxKind.ComputedPropertyName | SyntaxKind.TypeParameter | SyntaxKind.Parameter | SyntaxKind.Decorator | SyntaxKind.PropertySignature | SyntaxKind.PropertyDeclaration | SyntaxKind.MethodSignature | SyntaxKind.MethodDeclaration | SyntaxKind.Constructor | SyntaxKind.GetAccessor | SyntaxKind.SetAccessor | SyntaxKind.CallSignature | SyntaxKind.ConstructSignature | SyntaxKind.IndexSignature | SyntaxKind.TypePredicate | SyntaxKind.TypeReference | SyntaxKind.FunctionType | SyntaxKind.ConstructorType | SyntaxKind.TypeQuery | SyntaxKind.TypeLiteral | SyntaxKind.ArrayType | SyntaxKind.TupleType | SyntaxKind.UnionType | SyntaxKind.IntersectionType | SyntaxKind.ParenthesizedType | SyntaxKind.ThisType | SyntaxKind.LiteralType | SyntaxKind.ObjectBindingPattern | SyntaxKind.ArrayBindingPattern | SyntaxKind.BindingElement | SyntaxKind.ArrayLiteralExpression | SyntaxKind.ObjectLiteralExpression | SyntaxKind.PropertyAccessExpression | SyntaxKind.ElementAccessExpression | SyntaxKind.CallExpression | SyntaxKind.NewExpression | SyntaxKind.TaggedTemplateExpression | SyntaxKind.TypeAssertionExpression | SyntaxKind.ParenthesizedExpression | SyntaxKind.FunctionExpression | SyntaxKind.ArrowFunction | SyntaxKind.DeleteExpression | SyntaxKind.TypeOfExpression | SyntaxKind.VoidExpression | SyntaxKind.AwaitExpression | SyntaxKind.ConditionalExpression | SyntaxKind.TemplateExpression | SyntaxKind.YieldExpression | SyntaxKind.SpreadElementExpression | SyntaxKind.ClassExpression | SyntaxKind.OmittedExpression | SyntaxKind.ExpressionWithTypeArguments | SyntaxKind.AsExpression | SyntaxKind.NonNullExpression | SyntaxKind.TemplateSpan | SyntaxKind.SemicolonClassElement | SyntaxKind.Block | SyntaxKind.VariableStatement | SyntaxKind.EmptyStatement | SyntaxKind.ExpressionStatement | SyntaxKind.IfStatement | SyntaxKind.DoStatement | SyntaxKind.WhileStatement | SyntaxKind.ForStatement | SyntaxKind.ForInStatement | SyntaxKind.ForOfStatement | SyntaxKind.ContinueStatement | SyntaxKind.BreakStatement | SyntaxKind.ReturnStatement | SyntaxKind.WithStatement | SyntaxKind.SwitchStatement | SyntaxKind.LabeledStatement | SyntaxKind.ThrowStatement | SyntaxKind.TryStatement | SyntaxKind.DebuggerStatement | SyntaxKind.VariableDeclaration | SyntaxKind.VariableDeclarationList | SyntaxKind.FunctionDeclaration | SyntaxKind.ClassDeclaration | SyntaxKind.InterfaceDeclaration | SyntaxKind.TypeAliasDeclaration | SyntaxKind.EnumDeclaration | SyntaxKind.ModuleDeclaration | SyntaxKind.ModuleBlock | SyntaxKind.CaseBlock | SyntaxKind.NamespaceExportDeclaration | SyntaxKind.ImportEqualsDeclaration | SyntaxKind.ImportDeclaration | SyntaxKind.ImportClause | SyntaxKind.NamespaceImport | SyntaxKind.NamedImports | SyntaxKind.ImportSpecifier | SyntaxKind.ExportAssignment | SyntaxKind.ExportDeclaration | SyntaxKind.NamedExports | SyntaxKind.ExportSpecifier | SyntaxKind.MissingDeclaration | SyntaxKind.ExternalModuleReference | SyntaxKind.JsxElement | SyntaxKind.JsxSelfClosingElement | SyntaxKind.JsxOpeningElement | SyntaxKind.JsxText | SyntaxKind.JsxClosingElement | SyntaxKind.JsxAttribute | SyntaxKind.JsxSpreadAttribute | SyntaxKind.JsxExpression | SyntaxKind.CaseClause | SyntaxKind.DefaultClause | SyntaxKind.HeritageClause | SyntaxKind.CatchClause | SyntaxKind.PropertyAssignment | SyntaxKind.ShorthandPropertyAssignment | SyntaxKind.EnumMember | SyntaxKind.SourceFile | SyntaxKind.JSDocTypeExpression | SyntaxKind.JSDocAllType | SyntaxKind.JSDocUnknownType | SyntaxKind.JSDocArrayType | SyntaxKind.JSDocUnionType | SyntaxKind.JSDocTupleType | SyntaxKind.JSDocNullableType | SyntaxKind.JSDocNonNullableType | SyntaxKind.JSDocRecordType | SyntaxKind.JSDocRecordMember | SyntaxKind.JSDocTypeReference | SyntaxKind.JSDocOptionalType | SyntaxKind.JSDocFunctionType | SyntaxKind.JSDocVariadicType | SyntaxKind.JSDocConstructorType | SyntaxKind.JSDocThisType | SyntaxKind.JSDocComment | SyntaxKind.JSDocTag | SyntaxKind.JSDocParameterTag | SyntaxKind.JSDocReturnTag | SyntaxKind.JSDocTypeTag | SyntaxKind.JSDocTemplateTag | SyntaxKind.JSDocTypedefTag | SyntaxKind.JSDocPropertyTag | SyntaxKind.JSDocTypeLiteral | SyntaxKind.JSDocLiteralType | SyntaxKind.JSDocNullKeyword | SyntaxKind.JSDocUndefinedKeyword | SyntaxKind.JSDocNeverKeyword | SyntaxKind.SyntaxList | SyntaxKind.NotEmittedStatement | SyntaxKind.PartiallyEmittedExpression | SyntaxKind.Count;
- function getOperatorPrecedence(nodeKind: SyntaxKind, operatorKind: SyntaxKind, hasArguments?: boolean): 0 | 1 | -1 | 2 | 4 | 3 | 16 | 10 | 5 | 6 | 11 | 8 | 19 | 18 | 17 | 15 | 14 | 13 | 12 | 9 | 7;
- function createDiagnosticCollection(): DiagnosticCollection;
- function escapeString(s: string): string;
- function isIntrinsicJsxName(name: string): boolean;
- function escapeNonAsciiCharacters(s: string): string;
- interface EmitTextWriter {
- write(s: string): void;
- writeTextOfNode(text: string, node: Node): void;
- writeLine(): void;
- increaseIndent(): void;
- decreaseIndent(): void;
- getText(): string;
- rawWrite(s: string): void;
- writeLiteral(s: string): void;
- getTextPos(): number;
- getLine(): number;
- getColumn(): number;
- getIndent(): number;
- isAtStartOfLine(): boolean;
- reset(): void;
- }
- function getIndentString(level: number): string;
- function getIndentSize(): number;
- function createTextWriter(newLine: String): EmitTextWriter;
- function getResolvedExternalModuleName(host: EmitHost, file: SourceFile): string;
- function getExternalModuleNameFromDeclaration(host: EmitHost, resolver: EmitResolver, declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration | ModuleDeclaration): string;
- function getExternalModuleNameFromPath(host: EmitHost, fileName: string): string;
- function getOwnEmitOutputFilePath(sourceFile: SourceFile, host: EmitHost, extension: string): string;
- function getDeclarationEmitOutputFilePath(sourceFile: SourceFile, host: EmitHost): string;
- interface EmitFileNames {
- jsFilePath: string;
- sourceMapFilePath: string;
- declarationFilePath: string;
- }
- function getSourceFilesToEmit(host: EmitHost, targetSourceFile?: SourceFile): SourceFile[];
- function forEachTransformedEmitFile(host: EmitHost, sourceFiles: SourceFile[], action: (jsFilePath: string, sourceMapFilePath: string, declarationFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean) => void, emitOnlyDtsFiles?: boolean): void;
- function forEachExpectedEmitFile(host: EmitHost, action: (emitFileNames: EmitFileNames, sourceFiles: SourceFile[], isBundledEmit: boolean, emitOnlyDtsFiles: boolean) => void, targetSourceFile?: SourceFile, emitOnlyDtsFiles?: boolean): void;
- function getSourceFilePathInNewDir(sourceFile: SourceFile, host: EmitHost, newDirPath: string): string;
- function writeFile(host: EmitHost, diagnostics: DiagnosticCollection, fileName: string, data: string, writeByteOrderMark: boolean, sourceFiles?: SourceFile[]): void;
- function getLineOfLocalPosition(currentSourceFile: SourceFile, pos: number): number;
- function getLineOfLocalPositionFromLineMap(lineMap: number[], pos: number): number;
- function getFirstConstructorWithBody(node: ClassLikeDeclaration): ConstructorDeclaration;
- function getSetAccessorTypeAnnotationNode(accessor: SetAccessorDeclaration): TypeNode;
- function getThisParameter(signature: SignatureDeclaration): ParameterDeclaration | undefined;
- function parameterIsThisKeyword(parameter: ParameterDeclaration): boolean;
- function isThisIdentifier(node: Node | undefined): boolean;
- function identifierIsThisKeyword(id: Identifier): boolean;
- interface AllAccessorDeclarations {
- firstAccessor: AccessorDeclaration;
- secondAccessor: AccessorDeclaration;
- getAccessor: AccessorDeclaration;
- setAccessor: AccessorDeclaration;
- }
- function getAllAccessorDeclarations(declarations: NodeArray, accessor: AccessorDeclaration): AllAccessorDeclarations;
- function emitNewLineBeforeLeadingComments(lineMap: number[], writer: EmitTextWriter, node: TextRange, leadingComments: CommentRange[]): void;
- function emitNewLineBeforeLeadingCommentsOfPosition(lineMap: number[], writer: EmitTextWriter, pos: number, leadingComments: CommentRange[]): void;
- function emitNewLineBeforeLeadingCommentOfPosition(lineMap: number[], writer: EmitTextWriter, pos: number, commentPos: number): void;
- function emitComments(text: string, lineMap: number[], writer: EmitTextWriter, comments: CommentRange[], leadingSeparator: boolean, trailingSeparator: boolean, newLine: string, writeComment: (text: string, lineMap: number[], writer: EmitTextWriter, commentPos: number, commentEnd: number, newLine: string) => void): void;
- function emitDetachedComments(text: string, lineMap: number[], writer: EmitTextWriter, writeComment: (text: string, lineMap: number[], writer: EmitTextWriter, commentPos: number, commentEnd: number, newLine: string) => void, node: TextRange, newLine: string, removeComments: boolean): {
- nodePos: number;
- detachedCommentEndPos: number;
- };
- function writeCommentRange(text: string, lineMap: number[], writer: EmitTextWriter, commentPos: number, commentEnd: number, newLine: string): void;
- function hasModifiers(node: Node): boolean;
- function hasModifier(node: Node, flags: ModifierFlags): boolean;
- function getModifierFlags(node: Node): ModifierFlags;
- function modifierToFlag(token: SyntaxKind): ModifierFlags;
- function isLogicalOperator(token: SyntaxKind): boolean;
- function isAssignmentOperator(token: SyntaxKind): boolean;
- function tryGetClassExtendingExpressionWithTypeArguments(node: Node): ClassLikeDeclaration | undefined;
- function isDestructuringAssignment(node: Node): node is BinaryExpression;
- function isSupportedExpressionWithTypeArguments(node: ExpressionWithTypeArguments): boolean;
- function isExpressionWithTypeArgumentsInClassExtendsClause(node: Node): boolean;
- function isEntityNameExpression(node: Expression): node is EntityNameExpression;
- function isRightSideOfQualifiedNameOrPropertyAccess(node: Node): boolean;
- function isEmptyObjectLiteralOrArrayLiteral(expression: Node): boolean;
- function getLocalSymbolForExportDefault(symbol: Symbol): Symbol;
- function tryExtractTypeScriptExtension(fileName: string): string | undefined;
- const stringify: (value: any) => string;
- function convertToBase64(input: string): string;
- function getNewLineCharacter(options: CompilerOptions): string;
- function isSimpleExpression(node: Expression): boolean;
- function formatSyntaxKind(kind: SyntaxKind): string;
- function movePos(pos: number, value: number): number;
- function createRange(pos: number, end: number): TextRange;
- function moveRangeEnd(range: TextRange, end: number): TextRange;
- function moveRangePos(range: TextRange, pos: number): TextRange;
- function moveRangePastDecorators(node: Node): TextRange;
- function moveRangePastModifiers(node: Node): TextRange;
- function isCollapsedRange(range: TextRange): boolean;
- function collapseRangeToStart(range: TextRange): TextRange;
- function collapseRangeToEnd(range: TextRange): TextRange;
- function createTokenRange(pos: number, token: SyntaxKind): TextRange;
- function rangeIsOnSingleLine(range: TextRange, sourceFile: SourceFile): boolean;
- function rangeStartPositionsAreOnSameLine(range1: TextRange, range2: TextRange, sourceFile: SourceFile): boolean;
- function rangeEndPositionsAreOnSameLine(range1: TextRange, range2: TextRange, sourceFile: SourceFile): boolean;
- function rangeStartIsOnSameLineAsRangeEnd(range1: TextRange, range2: TextRange, sourceFile: SourceFile): boolean;
- function rangeEndIsOnSameLineAsRangeStart(range1: TextRange, range2: TextRange, sourceFile: SourceFile): boolean;
- function positionsAreOnSameLine(pos1: number, pos2: number, sourceFile: SourceFile): boolean;
- function getStartPositionOfRange(range: TextRange, sourceFile: SourceFile): number;
- function collectExternalModuleInfo(sourceFile: SourceFile, resolver: EmitResolver): {
- externalImports: (ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration)[];
- exportSpecifiers: Map;
- exportEquals: ExportAssignment;
- hasExportStarsToExportValues: boolean;
- };
- function getInitializedVariables(node: VariableDeclarationList): VariableDeclaration[];
- function isMergedWithClass(node: Node): boolean;
- function isFirstDeclarationOfKind(node: Node, kind: SyntaxKind): boolean;
- function isNodeArray(array: T[]): array is NodeArray;
- function isNoSubstitutionTemplateLiteral(node: Node): node is LiteralExpression;
- function isLiteralKind(kind: SyntaxKind): boolean;
- function isTextualLiteralKind(kind: SyntaxKind): boolean;
- function isLiteralExpression(node: Node): node is LiteralExpression;
- function isTemplateLiteralKind(kind: SyntaxKind): boolean;
- function isTemplateHead(node: Node): node is TemplateHead;
- function isTemplateMiddleOrTemplateTail(node: Node): node is TemplateMiddle | TemplateTail;
- function isIdentifier(node: Node): node is Identifier;
- function isGeneratedIdentifier(node: Node): boolean;
- function isModifier(node: Node): node is Modifier;
- function isQualifiedName(node: Node): node is QualifiedName;
- function isComputedPropertyName(node: Node): node is ComputedPropertyName;
- function isEntityName(node: Node): node is EntityName;
- function isPropertyName(node: Node): node is PropertyName;
- function isModuleName(node: Node): node is ModuleName;
- function isBindingName(node: Node): node is BindingName;
- function isTypeParameter(node: Node): node is TypeParameterDeclaration;
- function isParameter(node: Node): node is ParameterDeclaration;
- function isDecorator(node: Node): node is Decorator;
- function isMethodDeclaration(node: Node): node is MethodDeclaration;
- function isClassElement(node: Node): node is ClassElement;
- function isObjectLiteralElementLike(node: Node): node is ObjectLiteralElementLike;
- function isTypeNode(node: Node): node is TypeNode;
- function isBindingPattern(node: Node): node is BindingPattern;
- function isBindingElement(node: Node): node is BindingElement;
- function isArrayBindingElement(node: Node): node is ArrayBindingElement;
- function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression;
- function isElementAccessExpression(node: Node): node is ElementAccessExpression;
- function isBinaryExpression(node: Node): node is BinaryExpression;
- function isConditionalExpression(node: Node): node is ConditionalExpression;
- function isCallExpression(node: Node): node is CallExpression;
- function isTemplateLiteral(node: Node): node is TemplateLiteral;
- function isSpreadElementExpression(node: Node): node is SpreadElementExpression;
- function isExpressionWithTypeArguments(node: Node): node is ExpressionWithTypeArguments;
- function isLeftHandSideExpression(node: Node): node is LeftHandSideExpression;
- function isUnaryExpression(node: Node): node is UnaryExpression;
- function isExpression(node: Node): node is Expression;
- function isAssertionExpression(node: Node): node is AssertionExpression;
- function isPartiallyEmittedExpression(node: Node): node is PartiallyEmittedExpression;
- function isNotEmittedStatement(node: Node): node is NotEmittedStatement;
- function isNotEmittedOrPartiallyEmittedNode(node: Node): node is NotEmittedStatement | PartiallyEmittedExpression;
- function isOmittedExpression(node: Node): node is OmittedExpression;
- function isTemplateSpan(node: Node): node is TemplateSpan;
- function isBlock(node: Node): node is Block;
- function isConciseBody(node: Node): node is ConciseBody;
- function isFunctionBody(node: Node): node is FunctionBody;
- function isForInitializer(node: Node): node is ForInitializer;
- function isVariableDeclaration(node: Node): node is VariableDeclaration;
- function isVariableDeclarationList(node: Node): node is VariableDeclarationList;
- function isCaseBlock(node: Node): node is CaseBlock;
- function isModuleBody(node: Node): node is ModuleBody;
- function isImportEqualsDeclaration(node: Node): node is ImportEqualsDeclaration;
- function isImportClause(node: Node): node is ImportClause;
- function isNamedImportBindings(node: Node): node is NamedImportBindings;
- function isImportSpecifier(node: Node): node is ImportSpecifier;
- function isNamedExports(node: Node): node is NamedExports;
- function isExportSpecifier(node: Node): node is ExportSpecifier;
- function isModuleOrEnumDeclaration(node: Node): node is ModuleDeclaration | EnumDeclaration;
- function isDeclaration(node: Node): node is Declaration;
- function isDeclarationStatement(node: Node): node is DeclarationStatement;
- function isStatementButNotDeclaration(node: Node): node is Statement;
- function isStatement(node: Node): node is Statement;
- function isModuleReference(node: Node): node is ModuleReference;
- function isJsxOpeningElement(node: Node): node is JsxOpeningElement;
- function isJsxClosingElement(node: Node): node is JsxClosingElement;
- function isJsxTagNameExpression(node: Node): node is JsxTagNameExpression;
- function isJsxChild(node: Node): node is JsxChild;
- function isJsxAttributeLike(node: Node): node is JsxAttributeLike;
- function isJsxSpreadAttribute(node: Node): node is JsxSpreadAttribute;
- function isJsxAttribute(node: Node): node is JsxAttribute;
- function isStringLiteralOrJsxExpression(node: Node): node is StringLiteral | JsxExpression;
- function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause;
- function isHeritageClause(node: Node): node is HeritageClause;
- function isCatchClause(node: Node): node is CatchClause;
- function isPropertyAssignment(node: Node): node is PropertyAssignment;
- function isShorthandPropertyAssignment(node: Node): node is ShorthandPropertyAssignment;
- function isEnumMember(node: Node): node is EnumMember;
- function isSourceFile(node: Node): node is SourceFile;
- function isWatchSet(options: CompilerOptions): boolean;
-}
-declare namespace ts {
- function getDefaultLibFileName(options: CompilerOptions): string;
- function textSpanEnd(span: TextSpan): number;
- function textSpanIsEmpty(span: TextSpan): boolean;
- function textSpanContainsPosition(span: TextSpan, position: number): boolean;
- function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean;
- function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean;
- function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan;
- function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean;
- function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean;
- function decodedTextSpanIntersectsWith(start1: number, length1: number, start2: number, length2: number): boolean;
- function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean;
- function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan;
- function createTextSpan(start: number, length: number): TextSpan;
- function createTextSpanFromBounds(start: number, end: number): TextSpan;
- function textChangeRangeNewSpan(range: TextChangeRange): TextSpan;
- function textChangeRangeIsUnchanged(range: TextChangeRange): boolean;
- function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange;
- let unchangedTextChangeRange: TextChangeRange;
- function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange;
- function getTypeParameterOwner(d: Declaration): Declaration;
- function isParameterPropertyDeclaration(node: ParameterDeclaration): boolean;
- function getCombinedModifierFlags(node: Node): ModifierFlags;
- function getCombinedNodeFlags(node: Node): NodeFlags;
-}
-declare namespace ts {
- function updateNode(updated: T, original: T): T;
- function createNodeArray(elements?: T[], location?: TextRange, hasTrailingComma?: boolean): NodeArray;
- function createSynthesizedNode(kind: SyntaxKind, startsOnNewLine?: boolean): Node;
- function createSynthesizedNodeArray(elements?: T[]): NodeArray;
- function getSynthesizedClone(node: T): T;
- function getMutableClone(node: T): T;
- function createLiteral(textSource: StringLiteral | Identifier, location?: TextRange): StringLiteral;
- function createLiteral(value: string, location?: TextRange): StringLiteral;
- function createLiteral(value: number, location?: TextRange): NumericLiteral;
- function createLiteral(value: boolean, location?: TextRange): BooleanLiteral;
- function createLiteral(value: string | number | boolean, location?: TextRange): PrimaryExpression;
- function createIdentifier(text: string, location?: TextRange): Identifier;
- function createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined, location?: TextRange): Identifier;
- function createLoopVariable(location?: TextRange): Identifier;
- function createUniqueName(text: string, location?: TextRange): Identifier;
- function getGeneratedNameForNode(node: Node, location?: TextRange): Identifier;
- function createToken(token: TKind): Token;
- function createSuper(): PrimaryExpression;
- function createThis(location?: TextRange): PrimaryExpression;
- function createNull(): PrimaryExpression;
- function createComputedPropertyName(expression: Expression, location?: TextRange): ComputedPropertyName;
- function updateComputedPropertyName(node: ComputedPropertyName, expression: Expression): ComputedPropertyName;
- function createParameter(name: string | Identifier | BindingPattern, initializer?: Expression, location?: TextRange): ParameterDeclaration;
- function createParameterDeclaration(decorators: Decorator[], modifiers: Modifier[], dotDotDotToken: DotDotDotToken, name: string | Identifier | BindingPattern, questionToken: QuestionToken, type: TypeNode, initializer: Expression, location?: TextRange, flags?: NodeFlags): ParameterDeclaration;
- function updateParameterDeclaration(node: ParameterDeclaration, decorators: Decorator[], modifiers: Modifier[], name: BindingName, type: TypeNode, initializer: Expression): ParameterDeclaration;
- function createProperty(decorators: Decorator[], modifiers: Modifier[], name: string | PropertyName, questionToken: QuestionToken, type: TypeNode, initializer: Expression, location?: TextRange): PropertyDeclaration;
- function updateProperty(node: PropertyDeclaration, decorators: Decorator[], modifiers: Modifier[], name: PropertyName, type: TypeNode, initializer: Expression): PropertyDeclaration;
- function createMethod(decorators: Decorator[], modifiers: Modifier[], asteriskToken: AsteriskToken, name: string | PropertyName, typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, body: Block, location?: TextRange, flags?: NodeFlags): MethodDeclaration;
- function updateMethod(node: MethodDeclaration, decorators: Decorator[], modifiers: Modifier[], name: PropertyName, typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, body: Block): MethodDeclaration;
- function createConstructor(decorators: Decorator[], modifiers: Modifier[], parameters: ParameterDeclaration[], body: Block, location?: TextRange, flags?: NodeFlags): ConstructorDeclaration;
- function updateConstructor(node: ConstructorDeclaration, decorators: Decorator[], modifiers: Modifier[], parameters: ParameterDeclaration[], body: Block): ConstructorDeclaration;
- function createGetAccessor(decorators: Decorator[], modifiers: Modifier[], name: string | PropertyName, parameters: ParameterDeclaration[], type: TypeNode, body: Block, location?: TextRange, flags?: NodeFlags): GetAccessorDeclaration;
- function updateGetAccessor(node: GetAccessorDeclaration, decorators: Decorator[], modifiers: Modifier[], name: PropertyName, parameters: ParameterDeclaration[], type: TypeNode, body: Block): GetAccessorDeclaration;
- function createSetAccessor(decorators: Decorator[], modifiers: Modifier[], name: string | PropertyName, parameters: ParameterDeclaration[], body: Block, location?: TextRange, flags?: NodeFlags): SetAccessorDeclaration;
- function updateSetAccessor(node: SetAccessorDeclaration, decorators: Decorator[], modifiers: Modifier[], name: PropertyName, parameters: ParameterDeclaration[], body: Block): SetAccessorDeclaration;
- function createObjectBindingPattern(elements: BindingElement[], location?: TextRange): ObjectBindingPattern;
- function updateObjectBindingPattern(node: ObjectBindingPattern, elements: BindingElement[]): ObjectBindingPattern;
- function createArrayBindingPattern(elements: ArrayBindingElement[], location?: TextRange): ArrayBindingPattern;
- function updateArrayBindingPattern(node: ArrayBindingPattern, elements: ArrayBindingElement[]): ArrayBindingPattern;
- function createBindingElement(propertyName: string | PropertyName, dotDotDotToken: DotDotDotToken, name: string | BindingName, initializer?: Expression, location?: TextRange): BindingElement;
- function updateBindingElement(node: BindingElement, propertyName: PropertyName, name: BindingName, initializer: Expression): BindingElement;
- function createArrayLiteral(elements?: Expression[], location?: TextRange, multiLine?: boolean): ArrayLiteralExpression;
- function updateArrayLiteral(node: ArrayLiteralExpression, elements: Expression[]): ArrayLiteralExpression;
- function createObjectLiteral(properties?: ObjectLiteralElementLike[], location?: TextRange, multiLine?: boolean): ObjectLiteralExpression;
- function updateObjectLiteral(node: ObjectLiteralExpression, properties: ObjectLiteralElementLike[]): ObjectLiteralExpression;
- function createPropertyAccess(expression: Expression, name: string | Identifier, location?: TextRange, flags?: NodeFlags): PropertyAccessExpression;
- function updatePropertyAccess(node: PropertyAccessExpression, expression: Expression, name: Identifier): PropertyAccessExpression;
- function createElementAccess(expression: Expression, index: number | Expression, location?: TextRange): ElementAccessExpression;
- function updateElementAccess(node: ElementAccessExpression, expression: Expression, argumentExpression: Expression): ElementAccessExpression;
- function createCall(expression: Expression, typeArguments: TypeNode[], argumentsArray: Expression[], location?: TextRange, flags?: NodeFlags): CallExpression;
- function updateCall(node: CallExpression, expression: Expression, typeArguments: TypeNode[], argumentsArray: Expression[]): CallExpression;
- function createNew(expression: Expression, typeArguments: TypeNode[], argumentsArray: Expression[], location?: TextRange, flags?: NodeFlags): NewExpression;
- function updateNew(node: NewExpression, expression: Expression, typeArguments: TypeNode[], argumentsArray: Expression[]): NewExpression;
- function createTaggedTemplate(tag: Expression, template: TemplateLiteral, location?: TextRange): TaggedTemplateExpression;
- function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression;
- function createParen(expression: Expression, location?: TextRange): ParenthesizedExpression;
- function updateParen(node: ParenthesizedExpression, expression: Expression): ParenthesizedExpression;
- function createFunctionExpression(asteriskToken: AsteriskToken, name: string | Identifier, typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, body: Block, location?: TextRange, flags?: NodeFlags): FunctionExpression;
- function updateFunctionExpression(node: FunctionExpression, name: Identifier, typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, body: Block): FunctionExpression;
- function createArrowFunction(modifiers: Modifier[], typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody, location?: TextRange, flags?: NodeFlags): ArrowFunction;
- function updateArrowFunction(node: ArrowFunction, modifiers: Modifier[], typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, body: ConciseBody): ArrowFunction;
- function createDelete(expression: Expression, location?: TextRange): DeleteExpression;
- function updateDelete(node: DeleteExpression, expression: Expression): Expression;
- function createTypeOf(expression: Expression, location?: TextRange): TypeOfExpression;
- function updateTypeOf(node: TypeOfExpression, expression: Expression): Expression;
- function createVoid(expression: Expression, location?: TextRange): VoidExpression;
- function updateVoid(node: VoidExpression, expression: Expression): VoidExpression;
- function createAwait(expression: Expression, location?: TextRange): AwaitExpression;
- function updateAwait(node: AwaitExpression, expression: Expression): AwaitExpression;
- function createPrefix(operator: PrefixUnaryOperator, operand: Expression, location?: TextRange): PrefixUnaryExpression;
- function updatePrefix(node: PrefixUnaryExpression, operand: Expression): PrefixUnaryExpression;
- function createPostfix(operand: Expression, operator: PostfixUnaryOperator, location?: TextRange): PostfixUnaryExpression;
- function updatePostfix(node: PostfixUnaryExpression, operand: Expression): PostfixUnaryExpression;
- function createBinary(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression, location?: TextRange): BinaryExpression;
- function updateBinary(node: BinaryExpression, left: Expression, right: Expression): BinaryExpression;
- function createConditional(condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression, location?: TextRange): ConditionalExpression;
- function updateConditional(node: ConditionalExpression, condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression;
- function createTemplateExpression(head: TemplateHead, templateSpans: TemplateSpan[], location?: TextRange): TemplateExpression;
- function updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: TemplateSpan[]): TemplateExpression;
- function createYield(asteriskToken: AsteriskToken, expression: Expression, location?: TextRange): YieldExpression;
- function updateYield(node: YieldExpression, expression: Expression): YieldExpression;
- function createSpread(expression: Expression, location?: TextRange): SpreadElementExpression;
- function updateSpread(node: SpreadElementExpression, expression: Expression): SpreadElementExpression;
- function createClassExpression(modifiers: Modifier[], name: Identifier, typeParameters: TypeParameterDeclaration[], heritageClauses: HeritageClause[], members: ClassElement[], location?: TextRange): ClassExpression;
- function updateClassExpression(node: ClassExpression, modifiers: Modifier[], name: Identifier, typeParameters: TypeParameterDeclaration[], heritageClauses: HeritageClause[], members: ClassElement[]): ClassExpression;
- function createOmittedExpression(location?: TextRange): OmittedExpression;
- function createExpressionWithTypeArguments(typeArguments: TypeNode[], expression: Expression, location?: TextRange): ExpressionWithTypeArguments;
- function updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, typeArguments: TypeNode[], expression: Expression): ExpressionWithTypeArguments;
- function createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail, location?: TextRange): TemplateSpan;
- function updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan;
- function createBlock(statements: Statement[], location?: TextRange, multiLine?: boolean, flags?: NodeFlags): Block;
- function updateBlock(node: Block, statements: Statement[]): Block;
- function createVariableStatement(modifiers: Modifier[], declarationList: VariableDeclarationList | VariableDeclaration[], location?: TextRange, flags?: NodeFlags): VariableStatement;
- function updateVariableStatement(node: VariableStatement, modifiers: Modifier[], declarationList: VariableDeclarationList): VariableStatement;
- function createVariableDeclarationList(declarations: VariableDeclaration[], location?: TextRange, flags?: NodeFlags): VariableDeclarationList;
- function updateVariableDeclarationList(node: VariableDeclarationList, declarations: VariableDeclaration[]): VariableDeclarationList;
- function createVariableDeclaration(name: string | BindingPattern | Identifier, type?: TypeNode, initializer?: Expression, location?: TextRange, flags?: NodeFlags): VariableDeclaration;
- function updateVariableDeclaration(node: VariableDeclaration, name: BindingName, type: TypeNode, initializer: Expression): VariableDeclaration;
- function createEmptyStatement(location: TextRange): EmptyStatement;
- function createStatement(expression: Expression, location?: TextRange, flags?: NodeFlags): ExpressionStatement;
- function updateStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement;
- function createIf(expression: Expression, thenStatement: Statement, elseStatement?: Statement, location?: TextRange): IfStatement;
- function updateIf(node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement): IfStatement;
- function createDo(statement: Statement, expression: Expression, location?: TextRange): DoStatement;
- function updateDo(node: DoStatement, statement: Statement, expression: Expression): DoStatement;
- function createWhile(expression: Expression, statement: Statement, location?: TextRange): WhileStatement;
- function updateWhile(node: WhileStatement, expression: Expression, statement: Statement): WhileStatement;
- function createFor(initializer: ForInitializer, condition: Expression, incrementor: Expression, statement: Statement, location?: TextRange): ForStatement;
- function updateFor(node: ForStatement, initializer: ForInitializer, condition: Expression, incrementor: Expression, statement: Statement): ForStatement;
- function createForIn(initializer: ForInitializer, expression: Expression, statement: Statement, location?: TextRange): ForInStatement;
- function updateForIn(node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement;
- function createForOf(initializer: ForInitializer, expression: Expression, statement: Statement, location?: TextRange): ForOfStatement;
- function updateForOf(node: ForOfStatement, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement;
- function createContinue(label?: Identifier, location?: TextRange): ContinueStatement;
- function updateContinue(node: ContinueStatement, label: Identifier): ContinueStatement;
- function createBreak(label?: Identifier, location?: TextRange): BreakStatement;
- function updateBreak(node: BreakStatement, label: Identifier): BreakStatement;
- function createReturn(expression?: Expression, location?: TextRange): ReturnStatement;
- function updateReturn(node: ReturnStatement, expression: Expression): ReturnStatement;
- function createWith(expression: Expression, statement: Statement, location?: TextRange): WithStatement;
- function updateWith(node: WithStatement, expression: Expression, statement: Statement): WithStatement;
- function createSwitch(expression: Expression, caseBlock: CaseBlock, location?: TextRange): SwitchStatement;
- function updateSwitch(node: SwitchStatement, expression: Expression, caseBlock: CaseBlock): SwitchStatement;
- function createLabel(label: string | Identifier, statement: Statement, location?: TextRange): LabeledStatement;
- function updateLabel(node: LabeledStatement, label: Identifier, statement: Statement): LabeledStatement;
- function createThrow(expression: Expression, location?: TextRange): ThrowStatement;
- function updateThrow(node: ThrowStatement, expression: Expression): ThrowStatement;
- function createTry(tryBlock: Block, catchClause: CatchClause, finallyBlock: Block, location?: TextRange): TryStatement;
- function updateTry(node: TryStatement, tryBlock: Block, catchClause: CatchClause, finallyBlock: Block): TryStatement;
- function createCaseBlock(clauses: CaseOrDefaultClause[], location?: TextRange): CaseBlock;
- function updateCaseBlock(node: CaseBlock, clauses: CaseOrDefaultClause[]): CaseBlock;
- function createFunctionDeclaration(decorators: Decorator[], modifiers: Modifier[], asteriskToken: AsteriskToken, name: string | Identifier, typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, body: Block, location?: TextRange, flags?: NodeFlags): FunctionDeclaration;
- function updateFunctionDeclaration(node: FunctionDeclaration, decorators: Decorator[], modifiers: Modifier[], name: Identifier, typeParameters: TypeParameterDeclaration[], parameters: ParameterDeclaration[], type: TypeNode, body: Block): FunctionDeclaration;
- function createClassDeclaration(decorators: Decorator[], modifiers: Modifier[], name: Identifier, typeParameters: TypeParameterDeclaration[], heritageClauses: HeritageClause[], members: ClassElement[], location?: TextRange): ClassDeclaration;
- function updateClassDeclaration(node: ClassDeclaration, decorators: Decorator[], modifiers: Modifier[], name: Identifier, typeParameters: TypeParameterDeclaration[], heritageClauses: HeritageClause[], members: ClassElement[]): ClassDeclaration;
- function createImportDeclaration(decorators: Decorator[], modifiers: Modifier[], importClause: ImportClause, moduleSpecifier?: Expression, location?: TextRange): ImportDeclaration;
- function updateImportDeclaration(node: ImportDeclaration, decorators: Decorator[], modifiers: Modifier[], importClause: ImportClause, moduleSpecifier: Expression): ImportDeclaration;
- function createImportClause(name: Identifier, namedBindings: NamedImportBindings, location?: TextRange): ImportClause;
- function updateImportClause(node: ImportClause, name: Identifier, namedBindings: NamedImportBindings): ImportClause;
- function createNamespaceImport(name: Identifier, location?: TextRange): NamespaceImport;
- function updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport;
- function createNamedImports(elements: ImportSpecifier[], location?: TextRange): NamedImports;
- function updateNamedImports(node: NamedImports, elements: ImportSpecifier[]): NamedImports;
- function createImportSpecifier(propertyName: Identifier, name: Identifier, location?: TextRange): ImportSpecifier;
- function updateImportSpecifier(node: ImportSpecifier, propertyName: Identifier, name: Identifier): ImportSpecifier;
- function createExportAssignment(decorators: Decorator[], modifiers: Modifier[], isExportEquals: boolean, expression: Expression, location?: TextRange): ExportAssignment;
- function updateExportAssignment(node: ExportAssignment, decorators: Decorator[], modifiers: Modifier[], expression: Expression): ExportAssignment;
- function createExportDeclaration(decorators: Decorator[], modifiers: Modifier[], exportClause: NamedExports, moduleSpecifier?: Expression, location?: TextRange): ExportDeclaration;
- function updateExportDeclaration(node: ExportDeclaration, decorators: Decorator[], modifiers: Modifier[], exportClause: NamedExports, moduleSpecifier: Expression): ExportDeclaration;
- function createNamedExports(elements: ExportSpecifier[], location?: TextRange): NamedExports;
- function updateNamedExports(node: NamedExports, elements: ExportSpecifier[]): NamedExports;
- function createExportSpecifier(name: string | Identifier, propertyName?: string | Identifier, location?: TextRange): ExportSpecifier;
- function updateExportSpecifier(node: ExportSpecifier, name: Identifier, propertyName: Identifier): ExportSpecifier;
- function createJsxElement(openingElement: JsxOpeningElement, children: JsxChild[], closingElement: JsxClosingElement, location?: TextRange): JsxElement;
- function updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: JsxChild[], closingElement: JsxClosingElement): JsxElement;
- function createJsxSelfClosingElement(tagName: JsxTagNameExpression, attributes: JsxAttributeLike[], location?: TextRange): JsxSelfClosingElement;
- function updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: JsxTagNameExpression, attributes: JsxAttributeLike[]): JsxSelfClosingElement;
- function createJsxOpeningElement(tagName: JsxTagNameExpression, attributes: JsxAttributeLike[], location?: TextRange): JsxOpeningElement;
- function updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNameExpression, attributes: JsxAttributeLike[]): JsxOpeningElement;
- function createJsxClosingElement(tagName: JsxTagNameExpression, location?: TextRange): JsxClosingElement;
- function updateJsxClosingElement(node: JsxClosingElement, tagName: JsxTagNameExpression): JsxClosingElement;
- function createJsxAttribute(name: Identifier, initializer: StringLiteral | JsxExpression, location?: TextRange): JsxAttribute;
- function updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression): JsxAttribute;
- function createJsxSpreadAttribute(expression: Expression, location?: TextRange): JsxSpreadAttribute;
- function updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute;
- function createJsxExpression(expression: Expression, location?: TextRange): JsxExpression;
- function updateJsxExpression(node: JsxExpression, expression: Expression): JsxExpression;
- function createHeritageClause(token: SyntaxKind, types: ExpressionWithTypeArguments[], location?: TextRange): HeritageClause;
- function updateHeritageClause(node: HeritageClause, types: ExpressionWithTypeArguments[]): HeritageClause;
- function createCaseClause(expression: Expression, statements: Statement[], location?: TextRange): CaseClause;
- function updateCaseClause(node: CaseClause, expression: Expression, statements: Statement[]): CaseClause;
- function createDefaultClause(statements: Statement[], location?: TextRange): DefaultClause;
- function updateDefaultClause(node: DefaultClause, statements: Statement[]): DefaultClause;
- function createCatchClause(variableDeclaration: string | VariableDeclaration, block: Block, location?: TextRange): CatchClause;
- function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration, block: Block): CatchClause;
- function createPropertyAssignment(name: string | PropertyName, initializer: Expression, location?: TextRange): PropertyAssignment;
- function updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment;
- function createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer: Expression, location?: TextRange): ShorthandPropertyAssignment;
- function updateShorthandPropertyAssignment(node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression): ShorthandPropertyAssignment;
- function updateSourceFileNode(node: SourceFile, statements: Statement[]): SourceFile;
- function createNotEmittedStatement(original: Node): NotEmittedStatement;
- function createPartiallyEmittedExpression(expression: Expression, original?: Node, location?: TextRange): PartiallyEmittedExpression;
- function updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression;
- function createComma(left: Expression, right: Expression): Expression;
- function createLessThan(left: Expression, right: Expression, location?: TextRange): Expression;
- function createAssignment(left: Expression, right: Expression, location?: TextRange): BinaryExpression;
- function createStrictEquality(left: Expression, right: Expression): BinaryExpression;
- function createStrictInequality(left: Expression, right: Expression): BinaryExpression;
- function createAdd(left: Expression, right: Expression): BinaryExpression;
- function createSubtract(left: Expression, right: Expression): BinaryExpression;
- function createPostfixIncrement(operand: Expression, location?: TextRange): PostfixUnaryExpression;
- function createLogicalAnd(left: Expression, right: Expression): BinaryExpression;
- function createLogicalOr(left: Expression, right: Expression): BinaryExpression;
- function createLogicalNot(operand: Expression): PrefixUnaryExpression;
- function createVoidZero(): VoidExpression;
- function createMemberAccessForPropertyName(target: Expression, memberName: PropertyName, location?: TextRange): MemberExpression;
- function createRestParameter(name: string | Identifier): ParameterDeclaration;
- function createFunctionCall(func: Expression, thisArg: Expression, argumentsList: Expression[], location?: TextRange): CallExpression;
- function createFunctionApply(func: Expression, thisArg: Expression, argumentsExpression: Expression, location?: TextRange): CallExpression;
- function createArraySlice(array: Expression, start?: number | Expression): CallExpression;
- function createArrayConcat(array: Expression, values: Expression[]): CallExpression;
- function createMathPow(left: Expression, right: Expression, location?: TextRange): CallExpression;
- function createReactCreateElement(reactNamespace: string, tagName: Expression, props: Expression, children: Expression[], parentElement: JsxOpeningLikeElement, location: TextRange): LeftHandSideExpression;
- function createLetDeclarationList(declarations: VariableDeclaration[], location?: TextRange): VariableDeclarationList;
- function createConstDeclarationList(declarations: VariableDeclaration[], location?: TextRange): VariableDeclarationList;
- function createHelperName(externalHelpersModuleName: Identifier | undefined, name: string): Identifier | PropertyAccessExpression;
- function createExtendsHelper(externalHelpersModuleName: Identifier | undefined, name: Identifier): CallExpression;
- function createAssignHelper(externalHelpersModuleName: Identifier | undefined, attributesSegments: Expression[]): CallExpression;
- function createParamHelper(externalHelpersModuleName: Identifier | undefined, expression: Expression, parameterOffset: number, location?: TextRange): CallExpression;
- function createMetadataHelper(externalHelpersModuleName: Identifier | undefined, metadataKey: string, metadataValue: Expression): CallExpression;
- function createDecorateHelper(externalHelpersModuleName: Identifier | undefined, decoratorExpressions: Expression[], target: Expression, memberName?: Expression, descriptor?: Expression, location?: TextRange): CallExpression;
- function createAwaiterHelper(externalHelpersModuleName: Identifier | undefined, hasLexicalArguments: boolean, promiseConstructor: EntityName | Expression, body: Block): CallExpression;
- function createHasOwnProperty(target: LeftHandSideExpression, propertyName: Expression): CallExpression;
- function createAdvancedAsyncSuperHelper(): VariableStatement;
- function createSimpleAsyncSuperHelper(): VariableStatement;
- interface CallBinding {
- target: LeftHandSideExpression;
- thisArg: Expression;
- }
- function createCallBinding(expression: Expression, recordTempVariable: (temp: Identifier) => void, languageVersion?: ScriptTarget, cacheIdentifiers?: boolean): CallBinding;
- function inlineExpressions(expressions: Expression[]): Expression;
- function createExpressionFromEntityName(node: EntityName | Expression): Expression;
- function createExpressionForPropertyName(memberName: PropertyName): Expression;
- function createExpressionForObjectLiteralElementLike(node: ObjectLiteralExpression, property: ObjectLiteralElementLike, receiver: Expression): Expression;
- function addPrologueDirectives(target: Statement[], source: Statement[], ensureUseStrict?: boolean, visitor?: (node: Node) => VisitResult): number;
- function ensureUseStrict(node: SourceFile): SourceFile;
- function parenthesizeBinaryOperand(binaryOperator: SyntaxKind, operand: Expression, isLeftSideOfBinary: boolean, leftOperand?: Expression): Expression;
- function parenthesizeForNew(expression: Expression): LeftHandSideExpression;
- function parenthesizeForAccess(expression: Expression): LeftHandSideExpression;
- function parenthesizePostfixOperand(operand: Expression): LeftHandSideExpression;
- function parenthesizePrefixOperand(operand: Expression): UnaryExpression;
- function parenthesizeExpressionForList(expression: Expression): Expression;
- function parenthesizeExpressionForExpressionStatement(expression: Expression): Expression;
- function parenthesizeConciseBody(body: ConciseBody): ConciseBody;
- const enum OuterExpressionKinds {
- Parentheses = 1,
- Assertions = 2,
- PartiallyEmittedExpressions = 4,
- All = 7,
- }
- function skipOuterExpressions(node: Expression, kinds?: OuterExpressionKinds): Expression;
- function skipOuterExpressions(node: Node, kinds?: OuterExpressionKinds): Node;
- function skipParentheses(node: Expression): Expression;
- function skipParentheses(node: Node): Node;
- function skipAssertions(node: Expression): Expression;
- function skipAssertions(node: Node): Node;
- function skipPartiallyEmittedExpressions(node: Expression): Expression;
- function skipPartiallyEmittedExpressions(node: Node): Node;
- function startOnNewLine(node: T): T;
- function setOriginalNode(node: T, original: Node): T;
- function disposeEmitNodes(sourceFile: SourceFile): void;
- function getEmitFlags(node: Node): EmitFlags;
- function setEmitFlags(node: T, emitFlags: EmitFlags): T;
- function setSourceMapRange(node: T, range: TextRange): T;
- function setTokenSourceMapRange(node: T, token: SyntaxKind, range: TextRange): T;
- function setCommentRange(node: T, range: TextRange): T;
- function getCommentRange(node: Node): TextRange;
- function getSourceMapRange(node: Node): TextRange;
- function getTokenSourceMapRange(node: Node, token: SyntaxKind): TextRange;
- function getConstantValue(node: PropertyAccessExpression | ElementAccessExpression): number;
- function setConstantValue(node: PropertyAccessExpression | ElementAccessExpression, value: number): PropertyAccessExpression | ElementAccessExpression;
- function setTextRange(node: T, location: TextRange): T;
- function setNodeFlags(node: T, flags: NodeFlags): T;
- function setMultiLine(node: T, multiLine: boolean): T;
- function setHasTrailingComma(nodes: NodeArray, hasTrailingComma: boolean): NodeArray;
- function getLocalNameForExternalImport(node: ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration, sourceFile: SourceFile): Identifier;
- function getExternalModuleNameLiteral(importNode: ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration, sourceFile: SourceFile, host: EmitHost, resolver: EmitResolver, compilerOptions: CompilerOptions): StringLiteral;
- function tryGetModuleNameFromFile(file: SourceFile, host: EmitHost, options: CompilerOptions): StringLiteral;
-}
-declare namespace ts {
- function createNode(kind: SyntaxKind, pos?: number, end?: number): Node;
- function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T;
- function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile;
- function isExternalModule(file: SourceFile): boolean;
- function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
- function parseIsolatedJSDocComment(content: string, start?: number, length?: number): {
- jsDoc: JSDoc;
- diagnostics: Diagnostic[];
- };
- function parseJSDocTypeExpressionForTests(content: string, start?: number, length?: number): {
- jsDocTypeExpression: JSDocTypeExpression;
- diagnostics: Diagnostic[];
- };
-}
-declare namespace ts {
- const enum ModuleInstanceState {
- NonInstantiated = 0,
- Instantiated = 1,
- ConstEnumOnly = 2,
- }
- function getModuleInstanceState(node: Node): ModuleInstanceState;
- function bindSourceFile(file: SourceFile, options: CompilerOptions): void;
- function computeTransformFlagsForNode(node: Node, subtreeFlags: TransformFlags): TransformFlags;
-}
-declare namespace ts {
- function getNodeId(node: Node): number;
- function getSymbolId(symbol: Symbol): number;
- function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker;
-}
-declare namespace ts {
- type VisitResult = T | T[];
- function reduceEachChild(node: Node, f: (memo: T, node: Node) => T, initial: T): T;
- function visitNode(node: T, visitor: (node: Node) => VisitResult, test: (node: Node) => boolean, optional?: boolean, lift?: (node: NodeArray) => T): T;
- function visitNode(node: T, visitor: (node: Node) => VisitResult, test: (node: Node) => boolean, optional: boolean, lift: (node: NodeArray) => T, parenthesize: (node: Node, parentNode: Node) => Node, parentNode: Node): T;
- function visitNodes(nodes: NodeArray, visitor: (node: Node) => VisitResult, test: (node: Node) => boolean, start?: number, count?: number): NodeArray;
- function visitNodes(nodes: NodeArray, visitor: (node: Node) => VisitResult, test: (node: Node) => boolean, start: number, count: number, parenthesize: (node: Node, parentNode: Node) => Node, parentNode: Node): NodeArray;
- function visitEachChild(node: T, visitor: (node: Node) => VisitResult, context: LexicalEnvironment): T;
- function mergeFunctionBodyLexicalEnvironment(body: FunctionBody, declarations: Statement[]): FunctionBody;
- function mergeFunctionBodyLexicalEnvironment(body: ConciseBody, declarations: Statement[]): ConciseBody;
- function liftToBlock(nodes: Node[]): Statement;
- function aggregateTransformFlags(node: T): T;
- namespace Debug {
- const failNotOptional: (message?: string) => void;
- const failBadSyntaxKind: (node: Node, message?: string) => void;
- const assertNode: (node: Node, test: (node: Node) => boolean, message?: string) => void;
- }
-}
-declare namespace ts {
- function flattenDestructuringAssignment(context: TransformationContext, node: BinaryExpression, needsValue: boolean, recordTempVariable: (node: Identifier) => void, visitor?: (node: Node) => VisitResult): Expression;
- function flattenParameterDestructuring(context: TransformationContext, node: ParameterDeclaration, value: Expression, visitor?: (node: Node) => VisitResult): VariableDeclaration[];
- function flattenVariableDestructuring(context: TransformationContext, node: VariableDeclaration, value?: Expression, visitor?: (node: Node) => VisitResult, recordTempVariable?: (node: Identifier) => void): VariableDeclaration[];
- function flattenVariableDestructuringToExpression(context: TransformationContext, node: VariableDeclaration, recordTempVariable: (name: Identifier) => void, nameSubstitution?: (name: Identifier) => Expression, visitor?: (node: Node) => VisitResult): Expression;
-}
-declare namespace ts {
- function transformTypeScript(context: TransformationContext): (node: SourceFile) => SourceFile;
-}
-declare namespace ts {
- function transformJsx(context: TransformationContext): (node: SourceFile) => SourceFile;
-}
-declare namespace ts {
- function transformES7(context: TransformationContext): (node: SourceFile) => SourceFile;
-}
-declare namespace ts {
- function transformES6(context: TransformationContext): (node: SourceFile) => SourceFile;
-}
-declare namespace ts {
- function transformGenerators(context: TransformationContext): (node: SourceFile) => SourceFile;
-}
-declare namespace ts {
- function transformModule(context: TransformationContext): (node: SourceFile) => SourceFile;
-}
-declare namespace ts {
- function transformSystemModule(context: TransformationContext): (node: SourceFile) => SourceFile;
-}
-declare namespace ts {
- function transformES6Module(context: TransformationContext): (node: SourceFile) => SourceFile;
-}
-declare namespace ts {
- interface TransformationResult {
- transformed: SourceFile[];
- emitNodeWithSubstitution(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void): void;
- emitNodeWithNotification(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void): void;
- }
- interface TransformationContext extends LexicalEnvironment {
- getCompilerOptions(): CompilerOptions;
- getEmitResolver(): EmitResolver;
- getEmitHost(): EmitHost;
- hoistFunctionDeclaration(node: FunctionDeclaration): void;
- hoistVariableDeclaration(node: Identifier): void;
- enableSubstitution(kind: SyntaxKind): void;
- isSubstitutionEnabled(node: Node): boolean;
- onSubstituteNode?: (emitContext: EmitContext, node: Node) => Node;
- enableEmitNotification(kind: SyntaxKind): void;
- isEmitNotificationEnabled(node: Node): boolean;
- onEmitNode?: (emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void) => void;
- }
- type Transformer = (context: TransformationContext) => (node: SourceFile) => SourceFile;
- function getTransformers(compilerOptions: CompilerOptions): Transformer[];
- function transformFiles(resolver: EmitResolver, host: EmitHost, sourceFiles: SourceFile[], transformers: Transformer[]): TransformationResult;
-}
-declare namespace ts {
- function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver, targetSourceFile: SourceFile): Diagnostic[];
- function writeDeclarationFile(declarationFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean, host: EmitHost, resolver: EmitResolver, emitterDiagnostics: DiagnosticCollection, emitOnlyDtsFiles: boolean): boolean;
-}
-declare namespace ts {
- interface SourceMapWriter {
- initialize(filePath: string, sourceMapFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean): void;
- reset(): void;
- setSourceFile(sourceFile: SourceFile): void;
- emitPos(pos: number): void;
- emitNodeWithSourceMap(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void): void;
- emitTokenWithSourceMap(node: Node, token: SyntaxKind, tokenStartPos: number, emitCallback: (token: SyntaxKind, tokenStartPos: number) => number): number;
- getText(): string;
- getSourceMappingURL(): string;
- getSourceMapData(): SourceMapData;
- }
- function createSourceMapWriter(host: EmitHost, writer: EmitTextWriter): SourceMapWriter;
-}
-declare namespace ts {
- interface CommentWriter {
- reset(): void;
- setSourceFile(sourceFile: SourceFile): void;
- emitNodeWithComments(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void): void;
- emitBodyWithDetachedComments(node: Node, detachedRange: TextRange, emitCallback: (node: Node) => void): void;
- emitTrailingCommentsOfPosition(pos: number): void;
- }
- function createCommentWriter(host: EmitHost, writer: EmitTextWriter, sourceMap: SourceMapWriter): CommentWriter;
-}
-declare namespace ts {
- function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile, emitOnlyDtsFiles?: boolean): EmitResult;
-}
-declare namespace ts {
- const version = "2.1.0";
- function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string;
- function resolveTripleslashReference(moduleName: string, containingFile: string): string;
- function computeCommonSourceDirectoryOfFilenames(fileNames: string[], currentDirectory: string, getCanonicalFileName: (fileName: string) => string): string;
- function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
- function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[];
- interface FormatDiagnosticsHost {
- getCurrentDirectory(): string;
- getCanonicalFileName(fileName: string): string;
- getNewLine(): string;
- }
- function formatDiagnostics(diagnostics: Diagnostic[], host: FormatDiagnosticsHost): string;
- function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
- function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program;
-}
declare namespace ts {
interface Node {
getSourceFile(): SourceFile;
@@ -9186,10 +2174,6 @@ declare namespace ts {
getDocumentationComment(): SymbolDisplayPart[];
}
interface SourceFile {
- version: string;
- scriptSnapshot: IScriptSnapshot;
- nameTable: Map;
- getNamedDeclarations(): Map;
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
getLineStarts(): number[];
getPositionOfLineAndCharacter(line: number, character: number): number;
@@ -9279,8 +2263,6 @@ declare namespace ts {
getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[]): CodeAction[];
getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput;
getProgram(): Program;
- getNonBoundSourceFile(fileName: string): SourceFile;
- getSourceFile(fileName: string): SourceFile;
dispose(): void;
}
interface Classifications {
@@ -9672,123 +2654,8 @@ declare namespace ts {
jsxAttributeStringLiteralValue = 24,
}
}
-declare namespace ts {
- const scanner: Scanner;
- const emptyArray: any[];
- const enum SemanticMeaning {
- None = 0,
- Value = 1,
- Type = 2,
- Namespace = 4,
- All = 7,
- }
- function getMeaningFromDeclaration(node: Node): SemanticMeaning;
- function getMeaningFromLocation(node: Node): SemanticMeaning;
- function isCallExpressionTarget(node: Node): boolean;
- function isNewExpressionTarget(node: Node): boolean;
- function climbPastPropertyAccess(node: Node): Node;
- function getTargetLabel(referenceNode: Node, labelName: string): Identifier;
- function isJumpStatementTarget(node: Node): boolean;
- function isLabelName(node: Node): boolean;
- function isRightSideOfQualifiedName(node: Node): boolean;
- function isRightSideOfPropertyAccess(node: Node): boolean;
- function isNameOfModuleDeclaration(node: Node): boolean;
- function isNameOfFunctionDeclaration(node: Node): boolean;
- function isLiteralNameOfPropertyDeclarationOrIndexAccess(node: Node): boolean;
- function isExpressionOfExternalModuleImportEqualsDeclaration(node: Node): boolean;
- function isInsideComment(sourceFile: SourceFile, token: Node, position: number): boolean;
- function getContainerNode(node: Node): Declaration;
- function getNodeKind(node: Node): string;
- function getStringLiteralTypeForNode(node: StringLiteral | LiteralTypeNode, typeChecker: TypeChecker): LiteralType;
- function isThis(node: Node): boolean;
- interface ListItemInfo {
- listItemIndex: number;
- list: Node;
- }
- function getLineStartPositionForPosition(position: number, sourceFile: SourceFile): number;
- function rangeContainsRange(r1: TextRange, r2: TextRange): boolean;
- function startEndContainsRange(start: number, end: number, range: TextRange): boolean;
- function rangeContainsStartEnd(range: TextRange, start: number, end: number): boolean;
- function rangeOverlapsWithStartEnd(r1: TextRange, start: number, end: number): boolean;
- function startEndOverlapsWithStartEnd(start1: number, end1: number, start2: number, end2: number): boolean;
- function positionBelongsToNode(candidate: Node, position: number, sourceFile: SourceFile): boolean;
- function isCompletedNode(n: Node, sourceFile: SourceFile): boolean;
- function findListItemInfo(node: Node): ListItemInfo;
- function hasChildOfKind(n: Node, kind: SyntaxKind, sourceFile?: SourceFile): boolean;
- function findChildOfKind(n: Node, kind: SyntaxKind, sourceFile?: SourceFile): Node;
- function findContainingList(node: Node): Node;
- function getTouchingWord(sourceFile: SourceFile, position: number, includeJsDocComment?: boolean): Node;
- function getTouchingPropertyName(sourceFile: SourceFile, position: number, includeJsDocComment?: boolean): Node;
- function getTouchingToken(sourceFile: SourceFile, position: number, includeItemAtEndPosition?: (n: Node) => boolean, includeJsDocComment?: boolean): Node;
- function getTokenAtPosition(sourceFile: SourceFile, position: number, includeJsDocComment?: boolean): Node;
- function findTokenOnLeftOfPosition(file: SourceFile, position: number): Node;
- function findNextToken(previousToken: Node, parent: Node): Node;
- function findPrecedingToken(position: number, sourceFile: SourceFile, startNode?: Node): Node;
- function isInString(sourceFile: SourceFile, position: number): boolean;
- function isInComment(sourceFile: SourceFile, position: number): boolean;
- function isInsideJsxElementOrAttribute(sourceFile: SourceFile, position: number): boolean;
- function isInTemplateString(sourceFile: SourceFile, position: number): boolean;
- function isInCommentHelper(sourceFile: SourceFile, position: number, predicate?: (c: CommentRange) => boolean): boolean;
- function hasDocComment(sourceFile: SourceFile, position: number): boolean;
- function getJsDocTagAtPosition(sourceFile: SourceFile, position: number): JSDocTag;
- function getNodeModifiers(node: Node): string;
- function getTypeArgumentOrTypeParameterList(node: Node): NodeArray;
- function isToken(n: Node): boolean;
- function isWord(kind: SyntaxKind): boolean;
- function isComment(kind: SyntaxKind): boolean;
- function isStringOrRegularExpressionOrTemplateLiteral(kind: SyntaxKind): boolean;
- function isPunctuation(kind: SyntaxKind): boolean;
- function isInsideTemplateLiteral(node: LiteralExpression, position: number): boolean;
- function isAccessibilityModifier(kind: SyntaxKind): boolean;
- function compareDataObjects(dst: any, src: any): boolean;
- function isArrayLiteralOrObjectLiteralDestructuringPattern(node: Node): boolean;
- function hasTrailingDirectorySeparator(path: string): boolean;
- function isInReferenceComment(sourceFile: SourceFile, position: number): boolean;
- function isInNonReferenceComment(sourceFile: SourceFile, position: number): boolean;
-}
-declare namespace ts {
- function isFirstDeclarationOfSymbolParameter(symbol: Symbol): boolean;
- function symbolPart(text: string, symbol: Symbol): SymbolDisplayPart;
- function displayPart(text: string, kind: SymbolDisplayPartKind, symbol?: Symbol): SymbolDisplayPart;
- function spacePart(): SymbolDisplayPart;
- function keywordPart(kind: SyntaxKind): SymbolDisplayPart;
- function punctuationPart(kind: SyntaxKind): SymbolDisplayPart;
- function operatorPart(kind: SyntaxKind): SymbolDisplayPart;
- function textOrKeywordPart(text: string): SymbolDisplayPart;
- function textPart(text: string): SymbolDisplayPart;
- function getNewLineOrDefaultFromHost(host: LanguageServiceHost | LanguageServiceShimHost): string;
- function lineBreakPart(): SymbolDisplayPart;
- function mapToDisplayParts(writeDisplayParts: (writer: DisplayPartsSymbolWriter) => void): SymbolDisplayPart[];
- function typeToDisplayParts(typechecker: TypeChecker, type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[];
- function symbolToDisplayParts(typeChecker: TypeChecker, symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): SymbolDisplayPart[];
- function signatureToDisplayParts(typechecker: TypeChecker, signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[];
- function getDeclaredName(typeChecker: TypeChecker, symbol: Symbol, location: Node): string;
- function isImportOrExportSpecifierName(location: Node): boolean;
- function stripQuotes(name: string): string;
- function scriptKindIs(fileName: string, host: LanguageServiceHost, ...scriptKinds: ScriptKind[]): boolean;
- function getScriptKind(fileName: string, host?: LanguageServiceHost): ScriptKind;
- function sanitizeConfigFile(configFileName: string, content: string): {
- configJsonObject: any;
- diagnostics: Diagnostic[];
- };
-}
-declare namespace ts.BreakpointResolver {
- function spanInSourceFileAtLocation(sourceFile: SourceFile, position: number): TextSpan;
-}
declare namespace ts {
function createClassifier(): Classifier;
- function getSemanticClassifications(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFile: SourceFile, classifiableNames: Map, span: TextSpan): ClassifiedSpan[];
- function getEncodedSemanticClassifications(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFile: SourceFile, classifiableNames: Map, span: TextSpan): Classifications;
- function getSyntacticClassifications(cancellationToken: CancellationToken, sourceFile: SourceFile, span: TextSpan): ClassifiedSpan[];
- function getEncodedSyntacticClassifications(cancellationToken: CancellationToken, sourceFile: SourceFile, span: TextSpan): Classifications;
-}
-declare namespace ts.Completions {
- function getCompletionsAtPosition(host: LanguageServiceHost, typeChecker: TypeChecker, log: (message: string) => void, compilerOptions: CompilerOptions, sourceFile: SourceFile, position: number): CompletionInfo;
- function getCompletionEntryDetails(typeChecker: TypeChecker, log: (message: string) => void, compilerOptions: CompilerOptions, sourceFile: SourceFile, position: number, entryName: string): CompletionEntryDetails;
- function getCompletionEntrySymbol(typeChecker: TypeChecker, log: (message: string) => void, compilerOptions: CompilerOptions, sourceFile: SourceFile, position: number, entryName: string): Symbol;
-}
-declare namespace ts.DocumentHighlights {
- function getDocumentHighlights(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFile: SourceFile, position: number, sourceFilesToSearch: SourceFile[]): DocumentHighlights[];
}
declare namespace ts {
interface DocumentRegistry {
@@ -9806,88 +2673,9 @@ declare namespace ts {
};
function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry;
}
-declare namespace ts.FindAllReferences {
- function findReferencedSymbols(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFiles: SourceFile[], sourceFile: SourceFile, position: number, findInStrings: boolean, findInComments: boolean): ReferencedSymbol[];
- function getReferencedSymbolsForNode(typeChecker: TypeChecker, cancellationToken: CancellationToken, node: Node, sourceFiles: SourceFile[], findInStrings: boolean, findInComments: boolean, implementations: boolean): ReferencedSymbol[];
- function convertReferences(referenceSymbols: ReferencedSymbol[]): ReferenceEntry[];
- function getReferenceEntriesForShorthandPropertyAssignment(node: Node, typeChecker: TypeChecker, result: ReferenceEntry[]): void;
- function getReferenceEntryFromNode(node: Node): ReferenceEntry;
-}
-declare namespace ts.GoToDefinition {
- function getDefinitionAtPosition(program: Program, sourceFile: SourceFile, position: number): DefinitionInfo[];
- function getTypeDefinitionAtPosition(typeChecker: TypeChecker, sourceFile: SourceFile, position: number): DefinitionInfo[];
-}
-declare namespace ts.GoToImplementation {
- function getImplementationAtPosition(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFiles: SourceFile[], node: Node): ImplementationLocation[];
-}
-declare namespace ts.JsDoc {
- function getJsDocCommentsFromDeclarations(declarations: Declaration[], name: string, canUseParsedParamTagComments: boolean): SymbolDisplayPart[];
- function getAllJsDocCompletionEntries(): CompletionEntry[];
- function getDocCommentTemplateAtPosition(newLine: string, sourceFile: SourceFile, position: number): TextInsertion;
-}
-declare namespace ts.NavigateTo {
- function getNavigateToItems(sourceFiles: SourceFile[], checker: TypeChecker, cancellationToken: CancellationToken, searchValue: string, maxResultCount: number, excludeDtsFiles: boolean): NavigateToItem[];
-}
-declare namespace ts.NavigationBar {
- function getNavigationBarItems(sourceFile: SourceFile): NavigationBarItem[];
- function getNavigationTree(sourceFile: SourceFile): NavigationTree;
-}
-declare namespace ts.OutliningElementsCollector {
- function collectElements(sourceFile: SourceFile): OutliningSpan[];
-}
-declare namespace ts {
- enum PatternMatchKind {
- exact = 0,
- prefix = 1,
- substring = 2,
- camelCase = 3,
- }
- interface PatternMatch {
- kind: PatternMatchKind;
- camelCaseWeight?: number;
- isCaseSensitive: boolean;
- punctuationStripped: boolean;
- }
- interface PatternMatcher {
- getMatchesForLastSegmentOfPattern(candidate: string): PatternMatch[];
- getMatches(candidateContainers: string[], candidate: string): PatternMatch[];
- patternContainsDots: boolean;
- }
- function createPatternMatcher(pattern: string): PatternMatcher;
- function breakIntoCharacterSpans(identifier: string): TextSpan[];
- function breakIntoWordSpans(identifier: string): TextSpan[];
-}
declare namespace ts {
function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo;
}
-declare namespace ts.Rename {
- function getRenameInfo(typeChecker: TypeChecker, defaultLibFileName: string, getCanonicalFileName: (fileName: string) => string, sourceFile: SourceFile, position: number): RenameInfo;
-}
-declare namespace ts.SignatureHelp {
- const enum ArgumentListKind {
- TypeArguments = 0,
- CallArguments = 1,
- TaggedTemplateArguments = 2,
- }
- interface ArgumentListInfo {
- kind: ArgumentListKind;
- invocation: CallLikeExpression;
- argumentsSpan: TextSpan;
- argumentIndex?: number;
- argumentCount: number;
- }
- function getSignatureHelpItems(program: Program, sourceFile: SourceFile, position: number, cancellationToken: CancellationToken): SignatureHelpItems;
- function getContainingArgumentInfo(node: Node, position: number, sourceFile: SourceFile): ArgumentListInfo;
-}
-declare namespace ts.SymbolDisplay {
- function getSymbolKind(typeChecker: TypeChecker, symbol: Symbol, location: Node): string;
- function getSymbolModifiers(symbol: Symbol): string;
- function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker: TypeChecker, symbol: Symbol, sourceFile: SourceFile, enclosingDeclaration: Node, location: Node, semanticMeaning?: SemanticMeaning): {
- displayParts: SymbolDisplayPart[];
- documentation: SymbolDisplayPart[];
- symbolKind: string;
- };
-}
declare namespace ts {
interface TranspileOptions {
compilerOptions?: CompilerOptions;
@@ -9904,438 +2692,11 @@ declare namespace ts {
function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput;
function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string;
}
-declare namespace ts.formatting {
- interface FormattingScanner {
- advance(): void;
- isOnToken(): boolean;
- readTokenInfo(n: Node): TokenInfo;
- getCurrentLeadingTrivia(): TextRangeWithKind[];
- lastTrailingTriviaWasNewLine(): boolean;
- skipToEndOf(node: Node): void;
- close(): void;
- }
- function getFormattingScanner(sourceFile: SourceFile, startPos: number, endPos: number): FormattingScanner;
-}
-declare namespace ts.formatting {
- class FormattingContext {
- sourceFile: SourceFile;
- formattingRequestKind: FormattingRequestKind;
- currentTokenSpan: TextRangeWithKind;
- nextTokenSpan: TextRangeWithKind;
- contextNode: Node;
- currentTokenParent: Node;
- nextTokenParent: Node;
- private contextNodeAllOnSameLine;
- private nextNodeAllOnSameLine;
- private tokensAreOnSameLine;
- private contextNodeBlockIsOnOneLine;
- private nextNodeBlockIsOnOneLine;
- constructor(sourceFile: SourceFile, formattingRequestKind: FormattingRequestKind);
- updateContext(currentRange: TextRangeWithKind, currentTokenParent: Node, nextRange: TextRangeWithKind, nextTokenParent: Node, commonParent: Node): void;
- ContextNodeAllOnSameLine(): boolean;
- NextNodeAllOnSameLine(): boolean;
- TokensAreOnSameLine(): boolean;
- ContextNodeBlockIsOnOneLine(): boolean;
- NextNodeBlockIsOnOneLine(): boolean;
- private NodeIsOnOneLine(node);
- private BlockIsOnOneLine(node);
- }
-}
-declare namespace ts.formatting {
- const enum FormattingRequestKind {
- FormatDocument = 0,
- FormatSelection = 1,
- FormatOnEnter = 2,
- FormatOnSemicolon = 3,
- FormatOnClosingCurlyBrace = 4,
- }
-}
-declare namespace ts.formatting {
- class Rule {
- Descriptor: RuleDescriptor;
- Operation: RuleOperation;
- Flag: RuleFlags;
- constructor(Descriptor: RuleDescriptor, Operation: RuleOperation, Flag?: RuleFlags);
- toString(): string;
- }
-}
-declare namespace ts.formatting {
- const enum RuleAction {
- Ignore = 1,
- Space = 2,
- NewLine = 4,
- Delete = 8,
- }
-}
-declare namespace ts.formatting {
- class RuleDescriptor {
- LeftTokenRange: Shared.TokenRange;
- RightTokenRange: Shared.TokenRange;
- constructor(LeftTokenRange: Shared.TokenRange, RightTokenRange: Shared.TokenRange);
- toString(): string;
- static create1(left: SyntaxKind, right: SyntaxKind): RuleDescriptor;
- static create2(left: Shared.TokenRange, right: SyntaxKind): RuleDescriptor;
- static create3(left: SyntaxKind, right: Shared.TokenRange): RuleDescriptor;
- static create4(left: Shared.TokenRange, right: Shared.TokenRange): RuleDescriptor;
- }
-}
-declare namespace ts.formatting {
- const enum RuleFlags {
- None = 0,
- CanDeleteNewLines = 1,
- }
-}
-declare namespace ts.formatting {
- class RuleOperation {
- Context: RuleOperationContext;
- Action: RuleAction;
- constructor(Context: RuleOperationContext, Action: RuleAction);
- toString(): string;
- static create1(action: RuleAction): RuleOperation;
- static create2(context: RuleOperationContext, action: RuleAction): RuleOperation;
- }
-}
-declare namespace ts.formatting {
- class RuleOperationContext {
- private customContextChecks;
- constructor(...funcs: {
- (context: FormattingContext): boolean;
- }[]);
- static Any: RuleOperationContext;
- IsAny(): boolean;
- InContext(context: FormattingContext): boolean;
- }
-}
-declare namespace ts.formatting {
- class Rules {
- getRuleName(rule: Rule): string;
- [name: string]: any;
- IgnoreBeforeComment: Rule;
- IgnoreAfterLineComment: Rule;
- NoSpaceBeforeSemicolon: Rule;
- NoSpaceBeforeColon: Rule;
- NoSpaceBeforeQuestionMark: Rule;
- SpaceAfterColon: Rule;
- SpaceAfterQuestionMarkInConditionalOperator: Rule;
- NoSpaceAfterQuestionMark: Rule;
- SpaceAfterSemicolon: Rule;
- SpaceAfterCloseBrace: Rule;
- SpaceBetweenCloseBraceAndElse: Rule;
- SpaceBetweenCloseBraceAndWhile: Rule;
- NoSpaceAfterCloseBrace: Rule;
- NoSpaceBeforeDot: Rule;
- NoSpaceAfterDot: Rule;
- NoSpaceBeforeOpenBracket: Rule;
- NoSpaceAfterCloseBracket: Rule;
- SpaceAfterOpenBrace: Rule;
- SpaceBeforeCloseBrace: Rule;
- NoSpaceAfterOpenBrace: Rule;
- NoSpaceBeforeCloseBrace: Rule;
- NoSpaceBetweenEmptyBraceBrackets: Rule;
- NewLineAfterOpenBraceInBlockContext: Rule;
- NewLineBeforeCloseBraceInBlockContext: Rule;
- NoSpaceAfterUnaryPrefixOperator: Rule;
- NoSpaceAfterUnaryPreincrementOperator: Rule;
- NoSpaceAfterUnaryPredecrementOperator: Rule;
- NoSpaceBeforeUnaryPostincrementOperator: Rule;
- NoSpaceBeforeUnaryPostdecrementOperator: Rule;
- SpaceAfterPostincrementWhenFollowedByAdd: Rule;
- SpaceAfterAddWhenFollowedByUnaryPlus: Rule;
- SpaceAfterAddWhenFollowedByPreincrement: Rule;
- SpaceAfterPostdecrementWhenFollowedBySubtract: Rule;
- SpaceAfterSubtractWhenFollowedByUnaryMinus: Rule;
- SpaceAfterSubtractWhenFollowedByPredecrement: Rule;
- NoSpaceBeforeComma: Rule;
- SpaceAfterCertainKeywords: Rule;
- SpaceAfterLetConstInVariableDeclaration: Rule;
- NoSpaceBeforeOpenParenInFuncCall: Rule;
- SpaceAfterFunctionInFuncDecl: Rule;
- NoSpaceBeforeOpenParenInFuncDecl: Rule;
- SpaceAfterVoidOperator: Rule;
- NoSpaceBetweenReturnAndSemicolon: Rule;
- SpaceBetweenStatements: Rule;
- SpaceAfterTryFinally: Rule;
- SpaceAfterGetSetInMember: Rule;
- SpaceBeforeBinaryKeywordOperator: Rule;
- SpaceAfterBinaryKeywordOperator: Rule;
- NoSpaceAfterConstructor: Rule;
- NoSpaceAfterModuleImport: Rule;
- SpaceAfterCertainTypeScriptKeywords: Rule;
- SpaceBeforeCertainTypeScriptKeywords: Rule;
- SpaceAfterModuleName: Rule;
- SpaceBeforeArrow: Rule;
- SpaceAfterArrow: Rule;
- NoSpaceAfterEllipsis: Rule;
- NoSpaceAfterOptionalParameters: Rule;
- NoSpaceBeforeOpenAngularBracket: Rule;
- NoSpaceBetweenCloseParenAndAngularBracket: Rule;
- NoSpaceAfterOpenAngularBracket: Rule;
- NoSpaceBeforeCloseAngularBracket: Rule;
- NoSpaceAfterCloseAngularBracket: Rule;
- NoSpaceBetweenEmptyInterfaceBraceBrackets: Rule;
- HighPriorityCommonRules: Rule[];
- LowPriorityCommonRules: Rule[];
- SpaceAfterComma: Rule;
- NoSpaceAfterComma: Rule;
- SpaceBeforeBinaryOperator: Rule;
- SpaceAfterBinaryOperator: Rule;
- NoSpaceBeforeBinaryOperator: Rule;
- NoSpaceAfterBinaryOperator: Rule;
- SpaceAfterKeywordInControl: Rule;
- NoSpaceAfterKeywordInControl: Rule;
- FunctionOpenBraceLeftTokenRange: Shared.TokenRange;
- SpaceBeforeOpenBraceInFunction: Rule;
- NewLineBeforeOpenBraceInFunction: Rule;
- TypeScriptOpenBraceLeftTokenRange: Shared.TokenRange;
- SpaceBeforeOpenBraceInTypeScriptDeclWithBlock: Rule;
- NewLineBeforeOpenBraceInTypeScriptDeclWithBlock: Rule;
- ControlOpenBraceLeftTokenRange: Shared.TokenRange;
- SpaceBeforeOpenBraceInControl: Rule;
- NewLineBeforeOpenBraceInControl: Rule;
- SpaceAfterSemicolonInFor: Rule;
- NoSpaceAfterSemicolonInFor: Rule;
- SpaceAfterOpenParen: Rule;
- SpaceBeforeCloseParen: Rule;
- NoSpaceBetweenParens: Rule;
- NoSpaceAfterOpenParen: Rule;
- NoSpaceBeforeCloseParen: Rule;
- SpaceAfterOpenBracket: Rule;
- SpaceBeforeCloseBracket: Rule;
- NoSpaceBetweenBrackets: Rule;
- NoSpaceAfterOpenBracket: Rule;
- NoSpaceBeforeCloseBracket: Rule;
- SpaceAfterAnonymousFunctionKeyword: Rule;
- NoSpaceAfterAnonymousFunctionKeyword: Rule;
- SpaceBeforeAt: Rule;
- NoSpaceAfterAt: Rule;
- SpaceAfterDecorator: Rule;
- NoSpaceBetweenFunctionKeywordAndStar: Rule;
- SpaceAfterStarInGeneratorDeclaration: Rule;
- NoSpaceBetweenYieldKeywordAndStar: Rule;
- SpaceBetweenYieldOrYieldStarAndOperand: Rule;
- SpaceBetweenAsyncAndOpenParen: Rule;
- SpaceBetweenAsyncAndFunctionKeyword: Rule;
- NoSpaceBetweenTagAndTemplateString: Rule;
- NoSpaceAfterTemplateHeadAndMiddle: Rule;
- SpaceAfterTemplateHeadAndMiddle: Rule;
- NoSpaceBeforeTemplateMiddleAndTail: Rule;
- SpaceBeforeTemplateMiddleAndTail: Rule;
- NoSpaceAfterOpenBraceInJsxExpression: Rule;
- SpaceAfterOpenBraceInJsxExpression: Rule;
- NoSpaceBeforeCloseBraceInJsxExpression: Rule;
- SpaceBeforeCloseBraceInJsxExpression: Rule;
- SpaceBeforeJsxAttribute: Rule;
- SpaceBeforeSlashInJsxOpeningElement: Rule;
- NoSpaceBeforeGreaterThanTokenInJsxOpeningElement: Rule;
- NoSpaceBeforeEqualInJsxAttribute: Rule;
- NoSpaceAfterEqualInJsxAttribute: Rule;
- NoSpaceAfterTypeAssertion: Rule;
- SpaceAfterTypeAssertion: Rule;
- constructor();
- static IsForContext(context: FormattingContext): boolean;
- static IsNotForContext(context: FormattingContext): boolean;
- static IsBinaryOpContext(context: FormattingContext): boolean;
- static IsNotBinaryOpContext(context: FormattingContext): boolean;
- static IsConditionalOperatorContext(context: FormattingContext): boolean;
- static IsSameLineTokenOrBeforeMultilineBlockContext(context: FormattingContext): boolean;
- static IsBeforeMultilineBlockContext(context: FormattingContext): boolean;
- static IsMultilineBlockContext(context: FormattingContext): boolean;
- static IsSingleLineBlockContext(context: FormattingContext): boolean;
- static IsBlockContext(context: FormattingContext): boolean;
- static IsBeforeBlockContext(context: FormattingContext): boolean;
- static NodeIsBlockContext(node: Node): boolean;
- static IsFunctionDeclContext(context: FormattingContext): boolean;
- static IsFunctionDeclarationOrFunctionExpressionContext(context: FormattingContext): boolean;
- static IsTypeScriptDeclWithBlockContext(context: FormattingContext): boolean;
- static NodeIsTypeScriptDeclWithBlockContext(node: Node): boolean;
- static IsAfterCodeBlockContext(context: FormattingContext): boolean;
- static IsControlDeclContext(context: FormattingContext): boolean;
- static IsObjectContext(context: FormattingContext): boolean;
- static IsFunctionCallContext(context: FormattingContext): boolean;
- static IsNewContext(context: FormattingContext): boolean;
- static IsFunctionCallOrNewContext(context: FormattingContext): boolean;
- static IsPreviousTokenNotComma(context: FormattingContext): boolean;
- static IsNextTokenNotCloseBracket(context: FormattingContext): boolean;
- static IsArrowFunctionContext(context: FormattingContext): boolean;
- static IsNonJsxSameLineTokenContext(context: FormattingContext): boolean;
- static IsNonJsxElementContext(context: FormattingContext): boolean;
- static IsJsxExpressionContext(context: FormattingContext): boolean;
- static IsNextTokenParentJsxAttribute(context: FormattingContext): boolean;
- static IsJsxAttributeContext(context: FormattingContext): boolean;
- static IsJsxSelfClosingElementContext(context: FormattingContext): boolean;
- static IsNotBeforeBlockInFunctionDeclarationContext(context: FormattingContext): boolean;
- static IsEndOfDecoratorContextOnSameLine(context: FormattingContext): boolean;
- static NodeIsInDecoratorContext(node: Node): boolean;
- static IsStartOfVariableDeclarationList(context: FormattingContext): boolean;
- static IsNotFormatOnEnter(context: FormattingContext): boolean;
- static IsModuleDeclContext(context: FormattingContext): boolean;
- static IsObjectTypeContext(context: FormattingContext): boolean;
- static IsTypeArgumentOrParameterOrAssertion(token: TextRangeWithKind, parent: Node): boolean;
- static IsTypeArgumentOrParameterOrAssertionContext(context: FormattingContext): boolean;
- static IsTypeAssertionContext(context: FormattingContext): boolean;
- static IsVoidOpContext(context: FormattingContext): boolean;
- static IsYieldOrYieldStarWithOperand(context: FormattingContext): boolean;
- }
-}
-declare namespace ts.formatting {
- class RulesMap {
- map: RulesBucket[];
- mapRowLength: number;
- constructor();
- static create(rules: Rule[]): RulesMap;
- Initialize(rules: Rule[]): RulesBucket[];
- FillRules(rules: Rule[], rulesBucketConstructionStateList: RulesBucketConstructionState[]): void;
- private GetRuleBucketIndex(row, column);
- private FillRule(rule, rulesBucketConstructionStateList);
- GetRule(context: FormattingContext): Rule;
- }
- enum RulesPosition {
- IgnoreRulesSpecific = 0,
- IgnoreRulesAny,
- ContextRulesSpecific,
- ContextRulesAny,
- NoContextRulesSpecific,
- NoContextRulesAny,
- }
- class RulesBucketConstructionState {
- private rulesInsertionIndexBitmap;
- constructor();
- GetInsertionIndex(maskPosition: RulesPosition): number;
- IncreaseInsertionIndex(maskPosition: RulesPosition): void;
- }
- class RulesBucket {
- private rules;
- constructor();
- Rules(): Rule[];
- AddRule(rule: Rule, specificTokens: boolean, constructionState: RulesBucketConstructionState[], rulesBucketIndex: number): void;
- }
-}
-declare namespace ts.formatting {
- namespace Shared {
- interface ITokenAccess {
- GetTokens(): SyntaxKind[];
- Contains(token: SyntaxKind): boolean;
- }
- class TokenRangeAccess implements ITokenAccess {
- private tokens;
- constructor(from: SyntaxKind, to: SyntaxKind, except: SyntaxKind[]);
- GetTokens(): SyntaxKind[];
- Contains(token: SyntaxKind): boolean;
- }
- class TokenValuesAccess implements ITokenAccess {
- private tokens;
- constructor(tks: SyntaxKind[]);
- GetTokens(): SyntaxKind[];
- Contains(token: SyntaxKind): boolean;
- }
- class TokenSingleValueAccess implements ITokenAccess {
- token: SyntaxKind;
- constructor(token: SyntaxKind);
- GetTokens(): SyntaxKind[];
- Contains(tokenValue: SyntaxKind): boolean;
- }
- class TokenAllAccess implements ITokenAccess {
- GetTokens(): SyntaxKind[];
- Contains(tokenValue: SyntaxKind): boolean;
- toString(): string;
- }
- class TokenRange {
- tokenAccess: ITokenAccess;
- constructor(tokenAccess: ITokenAccess);
- static FromToken(token: SyntaxKind): TokenRange;
- static FromTokens(tokens: SyntaxKind[]): TokenRange;
- static FromRange(f: SyntaxKind, to: SyntaxKind, except?: SyntaxKind[]): TokenRange;
- static AllTokens(): TokenRange;
- GetTokens(): SyntaxKind[];
- Contains(token: SyntaxKind): boolean;
- toString(): string;
- static Any: TokenRange;
- static AnyIncludingMultilineComments: TokenRange;
- static Keywords: TokenRange;
- static BinaryOperators: TokenRange;
- static BinaryKeywordOperators: TokenRange;
- static UnaryPrefixOperators: TokenRange;
- static UnaryPrefixExpressions: TokenRange;
- static UnaryPreincrementExpressions: TokenRange;
- static UnaryPostincrementExpressions: TokenRange;
- static UnaryPredecrementExpressions: TokenRange;
- static UnaryPostdecrementExpressions: TokenRange;
- static Comments: TokenRange;
- static TypeNames: TokenRange;
- }
- }
-}
-declare namespace ts.formatting {
- class RulesProvider {
- private globalRules;
- private options;
- private activeRules;
- private rulesMap;
- constructor();
- getRuleName(rule: Rule): string;
- getRuleByName(name: string): Rule;
- getRulesMap(): RulesMap;
- ensureUpToDate(options: ts.FormatCodeSettings): void;
- private createActiveRules(options);
- }
-}
-declare namespace ts.formatting {
- interface TextRangeWithKind extends TextRange {
- kind: SyntaxKind;
- }
- interface TokenInfo {
- leadingTrivia: TextRangeWithKind[];
- token: TextRangeWithKind;
- trailingTrivia: TextRangeWithKind[];
- }
- function formatOnEnter(position: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeSettings): TextChange[];
- function formatOnSemicolon(position: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeSettings): TextChange[];
- function formatOnClosingCurly(position: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeSettings): TextChange[];
- function formatDocument(sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeSettings): TextChange[];
- function formatSelection(start: number, end: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeSettings): TextChange[];
- function getIndentationString(indentation: number, options: EditorSettings): string;
-}
-declare namespace ts.formatting {
- namespace SmartIndenter {
- function getIndentation(position: number, sourceFile: SourceFile, options: EditorSettings): number;
- function getIndentationForNode(n: Node, ignoreActualIndentationRange: TextRange, sourceFile: SourceFile, options: EditorSettings): number;
- function getBaseIndentation(options: EditorSettings): number;
- function childStartsOnTheSameLineWithElseInIfStatement(parent: Node, child: TextRangeWithKind, childStartLine: number, sourceFile: SourceFile): boolean;
- function findFirstNonWhitespaceCharacterAndColumn(startPos: number, endPos: number, sourceFile: SourceFile, options: EditorSettings): {
- column: number;
- character: number;
- };
- function findFirstNonWhitespaceColumn(startPos: number, endPos: number, sourceFile: SourceFile, options: EditorSettings): number;
- function nodeWillIndentChild(parent: TextRangeWithKind, child: TextRangeWithKind, indentByDefault: boolean): boolean;
- function shouldIndentChildNode(parent: TextRangeWithKind, child?: TextRangeWithKind): boolean;
- }
-}
-declare namespace ts {
- interface CodeFix {
- errorCodes: number[];
- getCodeActions(context: CodeFixContext): CodeAction[] | undefined;
- }
- interface CodeFixContext {
- errorCode: number;
- sourceFile: SourceFile;
- span: TextSpan;
- program: Program;
- newLineCharacter: string;
- }
- namespace codefix {
- function registerCodeFix(action: CodeFix): void;
- function getSupportedErrorCodes(): string[];
- function getFixes(context: CodeFixContext): CodeAction[];
- }
-}
-declare namespace ts.codefix {
-}
declare namespace ts {
const servicesVersion = "0.5";
interface DisplayPartsSymbolWriter extends SymbolWriter {
displayParts(): SymbolDisplayPart[];
}
- function toEditorSettings(options: FormatCodeOptions | FormatCodeSettings): FormatCodeSettings;
function toEditorSettings(options: EditorOptions | EditorSettings): EditorSettings;
function displayPartsToString(displayParts: SymbolDisplayPart[]): string;
function getDefaultCompilerOptions(): CompilerOptions;
@@ -10344,9 +2705,840 @@ declare namespace ts {
let disableIncrementalParsing: boolean;
function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService;
- function getNameTable(sourceFile: SourceFile): Map;
function getDefaultLibFilePath(options: CompilerOptions): string;
}
+declare namespace ts.server {
+ enum LogLevel {
+ terse = 0,
+ normal = 1,
+ requestTime = 2,
+ verbose = 3,
+ }
+ const emptyArray: ReadonlyArray;
+ interface Logger {
+ close(): void;
+ hasLevel(level: LogLevel): boolean;
+ loggingEnabled(): boolean;
+ perftrc(s: string): void;
+ info(s: string): void;
+ startGroup(): void;
+ endGroup(): void;
+ msg(s: string, type?: Msg.Types): void;
+ getLogFileName(): string;
+ }
+ namespace Msg {
+ type Err = "Err";
+ const Err: Err;
+ type Info = "Info";
+ const Info: Info;
+ type Perf = "Perf";
+ const Perf: Perf;
+ type Types = Err | Info | Perf;
+ }
+ function createInstallTypingsRequest(project: Project, typingOptions: TypingOptions, cachePath?: string): DiscoverTypings;
+ namespace Errors {
+ function ThrowNoProject(): never;
+ function ThrowProjectLanguageServiceDisabled(): never;
+ function ThrowProjectDoesNotContainDocument(fileName: string, project: Project): never;
+ }
+ function getDefaultFormatCodeSettings(host: ServerHost): FormatCodeSettings;
+ function mergeMaps(target: MapLike, source: MapLike): void;
+ function removeItemFromSet(items: T[], itemToRemove: T): void;
+ type NormalizedPath = string & {
+ __normalizedPathTag: any;
+ };
+ function toNormalizedPath(fileName: string): NormalizedPath;
+ function normalizedPathToPath(normalizedPath: NormalizedPath, currentDirectory: string, getCanonicalFileName: (f: string) => string): Path;
+ function asNormalizedPath(fileName: string): NormalizedPath;
+ interface NormalizedPathMap {
+ get(path: NormalizedPath): T;
+ set(path: NormalizedPath, value: T): void;
+ contains(path: NormalizedPath): boolean;
+ remove(path: NormalizedPath): void;
+ }
+ function createNormalizedPathMap(): NormalizedPathMap;
+ const nullLanguageService: LanguageService;
+ interface ServerLanguageServiceHost {
+ setCompilationSettings(options: CompilerOptions): void;
+ notifyFileRemoved(info: ScriptInfo): void;
+ }
+ const nullLanguageServiceHost: ServerLanguageServiceHost;
+ interface ProjectOptions {
+ configHasFilesProperty?: boolean;
+ files?: string[];
+ wildcardDirectories?: Map;
+ compilerOptions?: CompilerOptions;
+ typingOptions?: TypingOptions;
+ compileOnSave?: boolean;
+ }
+ function isInferredProjectName(name: string): boolean;
+ function makeInferredProjectName(counter: number): string;
+ class ThrottledOperations {
+ private readonly host;
+ private pendingTimeouts;
+ constructor(host: ServerHost);
+ schedule(operationId: string, delay: number, cb: () => void): void;
+ private static run(self, operationId, cb);
+ }
+ class GcTimer {
+ private readonly host;
+ private readonly delay;
+ private readonly logger;
+ private timerId;
+ constructor(host: ServerHost, delay: number, logger: Logger);
+ scheduleCollect(): void;
+ private static run(self);
+ }
+}
+declare namespace ts.server.protocol {
+ namespace CommandTypes {
+ type Brace = "brace";
+ type BraceCompletion = "braceCompletion";
+ type Change = "change";
+ type Close = "close";
+ type Completions = "completions";
+ type CompletionDetails = "completionEntryDetails";
+ type CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList";
+ type CompileOnSaveEmitFile = "compileOnSaveEmitFile";
+ type Configure = "configure";
+ type Definition = "definition";
+ type Implementation = "implementation";
+ type Exit = "exit";
+ type Format = "format";
+ type Formatonkey = "formatonkey";
+ type Geterr = "geterr";
+ type GeterrForProject = "geterrForProject";
+ type SemanticDiagnosticsSync = "semanticDiagnosticsSync";
+ type SyntacticDiagnosticsSync = "syntacticDiagnosticsSync";
+ type NavBar = "navbar";
+ type Navto = "navto";
+ type NavTree = "navtree";
+ type NavTreeFull = "navtree-full";
+ type Occurrences = "occurrences";
+ type DocumentHighlights = "documentHighlights";
+ type Open = "open";
+ type Quickinfo = "quickinfo";
+ type References = "references";
+ type Reload = "reload";
+ type Rename = "rename";
+ type Saveto = "saveto";
+ type SignatureHelp = "signatureHelp";
+ type TypeDefinition = "typeDefinition";
+ type ProjectInfo = "projectInfo";
+ type ReloadProjects = "reloadProjects";
+ type Unknown = "unknown";
+ type OpenExternalProject = "openExternalProject";
+ type OpenExternalProjects = "openExternalProjects";
+ type CloseExternalProject = "closeExternalProject";
+ type TodoComments = "todoComments";
+ type Indentation = "indentation";
+ type DocCommentTemplate = "docCommentTemplate";
+ type CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects";
+ type GetCodeFixes = "getCodeFixes";
+ type GetSupportedCodeFixes = "getSupportedCodeFixes";
+ }
+ interface Message {
+ seq: number;
+ type: "request" | "response" | "event";
+ }
+ interface Request extends Message {
+ command: string;
+ arguments?: any;
+ }
+ interface ReloadProjectsRequest extends Message {
+ command: CommandTypes.ReloadProjects;
+ }
+ interface Event extends Message {
+ event: string;
+ body?: any;
+ }
+ interface Response extends Message {
+ request_seq: number;
+ success: boolean;
+ command: string;
+ message?: string;
+ body?: any;
+ }
+ interface FileRequestArgs {
+ file: string;
+ projectFileName?: string;
+ }
+ interface DocCommentTemplateRequest extends FileLocationRequest {
+ command: CommandTypes.DocCommentTemplate;
+ }
+ interface DocCommandTemplateResponse extends Response {
+ body?: TextInsertion;
+ }
+ interface TodoCommentRequest extends FileRequest {
+ command: CommandTypes.TodoComments;
+ arguments: TodoCommentRequestArgs;
+ }
+ interface TodoCommentRequestArgs extends FileRequestArgs {
+ descriptors: TodoCommentDescriptor[];
+ }
+ interface TodoCommentsResponse extends Response {
+ body?: TodoComment[];
+ }
+ interface IndentationRequest extends FileLocationRequest {
+ command: CommandTypes.Indentation;
+ arguments: IndentationRequestArgs;
+ }
+ interface IndentationResponse extends Response {
+ body?: IndentationResult;
+ }
+ interface IndentationResult {
+ position: number;
+ indentation: number;
+ }
+ interface IndentationRequestArgs extends FileLocationRequestArgs {
+ options?: EditorSettings;
+ }
+ interface ProjectInfoRequestArgs extends FileRequestArgs {
+ needFileNameList: boolean;
+ }
+ interface ProjectInfoRequest extends Request {
+ command: CommandTypes.ProjectInfo;
+ arguments: ProjectInfoRequestArgs;
+ }
+ interface CompilerOptionsDiagnosticsRequest extends Request {
+ arguments: CompilerOptionsDiagnosticsRequestArgs;
+ }
+ interface CompilerOptionsDiagnosticsRequestArgs {
+ projectFileName: string;
+ }
+ interface ProjectInfo {
+ configFileName: string;
+ fileNames?: string[];
+ languageServiceDisabled?: boolean;
+ }
+ interface DiagnosticWithLinePosition {
+ message: string;
+ start: number;
+ length: number;
+ startLocation: Location;
+ endLocation: Location;
+ category: string;
+ code: number;
+ }
+ interface ProjectInfoResponse extends Response {
+ body?: ProjectInfo;
+ }
+ interface FileRequest extends Request {
+ arguments: FileRequestArgs;
+ }
+ interface FileLocationRequestArgs extends FileRequestArgs {
+ line: number;
+ offset: number;
+ }
+ interface CodeFixRequest extends Request {
+ command: CommandTypes.GetCodeFixes;
+ arguments: CodeFixRequestArgs;
+ }
+ interface CodeFixRequestArgs extends FileRequestArgs {
+ startLine: number;
+ startOffset: number;
+ endLine: number;
+ endOffset: number;
+ errorCodes?: number[];
+ }
+ interface GetCodeFixesResponse extends Response {
+ body?: CodeAction[];
+ }
+ interface FileLocationRequest extends FileRequest {
+ arguments: FileLocationRequestArgs;
+ }
+ interface GetSupportedCodeFixesRequest extends Request {
+ command: CommandTypes.GetSupportedCodeFixes;
+ }
+ interface GetSupportedCodeFixesResponse extends Response {
+ body?: string[];
+ }
+ interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs {
+ start: number;
+ length: number;
+ }
+ interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs {
+ filesToSearch: string[];
+ }
+ interface DefinitionRequest extends FileLocationRequest {
+ command: CommandTypes.Definition;
+ }
+ interface TypeDefinitionRequest extends FileLocationRequest {
+ command: CommandTypes.TypeDefinition;
+ }
+ interface ImplementationRequest extends FileLocationRequest {
+ command: CommandTypes.Implementation;
+ }
+ interface Location {
+ line: number;
+ offset: number;
+ }
+ interface TextSpan {
+ start: Location;
+ end: Location;
+ }
+ interface FileSpan extends TextSpan {
+ file: string;
+ }
+ interface DefinitionResponse extends Response {
+ body?: FileSpan[];
+ }
+ interface TypeDefinitionResponse extends Response {
+ body?: FileSpan[];
+ }
+ interface ImplementationResponse extends Response {
+ body?: FileSpan[];
+ }
+ interface BraceCompletionRequest extends FileLocationRequest {
+ command: CommandTypes.BraceCompletion;
+ arguments: BraceCompletionRequestArgs;
+ }
+ interface BraceCompletionRequestArgs extends FileLocationRequestArgs {
+ openingBrace: string;
+ }
+ interface OccurrencesRequest extends FileLocationRequest {
+ command: CommandTypes.Occurrences;
+ }
+ interface OccurrencesResponseItem extends FileSpan {
+ isWriteAccess: boolean;
+ }
+ interface OccurrencesResponse extends Response {
+ body?: OccurrencesResponseItem[];
+ }
+ interface DocumentHighlightsRequest extends FileLocationRequest {
+ command: CommandTypes.DocumentHighlights;
+ arguments: DocumentHighlightsRequestArgs;
+ }
+ interface HighlightSpan extends TextSpan {
+ kind: string;
+ }
+ interface DocumentHighlightsItem {
+ file: string;
+ highlightSpans: HighlightSpan[];
+ }
+ interface DocumentHighlightsResponse extends Response {
+ body?: DocumentHighlightsItem[];
+ }
+ interface ReferencesRequest extends FileLocationRequest {
+ command: CommandTypes.References;
+ }
+ interface ReferencesResponseItem extends FileSpan {
+ lineText: string;
+ isWriteAccess: boolean;
+ isDefinition: boolean;
+ }
+ interface ReferencesResponseBody {
+ refs: ReferencesResponseItem[];
+ symbolName: string;
+ symbolStartOffset: number;
+ symbolDisplayString: string;
+ }
+ interface ReferencesResponse extends Response {
+ body?: ReferencesResponseBody;
+ }
+ interface RenameRequestArgs extends FileLocationRequestArgs {
+ findInComments?: boolean;
+ findInStrings?: boolean;
+ }
+ interface RenameRequest extends FileLocationRequest {
+ command: CommandTypes.Rename;
+ arguments: RenameRequestArgs;
+ }
+ interface RenameInfo {
+ canRename: boolean;
+ localizedErrorMessage?: string;
+ displayName: string;
+ fullDisplayName: string;
+ kind: string;
+ kindModifiers: string;
+ }
+ interface SpanGroup {
+ file: string;
+ locs: TextSpan[];
+ }
+ interface RenameResponseBody {
+ info: RenameInfo;
+ locs: SpanGroup[];
+ }
+ interface RenameResponse extends Response {
+ body?: RenameResponseBody;
+ }
+ interface ExternalFile {
+ fileName: string;
+ scriptKind?: ScriptKindName | ts.ScriptKind;
+ hasMixedContent?: boolean;
+ content?: string;
+ }
+ interface ExternalProject {
+ projectFileName: string;
+ rootFiles: ExternalFile[];
+ options: ExternalProjectCompilerOptions;
+ typingOptions?: TypingOptions;
+ }
+ interface CompileOnSaveMixin {
+ compileOnSave?: boolean;
+ }
+ type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin;
+ interface ProjectChanges {
+ added: string[];
+ removed: string[];
+ }
+ interface ConfigureRequestArguments {
+ hostInfo?: string;
+ file?: string;
+ formatOptions?: FormatCodeSettings;
+ }
+ interface ConfigureRequest extends Request {
+ command: CommandTypes.Configure;
+ arguments: ConfigureRequestArguments;
+ }
+ interface ConfigureResponse extends Response {
+ }
+ interface OpenRequestArgs extends FileRequestArgs {
+ fileContent?: string;
+ scriptKindName?: ScriptKindName;
+ }
+ type ScriptKindName = "TS" | "JS" | "TSX" | "JSX";
+ interface OpenRequest extends Request {
+ command: CommandTypes.Open;
+ arguments: OpenRequestArgs;
+ }
+ interface OpenExternalProjectRequest extends Request {
+ command: CommandTypes.OpenExternalProject;
+ arguments: OpenExternalProjectArgs;
+ }
+ type OpenExternalProjectArgs = ExternalProject;
+ interface OpenExternalProjectsRequest extends Request {
+ command: CommandTypes.OpenExternalProjects;
+ arguments: OpenExternalProjectsArgs;
+ }
+ interface OpenExternalProjectsArgs {
+ projects: ExternalProject[];
+ }
+ interface OpenExternalProjectResponse extends Response {
+ }
+ interface OpenExternalProjectsResponse extends Response {
+ }
+ interface CloseExternalProjectRequest extends Request {
+ command: CommandTypes.CloseExternalProject;
+ arguments: CloseExternalProjectRequestArgs;
+ }
+ interface CloseExternalProjectRequestArgs {
+ projectFileName: string;
+ }
+ interface CloseExternalProjectResponse extends Response {
+ }
+ interface SetCompilerOptionsForInferredProjectsRequest extends Request {
+ command: CommandTypes.CompilerOptionsForInferredProjects;
+ arguments: SetCompilerOptionsForInferredProjectsArgs;
+ }
+ interface SetCompilerOptionsForInferredProjectsArgs {
+ options: ExternalProjectCompilerOptions;
+ }
+ interface SetCompilerOptionsForInferredProjectsResponse extends Response {
+ }
+ interface ExitRequest extends Request {
+ command: CommandTypes.Exit;
+ }
+ interface CloseRequest extends FileRequest {
+ command: CommandTypes.Close;
+ }
+ interface CompileOnSaveAffectedFileListRequest extends FileRequest {
+ command: CommandTypes.CompileOnSaveAffectedFileList;
+ }
+ interface CompileOnSaveAffectedFileListSingleProject {
+ projectFileName: string;
+ fileNames: string[];
+ }
+ interface CompileOnSaveAffectedFileListResponse extends Response {
+ body: CompileOnSaveAffectedFileListSingleProject[];
+ }
+ interface CompileOnSaveEmitFileRequest extends FileRequest {
+ command: CommandTypes.CompileOnSaveEmitFile;
+ arguments: CompileOnSaveEmitFileRequestArgs;
+ }
+ interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs {
+ forced?: boolean;
+ }
+ interface QuickInfoRequest extends FileLocationRequest {
+ command: CommandTypes.Quickinfo;
+ }
+ interface QuickInfoResponseBody {
+ kind: string;
+ kindModifiers: string;
+ start: Location;
+ end: Location;
+ displayString: string;
+ documentation: string;
+ }
+ interface QuickInfoResponse extends Response {
+ body?: QuickInfoResponseBody;
+ }
+ interface FormatRequestArgs extends FileLocationRequestArgs {
+ endLine: number;
+ endOffset: number;
+ options?: FormatCodeSettings;
+ }
+ interface FormatRequest extends FileLocationRequest {
+ command: CommandTypes.Format;
+ arguments: FormatRequestArgs;
+ }
+ interface CodeEdit {
+ start: Location;
+ end: Location;
+ newText: string;
+ }
+ interface FileCodeEdits {
+ fileName: string;
+ textChanges: CodeEdit[];
+ }
+ interface CodeFixResponse extends Response {
+ body?: CodeAction[];
+ }
+ interface CodeAction {
+ description: string;
+ changes: FileCodeEdits[];
+ }
+ interface FormatResponse extends Response {
+ body?: CodeEdit[];
+ }
+ interface FormatOnKeyRequestArgs extends FileLocationRequestArgs {
+ key: string;
+ options?: FormatCodeSettings;
+ }
+ interface FormatOnKeyRequest extends FileLocationRequest {
+ command: CommandTypes.Formatonkey;
+ arguments: FormatOnKeyRequestArgs;
+ }
+ interface CompletionsRequestArgs extends FileLocationRequestArgs {
+ prefix?: string;
+ }
+ interface CompletionsRequest extends FileLocationRequest {
+ command: CommandTypes.Completions;
+ arguments: CompletionsRequestArgs;
+ }
+ interface CompletionDetailsRequestArgs extends FileLocationRequestArgs {
+ entryNames: string[];
+ }
+ interface CompletionDetailsRequest extends FileLocationRequest {
+ command: CommandTypes.CompletionDetails;
+ arguments: CompletionDetailsRequestArgs;
+ }
+ interface SymbolDisplayPart {
+ text: string;
+ kind: string;
+ }
+ interface CompletionEntry {
+ name: string;
+ kind: string;
+ kindModifiers: string;
+ sortText: string;
+ replacementSpan?: TextSpan;
+ }
+ interface CompletionEntryDetails {
+ name: string;
+ kind: string;
+ kindModifiers: string;
+ displayParts: SymbolDisplayPart[];
+ documentation: SymbolDisplayPart[];
+ }
+ interface CompletionsResponse extends Response {
+ body?: CompletionEntry[];
+ }
+ interface CompletionDetailsResponse extends Response {
+ body?: CompletionEntryDetails[];
+ }
+ interface SignatureHelpParameter {
+ name: string;
+ documentation: SymbolDisplayPart[];
+ displayParts: SymbolDisplayPart[];
+ isOptional: boolean;
+ }
+ interface SignatureHelpItem {
+ isVariadic: boolean;
+ prefixDisplayParts: SymbolDisplayPart[];
+ suffixDisplayParts: SymbolDisplayPart[];
+ separatorDisplayParts: SymbolDisplayPart[];
+ parameters: SignatureHelpParameter[];
+ documentation: SymbolDisplayPart[];
+ }
+ interface SignatureHelpItems {
+ items: SignatureHelpItem[];
+ applicableSpan: TextSpan;
+ selectedItemIndex: number;
+ argumentIndex: number;
+ argumentCount: number;
+ }
+ interface SignatureHelpRequestArgs extends FileLocationRequestArgs {
+ }
+ interface SignatureHelpRequest extends FileLocationRequest {
+ command: CommandTypes.SignatureHelp;
+ arguments: SignatureHelpRequestArgs;
+ }
+ interface SignatureHelpResponse extends Response {
+ body?: SignatureHelpItems;
+ }
+ interface SemanticDiagnosticsSyncRequest extends FileRequest {
+ command: CommandTypes.SemanticDiagnosticsSync;
+ arguments: SemanticDiagnosticsSyncRequestArgs;
+ }
+ interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs {
+ includeLinePosition?: boolean;
+ }
+ interface SemanticDiagnosticsSyncResponse extends Response {
+ body?: Diagnostic[] | DiagnosticWithLinePosition[];
+ }
+ interface SyntacticDiagnosticsSyncRequest extends FileRequest {
+ command: CommandTypes.SyntacticDiagnosticsSync;
+ arguments: SyntacticDiagnosticsSyncRequestArgs;
+ }
+ interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs {
+ includeLinePosition?: boolean;
+ }
+ interface SyntacticDiagnosticsSyncResponse extends Response {
+ body?: Diagnostic[] | DiagnosticWithLinePosition[];
+ }
+ interface GeterrForProjectRequestArgs {
+ file: string;
+ delay: number;
+ }
+ interface GeterrForProjectRequest extends Request {
+ command: CommandTypes.GeterrForProject;
+ arguments: GeterrForProjectRequestArgs;
+ }
+ interface GeterrRequestArgs {
+ files: string[];
+ delay: number;
+ }
+ interface GeterrRequest extends Request {
+ command: CommandTypes.Geterr;
+ arguments: GeterrRequestArgs;
+ }
+ interface Diagnostic {
+ start: Location;
+ end: Location;
+ text: string;
+ code?: number;
+ }
+ interface DiagnosticEventBody {
+ file: string;
+ diagnostics: Diagnostic[];
+ }
+ interface DiagnosticEvent extends Event {
+ body?: DiagnosticEventBody;
+ }
+ interface ConfigFileDiagnosticEventBody {
+ triggerFile: string;
+ configFile: string;
+ diagnostics: Diagnostic[];
+ }
+ interface ConfigFileDiagnosticEvent extends Event {
+ body?: ConfigFileDiagnosticEventBody;
+ event: "configFileDiag";
+ }
+ interface ReloadRequestArgs extends FileRequestArgs {
+ tmpfile: string;
+ }
+ interface ReloadRequest extends FileRequest {
+ command: CommandTypes.Reload;
+ arguments: ReloadRequestArgs;
+ }
+ interface ReloadResponse extends Response {
+ }
+ interface SavetoRequestArgs extends FileRequestArgs {
+ tmpfile: string;
+ }
+ interface SavetoRequest extends FileRequest {
+ command: CommandTypes.Saveto;
+ arguments: SavetoRequestArgs;
+ }
+ interface NavtoRequestArgs extends FileRequestArgs {
+ searchValue: string;
+ maxResultCount?: number;
+ currentFileOnly?: boolean;
+ projectFileName?: string;
+ }
+ interface NavtoRequest extends FileRequest {
+ command: CommandTypes.Navto;
+ arguments: NavtoRequestArgs;
+ }
+ interface NavtoItem {
+ name: string;
+ kind: string;
+ matchKind?: string;
+ isCaseSensitive?: boolean;
+ kindModifiers?: string;
+ file: string;
+ start: Location;
+ end: Location;
+ containerName?: string;
+ containerKind?: string;
+ }
+ interface NavtoResponse extends Response {
+ body?: NavtoItem[];
+ }
+ interface ChangeRequestArgs extends FormatRequestArgs {
+ insertString?: string;
+ }
+ interface ChangeRequest extends FileLocationRequest {
+ command: CommandTypes.Change;
+ arguments: ChangeRequestArgs;
+ }
+ interface BraceResponse extends Response {
+ body?: TextSpan[];
+ }
+ interface BraceRequest extends FileLocationRequest {
+ command: CommandTypes.Brace;
+ }
+ interface NavBarRequest extends FileRequest {
+ command: CommandTypes.NavBar;
+ }
+ interface NavTreeRequest extends FileRequest {
+ command: CommandTypes.NavTree;
+ }
+ interface NavigationBarItem {
+ text: string;
+ kind: string;
+ kindModifiers?: string;
+ spans: TextSpan[];
+ childItems?: NavigationBarItem[];
+ indent: number;
+ }
+ interface NavigationTree {
+ text: string;
+ kind: string;
+ kindModifiers: string;
+ spans: TextSpan[];
+ childItems?: NavigationTree[];
+ }
+ interface NavBarResponse extends Response {
+ body?: NavigationBarItem[];
+ }
+ interface NavTreeResponse extends Response {
+ body?: NavigationTree;
+ }
+ namespace IndentStyle {
+ type None = "None";
+ type Block = "Block";
+ type Smart = "Smart";
+ }
+ type IndentStyle = IndentStyle.None | IndentStyle.Block | IndentStyle.Smart;
+ interface EditorSettings {
+ baseIndentSize?: number;
+ indentSize?: number;
+ tabSize?: number;
+ newLineCharacter?: string;
+ convertTabsToSpaces?: boolean;
+ indentStyle?: IndentStyle | ts.IndentStyle;
+ }
+ interface FormatCodeSettings extends EditorSettings {
+ insertSpaceAfterCommaDelimiter?: boolean;
+ insertSpaceAfterSemicolonInForStatements?: boolean;
+ insertSpaceBeforeAndAfterBinaryOperators?: boolean;
+ insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
+ insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
+ insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
+ insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
+ insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
+ insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
+ placeOpenBraceOnNewLineForFunctions?: boolean;
+ placeOpenBraceOnNewLineForControlBlocks?: boolean;
+ }
+ interface CompilerOptions {
+ allowJs?: boolean;
+ allowSyntheticDefaultImports?: boolean;
+ allowUnreachableCode?: boolean;
+ allowUnusedLabels?: boolean;
+ baseUrl?: string;
+ charset?: string;
+ declaration?: boolean;
+ declarationDir?: string;
+ disableSizeLimit?: boolean;
+ emitBOM?: boolean;
+ emitDecoratorMetadata?: boolean;
+ experimentalDecorators?: boolean;
+ forceConsistentCasingInFileNames?: boolean;
+ inlineSourceMap?: boolean;
+ inlineSources?: boolean;
+ isolatedModules?: boolean;
+ jsx?: JsxEmit | ts.JsxEmit;
+ lib?: string[];
+ locale?: string;
+ mapRoot?: string;
+ maxNodeModuleJsDepth?: number;
+ module?: ModuleKind | ts.ModuleKind;
+ moduleResolution?: ModuleResolutionKind | ts.ModuleResolutionKind;
+ newLine?: NewLineKind | ts.NewLineKind;
+ noEmit?: boolean;
+ noEmitHelpers?: boolean;
+ noEmitOnError?: boolean;
+ noErrorTruncation?: boolean;
+ noFallthroughCasesInSwitch?: boolean;
+ noImplicitAny?: boolean;
+ noImplicitReturns?: boolean;
+ noImplicitThis?: boolean;
+ noUnusedLocals?: boolean;
+ noUnusedParameters?: boolean;
+ noImplicitUseStrict?: boolean;
+ noLib?: boolean;
+ noResolve?: boolean;
+ out?: string;
+ outDir?: string;
+ outFile?: string;
+ paths?: MapLike;
+ preserveConstEnums?: boolean;
+ project?: string;
+ reactNamespace?: string;
+ removeComments?: boolean;
+ rootDir?: string;
+ rootDirs?: string[];
+ skipLibCheck?: boolean;
+ skipDefaultLibCheck?: boolean;
+ sourceMap?: boolean;
+ sourceRoot?: string;
+ strictNullChecks?: boolean;
+ suppressExcessPropertyErrors?: boolean;
+ suppressImplicitAnyIndexErrors?: boolean;
+ target?: ScriptTarget | ts.ScriptTarget;
+ traceResolution?: boolean;
+ types?: string[];
+ typeRoots?: string[];
+ [option: string]: CompilerOptionsValue | undefined;
+ }
+ namespace JsxEmit {
+ type None = "None";
+ type Preserve = "Preserve";
+ type React = "React";
+ }
+ type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React;
+ namespace ModuleKind {
+ type None = "None";
+ type CommonJS = "CommonJS";
+ type AMD = "AMD";
+ type UMD = "UMD";
+ type System = "System";
+ type ES6 = "ES6";
+ type ES2015 = "ES2015";
+ }
+ type ModuleKind = ModuleKind.None | ModuleKind.CommonJS | ModuleKind.AMD | ModuleKind.UMD | ModuleKind.System | ModuleKind.ES6 | ModuleKind.ES2015;
+ namespace ModuleResolutionKind {
+ type Classic = "Classic";
+ type Node = "Node";
+ }
+ type ModuleResolutionKind = ModuleResolutionKind.Classic | ModuleResolutionKind.Node;
+ namespace NewLineKind {
+ type Crlf = "Crlf";
+ type Lf = "Lf";
+ }
+ type NewLineKind = NewLineKind.Crlf | NewLineKind.Lf;
+ namespace ScriptTarget {
+ type ES3 = "ES3";
+ type ES5 = "ES5";
+ type ES6 = "ES6";
+ type ES2015 = "ES2015";
+ }
+ type ScriptTarget = ScriptTarget.ES3 | ScriptTarget.ES5 | ScriptTarget.ES6 | ScriptTarget.ES2015;
+}
declare namespace ts.server {
class ScriptInfo {
private readonly host;
@@ -10372,7 +3564,7 @@ declare namespace ts.server {
getLatestVersion(): string;
reload(script: string): void;
saveTo(fileName: string): void;
- reloadFromFile(): void;
+ reloadFromFile(tempFileName?: NormalizedPath): void;
snap(): LineIndexSnapshot;
getLineInfo(line: number): ILineInfo;
editContent(start: number, end: number, newText: string): void;
@@ -10529,7 +3721,7 @@ declare namespace ts.server {
getScriptInfo(uncheckedFileName: string): ScriptInfo;
filesToString(): string;
setCompilerOptions(compilerOptions: CompilerOptions): void;
- reloadScript(filename: NormalizedPath): boolean;
+ reloadScript(filename: NormalizedPath, tempFileName?: NormalizedPath): boolean;
getChangesSinceVersion(lastKnownVersion?: number): ProjectFilesWithTSDiagnostics;
getReferencedFiles(path: Path): Path[];
private removeRootFileIfNecessary(info);
@@ -10595,7 +3787,7 @@ declare namespace ts.server {
} | {
eventName: "configFileDiag";
data: {
- triggerFile?: string;
+ triggerFile: string;
configFileName: string;
diagnostics: Diagnostic[];
};
@@ -10603,6 +3795,10 @@ declare namespace ts.server {
interface ProjectServiceEventHandler {
(event: ProjectServiceEvent): void;
}
+ function convertFormatOptions(protocolOptions: protocol.FormatCodeSettings): FormatCodeSettings;
+ function convertCompilerOptions(protocolOptions: protocol.ExternalProjectCompilerOptions): CompilerOptions & protocol.CompileOnSaveMixin;
+ function tryConvertScriptKindName(scriptKindName: protocol.ScriptKindName | ScriptKind): ScriptKind;
+ function convertScriptKindName(scriptKindName: protocol.ScriptKindName): ScriptKind;
function combineProjectOutput(projects: Project[], action: (project: Project) => T[], comparer?: (a: T, b: T) => number, areEqual?: (a: T, b: T) => boolean): T[];
interface HostConfiguration {
formatCodeOptions: FormatCodeSettings;
@@ -10638,6 +3834,7 @@ declare namespace ts.server {
constructor(host: ServerHost, logger: Logger, cancellationToken: HostCancellationToken, useSingleInferredProject: boolean, typingsInstaller?: ITypingsInstaller, eventHandler?: ProjectServiceEventHandler);
getChangedFiles_TestOnly(): ScriptInfo[];
ensureInferredProjectsUpToDate_TestOnly(): void;
+ getCompilerOptionsForInferredProjects(): CompilerOptions;
updateTypingsForProject(response: SetTypings | InvalidateCachedTypings): void;
setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.ExternalProjectCompilerOptions): void;
stopWatchingDirectory(directory: string): void;
@@ -10651,7 +3848,7 @@ declare namespace ts.server {
private handleDeletedFile(info);
private onTypeRootFileChanged(project, fileName);
private onSourceFileInDirectoryChangedForConfiguredProject(project, fileName);
- private handleChangeInSourceFileForConfiguredProject(project);
+ private handleChangeInSourceFileForConfiguredProject(project, triggerFile);
private onConfigChangedForConfiguredProject(project);
private onConfigFileAddedForInferredProject(fileName);
private getCanonicalFileName(fileName);
@@ -10666,7 +3863,7 @@ declare namespace ts.server {
private convertConfigFileContentToProjectOptions(configFilename);
private exceededTotalSizeLimitForNonTsFiles(options, fileNames, propertyReader);
private createAndAddExternalProject(projectFileName, files, options, typingOptions);
- private reportConfigFileDiagnostics(configFileName, diagnostics, triggerFile?);
+ private reportConfigFileDiagnostics(configFileName, diagnostics, triggerFile);
private createAndAddConfiguredProject(configFileName, projectOptions, configFileErrors, clientFileName?);
private watchConfigDirectoryForProject(project, options);
private addFilesToProjectAndUpdateGraph(project, files, propertyReader, clientFileName, typingOptions, configFileErrors);
@@ -10800,7 +3997,7 @@ declare namespace ts.server {
private getProject(projectFileName);
private getCompilerOptionsDiagnostics(args);
private convertToDiagnosticsWithLinePosition(diagnostics, scriptInfo);
- private getDiagnosticsWorker(args, selector, includeLinePosition);
+ private getDiagnosticsWorker(args, isSemantic, selector, includeLinePosition);
private getDefinition(args, simplifiedResult);
private getTypeDefinition(args);
private getImplementation(args, simplifiedResult);
@@ -10996,178 +4193,3 @@ declare namespace ts.server {
lineCount(): number;
}
}
-declare let debugObjectHost: any;
-declare namespace ts {
- interface ScriptSnapshotShim {
- getText(start: number, end: number): string;
- getLength(): number;
- getChangeRange(oldSnapshot: ScriptSnapshotShim): string;
- dispose?(): void;
- }
- interface Logger {
- log(s: string): void;
- trace(s: string): void;
- error(s: string): void;
- }
- interface LanguageServiceShimHost extends Logger {
- getCompilationSettings(): string;
- getScriptFileNames(): string;
- getScriptKind?(fileName: string): ScriptKind;
- getScriptVersion(fileName: string): string;
- getScriptSnapshot(fileName: string): ScriptSnapshotShim;
- getLocalizedDiagnosticMessages(): string;
- getCancellationToken(): HostCancellationToken;
- getCurrentDirectory(): string;
- getDirectories(path: string): string;
- getDefaultLibFileName(options: string): string;
- getNewLine?(): string;
- getProjectVersion?(): string;
- useCaseSensitiveFileNames?(): boolean;
- getTypeRootsVersion?(): number;
- readDirectory(rootDir: string, extension: string, basePaths?: string, excludeEx?: string, includeFileEx?: string, includeDirEx?: string, depth?: number): string;
- readFile(path: string, encoding?: string): string;
- fileExists(path: string): boolean;
- getModuleResolutionsForFile?(fileName: string): string;
- getTypeReferenceDirectiveResolutionsForFile?(fileName: string): string;
- directoryExists(directoryName: string): boolean;
- }
- interface CoreServicesShimHost extends Logger {
- directoryExists(directoryName: string): boolean;
- fileExists(fileName: string): boolean;
- getCurrentDirectory(): string;
- getDirectories(path: string): string;
- readDirectory(rootDir: string, extension: string, basePaths?: string, excludeEx?: string, includeFileEx?: string, includeDirEx?: string, depth?: number): string;
- readFile(fileName: string): string;
- realpath?(path: string): string;
- trace(s: string): void;
- useCaseSensitiveFileNames?(): boolean;
- }
- interface IFileReference {
- path: string;
- position: number;
- length: number;
- }
- interface ShimFactory {
- registerShim(shim: Shim): void;
- unregisterShim(shim: Shim): void;
- }
- interface Shim {
- dispose(dummy: any): void;
- }
- interface LanguageServiceShim extends Shim {
- languageService: LanguageService;
- dispose(dummy: any): void;
- refresh(throwOnError: boolean): void;
- cleanupSemanticCache(): void;
- getSyntacticDiagnostics(fileName: string): string;
- getSemanticDiagnostics(fileName: string): string;
- getCompilerOptionsDiagnostics(): string;
- getSyntacticClassifications(fileName: string, start: number, length: number): string;
- getSemanticClassifications(fileName: string, start: number, length: number): string;
- getEncodedSyntacticClassifications(fileName: string, start: number, length: number): string;
- getEncodedSemanticClassifications(fileName: string, start: number, length: number): string;
- getCompletionsAtPosition(fileName: string, position: number): string;
- getCompletionEntryDetails(fileName: string, position: number, entryName: string): string;
- getQuickInfoAtPosition(fileName: string, position: number): string;
- getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): string;
- getBreakpointStatementAtPosition(fileName: string, position: number): string;
- getSignatureHelpItems(fileName: string, position: number): string;
- getRenameInfo(fileName: string, position: number): string;
- findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): string;
- getDefinitionAtPosition(fileName: string, position: number): string;
- getTypeDefinitionAtPosition(fileName: string, position: number): string;
- getImplementationAtPosition(fileName: string, position: number): string;
- getReferencesAtPosition(fileName: string, position: number): string;
- findReferences(fileName: string, position: number): string;
- getOccurrencesAtPosition(fileName: string, position: number): string;
- getDocumentHighlights(fileName: string, position: number, filesToSearch: string): string;
- getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string): string;
- getNavigationBarItems(fileName: string): string;
- getNavigationTree(fileName: string): string;
- getOutliningSpans(fileName: string): string;
- getTodoComments(fileName: string, todoCommentDescriptors: string): string;
- getBraceMatchingAtPosition(fileName: string, position: number): string;
- getIndentationAtPosition(fileName: string, position: number, options: string): string;
- getFormattingEditsForRange(fileName: string, start: number, end: number, options: string): string;
- getFormattingEditsForDocument(fileName: string, options: string): string;
- getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: string): string;
- getDocCommentTemplateAtPosition(fileName: string, position: number): string;
- isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): string;
- getEmitOutput(fileName: string): string;
- getEmitOutputObject(fileName: string): EmitOutput;
- }
- interface ClassifierShim extends Shim {
- getEncodedLexicalClassifications(text: string, lexState: EndOfLineState, syntacticClassifierAbsent?: boolean): string;
- getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent?: boolean): string;
- }
- interface CoreServicesShim extends Shim {
- getAutomaticTypeDirectiveNames(compilerOptionsJson: string): string;
- getPreProcessedFileInfo(fileName: string, sourceText: IScriptSnapshot): string;
- getTSConfigFileInfo(fileName: string, sourceText: IScriptSnapshot): string;
- getDefaultCompilationSettings(): string;
- discoverTypings(discoverTypingsJson: string): string;
- }
- class LanguageServiceShimHostAdapter implements LanguageServiceHost {
- private shimHost;
- private files;
- private loggingEnabled;
- private tracingEnabled;
- resolveModuleNames: (moduleName: string[], containingFile: string) => ResolvedModule[];
- resolveTypeReferenceDirectives: (typeDirectiveNames: string[], containingFile: string) => ResolvedTypeReferenceDirective[];
- directoryExists: (directoryName: string) => boolean;
- constructor(shimHost: LanguageServiceShimHost);
- log(s: string): void;
- trace(s: string): void;
- error(s: string): void;
- getProjectVersion(): string;
- getTypeRootsVersion(): number;
- useCaseSensitiveFileNames(): boolean;
- getCompilationSettings(): CompilerOptions;
- getScriptFileNames(): string[];
- getScriptSnapshot(fileName: string): IScriptSnapshot;
- getScriptKind(fileName: string): ScriptKind;
- getScriptVersion(fileName: string): string;
- getLocalizedDiagnosticMessages(): any;
- getCancellationToken(): HostCancellationToken;
- getCurrentDirectory(): string;
- getDirectories(path: string): string[];
- getDefaultLibFileName(options: CompilerOptions): string;
- readDirectory(path: string, extensions?: string[], exclude?: string[], include?: string[], depth?: number): string[];
- readFile(path: string, encoding?: string): string;
- fileExists(path: string): boolean;
- }
- class CoreServicesShimHostAdapter implements ParseConfigHost, ModuleResolutionHost {
- private shimHost;
- directoryExists: (directoryName: string) => boolean;
- realpath: (path: string) => string;
- useCaseSensitiveFileNames: boolean;
- constructor(shimHost: CoreServicesShimHost);
- readDirectory(rootDir: string, extensions: string[], exclude: string[], include: string[], depth?: number): string[];
- fileExists(fileName: string): boolean;
- readFile(fileName: string): string;
- private readDirectoryFallback(rootDir, extension, exclude);
- getDirectories(path: string): string[];
- }
- function realizeDiagnostics(diagnostics: Diagnostic[], newLine: string): {
- message: string;
- start: number;
- length: number;
- category: string;
- code: number;
- }[];
- class TypeScriptServicesFactory implements ShimFactory {
- private _shims;
- private documentRegistry;
- getServicesVersion(): string;
- createLanguageServiceShim(host: LanguageServiceShimHost): LanguageServiceShim;
- createClassifierShim(logger: Logger): ClassifierShim;
- createCoreServicesShim(host: CoreServicesShimHost): CoreServicesShim;
- close(): void;
- registerShim(shim: Shim): void;
- unregisterShim(shim: Shim): void;
- }
-}
-declare namespace TypeScript.Services {
- const TypeScriptServicesFactory: typeof ts.TypeScriptServicesFactory;
-}
-declare const toolsVersion = "2.1";
diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js
index a360ac081ec..0a476fd3ed1 100644
--- a/lib/tsserverlibrary.js
+++ b/lib/tsserverlibrary.js
@@ -20,6 +20,418 @@ var __extends = (this && this.__extends) || function (d, b) {
};
var ts;
(function (ts) {
+ (function (SyntaxKind) {
+ SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown";
+ SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken";
+ SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia";
+ SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia";
+ SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia";
+ SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia";
+ SyntaxKind[SyntaxKind["ShebangTrivia"] = 6] = "ShebangTrivia";
+ SyntaxKind[SyntaxKind["ConflictMarkerTrivia"] = 7] = "ConflictMarkerTrivia";
+ SyntaxKind[SyntaxKind["NumericLiteral"] = 8] = "NumericLiteral";
+ SyntaxKind[SyntaxKind["StringLiteral"] = 9] = "StringLiteral";
+ SyntaxKind[SyntaxKind["JsxText"] = 10] = "JsxText";
+ SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 11] = "RegularExpressionLiteral";
+ SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 12] = "NoSubstitutionTemplateLiteral";
+ SyntaxKind[SyntaxKind["TemplateHead"] = 13] = "TemplateHead";
+ SyntaxKind[SyntaxKind["TemplateMiddle"] = 14] = "TemplateMiddle";
+ SyntaxKind[SyntaxKind["TemplateTail"] = 15] = "TemplateTail";
+ SyntaxKind[SyntaxKind["OpenBraceToken"] = 16] = "OpenBraceToken";
+ SyntaxKind[SyntaxKind["CloseBraceToken"] = 17] = "CloseBraceToken";
+ SyntaxKind[SyntaxKind["OpenParenToken"] = 18] = "OpenParenToken";
+ SyntaxKind[SyntaxKind["CloseParenToken"] = 19] = "CloseParenToken";
+ SyntaxKind[SyntaxKind["OpenBracketToken"] = 20] = "OpenBracketToken";
+ SyntaxKind[SyntaxKind["CloseBracketToken"] = 21] = "CloseBracketToken";
+ SyntaxKind[SyntaxKind["DotToken"] = 22] = "DotToken";
+ SyntaxKind[SyntaxKind["DotDotDotToken"] = 23] = "DotDotDotToken";
+ SyntaxKind[SyntaxKind["SemicolonToken"] = 24] = "SemicolonToken";
+ SyntaxKind[SyntaxKind["CommaToken"] = 25] = "CommaToken";
+ SyntaxKind[SyntaxKind["LessThanToken"] = 26] = "LessThanToken";
+ SyntaxKind[SyntaxKind["LessThanSlashToken"] = 27] = "LessThanSlashToken";
+ SyntaxKind[SyntaxKind["GreaterThanToken"] = 28] = "GreaterThanToken";
+ SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 29] = "LessThanEqualsToken";
+ SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 30] = "GreaterThanEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 31] = "EqualsEqualsToken";
+ SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 32] = "ExclamationEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 33] = "EqualsEqualsEqualsToken";
+ SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 34] = "ExclamationEqualsEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 35] = "EqualsGreaterThanToken";
+ SyntaxKind[SyntaxKind["PlusToken"] = 36] = "PlusToken";
+ SyntaxKind[SyntaxKind["MinusToken"] = 37] = "MinusToken";
+ SyntaxKind[SyntaxKind["AsteriskToken"] = 38] = "AsteriskToken";
+ SyntaxKind[SyntaxKind["AsteriskAsteriskToken"] = 39] = "AsteriskAsteriskToken";
+ SyntaxKind[SyntaxKind["SlashToken"] = 40] = "SlashToken";
+ SyntaxKind[SyntaxKind["PercentToken"] = 41] = "PercentToken";
+ SyntaxKind[SyntaxKind["PlusPlusToken"] = 42] = "PlusPlusToken";
+ SyntaxKind[SyntaxKind["MinusMinusToken"] = 43] = "MinusMinusToken";
+ SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 44] = "LessThanLessThanToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 45] = "GreaterThanGreaterThanToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 46] = "GreaterThanGreaterThanGreaterThanToken";
+ SyntaxKind[SyntaxKind["AmpersandToken"] = 47] = "AmpersandToken";
+ SyntaxKind[SyntaxKind["BarToken"] = 48] = "BarToken";
+ SyntaxKind[SyntaxKind["CaretToken"] = 49] = "CaretToken";
+ SyntaxKind[SyntaxKind["ExclamationToken"] = 50] = "ExclamationToken";
+ SyntaxKind[SyntaxKind["TildeToken"] = 51] = "TildeToken";
+ SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 52] = "AmpersandAmpersandToken";
+ SyntaxKind[SyntaxKind["BarBarToken"] = 53] = "BarBarToken";
+ SyntaxKind[SyntaxKind["QuestionToken"] = 54] = "QuestionToken";
+ SyntaxKind[SyntaxKind["ColonToken"] = 55] = "ColonToken";
+ SyntaxKind[SyntaxKind["AtToken"] = 56] = "AtToken";
+ SyntaxKind[SyntaxKind["EqualsToken"] = 57] = "EqualsToken";
+ SyntaxKind[SyntaxKind["PlusEqualsToken"] = 58] = "PlusEqualsToken";
+ SyntaxKind[SyntaxKind["MinusEqualsToken"] = 59] = "MinusEqualsToken";
+ SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 60] = "AsteriskEqualsToken";
+ SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 61] = "AsteriskAsteriskEqualsToken";
+ SyntaxKind[SyntaxKind["SlashEqualsToken"] = 62] = "SlashEqualsToken";
+ SyntaxKind[SyntaxKind["PercentEqualsToken"] = 63] = "PercentEqualsToken";
+ SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 64] = "LessThanLessThanEqualsToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 65] = "GreaterThanGreaterThanEqualsToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 66] = "GreaterThanGreaterThanGreaterThanEqualsToken";
+ SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 67] = "AmpersandEqualsToken";
+ SyntaxKind[SyntaxKind["BarEqualsToken"] = 68] = "BarEqualsToken";
+ SyntaxKind[SyntaxKind["CaretEqualsToken"] = 69] = "CaretEqualsToken";
+ SyntaxKind[SyntaxKind["Identifier"] = 70] = "Identifier";
+ SyntaxKind[SyntaxKind["BreakKeyword"] = 71] = "BreakKeyword";
+ SyntaxKind[SyntaxKind["CaseKeyword"] = 72] = "CaseKeyword";
+ SyntaxKind[SyntaxKind["CatchKeyword"] = 73] = "CatchKeyword";
+ SyntaxKind[SyntaxKind["ClassKeyword"] = 74] = "ClassKeyword";
+ SyntaxKind[SyntaxKind["ConstKeyword"] = 75] = "ConstKeyword";
+ SyntaxKind[SyntaxKind["ContinueKeyword"] = 76] = "ContinueKeyword";
+ SyntaxKind[SyntaxKind["DebuggerKeyword"] = 77] = "DebuggerKeyword";
+ SyntaxKind[SyntaxKind["DefaultKeyword"] = 78] = "DefaultKeyword";
+ SyntaxKind[SyntaxKind["DeleteKeyword"] = 79] = "DeleteKeyword";
+ SyntaxKind[SyntaxKind["DoKeyword"] = 80] = "DoKeyword";
+ SyntaxKind[SyntaxKind["ElseKeyword"] = 81] = "ElseKeyword";
+ SyntaxKind[SyntaxKind["EnumKeyword"] = 82] = "EnumKeyword";
+ SyntaxKind[SyntaxKind["ExportKeyword"] = 83] = "ExportKeyword";
+ SyntaxKind[SyntaxKind["ExtendsKeyword"] = 84] = "ExtendsKeyword";
+ SyntaxKind[SyntaxKind["FalseKeyword"] = 85] = "FalseKeyword";
+ SyntaxKind[SyntaxKind["FinallyKeyword"] = 86] = "FinallyKeyword";
+ SyntaxKind[SyntaxKind["ForKeyword"] = 87] = "ForKeyword";
+ SyntaxKind[SyntaxKind["FunctionKeyword"] = 88] = "FunctionKeyword";
+ SyntaxKind[SyntaxKind["IfKeyword"] = 89] = "IfKeyword";
+ SyntaxKind[SyntaxKind["ImportKeyword"] = 90] = "ImportKeyword";
+ SyntaxKind[SyntaxKind["InKeyword"] = 91] = "InKeyword";
+ SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 92] = "InstanceOfKeyword";
+ SyntaxKind[SyntaxKind["NewKeyword"] = 93] = "NewKeyword";
+ SyntaxKind[SyntaxKind["NullKeyword"] = 94] = "NullKeyword";
+ SyntaxKind[SyntaxKind["ReturnKeyword"] = 95] = "ReturnKeyword";
+ SyntaxKind[SyntaxKind["SuperKeyword"] = 96] = "SuperKeyword";
+ SyntaxKind[SyntaxKind["SwitchKeyword"] = 97] = "SwitchKeyword";
+ SyntaxKind[SyntaxKind["ThisKeyword"] = 98] = "ThisKeyword";
+ SyntaxKind[SyntaxKind["ThrowKeyword"] = 99] = "ThrowKeyword";
+ SyntaxKind[SyntaxKind["TrueKeyword"] = 100] = "TrueKeyword";
+ SyntaxKind[SyntaxKind["TryKeyword"] = 101] = "TryKeyword";
+ SyntaxKind[SyntaxKind["TypeOfKeyword"] = 102] = "TypeOfKeyword";
+ SyntaxKind[SyntaxKind["VarKeyword"] = 103] = "VarKeyword";
+ SyntaxKind[SyntaxKind["VoidKeyword"] = 104] = "VoidKeyword";
+ SyntaxKind[SyntaxKind["WhileKeyword"] = 105] = "WhileKeyword";
+ SyntaxKind[SyntaxKind["WithKeyword"] = 106] = "WithKeyword";
+ SyntaxKind[SyntaxKind["ImplementsKeyword"] = 107] = "ImplementsKeyword";
+ SyntaxKind[SyntaxKind["InterfaceKeyword"] = 108] = "InterfaceKeyword";
+ SyntaxKind[SyntaxKind["LetKeyword"] = 109] = "LetKeyword";
+ SyntaxKind[SyntaxKind["PackageKeyword"] = 110] = "PackageKeyword";
+ SyntaxKind[SyntaxKind["PrivateKeyword"] = 111] = "PrivateKeyword";
+ SyntaxKind[SyntaxKind["ProtectedKeyword"] = 112] = "ProtectedKeyword";
+ SyntaxKind[SyntaxKind["PublicKeyword"] = 113] = "PublicKeyword";
+ SyntaxKind[SyntaxKind["StaticKeyword"] = 114] = "StaticKeyword";
+ SyntaxKind[SyntaxKind["YieldKeyword"] = 115] = "YieldKeyword";
+ SyntaxKind[SyntaxKind["AbstractKeyword"] = 116] = "AbstractKeyword";
+ SyntaxKind[SyntaxKind["AsKeyword"] = 117] = "AsKeyword";
+ SyntaxKind[SyntaxKind["AnyKeyword"] = 118] = "AnyKeyword";
+ SyntaxKind[SyntaxKind["AsyncKeyword"] = 119] = "AsyncKeyword";
+ SyntaxKind[SyntaxKind["AwaitKeyword"] = 120] = "AwaitKeyword";
+ SyntaxKind[SyntaxKind["BooleanKeyword"] = 121] = "BooleanKeyword";
+ SyntaxKind[SyntaxKind["ConstructorKeyword"] = 122] = "ConstructorKeyword";
+ SyntaxKind[SyntaxKind["DeclareKeyword"] = 123] = "DeclareKeyword";
+ SyntaxKind[SyntaxKind["GetKeyword"] = 124] = "GetKeyword";
+ SyntaxKind[SyntaxKind["IsKeyword"] = 125] = "IsKeyword";
+ SyntaxKind[SyntaxKind["ModuleKeyword"] = 126] = "ModuleKeyword";
+ SyntaxKind[SyntaxKind["NamespaceKeyword"] = 127] = "NamespaceKeyword";
+ SyntaxKind[SyntaxKind["NeverKeyword"] = 128] = "NeverKeyword";
+ SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 129] = "ReadonlyKeyword";
+ SyntaxKind[SyntaxKind["RequireKeyword"] = 130] = "RequireKeyword";
+ SyntaxKind[SyntaxKind["NumberKeyword"] = 131] = "NumberKeyword";
+ SyntaxKind[SyntaxKind["SetKeyword"] = 132] = "SetKeyword";
+ SyntaxKind[SyntaxKind["StringKeyword"] = 133] = "StringKeyword";
+ SyntaxKind[SyntaxKind["SymbolKeyword"] = 134] = "SymbolKeyword";
+ SyntaxKind[SyntaxKind["TypeKeyword"] = 135] = "TypeKeyword";
+ SyntaxKind[SyntaxKind["UndefinedKeyword"] = 136] = "UndefinedKeyword";
+ SyntaxKind[SyntaxKind["FromKeyword"] = 137] = "FromKeyword";
+ SyntaxKind[SyntaxKind["GlobalKeyword"] = 138] = "GlobalKeyword";
+ SyntaxKind[SyntaxKind["OfKeyword"] = 139] = "OfKeyword";
+ SyntaxKind[SyntaxKind["QualifiedName"] = 140] = "QualifiedName";
+ SyntaxKind[SyntaxKind["ComputedPropertyName"] = 141] = "ComputedPropertyName";
+ SyntaxKind[SyntaxKind["TypeParameter"] = 142] = "TypeParameter";
+ SyntaxKind[SyntaxKind["Parameter"] = 143] = "Parameter";
+ SyntaxKind[SyntaxKind["Decorator"] = 144] = "Decorator";
+ SyntaxKind[SyntaxKind["PropertySignature"] = 145] = "PropertySignature";
+ SyntaxKind[SyntaxKind["PropertyDeclaration"] = 146] = "PropertyDeclaration";
+ SyntaxKind[SyntaxKind["MethodSignature"] = 147] = "MethodSignature";
+ SyntaxKind[SyntaxKind["MethodDeclaration"] = 148] = "MethodDeclaration";
+ SyntaxKind[SyntaxKind["Constructor"] = 149] = "Constructor";
+ SyntaxKind[SyntaxKind["GetAccessor"] = 150] = "GetAccessor";
+ SyntaxKind[SyntaxKind["SetAccessor"] = 151] = "SetAccessor";
+ SyntaxKind[SyntaxKind["CallSignature"] = 152] = "CallSignature";
+ SyntaxKind[SyntaxKind["ConstructSignature"] = 153] = "ConstructSignature";
+ SyntaxKind[SyntaxKind["IndexSignature"] = 154] = "IndexSignature";
+ SyntaxKind[SyntaxKind["TypePredicate"] = 155] = "TypePredicate";
+ SyntaxKind[SyntaxKind["TypeReference"] = 156] = "TypeReference";
+ SyntaxKind[SyntaxKind["FunctionType"] = 157] = "FunctionType";
+ SyntaxKind[SyntaxKind["ConstructorType"] = 158] = "ConstructorType";
+ SyntaxKind[SyntaxKind["TypeQuery"] = 159] = "TypeQuery";
+ SyntaxKind[SyntaxKind["TypeLiteral"] = 160] = "TypeLiteral";
+ SyntaxKind[SyntaxKind["ArrayType"] = 161] = "ArrayType";
+ SyntaxKind[SyntaxKind["TupleType"] = 162] = "TupleType";
+ SyntaxKind[SyntaxKind["UnionType"] = 163] = "UnionType";
+ SyntaxKind[SyntaxKind["IntersectionType"] = 164] = "IntersectionType";
+ SyntaxKind[SyntaxKind["ParenthesizedType"] = 165] = "ParenthesizedType";
+ SyntaxKind[SyntaxKind["ThisType"] = 166] = "ThisType";
+ SyntaxKind[SyntaxKind["LiteralType"] = 167] = "LiteralType";
+ SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 168] = "ObjectBindingPattern";
+ SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 169] = "ArrayBindingPattern";
+ SyntaxKind[SyntaxKind["BindingElement"] = 170] = "BindingElement";
+ SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 171] = "ArrayLiteralExpression";
+ SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 172] = "ObjectLiteralExpression";
+ SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 173] = "PropertyAccessExpression";
+ SyntaxKind[SyntaxKind["ElementAccessExpression"] = 174] = "ElementAccessExpression";
+ SyntaxKind[SyntaxKind["CallExpression"] = 175] = "CallExpression";
+ SyntaxKind[SyntaxKind["NewExpression"] = 176] = "NewExpression";
+ SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 177] = "TaggedTemplateExpression";
+ SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 178] = "TypeAssertionExpression";
+ SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 179] = "ParenthesizedExpression";
+ SyntaxKind[SyntaxKind["FunctionExpression"] = 180] = "FunctionExpression";
+ SyntaxKind[SyntaxKind["ArrowFunction"] = 181] = "ArrowFunction";
+ SyntaxKind[SyntaxKind["DeleteExpression"] = 182] = "DeleteExpression";
+ SyntaxKind[SyntaxKind["TypeOfExpression"] = 183] = "TypeOfExpression";
+ SyntaxKind[SyntaxKind["VoidExpression"] = 184] = "VoidExpression";
+ SyntaxKind[SyntaxKind["AwaitExpression"] = 185] = "AwaitExpression";
+ SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 186] = "PrefixUnaryExpression";
+ SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 187] = "PostfixUnaryExpression";
+ SyntaxKind[SyntaxKind["BinaryExpression"] = 188] = "BinaryExpression";
+ SyntaxKind[SyntaxKind["ConditionalExpression"] = 189] = "ConditionalExpression";
+ SyntaxKind[SyntaxKind["TemplateExpression"] = 190] = "TemplateExpression";
+ SyntaxKind[SyntaxKind["YieldExpression"] = 191] = "YieldExpression";
+ SyntaxKind[SyntaxKind["SpreadElementExpression"] = 192] = "SpreadElementExpression";
+ SyntaxKind[SyntaxKind["ClassExpression"] = 193] = "ClassExpression";
+ SyntaxKind[SyntaxKind["OmittedExpression"] = 194] = "OmittedExpression";
+ SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 195] = "ExpressionWithTypeArguments";
+ SyntaxKind[SyntaxKind["AsExpression"] = 196] = "AsExpression";
+ SyntaxKind[SyntaxKind["NonNullExpression"] = 197] = "NonNullExpression";
+ SyntaxKind[SyntaxKind["TemplateSpan"] = 198] = "TemplateSpan";
+ SyntaxKind[SyntaxKind["SemicolonClassElement"] = 199] = "SemicolonClassElement";
+ SyntaxKind[SyntaxKind["Block"] = 200] = "Block";
+ SyntaxKind[SyntaxKind["VariableStatement"] = 201] = "VariableStatement";
+ SyntaxKind[SyntaxKind["EmptyStatement"] = 202] = "EmptyStatement";
+ SyntaxKind[SyntaxKind["ExpressionStatement"] = 203] = "ExpressionStatement";
+ SyntaxKind[SyntaxKind["IfStatement"] = 204] = "IfStatement";
+ SyntaxKind[SyntaxKind["DoStatement"] = 205] = "DoStatement";
+ SyntaxKind[SyntaxKind["WhileStatement"] = 206] = "WhileStatement";
+ SyntaxKind[SyntaxKind["ForStatement"] = 207] = "ForStatement";
+ SyntaxKind[SyntaxKind["ForInStatement"] = 208] = "ForInStatement";
+ SyntaxKind[SyntaxKind["ForOfStatement"] = 209] = "ForOfStatement";
+ SyntaxKind[SyntaxKind["ContinueStatement"] = 210] = "ContinueStatement";
+ SyntaxKind[SyntaxKind["BreakStatement"] = 211] = "BreakStatement";
+ SyntaxKind[SyntaxKind["ReturnStatement"] = 212] = "ReturnStatement";
+ SyntaxKind[SyntaxKind["WithStatement"] = 213] = "WithStatement";
+ SyntaxKind[SyntaxKind["SwitchStatement"] = 214] = "SwitchStatement";
+ SyntaxKind[SyntaxKind["LabeledStatement"] = 215] = "LabeledStatement";
+ SyntaxKind[SyntaxKind["ThrowStatement"] = 216] = "ThrowStatement";
+ SyntaxKind[SyntaxKind["TryStatement"] = 217] = "TryStatement";
+ SyntaxKind[SyntaxKind["DebuggerStatement"] = 218] = "DebuggerStatement";
+ SyntaxKind[SyntaxKind["VariableDeclaration"] = 219] = "VariableDeclaration";
+ SyntaxKind[SyntaxKind["VariableDeclarationList"] = 220] = "VariableDeclarationList";
+ SyntaxKind[SyntaxKind["FunctionDeclaration"] = 221] = "FunctionDeclaration";
+ SyntaxKind[SyntaxKind["ClassDeclaration"] = 222] = "ClassDeclaration";
+ SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 223] = "InterfaceDeclaration";
+ SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 224] = "TypeAliasDeclaration";
+ SyntaxKind[SyntaxKind["EnumDeclaration"] = 225] = "EnumDeclaration";
+ SyntaxKind[SyntaxKind["ModuleDeclaration"] = 226] = "ModuleDeclaration";
+ SyntaxKind[SyntaxKind["ModuleBlock"] = 227] = "ModuleBlock";
+ SyntaxKind[SyntaxKind["CaseBlock"] = 228] = "CaseBlock";
+ SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 229] = "NamespaceExportDeclaration";
+ SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 230] = "ImportEqualsDeclaration";
+ SyntaxKind[SyntaxKind["ImportDeclaration"] = 231] = "ImportDeclaration";
+ SyntaxKind[SyntaxKind["ImportClause"] = 232] = "ImportClause";
+ SyntaxKind[SyntaxKind["NamespaceImport"] = 233] = "NamespaceImport";
+ SyntaxKind[SyntaxKind["NamedImports"] = 234] = "NamedImports";
+ SyntaxKind[SyntaxKind["ImportSpecifier"] = 235] = "ImportSpecifier";
+ SyntaxKind[SyntaxKind["ExportAssignment"] = 236] = "ExportAssignment";
+ SyntaxKind[SyntaxKind["ExportDeclaration"] = 237] = "ExportDeclaration";
+ SyntaxKind[SyntaxKind["NamedExports"] = 238] = "NamedExports";
+ SyntaxKind[SyntaxKind["ExportSpecifier"] = 239] = "ExportSpecifier";
+ SyntaxKind[SyntaxKind["MissingDeclaration"] = 240] = "MissingDeclaration";
+ SyntaxKind[SyntaxKind["ExternalModuleReference"] = 241] = "ExternalModuleReference";
+ SyntaxKind[SyntaxKind["JsxElement"] = 242] = "JsxElement";
+ SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 243] = "JsxSelfClosingElement";
+ SyntaxKind[SyntaxKind["JsxOpeningElement"] = 244] = "JsxOpeningElement";
+ SyntaxKind[SyntaxKind["JsxClosingElement"] = 245] = "JsxClosingElement";
+ SyntaxKind[SyntaxKind["JsxAttribute"] = 246] = "JsxAttribute";
+ SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 247] = "JsxSpreadAttribute";
+ SyntaxKind[SyntaxKind["JsxExpression"] = 248] = "JsxExpression";
+ SyntaxKind[SyntaxKind["CaseClause"] = 249] = "CaseClause";
+ SyntaxKind[SyntaxKind["DefaultClause"] = 250] = "DefaultClause";
+ SyntaxKind[SyntaxKind["HeritageClause"] = 251] = "HeritageClause";
+ SyntaxKind[SyntaxKind["CatchClause"] = 252] = "CatchClause";
+ SyntaxKind[SyntaxKind["PropertyAssignment"] = 253] = "PropertyAssignment";
+ SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 254] = "ShorthandPropertyAssignment";
+ SyntaxKind[SyntaxKind["EnumMember"] = 255] = "EnumMember";
+ SyntaxKind[SyntaxKind["SourceFile"] = 256] = "SourceFile";
+ SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 257] = "JSDocTypeExpression";
+ SyntaxKind[SyntaxKind["JSDocAllType"] = 258] = "JSDocAllType";
+ SyntaxKind[SyntaxKind["JSDocUnknownType"] = 259] = "JSDocUnknownType";
+ SyntaxKind[SyntaxKind["JSDocArrayType"] = 260] = "JSDocArrayType";
+ SyntaxKind[SyntaxKind["JSDocUnionType"] = 261] = "JSDocUnionType";
+ SyntaxKind[SyntaxKind["JSDocTupleType"] = 262] = "JSDocTupleType";
+ SyntaxKind[SyntaxKind["JSDocNullableType"] = 263] = "JSDocNullableType";
+ SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 264] = "JSDocNonNullableType";
+ SyntaxKind[SyntaxKind["JSDocRecordType"] = 265] = "JSDocRecordType";
+ SyntaxKind[SyntaxKind["JSDocRecordMember"] = 266] = "JSDocRecordMember";
+ SyntaxKind[SyntaxKind["JSDocTypeReference"] = 267] = "JSDocTypeReference";
+ SyntaxKind[SyntaxKind["JSDocOptionalType"] = 268] = "JSDocOptionalType";
+ SyntaxKind[SyntaxKind["JSDocFunctionType"] = 269] = "JSDocFunctionType";
+ SyntaxKind[SyntaxKind["JSDocVariadicType"] = 270] = "JSDocVariadicType";
+ SyntaxKind[SyntaxKind["JSDocConstructorType"] = 271] = "JSDocConstructorType";
+ SyntaxKind[SyntaxKind["JSDocThisType"] = 272] = "JSDocThisType";
+ SyntaxKind[SyntaxKind["JSDocComment"] = 273] = "JSDocComment";
+ SyntaxKind[SyntaxKind["JSDocTag"] = 274] = "JSDocTag";
+ SyntaxKind[SyntaxKind["JSDocParameterTag"] = 275] = "JSDocParameterTag";
+ SyntaxKind[SyntaxKind["JSDocReturnTag"] = 276] = "JSDocReturnTag";
+ SyntaxKind[SyntaxKind["JSDocTypeTag"] = 277] = "JSDocTypeTag";
+ SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 278] = "JSDocTemplateTag";
+ SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 279] = "JSDocTypedefTag";
+ SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 280] = "JSDocPropertyTag";
+ SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 281] = "JSDocTypeLiteral";
+ SyntaxKind[SyntaxKind["JSDocLiteralType"] = 282] = "JSDocLiteralType";
+ SyntaxKind[SyntaxKind["JSDocNullKeyword"] = 283] = "JSDocNullKeyword";
+ SyntaxKind[SyntaxKind["JSDocUndefinedKeyword"] = 284] = "JSDocUndefinedKeyword";
+ SyntaxKind[SyntaxKind["JSDocNeverKeyword"] = 285] = "JSDocNeverKeyword";
+ SyntaxKind[SyntaxKind["SyntaxList"] = 286] = "SyntaxList";
+ SyntaxKind[SyntaxKind["NotEmittedStatement"] = 287] = "NotEmittedStatement";
+ SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 288] = "PartiallyEmittedExpression";
+ SyntaxKind[SyntaxKind["Count"] = 289] = "Count";
+ SyntaxKind[SyntaxKind["FirstAssignment"] = 57] = "FirstAssignment";
+ SyntaxKind[SyntaxKind["LastAssignment"] = 69] = "LastAssignment";
+ SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 58] = "FirstCompoundAssignment";
+ SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 69] = "LastCompoundAssignment";
+ SyntaxKind[SyntaxKind["FirstReservedWord"] = 71] = "FirstReservedWord";
+ SyntaxKind[SyntaxKind["LastReservedWord"] = 106] = "LastReservedWord";
+ SyntaxKind[SyntaxKind["FirstKeyword"] = 71] = "FirstKeyword";
+ SyntaxKind[SyntaxKind["LastKeyword"] = 139] = "LastKeyword";
+ SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 107] = "FirstFutureReservedWord";
+ SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 115] = "LastFutureReservedWord";
+ SyntaxKind[SyntaxKind["FirstTypeNode"] = 155] = "FirstTypeNode";
+ SyntaxKind[SyntaxKind["LastTypeNode"] = 167] = "LastTypeNode";
+ SyntaxKind[SyntaxKind["FirstPunctuation"] = 16] = "FirstPunctuation";
+ SyntaxKind[SyntaxKind["LastPunctuation"] = 69] = "LastPunctuation";
+ SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken";
+ SyntaxKind[SyntaxKind["LastToken"] = 139] = "LastToken";
+ SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken";
+ SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken";
+ SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken";
+ SyntaxKind[SyntaxKind["LastLiteralToken"] = 12] = "LastLiteralToken";
+ SyntaxKind[SyntaxKind["FirstTemplateToken"] = 12] = "FirstTemplateToken";
+ SyntaxKind[SyntaxKind["LastTemplateToken"] = 15] = "LastTemplateToken";
+ SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 26] = "FirstBinaryOperator";
+ SyntaxKind[SyntaxKind["LastBinaryOperator"] = 69] = "LastBinaryOperator";
+ SyntaxKind[SyntaxKind["FirstNode"] = 140] = "FirstNode";
+ SyntaxKind[SyntaxKind["FirstJSDocNode"] = 257] = "FirstJSDocNode";
+ SyntaxKind[SyntaxKind["LastJSDocNode"] = 282] = "LastJSDocNode";
+ SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 273] = "FirstJSDocTagNode";
+ SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 285] = "LastJSDocTagNode";
+ })(ts.SyntaxKind || (ts.SyntaxKind = {}));
+ var SyntaxKind = ts.SyntaxKind;
+ (function (NodeFlags) {
+ NodeFlags[NodeFlags["None"] = 0] = "None";
+ NodeFlags[NodeFlags["Let"] = 1] = "Let";
+ NodeFlags[NodeFlags["Const"] = 2] = "Const";
+ NodeFlags[NodeFlags["NestedNamespace"] = 4] = "NestedNamespace";
+ NodeFlags[NodeFlags["Synthesized"] = 8] = "Synthesized";
+ NodeFlags[NodeFlags["Namespace"] = 16] = "Namespace";
+ NodeFlags[NodeFlags["ExportContext"] = 32] = "ExportContext";
+ NodeFlags[NodeFlags["ContainsThis"] = 64] = "ContainsThis";
+ NodeFlags[NodeFlags["HasImplicitReturn"] = 128] = "HasImplicitReturn";
+ NodeFlags[NodeFlags["HasExplicitReturn"] = 256] = "HasExplicitReturn";
+ NodeFlags[NodeFlags["GlobalAugmentation"] = 512] = "GlobalAugmentation";
+ NodeFlags[NodeFlags["HasClassExtends"] = 1024] = "HasClassExtends";
+ NodeFlags[NodeFlags["HasDecorators"] = 2048] = "HasDecorators";
+ NodeFlags[NodeFlags["HasParamDecorators"] = 4096] = "HasParamDecorators";
+ NodeFlags[NodeFlags["HasAsyncFunctions"] = 8192] = "HasAsyncFunctions";
+ NodeFlags[NodeFlags["HasJsxSpreadAttributes"] = 16384] = "HasJsxSpreadAttributes";
+ NodeFlags[NodeFlags["DisallowInContext"] = 32768] = "DisallowInContext";
+ NodeFlags[NodeFlags["YieldContext"] = 65536] = "YieldContext";
+ NodeFlags[NodeFlags["DecoratorContext"] = 131072] = "DecoratorContext";
+ NodeFlags[NodeFlags["AwaitContext"] = 262144] = "AwaitContext";
+ NodeFlags[NodeFlags["ThisNodeHasError"] = 524288] = "ThisNodeHasError";
+ NodeFlags[NodeFlags["JavaScriptFile"] = 1048576] = "JavaScriptFile";
+ NodeFlags[NodeFlags["ThisNodeOrAnySubNodesHasError"] = 2097152] = "ThisNodeOrAnySubNodesHasError";
+ NodeFlags[NodeFlags["HasAggregatedChildData"] = 4194304] = "HasAggregatedChildData";
+ NodeFlags[NodeFlags["BlockScoped"] = 3] = "BlockScoped";
+ NodeFlags[NodeFlags["ReachabilityCheckFlags"] = 384] = "ReachabilityCheckFlags";
+ NodeFlags[NodeFlags["EmitHelperFlags"] = 31744] = "EmitHelperFlags";
+ NodeFlags[NodeFlags["ReachabilityAndEmitFlags"] = 32128] = "ReachabilityAndEmitFlags";
+ NodeFlags[NodeFlags["ContextFlags"] = 1540096] = "ContextFlags";
+ NodeFlags[NodeFlags["TypeExcludesFlags"] = 327680] = "TypeExcludesFlags";
+ })(ts.NodeFlags || (ts.NodeFlags = {}));
+ var NodeFlags = ts.NodeFlags;
+ (function (ModifierFlags) {
+ ModifierFlags[ModifierFlags["None"] = 0] = "None";
+ ModifierFlags[ModifierFlags["Export"] = 1] = "Export";
+ ModifierFlags[ModifierFlags["Ambient"] = 2] = "Ambient";
+ ModifierFlags[ModifierFlags["Public"] = 4] = "Public";
+ ModifierFlags[ModifierFlags["Private"] = 8] = "Private";
+ ModifierFlags[ModifierFlags["Protected"] = 16] = "Protected";
+ ModifierFlags[ModifierFlags["Static"] = 32] = "Static";
+ ModifierFlags[ModifierFlags["Readonly"] = 64] = "Readonly";
+ ModifierFlags[ModifierFlags["Abstract"] = 128] = "Abstract";
+ ModifierFlags[ModifierFlags["Async"] = 256] = "Async";
+ ModifierFlags[ModifierFlags["Default"] = 512] = "Default";
+ ModifierFlags[ModifierFlags["Const"] = 2048] = "Const";
+ ModifierFlags[ModifierFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags";
+ ModifierFlags[ModifierFlags["AccessibilityModifier"] = 28] = "AccessibilityModifier";
+ ModifierFlags[ModifierFlags["ParameterPropertyModifier"] = 92] = "ParameterPropertyModifier";
+ ModifierFlags[ModifierFlags["NonPublicAccessibilityModifier"] = 24] = "NonPublicAccessibilityModifier";
+ ModifierFlags[ModifierFlags["TypeScriptModifier"] = 2270] = "TypeScriptModifier";
+ })(ts.ModifierFlags || (ts.ModifierFlags = {}));
+ var ModifierFlags = ts.ModifierFlags;
+ (function (JsxFlags) {
+ JsxFlags[JsxFlags["None"] = 0] = "None";
+ JsxFlags[JsxFlags["IntrinsicNamedElement"] = 1] = "IntrinsicNamedElement";
+ JsxFlags[JsxFlags["IntrinsicIndexedElement"] = 2] = "IntrinsicIndexedElement";
+ JsxFlags[JsxFlags["IntrinsicElement"] = 3] = "IntrinsicElement";
+ })(ts.JsxFlags || (ts.JsxFlags = {}));
+ var JsxFlags = ts.JsxFlags;
+ (function (RelationComparisonResult) {
+ RelationComparisonResult[RelationComparisonResult["Succeeded"] = 1] = "Succeeded";
+ RelationComparisonResult[RelationComparisonResult["Failed"] = 2] = "Failed";
+ RelationComparisonResult[RelationComparisonResult["FailedAndReported"] = 3] = "FailedAndReported";
+ })(ts.RelationComparisonResult || (ts.RelationComparisonResult = {}));
+ var RelationComparisonResult = ts.RelationComparisonResult;
+ (function (GeneratedIdentifierKind) {
+ GeneratedIdentifierKind[GeneratedIdentifierKind["None"] = 0] = "None";
+ GeneratedIdentifierKind[GeneratedIdentifierKind["Auto"] = 1] = "Auto";
+ GeneratedIdentifierKind[GeneratedIdentifierKind["Loop"] = 2] = "Loop";
+ GeneratedIdentifierKind[GeneratedIdentifierKind["Unique"] = 3] = "Unique";
+ GeneratedIdentifierKind[GeneratedIdentifierKind["Node"] = 4] = "Node";
+ })(ts.GeneratedIdentifierKind || (ts.GeneratedIdentifierKind = {}));
+ var GeneratedIdentifierKind = ts.GeneratedIdentifierKind;
+ (function (FlowFlags) {
+ FlowFlags[FlowFlags["Unreachable"] = 1] = "Unreachable";
+ FlowFlags[FlowFlags["Start"] = 2] = "Start";
+ FlowFlags[FlowFlags["BranchLabel"] = 4] = "BranchLabel";
+ FlowFlags[FlowFlags["LoopLabel"] = 8] = "LoopLabel";
+ FlowFlags[FlowFlags["Assignment"] = 16] = "Assignment";
+ FlowFlags[FlowFlags["TrueCondition"] = 32] = "TrueCondition";
+ FlowFlags[FlowFlags["FalseCondition"] = 64] = "FalseCondition";
+ FlowFlags[FlowFlags["SwitchClause"] = 128] = "SwitchClause";
+ FlowFlags[FlowFlags["ArrayMutation"] = 256] = "ArrayMutation";
+ FlowFlags[FlowFlags["Referenced"] = 512] = "Referenced";
+ FlowFlags[FlowFlags["Shared"] = 1024] = "Shared";
+ FlowFlags[FlowFlags["Label"] = 12] = "Label";
+ FlowFlags[FlowFlags["Condition"] = 96] = "Condition";
+ })(ts.FlowFlags || (ts.FlowFlags = {}));
+ var FlowFlags = ts.FlowFlags;
var OperationCanceledException = (function () {
function OperationCanceledException() {
}
@@ -32,6 +444,38 @@ var ts;
ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated";
})(ts.ExitStatus || (ts.ExitStatus = {}));
var ExitStatus = ts.ExitStatus;
+ (function (TypeFormatFlags) {
+ TypeFormatFlags[TypeFormatFlags["None"] = 0] = "None";
+ TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 1] = "WriteArrayAsGenericType";
+ TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 2] = "UseTypeOfFunction";
+ TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 4] = "NoTruncation";
+ TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 8] = "WriteArrowStyleSignature";
+ TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 16] = "WriteOwnNameForAnyLike";
+ TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature";
+ TypeFormatFlags[TypeFormatFlags["InElementType"] = 64] = "InElementType";
+ TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 128] = "UseFullyQualifiedType";
+ TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 256] = "InFirstTypeArgument";
+ TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 512] = "InTypeAlias";
+ TypeFormatFlags[TypeFormatFlags["UseTypeAliasValue"] = 1024] = "UseTypeAliasValue";
+ })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {}));
+ var TypeFormatFlags = ts.TypeFormatFlags;
+ (function (SymbolFormatFlags) {
+ SymbolFormatFlags[SymbolFormatFlags["None"] = 0] = "None";
+ SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments";
+ SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing";
+ })(ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {}));
+ var SymbolFormatFlags = ts.SymbolFormatFlags;
+ (function (SymbolAccessibility) {
+ SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible";
+ SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible";
+ SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed";
+ })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {}));
+ var SymbolAccessibility = ts.SymbolAccessibility;
+ (function (TypePredicateKind) {
+ TypePredicateKind[TypePredicateKind["This"] = 0] = "This";
+ TypePredicateKind[TypePredicateKind["Identifier"] = 1] = "Identifier";
+ })(ts.TypePredicateKind || (ts.TypePredicateKind = {}));
+ var TypePredicateKind = ts.TypePredicateKind;
(function (TypeReferenceSerializationKind) {
TypeReferenceSerializationKind[TypeReferenceSerializationKind["Unknown"] = 0] = "Unknown";
TypeReferenceSerializationKind[TypeReferenceSerializationKind["TypeWithConstructSignatureAndValue"] = 1] = "TypeWithConstructSignatureAndValue";
@@ -46,6 +490,166 @@ var ts;
TypeReferenceSerializationKind[TypeReferenceSerializationKind["ObjectType"] = 10] = "ObjectType";
})(ts.TypeReferenceSerializationKind || (ts.TypeReferenceSerializationKind = {}));
var TypeReferenceSerializationKind = ts.TypeReferenceSerializationKind;
+ (function (SymbolFlags) {
+ SymbolFlags[SymbolFlags["None"] = 0] = "None";
+ SymbolFlags[SymbolFlags["FunctionScopedVariable"] = 1] = "FunctionScopedVariable";
+ SymbolFlags[SymbolFlags["BlockScopedVariable"] = 2] = "BlockScopedVariable";
+ SymbolFlags[SymbolFlags["Property"] = 4] = "Property";
+ SymbolFlags[SymbolFlags["EnumMember"] = 8] = "EnumMember";
+ SymbolFlags[SymbolFlags["Function"] = 16] = "Function";
+ SymbolFlags[SymbolFlags["Class"] = 32] = "Class";
+ SymbolFlags[SymbolFlags["Interface"] = 64] = "Interface";
+ SymbolFlags[SymbolFlags["ConstEnum"] = 128] = "ConstEnum";
+ SymbolFlags[SymbolFlags["RegularEnum"] = 256] = "RegularEnum";
+ SymbolFlags[SymbolFlags["ValueModule"] = 512] = "ValueModule";
+ SymbolFlags[SymbolFlags["NamespaceModule"] = 1024] = "NamespaceModule";
+ SymbolFlags[SymbolFlags["TypeLiteral"] = 2048] = "TypeLiteral";
+ SymbolFlags[SymbolFlags["ObjectLiteral"] = 4096] = "ObjectLiteral";
+ SymbolFlags[SymbolFlags["Method"] = 8192] = "Method";
+ SymbolFlags[SymbolFlags["Constructor"] = 16384] = "Constructor";
+ SymbolFlags[SymbolFlags["GetAccessor"] = 32768] = "GetAccessor";
+ SymbolFlags[SymbolFlags["SetAccessor"] = 65536] = "SetAccessor";
+ SymbolFlags[SymbolFlags["Signature"] = 131072] = "Signature";
+ SymbolFlags[SymbolFlags["TypeParameter"] = 262144] = "TypeParameter";
+ SymbolFlags[SymbolFlags["TypeAlias"] = 524288] = "TypeAlias";
+ SymbolFlags[SymbolFlags["ExportValue"] = 1048576] = "ExportValue";
+ SymbolFlags[SymbolFlags["ExportType"] = 2097152] = "ExportType";
+ SymbolFlags[SymbolFlags["ExportNamespace"] = 4194304] = "ExportNamespace";
+ SymbolFlags[SymbolFlags["Alias"] = 8388608] = "Alias";
+ SymbolFlags[SymbolFlags["Instantiated"] = 16777216] = "Instantiated";
+ SymbolFlags[SymbolFlags["Merged"] = 33554432] = "Merged";
+ SymbolFlags[SymbolFlags["Transient"] = 67108864] = "Transient";
+ SymbolFlags[SymbolFlags["Prototype"] = 134217728] = "Prototype";
+ SymbolFlags[SymbolFlags["SyntheticProperty"] = 268435456] = "SyntheticProperty";
+ SymbolFlags[SymbolFlags["Optional"] = 536870912] = "Optional";
+ SymbolFlags[SymbolFlags["ExportStar"] = 1073741824] = "ExportStar";
+ SymbolFlags[SymbolFlags["Enum"] = 384] = "Enum";
+ SymbolFlags[SymbolFlags["Variable"] = 3] = "Variable";
+ SymbolFlags[SymbolFlags["Value"] = 107455] = "Value";
+ SymbolFlags[SymbolFlags["Type"] = 793064] = "Type";
+ SymbolFlags[SymbolFlags["Namespace"] = 1920] = "Namespace";
+ SymbolFlags[SymbolFlags["Module"] = 1536] = "Module";
+ SymbolFlags[SymbolFlags["Accessor"] = 98304] = "Accessor";
+ SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = 107454] = "FunctionScopedVariableExcludes";
+ SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = 107455] = "BlockScopedVariableExcludes";
+ SymbolFlags[SymbolFlags["ParameterExcludes"] = 107455] = "ParameterExcludes";
+ SymbolFlags[SymbolFlags["PropertyExcludes"] = 0] = "PropertyExcludes";
+ SymbolFlags[SymbolFlags["EnumMemberExcludes"] = 900095] = "EnumMemberExcludes";
+ SymbolFlags[SymbolFlags["FunctionExcludes"] = 106927] = "FunctionExcludes";
+ SymbolFlags[SymbolFlags["ClassExcludes"] = 899519] = "ClassExcludes";
+ SymbolFlags[SymbolFlags["InterfaceExcludes"] = 792968] = "InterfaceExcludes";
+ SymbolFlags[SymbolFlags["RegularEnumExcludes"] = 899327] = "RegularEnumExcludes";
+ SymbolFlags[SymbolFlags["ConstEnumExcludes"] = 899967] = "ConstEnumExcludes";
+ SymbolFlags[SymbolFlags["ValueModuleExcludes"] = 106639] = "ValueModuleExcludes";
+ SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes";
+ SymbolFlags[SymbolFlags["MethodExcludes"] = 99263] = "MethodExcludes";
+ SymbolFlags[SymbolFlags["GetAccessorExcludes"] = 41919] = "GetAccessorExcludes";
+ SymbolFlags[SymbolFlags["SetAccessorExcludes"] = 74687] = "SetAccessorExcludes";
+ SymbolFlags[SymbolFlags["TypeParameterExcludes"] = 530920] = "TypeParameterExcludes";
+ SymbolFlags[SymbolFlags["TypeAliasExcludes"] = 793064] = "TypeAliasExcludes";
+ SymbolFlags[SymbolFlags["AliasExcludes"] = 8388608] = "AliasExcludes";
+ SymbolFlags[SymbolFlags["ModuleMember"] = 8914931] = "ModuleMember";
+ SymbolFlags[SymbolFlags["ExportHasLocal"] = 944] = "ExportHasLocal";
+ SymbolFlags[SymbolFlags["HasExports"] = 1952] = "HasExports";
+ SymbolFlags[SymbolFlags["HasMembers"] = 6240] = "HasMembers";
+ SymbolFlags[SymbolFlags["BlockScoped"] = 418] = "BlockScoped";
+ SymbolFlags[SymbolFlags["PropertyOrAccessor"] = 98308] = "PropertyOrAccessor";
+ SymbolFlags[SymbolFlags["Export"] = 7340032] = "Export";
+ SymbolFlags[SymbolFlags["ClassMember"] = 106500] = "ClassMember";
+ SymbolFlags[SymbolFlags["Classifiable"] = 788448] = "Classifiable";
+ })(ts.SymbolFlags || (ts.SymbolFlags = {}));
+ var SymbolFlags = ts.SymbolFlags;
+ (function (NodeCheckFlags) {
+ NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 1] = "TypeChecked";
+ NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 2] = "LexicalThis";
+ NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 4] = "CaptureThis";
+ NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 256] = "SuperInstance";
+ NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 512] = "SuperStatic";
+ NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 1024] = "ContextChecked";
+ NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuper"] = 2048] = "AsyncMethodWithSuper";
+ NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuperBinding"] = 4096] = "AsyncMethodWithSuperBinding";
+ NodeCheckFlags[NodeCheckFlags["CaptureArguments"] = 8192] = "CaptureArguments";
+ NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 16384] = "EnumValuesComputed";
+ NodeCheckFlags[NodeCheckFlags["LexicalModuleMergesWithClass"] = 32768] = "LexicalModuleMergesWithClass";
+ NodeCheckFlags[NodeCheckFlags["LoopWithCapturedBlockScopedBinding"] = 65536] = "LoopWithCapturedBlockScopedBinding";
+ NodeCheckFlags[NodeCheckFlags["CapturedBlockScopedBinding"] = 131072] = "CapturedBlockScopedBinding";
+ NodeCheckFlags[NodeCheckFlags["BlockScopedBindingInLoop"] = 262144] = "BlockScopedBindingInLoop";
+ NodeCheckFlags[NodeCheckFlags["ClassWithBodyScopedClassBinding"] = 524288] = "ClassWithBodyScopedClassBinding";
+ NodeCheckFlags[NodeCheckFlags["BodyScopedClassBinding"] = 1048576] = "BodyScopedClassBinding";
+ NodeCheckFlags[NodeCheckFlags["NeedsLoopOutParameter"] = 2097152] = "NeedsLoopOutParameter";
+ NodeCheckFlags[NodeCheckFlags["AssignmentsMarked"] = 4194304] = "AssignmentsMarked";
+ NodeCheckFlags[NodeCheckFlags["ClassWithConstructorReference"] = 8388608] = "ClassWithConstructorReference";
+ NodeCheckFlags[NodeCheckFlags["ConstructorReferenceInClass"] = 16777216] = "ConstructorReferenceInClass";
+ })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {}));
+ var NodeCheckFlags = ts.NodeCheckFlags;
+ (function (TypeFlags) {
+ TypeFlags[TypeFlags["Any"] = 1] = "Any";
+ TypeFlags[TypeFlags["String"] = 2] = "String";
+ TypeFlags[TypeFlags["Number"] = 4] = "Number";
+ TypeFlags[TypeFlags["Boolean"] = 8] = "Boolean";
+ TypeFlags[TypeFlags["Enum"] = 16] = "Enum";
+ TypeFlags[TypeFlags["StringLiteral"] = 32] = "StringLiteral";
+ TypeFlags[TypeFlags["NumberLiteral"] = 64] = "NumberLiteral";
+ TypeFlags[TypeFlags["BooleanLiteral"] = 128] = "BooleanLiteral";
+ TypeFlags[TypeFlags["EnumLiteral"] = 256] = "EnumLiteral";
+ TypeFlags[TypeFlags["ESSymbol"] = 512] = "ESSymbol";
+ TypeFlags[TypeFlags["Void"] = 1024] = "Void";
+ TypeFlags[TypeFlags["Undefined"] = 2048] = "Undefined";
+ TypeFlags[TypeFlags["Null"] = 4096] = "Null";
+ TypeFlags[TypeFlags["Never"] = 8192] = "Never";
+ TypeFlags[TypeFlags["TypeParameter"] = 16384] = "TypeParameter";
+ TypeFlags[TypeFlags["Class"] = 32768] = "Class";
+ TypeFlags[TypeFlags["Interface"] = 65536] = "Interface";
+ TypeFlags[TypeFlags["Reference"] = 131072] = "Reference";
+ TypeFlags[TypeFlags["Tuple"] = 262144] = "Tuple";
+ TypeFlags[TypeFlags["Union"] = 524288] = "Union";
+ TypeFlags[TypeFlags["Intersection"] = 1048576] = "Intersection";
+ TypeFlags[TypeFlags["Anonymous"] = 2097152] = "Anonymous";
+ TypeFlags[TypeFlags["Instantiated"] = 4194304] = "Instantiated";
+ TypeFlags[TypeFlags["ObjectLiteral"] = 8388608] = "ObjectLiteral";
+ TypeFlags[TypeFlags["FreshLiteral"] = 16777216] = "FreshLiteral";
+ TypeFlags[TypeFlags["ContainsWideningType"] = 33554432] = "ContainsWideningType";
+ TypeFlags[TypeFlags["ContainsObjectLiteral"] = 67108864] = "ContainsObjectLiteral";
+ TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 134217728] = "ContainsAnyFunctionType";
+ TypeFlags[TypeFlags["Nullable"] = 6144] = "Nullable";
+ TypeFlags[TypeFlags["Literal"] = 480] = "Literal";
+ TypeFlags[TypeFlags["StringOrNumberLiteral"] = 96] = "StringOrNumberLiteral";
+ TypeFlags[TypeFlags["DefinitelyFalsy"] = 7392] = "DefinitelyFalsy";
+ TypeFlags[TypeFlags["PossiblyFalsy"] = 7406] = "PossiblyFalsy";
+ TypeFlags[TypeFlags["Intrinsic"] = 16015] = "Intrinsic";
+ TypeFlags[TypeFlags["Primitive"] = 8190] = "Primitive";
+ TypeFlags[TypeFlags["StringLike"] = 34] = "StringLike";
+ TypeFlags[TypeFlags["NumberLike"] = 340] = "NumberLike";
+ TypeFlags[TypeFlags["BooleanLike"] = 136] = "BooleanLike";
+ TypeFlags[TypeFlags["EnumLike"] = 272] = "EnumLike";
+ TypeFlags[TypeFlags["ObjectType"] = 2588672] = "ObjectType";
+ TypeFlags[TypeFlags["UnionOrIntersection"] = 1572864] = "UnionOrIntersection";
+ TypeFlags[TypeFlags["StructuredType"] = 4161536] = "StructuredType";
+ TypeFlags[TypeFlags["StructuredOrTypeParameter"] = 4177920] = "StructuredOrTypeParameter";
+ TypeFlags[TypeFlags["Narrowable"] = 4178943] = "Narrowable";
+ TypeFlags[TypeFlags["NotUnionOrUnit"] = 2589185] = "NotUnionOrUnit";
+ TypeFlags[TypeFlags["RequiresWidening"] = 100663296] = "RequiresWidening";
+ TypeFlags[TypeFlags["PropagatingFlags"] = 234881024] = "PropagatingFlags";
+ })(ts.TypeFlags || (ts.TypeFlags = {}));
+ var TypeFlags = ts.TypeFlags;
+ (function (SignatureKind) {
+ SignatureKind[SignatureKind["Call"] = 0] = "Call";
+ SignatureKind[SignatureKind["Construct"] = 1] = "Construct";
+ })(ts.SignatureKind || (ts.SignatureKind = {}));
+ var SignatureKind = ts.SignatureKind;
+ (function (IndexKind) {
+ IndexKind[IndexKind["String"] = 0] = "String";
+ IndexKind[IndexKind["Number"] = 1] = "Number";
+ })(ts.IndexKind || (ts.IndexKind = {}));
+ var IndexKind = ts.IndexKind;
+ (function (SpecialPropertyAssignmentKind) {
+ SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["None"] = 0] = "None";
+ SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ExportsProperty"] = 1] = "ExportsProperty";
+ SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ModuleExports"] = 2] = "ModuleExports";
+ SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["PrototypeProperty"] = 3] = "PrototypeProperty";
+ SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ThisProperty"] = 4] = "ThisProperty";
+ })(ts.SpecialPropertyAssignmentKind || (ts.SpecialPropertyAssignmentKind = {}));
+ var SpecialPropertyAssignmentKind = ts.SpecialPropertyAssignmentKind;
(function (DiagnosticCategory) {
DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning";
DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error";
@@ -63,10 +667,267 @@ var ts;
ModuleKind[ModuleKind["AMD"] = 2] = "AMD";
ModuleKind[ModuleKind["UMD"] = 3] = "UMD";
ModuleKind[ModuleKind["System"] = 4] = "System";
- ModuleKind[ModuleKind["ES6"] = 5] = "ES6";
ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015";
})(ts.ModuleKind || (ts.ModuleKind = {}));
var ModuleKind = ts.ModuleKind;
+ (function (JsxEmit) {
+ JsxEmit[JsxEmit["None"] = 0] = "None";
+ JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve";
+ JsxEmit[JsxEmit["React"] = 2] = "React";
+ })(ts.JsxEmit || (ts.JsxEmit = {}));
+ var JsxEmit = ts.JsxEmit;
+ (function (NewLineKind) {
+ NewLineKind[NewLineKind["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed";
+ NewLineKind[NewLineKind["LineFeed"] = 1] = "LineFeed";
+ })(ts.NewLineKind || (ts.NewLineKind = {}));
+ var NewLineKind = ts.NewLineKind;
+ (function (ScriptKind) {
+ ScriptKind[ScriptKind["Unknown"] = 0] = "Unknown";
+ ScriptKind[ScriptKind["JS"] = 1] = "JS";
+ ScriptKind[ScriptKind["JSX"] = 2] = "JSX";
+ ScriptKind[ScriptKind["TS"] = 3] = "TS";
+ ScriptKind[ScriptKind["TSX"] = 4] = "TSX";
+ })(ts.ScriptKind || (ts.ScriptKind = {}));
+ var ScriptKind = ts.ScriptKind;
+ (function (ScriptTarget) {
+ ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3";
+ ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5";
+ ScriptTarget[ScriptTarget["ES2015"] = 2] = "ES2015";
+ ScriptTarget[ScriptTarget["ES2016"] = 3] = "ES2016";
+ ScriptTarget[ScriptTarget["ES2017"] = 4] = "ES2017";
+ ScriptTarget[ScriptTarget["Latest"] = 4] = "Latest";
+ })(ts.ScriptTarget || (ts.ScriptTarget = {}));
+ var ScriptTarget = ts.ScriptTarget;
+ (function (LanguageVariant) {
+ LanguageVariant[LanguageVariant["Standard"] = 0] = "Standard";
+ LanguageVariant[LanguageVariant["JSX"] = 1] = "JSX";
+ })(ts.LanguageVariant || (ts.LanguageVariant = {}));
+ var LanguageVariant = ts.LanguageVariant;
+ (function (DiagnosticStyle) {
+ DiagnosticStyle[DiagnosticStyle["Simple"] = 0] = "Simple";
+ DiagnosticStyle[DiagnosticStyle["Pretty"] = 1] = "Pretty";
+ })(ts.DiagnosticStyle || (ts.DiagnosticStyle = {}));
+ var DiagnosticStyle = ts.DiagnosticStyle;
+ (function (WatchDirectoryFlags) {
+ WatchDirectoryFlags[WatchDirectoryFlags["None"] = 0] = "None";
+ WatchDirectoryFlags[WatchDirectoryFlags["Recursive"] = 1] = "Recursive";
+ })(ts.WatchDirectoryFlags || (ts.WatchDirectoryFlags = {}));
+ var WatchDirectoryFlags = ts.WatchDirectoryFlags;
+ (function (CharacterCodes) {
+ CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter";
+ CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter";
+ CharacterCodes[CharacterCodes["lineFeed"] = 10] = "lineFeed";
+ CharacterCodes[CharacterCodes["carriageReturn"] = 13] = "carriageReturn";
+ CharacterCodes[CharacterCodes["lineSeparator"] = 8232] = "lineSeparator";
+ CharacterCodes[CharacterCodes["paragraphSeparator"] = 8233] = "paragraphSeparator";
+ CharacterCodes[CharacterCodes["nextLine"] = 133] = "nextLine";
+ CharacterCodes[CharacterCodes["space"] = 32] = "space";
+ CharacterCodes[CharacterCodes["nonBreakingSpace"] = 160] = "nonBreakingSpace";
+ CharacterCodes[CharacterCodes["enQuad"] = 8192] = "enQuad";
+ CharacterCodes[CharacterCodes["emQuad"] = 8193] = "emQuad";
+ CharacterCodes[CharacterCodes["enSpace"] = 8194] = "enSpace";
+ CharacterCodes[CharacterCodes["emSpace"] = 8195] = "emSpace";
+ CharacterCodes[CharacterCodes["threePerEmSpace"] = 8196] = "threePerEmSpace";
+ CharacterCodes[CharacterCodes["fourPerEmSpace"] = 8197] = "fourPerEmSpace";
+ CharacterCodes[CharacterCodes["sixPerEmSpace"] = 8198] = "sixPerEmSpace";
+ CharacterCodes[CharacterCodes["figureSpace"] = 8199] = "figureSpace";
+ CharacterCodes[CharacterCodes["punctuationSpace"] = 8200] = "punctuationSpace";
+ CharacterCodes[CharacterCodes["thinSpace"] = 8201] = "thinSpace";
+ CharacterCodes[CharacterCodes["hairSpace"] = 8202] = "hairSpace";
+ CharacterCodes[CharacterCodes["zeroWidthSpace"] = 8203] = "zeroWidthSpace";
+ CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 8239] = "narrowNoBreakSpace";
+ CharacterCodes[CharacterCodes["ideographicSpace"] = 12288] = "ideographicSpace";
+ CharacterCodes[CharacterCodes["mathematicalSpace"] = 8287] = "mathematicalSpace";
+ CharacterCodes[CharacterCodes["ogham"] = 5760] = "ogham";
+ CharacterCodes[CharacterCodes["_"] = 95] = "_";
+ CharacterCodes[CharacterCodes["$"] = 36] = "$";
+ CharacterCodes[CharacterCodes["_0"] = 48] = "_0";
+ CharacterCodes[CharacterCodes["_1"] = 49] = "_1";
+ CharacterCodes[CharacterCodes["_2"] = 50] = "_2";
+ CharacterCodes[CharacterCodes["_3"] = 51] = "_3";
+ CharacterCodes[CharacterCodes["_4"] = 52] = "_4";
+ CharacterCodes[CharacterCodes["_5"] = 53] = "_5";
+ CharacterCodes[CharacterCodes["_6"] = 54] = "_6";
+ CharacterCodes[CharacterCodes["_7"] = 55] = "_7";
+ CharacterCodes[CharacterCodes["_8"] = 56] = "_8";
+ CharacterCodes[CharacterCodes["_9"] = 57] = "_9";
+ CharacterCodes[CharacterCodes["a"] = 97] = "a";
+ CharacterCodes[CharacterCodes["b"] = 98] = "b";
+ CharacterCodes[CharacterCodes["c"] = 99] = "c";
+ CharacterCodes[CharacterCodes["d"] = 100] = "d";
+ CharacterCodes[CharacterCodes["e"] = 101] = "e";
+ CharacterCodes[CharacterCodes["f"] = 102] = "f";
+ CharacterCodes[CharacterCodes["g"] = 103] = "g";
+ CharacterCodes[CharacterCodes["h"] = 104] = "h";
+ CharacterCodes[CharacterCodes["i"] = 105] = "i";
+ CharacterCodes[CharacterCodes["j"] = 106] = "j";
+ CharacterCodes[CharacterCodes["k"] = 107] = "k";
+ CharacterCodes[CharacterCodes["l"] = 108] = "l";
+ CharacterCodes[CharacterCodes["m"] = 109] = "m";
+ CharacterCodes[CharacterCodes["n"] = 110] = "n";
+ CharacterCodes[CharacterCodes["o"] = 111] = "o";
+ CharacterCodes[CharacterCodes["p"] = 112] = "p";
+ CharacterCodes[CharacterCodes["q"] = 113] = "q";
+ CharacterCodes[CharacterCodes["r"] = 114] = "r";
+ CharacterCodes[CharacterCodes["s"] = 115] = "s";
+ CharacterCodes[CharacterCodes["t"] = 116] = "t";
+ CharacterCodes[CharacterCodes["u"] = 117] = "u";
+ CharacterCodes[CharacterCodes["v"] = 118] = "v";
+ CharacterCodes[CharacterCodes["w"] = 119] = "w";
+ CharacterCodes[CharacterCodes["x"] = 120] = "x";
+ CharacterCodes[CharacterCodes["y"] = 121] = "y";
+ CharacterCodes[CharacterCodes["z"] = 122] = "z";
+ CharacterCodes[CharacterCodes["A"] = 65] = "A";
+ CharacterCodes[CharacterCodes["B"] = 66] = "B";
+ CharacterCodes[CharacterCodes["C"] = 67] = "C";
+ CharacterCodes[CharacterCodes["D"] = 68] = "D";
+ CharacterCodes[CharacterCodes["E"] = 69] = "E";
+ CharacterCodes[CharacterCodes["F"] = 70] = "F";
+ CharacterCodes[CharacterCodes["G"] = 71] = "G";
+ CharacterCodes[CharacterCodes["H"] = 72] = "H";
+ CharacterCodes[CharacterCodes["I"] = 73] = "I";
+ CharacterCodes[CharacterCodes["J"] = 74] = "J";
+ CharacterCodes[CharacterCodes["K"] = 75] = "K";
+ CharacterCodes[CharacterCodes["L"] = 76] = "L";
+ CharacterCodes[CharacterCodes["M"] = 77] = "M";
+ CharacterCodes[CharacterCodes["N"] = 78] = "N";
+ CharacterCodes[CharacterCodes["O"] = 79] = "O";
+ CharacterCodes[CharacterCodes["P"] = 80] = "P";
+ CharacterCodes[CharacterCodes["Q"] = 81] = "Q";
+ CharacterCodes[CharacterCodes["R"] = 82] = "R";
+ CharacterCodes[CharacterCodes["S"] = 83] = "S";
+ CharacterCodes[CharacterCodes["T"] = 84] = "T";
+ CharacterCodes[CharacterCodes["U"] = 85] = "U";
+ CharacterCodes[CharacterCodes["V"] = 86] = "V";
+ CharacterCodes[CharacterCodes["W"] = 87] = "W";
+ CharacterCodes[CharacterCodes["X"] = 88] = "X";
+ CharacterCodes[CharacterCodes["Y"] = 89] = "Y";
+ CharacterCodes[CharacterCodes["Z"] = 90] = "Z";
+ CharacterCodes[CharacterCodes["ampersand"] = 38] = "ampersand";
+ CharacterCodes[CharacterCodes["asterisk"] = 42] = "asterisk";
+ CharacterCodes[CharacterCodes["at"] = 64] = "at";
+ CharacterCodes[CharacterCodes["backslash"] = 92] = "backslash";
+ CharacterCodes[CharacterCodes["backtick"] = 96] = "backtick";
+ CharacterCodes[CharacterCodes["bar"] = 124] = "bar";
+ CharacterCodes[CharacterCodes["caret"] = 94] = "caret";
+ CharacterCodes[CharacterCodes["closeBrace"] = 125] = "closeBrace";
+ CharacterCodes[CharacterCodes["closeBracket"] = 93] = "closeBracket";
+ CharacterCodes[CharacterCodes["closeParen"] = 41] = "closeParen";
+ CharacterCodes[CharacterCodes["colon"] = 58] = "colon";
+ CharacterCodes[CharacterCodes["comma"] = 44] = "comma";
+ CharacterCodes[CharacterCodes["dot"] = 46] = "dot";
+ CharacterCodes[CharacterCodes["doubleQuote"] = 34] = "doubleQuote";
+ CharacterCodes[CharacterCodes["equals"] = 61] = "equals";
+ CharacterCodes[CharacterCodes["exclamation"] = 33] = "exclamation";
+ CharacterCodes[CharacterCodes["greaterThan"] = 62] = "greaterThan";
+ CharacterCodes[CharacterCodes["hash"] = 35] = "hash";
+ CharacterCodes[CharacterCodes["lessThan"] = 60] = "lessThan";
+ CharacterCodes[CharacterCodes["minus"] = 45] = "minus";
+ CharacterCodes[CharacterCodes["openBrace"] = 123] = "openBrace";
+ CharacterCodes[CharacterCodes["openBracket"] = 91] = "openBracket";
+ CharacterCodes[CharacterCodes["openParen"] = 40] = "openParen";
+ CharacterCodes[CharacterCodes["percent"] = 37] = "percent";
+ CharacterCodes[CharacterCodes["plus"] = 43] = "plus";
+ CharacterCodes[CharacterCodes["question"] = 63] = "question";
+ CharacterCodes[CharacterCodes["semicolon"] = 59] = "semicolon";
+ CharacterCodes[CharacterCodes["singleQuote"] = 39] = "singleQuote";
+ CharacterCodes[CharacterCodes["slash"] = 47] = "slash";
+ CharacterCodes[CharacterCodes["tilde"] = 126] = "tilde";
+ CharacterCodes[CharacterCodes["backspace"] = 8] = "backspace";
+ CharacterCodes[CharacterCodes["formFeed"] = 12] = "formFeed";
+ CharacterCodes[CharacterCodes["byteOrderMark"] = 65279] = "byteOrderMark";
+ CharacterCodes[CharacterCodes["tab"] = 9] = "tab";
+ CharacterCodes[CharacterCodes["verticalTab"] = 11] = "verticalTab";
+ })(ts.CharacterCodes || (ts.CharacterCodes = {}));
+ var CharacterCodes = ts.CharacterCodes;
+ (function (TransformFlags) {
+ TransformFlags[TransformFlags["None"] = 0] = "None";
+ TransformFlags[TransformFlags["TypeScript"] = 1] = "TypeScript";
+ TransformFlags[TransformFlags["ContainsTypeScript"] = 2] = "ContainsTypeScript";
+ TransformFlags[TransformFlags["Jsx"] = 4] = "Jsx";
+ TransformFlags[TransformFlags["ContainsJsx"] = 8] = "ContainsJsx";
+ TransformFlags[TransformFlags["ES2017"] = 16] = "ES2017";
+ TransformFlags[TransformFlags["ContainsES2017"] = 32] = "ContainsES2017";
+ TransformFlags[TransformFlags["ES2016"] = 64] = "ES2016";
+ TransformFlags[TransformFlags["ContainsES2016"] = 128] = "ContainsES2016";
+ TransformFlags[TransformFlags["ES2015"] = 256] = "ES2015";
+ TransformFlags[TransformFlags["ContainsES2015"] = 512] = "ContainsES2015";
+ TransformFlags[TransformFlags["DestructuringAssignment"] = 1024] = "DestructuringAssignment";
+ TransformFlags[TransformFlags["Generator"] = 2048] = "Generator";
+ TransformFlags[TransformFlags["ContainsGenerator"] = 4096] = "ContainsGenerator";
+ TransformFlags[TransformFlags["ContainsDecorators"] = 8192] = "ContainsDecorators";
+ TransformFlags[TransformFlags["ContainsPropertyInitializer"] = 16384] = "ContainsPropertyInitializer";
+ TransformFlags[TransformFlags["ContainsLexicalThis"] = 32768] = "ContainsLexicalThis";
+ TransformFlags[TransformFlags["ContainsCapturedLexicalThis"] = 65536] = "ContainsCapturedLexicalThis";
+ TransformFlags[TransformFlags["ContainsLexicalThisInComputedPropertyName"] = 131072] = "ContainsLexicalThisInComputedPropertyName";
+ TransformFlags[TransformFlags["ContainsDefaultValueAssignments"] = 262144] = "ContainsDefaultValueAssignments";
+ TransformFlags[TransformFlags["ContainsParameterPropertyAssignments"] = 524288] = "ContainsParameterPropertyAssignments";
+ TransformFlags[TransformFlags["ContainsSpreadElementExpression"] = 1048576] = "ContainsSpreadElementExpression";
+ TransformFlags[TransformFlags["ContainsComputedPropertyName"] = 2097152] = "ContainsComputedPropertyName";
+ TransformFlags[TransformFlags["ContainsBlockScopedBinding"] = 4194304] = "ContainsBlockScopedBinding";
+ TransformFlags[TransformFlags["ContainsBindingPattern"] = 8388608] = "ContainsBindingPattern";
+ TransformFlags[TransformFlags["ContainsYield"] = 16777216] = "ContainsYield";
+ TransformFlags[TransformFlags["ContainsHoistedDeclarationOrCompletion"] = 33554432] = "ContainsHoistedDeclarationOrCompletion";
+ TransformFlags[TransformFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags";
+ TransformFlags[TransformFlags["AssertTypeScript"] = 3] = "AssertTypeScript";
+ TransformFlags[TransformFlags["AssertJsx"] = 12] = "AssertJsx";
+ TransformFlags[TransformFlags["AssertES2017"] = 48] = "AssertES2017";
+ TransformFlags[TransformFlags["AssertES2016"] = 192] = "AssertES2016";
+ TransformFlags[TransformFlags["AssertES2015"] = 768] = "AssertES2015";
+ TransformFlags[TransformFlags["AssertGenerator"] = 6144] = "AssertGenerator";
+ TransformFlags[TransformFlags["NodeExcludes"] = 536874325] = "NodeExcludes";
+ TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 592227669] = "ArrowFunctionExcludes";
+ TransformFlags[TransformFlags["FunctionExcludes"] = 592293205] = "FunctionExcludes";
+ TransformFlags[TransformFlags["ConstructorExcludes"] = 591760725] = "ConstructorExcludes";
+ TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 591760725] = "MethodOrAccessorExcludes";
+ TransformFlags[TransformFlags["ClassExcludes"] = 539749717] = "ClassExcludes";
+ TransformFlags[TransformFlags["ModuleExcludes"] = 574729557] = "ModuleExcludes";
+ TransformFlags[TransformFlags["TypeExcludes"] = -3] = "TypeExcludes";
+ TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 539110741] = "ObjectLiteralExcludes";
+ TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 537922901] = "ArrayLiteralOrCallOrNewExcludes";
+ TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 545262933] = "VariableDeclarationListExcludes";
+ TransformFlags[TransformFlags["ParameterExcludes"] = 545262933] = "ParameterExcludes";
+ TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 548864] = "TypeScriptClassSyntaxMask";
+ TransformFlags[TransformFlags["ES2015FunctionSyntaxMask"] = 327680] = "ES2015FunctionSyntaxMask";
+ })(ts.TransformFlags || (ts.TransformFlags = {}));
+ var TransformFlags = ts.TransformFlags;
+ (function (EmitFlags) {
+ EmitFlags[EmitFlags["EmitEmitHelpers"] = 1] = "EmitEmitHelpers";
+ EmitFlags[EmitFlags["EmitExportStar"] = 2] = "EmitExportStar";
+ EmitFlags[EmitFlags["EmitSuperHelper"] = 4] = "EmitSuperHelper";
+ EmitFlags[EmitFlags["EmitAdvancedSuperHelper"] = 8] = "EmitAdvancedSuperHelper";
+ EmitFlags[EmitFlags["UMDDefine"] = 16] = "UMDDefine";
+ EmitFlags[EmitFlags["SingleLine"] = 32] = "SingleLine";
+ EmitFlags[EmitFlags["AdviseOnEmitNode"] = 64] = "AdviseOnEmitNode";
+ EmitFlags[EmitFlags["NoSubstitution"] = 128] = "NoSubstitution";
+ EmitFlags[EmitFlags["CapturesThis"] = 256] = "CapturesThis";
+ EmitFlags[EmitFlags["NoLeadingSourceMap"] = 512] = "NoLeadingSourceMap";
+ EmitFlags[EmitFlags["NoTrailingSourceMap"] = 1024] = "NoTrailingSourceMap";
+ EmitFlags[EmitFlags["NoSourceMap"] = 1536] = "NoSourceMap";
+ EmitFlags[EmitFlags["NoNestedSourceMaps"] = 2048] = "NoNestedSourceMaps";
+ EmitFlags[EmitFlags["NoTokenLeadingSourceMaps"] = 4096] = "NoTokenLeadingSourceMaps";
+ EmitFlags[EmitFlags["NoTokenTrailingSourceMaps"] = 8192] = "NoTokenTrailingSourceMaps";
+ EmitFlags[EmitFlags["NoTokenSourceMaps"] = 12288] = "NoTokenSourceMaps";
+ EmitFlags[EmitFlags["NoLeadingComments"] = 16384] = "NoLeadingComments";
+ EmitFlags[EmitFlags["NoTrailingComments"] = 32768] = "NoTrailingComments";
+ EmitFlags[EmitFlags["NoComments"] = 49152] = "NoComments";
+ EmitFlags[EmitFlags["NoNestedComments"] = 65536] = "NoNestedComments";
+ EmitFlags[EmitFlags["ExportName"] = 131072] = "ExportName";
+ EmitFlags[EmitFlags["LocalName"] = 262144] = "LocalName";
+ EmitFlags[EmitFlags["Indented"] = 524288] = "Indented";
+ EmitFlags[EmitFlags["NoIndentation"] = 1048576] = "NoIndentation";
+ EmitFlags[EmitFlags["AsyncFunctionBody"] = 2097152] = "AsyncFunctionBody";
+ EmitFlags[EmitFlags["ReuseTempVariableScope"] = 4194304] = "ReuseTempVariableScope";
+ EmitFlags[EmitFlags["CustomPrologue"] = 8388608] = "CustomPrologue";
+ })(ts.EmitFlags || (ts.EmitFlags = {}));
+ var EmitFlags = ts.EmitFlags;
+ (function (EmitContext) {
+ EmitContext[EmitContext["SourceFile"] = 0] = "SourceFile";
+ EmitContext[EmitContext["Expression"] = 1] = "Expression";
+ EmitContext[EmitContext["IdentifierName"] = 2] = "IdentifierName";
+ EmitContext[EmitContext["Unspecified"] = 3] = "Unspecified";
+ })(ts.EmitContext || (ts.EmitContext = {}));
+ var EmitContext = ts.EmitContext;
})(ts || (ts = {}));
var ts;
(function (ts) {
@@ -77,7 +938,7 @@ var ts;
(function (performance) {
var profilerEvent = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true
? onProfilerEvent
- : function (markName) { };
+ : function (_markName) { };
var enabled = false;
var profilerStart = 0;
var counts;
@@ -129,7 +990,14 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
+ (function (Ternary) {
+ Ternary[Ternary["False"] = 0] = "False";
+ Ternary[Ternary["Maybe"] = 1] = "Maybe";
+ Ternary[Ternary["True"] = -1] = "True";
+ })(ts.Ternary || (ts.Ternary = {}));
+ var Ternary = ts.Ternary;
var createObject = Object.create;
+ ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined;
function createMap(template) {
var map = createObject(null);
map["__"] = undefined;
@@ -150,7 +1018,7 @@ var ts;
remove: remove,
forEachValue: forEachValueInMap,
getKeys: getKeys,
- clear: clear
+ clear: clear,
};
function forEachValueInMap(f) {
for (var key in files) {
@@ -192,6 +1060,12 @@ var ts;
return getCanonicalFileName(nonCanonicalizedPath);
}
ts.toPath = toPath;
+ (function (Comparison) {
+ Comparison[Comparison["LessThan"] = -1] = "LessThan";
+ Comparison[Comparison["EqualTo"] = 0] = "EqualTo";
+ Comparison[Comparison["GreaterThan"] = 1] = "GreaterThan";
+ })(ts.Comparison || (ts.Comparison = {}));
+ var Comparison = ts.Comparison;
function forEach(array, callback) {
if (array) {
for (var i = 0, len = array.length; i < len; i++) {
@@ -335,13 +1209,32 @@ var ts;
if (array) {
result = [];
for (var i = 0; i < array.length; i++) {
- var v = array[i];
- result.push(f(v, i));
+ result.push(f(array[i], i));
}
}
return result;
}
ts.map = map;
+ function sameMap(array, f) {
+ var result;
+ if (array) {
+ for (var i = 0; i < array.length; i++) {
+ if (result) {
+ result.push(f(array[i], i));
+ }
+ else {
+ var item = array[i];
+ var mapped = f(item, i);
+ if (item !== mapped) {
+ result = array.slice(0, i);
+ result.push(mapped);
+ }
+ }
+ }
+ }
+ return result || array;
+ }
+ ts.sameMap = sameMap;
function flatten(array) {
var result;
if (array) {
@@ -442,6 +1335,18 @@ var ts;
return result;
}
ts.mapObject = mapObject;
+ function some(array, predicate) {
+ if (array) {
+ for (var _i = 0, array_5 = array; _i < array_5.length; _i++) {
+ var v = array_5[_i];
+ if (!predicate || predicate(v)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ ts.some = some;
function concatenate(array1, array2) {
if (!array2 || !array2.length)
return array1;
@@ -454,8 +1359,8 @@ var ts;
var result;
if (array) {
result = [];
- loop: for (var _i = 0, array_5 = array; _i < array_5.length; _i++) {
- var item = array_5[_i];
+ loop: for (var _i = 0, array_6 = array; _i < array_6.length; _i++) {
+ var item = array_6[_i];
for (var _a = 0, result_1 = result; _a < result_1.length; _a++) {
var res = result_1[_a];
if (areEqual ? areEqual(res, item) : res === item) {
@@ -488,8 +1393,8 @@ var ts;
ts.compact = compact;
function sum(array, prop) {
var result = 0;
- for (var _i = 0, array_6 = array; _i < array_6.length; _i++) {
- var v = array_6[_i];
+ for (var _i = 0, array_7 = array; _i < array_7.length; _i++) {
+ var v = array_7[_i];
result += v[prop];
}
return result;
@@ -708,8 +1613,8 @@ var ts;
ts.equalOwnProperties = equalOwnProperties;
function arrayToMap(array, makeKey, makeValue) {
var result = createMap();
- for (var _i = 0, array_7 = array; _i < array_7.length; _i++) {
- var value = array_7[_i];
+ for (var _i = 0, array_8 = array; _i < array_8.length; _i++) {
+ var value = array_8[_i];
result[makeKey(value)] = makeValue ? makeValue(value) : value;
}
return result;
@@ -810,7 +1715,7 @@ var ts;
return function (t) { return compose(a(t)); };
}
else {
- return function (t) { return function (u) { return u; }; };
+ return function (_) { return function (u) { return u; }; };
}
}
ts.chain = chain;
@@ -841,7 +1746,7 @@ var ts;
ts.compose = compose;
function formatStringFromArgs(text, args, baseIndex) {
baseIndex = baseIndex || 0;
- return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; });
+ return text.replace(/{(\d+)}/g, function (_match, index) { return args[+index + baseIndex]; });
}
ts.localizedDiagnosticMessages = undefined;
function getLocaleSpecificMessage(message) {
@@ -866,11 +1771,11 @@ var ts;
length: length,
messageText: text,
category: message.category,
- code: message.code
+ code: message.code,
};
}
ts.createFileDiagnostic = createFileDiagnostic;
- function formatMessage(dummy, message) {
+ function formatMessage(_dummy, message) {
var text = getLocaleSpecificMessage(message);
if (arguments.length > 2) {
text = formatStringFromArgs(text, arguments, 2);
@@ -933,7 +1838,7 @@ var ts;
if (b === undefined)
return 1;
if (ignoreCase) {
- if (String.prototype.localeCompare) {
+ if (ts.collator && String.prototype.localeCompare) {
var result = a.localeCompare(b, undefined, { usage: "sort", sensitivity: "accent" });
return result < 0 ? -1 : result > 0 ? 1 : 0;
}
@@ -1086,7 +1991,7 @@ var ts;
function getEmitModuleKind(compilerOptions) {
return typeof compilerOptions.module === "number" ?
compilerOptions.module :
- getEmitScriptTarget(compilerOptions) === 2 ? ts.ModuleKind.ES6 : ts.ModuleKind.CommonJS;
+ getEmitScriptTarget(compilerOptions) >= 2 ? ts.ModuleKind.ES2015 : ts.ModuleKind.CommonJS;
}
ts.getEmitModuleKind = getEmitModuleKind;
function hasZeroOrOneAsteriskCharacter(str) {
@@ -1383,7 +2288,7 @@ var ts;
function replaceWildcardCharacter(match, singleAsteriskRegexFragment) {
return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match;
}
- function getFileMatcherPatterns(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {
+ function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {
path = normalizePath(path);
currentDirectory = normalizePath(currentDirectory);
var absolutePath = combinePaths(currentDirectory, path);
@@ -1398,7 +2303,7 @@ var ts;
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, getFileSystemEntries) {
path = normalizePath(path);
currentDirectory = normalizePath(currentDirectory);
- var patterns = getFileMatcherPatterns(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
+ var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
var regexFlag = useCaseSensitiveFileNames ? "" : "i";
var includeFileRegex = patterns.includeFilePattern && new RegExp(patterns.includeFilePattern, regexFlag);
var includeDirectoryRegex = patterns.includeDirectoryPattern && new RegExp(patterns.includeDirectoryPattern, regexFlag);
@@ -1508,6 +2413,14 @@ var ts;
return false;
}
ts.isSupportedSourceFileName = isSupportedSourceFileName;
+ (function (ExtensionPriority) {
+ ExtensionPriority[ExtensionPriority["TypeScriptFiles"] = 0] = "TypeScriptFiles";
+ ExtensionPriority[ExtensionPriority["DeclarationAndJavaScriptFiles"] = 2] = "DeclarationAndJavaScriptFiles";
+ ExtensionPriority[ExtensionPriority["Limit"] = 5] = "Limit";
+ ExtensionPriority[ExtensionPriority["Highest"] = 0] = "Highest";
+ ExtensionPriority[ExtensionPriority["Lowest"] = 2] = "Lowest";
+ })(ts.ExtensionPriority || (ts.ExtensionPriority = {}));
+ var ExtensionPriority = ts.ExtensionPriority;
function getExtensionPriority(path, supportedExtensions) {
for (var i = supportedExtensions.length - 1; i >= 0; i--) {
if (fileExtensionIs(path, supportedExtensions[i])) {
@@ -1571,10 +2484,10 @@ var ts;
this.name = name;
this.declarations = undefined;
}
- function Type(checker, flags) {
+ function Type(_checker, flags) {
this.flags = flags;
}
- function Signature(checker) {
+ function Signature() {
}
function Node(kind, pos, end) {
this.id = 0;
@@ -1596,6 +2509,13 @@ var ts;
getTypeConstructor: function () { return Type; },
getSignatureConstructor: function () { return Signature; }
};
+ (function (AssertionLevel) {
+ AssertionLevel[AssertionLevel["None"] = 0] = "None";
+ AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal";
+ AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive";
+ AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive";
+ })(ts.AssertionLevel || (ts.AssertionLevel = {}));
+ var AssertionLevel = ts.AssertionLevel;
var Debug;
(function (Debug) {
Debug.currentAssertionLevel = 0;
@@ -1908,7 +2828,7 @@ var ts;
}
var platform = _os.platform();
var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
- function readFile(fileName, encoding) {
+ function readFile(fileName, _encoding) {
if (!fileExists(fileName)) {
return undefined;
}
@@ -1980,6 +2900,11 @@ var ts;
function readDirectory(path, extensions, excludes, includes) {
return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), getAccessibleFileSystemEntries);
}
+ var FileSystemEntryKind;
+ (function (FileSystemEntryKind) {
+ FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File";
+ FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory";
+ })(FileSystemEntryKind || (FileSystemEntryKind = {}));
function fileSystemEntryExists(path, entryKind) {
try {
var stat = _fs.statSync(path);
@@ -2121,7 +3046,7 @@ var ts;
args: ChakraHost.args,
useCaseSensitiveFileNames: !!ChakraHost.useCaseSensitiveFileNames,
write: ChakraHost.echo,
- readFile: function (path, encoding) {
+ readFile: function (path, _encoding) {
return ChakraHost.readFile(path);
},
writeFile: function (path, data, writeByteOrderMark) {
@@ -2137,9 +3062,9 @@ var ts;
getExecutingFilePath: function () { return ChakraHost.executingFile; },
getCurrentDirectory: function () { return ChakraHost.currentDirectory; },
getDirectories: ChakraHost.getDirectories,
- getEnvironmentVariable: ChakraHost.getEnvironmentVariable || (function (name) { return ""; }),
+ getEnvironmentVariable: ChakraHost.getEnvironmentVariable || (function () { return ""; }),
readDirectory: function (path, extensions, excludes, includes) {
- var pattern = ts.getFileMatcherPatterns(path, extensions, excludes, includes, !!ChakraHost.useCaseSensitiveFileNames, ChakraHost.currentDirectory);
+ var pattern = ts.getFileMatcherPatterns(path, excludes, includes, !!ChakraHost.useCaseSensitiveFileNames, ChakraHost.currentDirectory);
return ChakraHost.readDirectory(path, extensions, pattern.basePaths, pattern.excludePattern, pattern.includeFilePattern, pattern.includeDirectoryPattern);
},
exit: ChakraHost.quit,
@@ -2927,7 +3852,7 @@ var ts;
Binding_element_0_implicitly_has_an_1_type: { code: 7031, category: ts.DiagnosticCategory.Error, key: "Binding_element_0_implicitly_has_an_1_type_7031", message: "Binding element '{0}' implicitly has an '{1}' type." },
Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: { code: 7032, category: ts.DiagnosticCategory.Error, key: "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032", message: "Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation." },
Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: { code: 7033, category: ts.DiagnosticCategory.Error, key: "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033", message: "Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation." },
- Variable_0_implicitly_has_type_any_in_some_locations_where_its_type_cannot_be_determined: { code: 7034, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_type_any_in_some_locations_where_its_type_cannot_be_determined_7034", message: "Variable '{0}' implicitly has type 'any' in some locations where its type cannot be determined." },
+ Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: { code: 7034, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", message: "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined." },
You_cannot_rename_this_element: { code: 8000, category: ts.DiagnosticCategory.Error, key: "You_cannot_rename_this_element_8000", message: "You cannot rename this element." },
You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: ts.DiagnosticCategory.Error, key: "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", message: "You cannot rename elements that are defined in the standard TypeScript library." },
import_can_only_be_used_in_a_ts_file: { code: 8002, category: ts.DiagnosticCategory.Error, key: "import_can_only_be_used_in_a_ts_file_8002", message: "'import ... =' can only be used in a .ts file." },
@@ -2964,3022 +3889,12 @@ var ts;
Remove_unused_identifiers: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_unused_identifiers_90004", message: "Remove unused identifiers" },
Implement_interface_on_reference: { code: 90005, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_reference_90005", message: "Implement interface on reference" },
Implement_interface_on_class: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_class_90006", message: "Implement interface on class" },
- Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" }
+ Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" },
};
})(ts || (ts = {}));
var ts;
(function (ts) {
- function tokenIsIdentifierOrKeyword(token) {
- return token >= 69;
- }
- ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword;
- var textToToken = ts.createMap({
- "abstract": 115,
- "any": 117,
- "as": 116,
- "boolean": 120,
- "break": 70,
- "case": 71,
- "catch": 72,
- "class": 73,
- "continue": 75,
- "const": 74,
- "constructor": 121,
- "debugger": 76,
- "declare": 122,
- "default": 77,
- "delete": 78,
- "do": 79,
- "else": 80,
- "enum": 81,
- "export": 82,
- "extends": 83,
- "false": 84,
- "finally": 85,
- "for": 86,
- "from": 136,
- "function": 87,
- "get": 123,
- "if": 88,
- "implements": 106,
- "import": 89,
- "in": 90,
- "instanceof": 91,
- "interface": 107,
- "is": 124,
- "let": 108,
- "module": 125,
- "namespace": 126,
- "never": 127,
- "new": 92,
- "null": 93,
- "number": 130,
- "package": 109,
- "private": 110,
- "protected": 111,
- "public": 112,
- "readonly": 128,
- "require": 129,
- "global": 137,
- "return": 94,
- "set": 131,
- "static": 113,
- "string": 132,
- "super": 95,
- "switch": 96,
- "symbol": 133,
- "this": 97,
- "throw": 98,
- "true": 99,
- "try": 100,
- "type": 134,
- "typeof": 101,
- "undefined": 135,
- "var": 102,
- "void": 103,
- "while": 104,
- "with": 105,
- "yield": 114,
- "async": 118,
- "await": 119,
- "of": 138,
- "{": 15,
- "}": 16,
- "(": 17,
- ")": 18,
- "[": 19,
- "]": 20,
- ".": 21,
- "...": 22,
- ";": 23,
- ",": 24,
- "<": 25,
- ">": 27,
- "<=": 28,
- ">=": 29,
- "==": 30,
- "!=": 31,
- "===": 32,
- "!==": 33,
- "=>": 34,
- "+": 35,
- "-": 36,
- "**": 38,
- "*": 37,
- "/": 39,
- "%": 40,
- "++": 41,
- "--": 42,
- "<<": 43,
- "": 26,
- ">>": 44,
- ">>>": 45,
- "&": 46,
- "|": 47,
- "^": 48,
- "!": 49,
- "~": 50,
- "&&": 51,
- "||": 52,
- "?": 53,
- ":": 54,
- "=": 56,
- "+=": 57,
- "-=": 58,
- "*=": 59,
- "**=": 60,
- "/=": 61,
- "%=": 62,
- "<<=": 63,
- ">>=": 64,
- ">>>=": 65,
- "&=": 66,
- "|=": 67,
- "^=": 68,
- "@": 55
- });
- var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
- var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
- var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
- var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
- function lookupInUnicodeMap(code, map) {
- if (code < map[0]) {
- return false;
- }
- var lo = 0;
- var hi = map.length;
- var mid;
- while (lo + 1 < hi) {
- mid = lo + (hi - lo) / 2;
- mid -= mid % 2;
- if (map[mid] <= code && code <= map[mid + 1]) {
- return true;
- }
- if (code < map[mid]) {
- hi = mid;
- }
- else {
- lo = mid + 2;
- }
- }
- return false;
- }
- function isUnicodeIdentifierStart(code, languageVersion) {
- return languageVersion >= 1 ?
- lookupInUnicodeMap(code, unicodeES5IdentifierStart) :
- lookupInUnicodeMap(code, unicodeES3IdentifierStart);
- }
- ts.isUnicodeIdentifierStart = isUnicodeIdentifierStart;
- function isUnicodeIdentifierPart(code, languageVersion) {
- return languageVersion >= 1 ?
- lookupInUnicodeMap(code, unicodeES5IdentifierPart) :
- lookupInUnicodeMap(code, unicodeES3IdentifierPart);
- }
- function makeReverseMap(source) {
- var result = [];
- for (var name_4 in source) {
- result[source[name_4]] = name_4;
- }
- return result;
- }
- var tokenStrings = makeReverseMap(textToToken);
- function tokenToString(t) {
- return tokenStrings[t];
- }
- ts.tokenToString = tokenToString;
- function stringToToken(s) {
- return textToToken[s];
- }
- ts.stringToToken = stringToToken;
- function computeLineStarts(text) {
- var result = new Array();
- var pos = 0;
- var lineStart = 0;
- while (pos < text.length) {
- var ch = text.charCodeAt(pos);
- pos++;
- switch (ch) {
- case 13:
- if (text.charCodeAt(pos) === 10) {
- pos++;
- }
- case 10:
- result.push(lineStart);
- lineStart = pos;
- break;
- default:
- if (ch > 127 && isLineBreak(ch)) {
- result.push(lineStart);
- lineStart = pos;
- }
- break;
- }
- }
- result.push(lineStart);
- return result;
- }
- ts.computeLineStarts = computeLineStarts;
- function getPositionOfLineAndCharacter(sourceFile, line, character) {
- return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character);
- }
- ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter;
- function computePositionOfLineAndCharacter(lineStarts, line, character) {
- ts.Debug.assert(line >= 0 && line < lineStarts.length);
- return lineStarts[line] + character;
- }
- ts.computePositionOfLineAndCharacter = computePositionOfLineAndCharacter;
- function getLineStarts(sourceFile) {
- return sourceFile.lineMap || (sourceFile.lineMap = computeLineStarts(sourceFile.text));
- }
- ts.getLineStarts = getLineStarts;
- function computeLineAndCharacterOfPosition(lineStarts, position) {
- var lineNumber = ts.binarySearch(lineStarts, position);
- if (lineNumber < 0) {
- lineNumber = ~lineNumber - 1;
- ts.Debug.assert(lineNumber !== -1, "position cannot precede the beginning of the file");
- }
- return {
- line: lineNumber,
- character: position - lineStarts[lineNumber]
- };
- }
- ts.computeLineAndCharacterOfPosition = computeLineAndCharacterOfPosition;
- function getLineAndCharacterOfPosition(sourceFile, position) {
- return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position);
- }
- ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition;
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function isWhiteSpace(ch) {
- return isWhiteSpaceSingleLine(ch) || isLineBreak(ch);
- }
- ts.isWhiteSpace = isWhiteSpace;
- function isWhiteSpaceSingleLine(ch) {
- return ch === 32 ||
- ch === 9 ||
- ch === 11 ||
- ch === 12 ||
- ch === 160 ||
- ch === 133 ||
- ch === 5760 ||
- ch >= 8192 && ch <= 8203 ||
- ch === 8239 ||
- ch === 8287 ||
- ch === 12288 ||
- ch === 65279;
- }
- ts.isWhiteSpaceSingleLine = isWhiteSpaceSingleLine;
- function isLineBreak(ch) {
- return ch === 10 ||
- ch === 13 ||
- ch === 8232 ||
- ch === 8233;
- }
- ts.isLineBreak = isLineBreak;
- function isDigit(ch) {
- return ch >= 48 && ch <= 57;
- }
- function isOctalDigit(ch) {
- return ch >= 48 && ch <= 55;
- }
- ts.isOctalDigit = isOctalDigit;
- function couldStartTrivia(text, pos) {
- var ch = text.charCodeAt(pos);
- switch (ch) {
- case 13:
- case 10:
- case 9:
- case 11:
- case 12:
- case 32:
- case 47:
- case 60:
- case 61:
- case 62:
- return true;
- case 35:
- return pos === 0;
- default:
- return ch > 127;
- }
- }
- ts.couldStartTrivia = couldStartTrivia;
- function skipTrivia(text, pos, stopAfterLineBreak, stopAtComments) {
- if (stopAtComments === void 0) { stopAtComments = false; }
- if (ts.positionIsSynthesized(pos)) {
- return pos;
- }
- while (true) {
- var ch = text.charCodeAt(pos);
- switch (ch) {
- case 13:
- if (text.charCodeAt(pos + 1) === 10) {
- pos++;
- }
- case 10:
- pos++;
- if (stopAfterLineBreak) {
- return pos;
- }
- continue;
- case 9:
- case 11:
- case 12:
- case 32:
- pos++;
- continue;
- case 47:
- if (stopAtComments) {
- break;
- }
- if (text.charCodeAt(pos + 1) === 47) {
- pos += 2;
- while (pos < text.length) {
- if (isLineBreak(text.charCodeAt(pos))) {
- break;
- }
- pos++;
- }
- continue;
- }
- if (text.charCodeAt(pos + 1) === 42) {
- pos += 2;
- while (pos < text.length) {
- if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) {
- pos += 2;
- break;
- }
- pos++;
- }
- continue;
- }
- break;
- case 60:
- case 61:
- case 62:
- if (isConflictMarkerTrivia(text, pos)) {
- pos = scanConflictMarkerTrivia(text, pos);
- continue;
- }
- break;
- case 35:
- if (pos === 0 && isShebangTrivia(text, pos)) {
- pos = scanShebangTrivia(text, pos);
- continue;
- }
- break;
- default:
- if (ch > 127 && (isWhiteSpace(ch))) {
- pos++;
- continue;
- }
- break;
- }
- return pos;
- }
- }
- ts.skipTrivia = skipTrivia;
- var mergeConflictMarkerLength = "<<<<<<<".length;
- function isConflictMarkerTrivia(text, pos) {
- ts.Debug.assert(pos >= 0);
- if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) {
- var ch = text.charCodeAt(pos);
- if ((pos + mergeConflictMarkerLength) < text.length) {
- for (var i = 0, n = mergeConflictMarkerLength; i < n; i++) {
- if (text.charCodeAt(pos + i) !== ch) {
- return false;
- }
- }
- return ch === 61 ||
- text.charCodeAt(pos + mergeConflictMarkerLength) === 32;
- }
- }
- return false;
- }
- function scanConflictMarkerTrivia(text, pos, error) {
- if (error) {
- error(ts.Diagnostics.Merge_conflict_marker_encountered, mergeConflictMarkerLength);
- }
- var ch = text.charCodeAt(pos);
- var len = text.length;
- if (ch === 60 || ch === 62) {
- while (pos < len && !isLineBreak(text.charCodeAt(pos))) {
- pos++;
- }
- }
- else {
- ts.Debug.assert(ch === 61);
- while (pos < len) {
- var ch_1 = text.charCodeAt(pos);
- if (ch_1 === 62 && isConflictMarkerTrivia(text, pos)) {
- break;
- }
- pos++;
- }
- }
- return pos;
- }
- var shebangTriviaRegex = /^#!.*/;
- function isShebangTrivia(text, pos) {
- ts.Debug.assert(pos === 0);
- return shebangTriviaRegex.test(text);
- }
- function scanShebangTrivia(text, pos) {
- var shebang = shebangTriviaRegex.exec(text)[0];
- pos = pos + shebang.length;
- return pos;
- }
- function iterateCommentRanges(reduce, text, pos, trailing, cb, state, initial) {
- var pendingPos;
- var pendingEnd;
- var pendingKind;
- var pendingHasTrailingNewLine;
- var hasPendingCommentRange = false;
- var collecting = trailing || pos === 0;
- var accumulator = initial;
- scan: while (pos >= 0 && pos < text.length) {
- var ch = text.charCodeAt(pos);
- switch (ch) {
- case 13:
- if (text.charCodeAt(pos + 1) === 10) {
- pos++;
- }
- case 10:
- pos++;
- if (trailing) {
- break scan;
- }
- collecting = true;
- if (hasPendingCommentRange) {
- pendingHasTrailingNewLine = true;
- }
- continue;
- case 9:
- case 11:
- case 12:
- case 32:
- pos++;
- continue;
- case 47:
- var nextChar = text.charCodeAt(pos + 1);
- var hasTrailingNewLine = false;
- if (nextChar === 47 || nextChar === 42) {
- var kind = nextChar === 47 ? 2 : 3;
- var startPos = pos;
- pos += 2;
- if (nextChar === 47) {
- while (pos < text.length) {
- if (isLineBreak(text.charCodeAt(pos))) {
- hasTrailingNewLine = true;
- break;
- }
- pos++;
- }
- }
- else {
- while (pos < text.length) {
- if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) {
- pos += 2;
- break;
- }
- pos++;
- }
- }
- if (collecting) {
- if (hasPendingCommentRange) {
- accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator);
- if (!reduce && accumulator) {
- return accumulator;
- }
- hasPendingCommentRange = false;
- }
- pendingPos = startPos;
- pendingEnd = pos;
- pendingKind = kind;
- pendingHasTrailingNewLine = hasTrailingNewLine;
- hasPendingCommentRange = true;
- }
- continue;
- }
- break scan;
- default:
- if (ch > 127 && (isWhiteSpace(ch))) {
- if (hasPendingCommentRange && isLineBreak(ch)) {
- pendingHasTrailingNewLine = true;
- }
- pos++;
- continue;
- }
- break scan;
- }
- }
- if (hasPendingCommentRange) {
- accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator);
- }
- return accumulator;
- }
- function forEachLeadingCommentRange(text, pos, cb, state) {
- return iterateCommentRanges(false, text, pos, false, cb, state);
- }
- ts.forEachLeadingCommentRange = forEachLeadingCommentRange;
- function forEachTrailingCommentRange(text, pos, cb, state) {
- return iterateCommentRanges(false, text, pos, true, cb, state);
- }
- ts.forEachTrailingCommentRange = forEachTrailingCommentRange;
- function reduceEachLeadingCommentRange(text, pos, cb, state, initial) {
- return iterateCommentRanges(true, text, pos, false, cb, state, initial);
- }
- ts.reduceEachLeadingCommentRange = reduceEachLeadingCommentRange;
- function reduceEachTrailingCommentRange(text, pos, cb, state, initial) {
- return iterateCommentRanges(true, text, pos, true, cb, state, initial);
- }
- ts.reduceEachTrailingCommentRange = reduceEachTrailingCommentRange;
- function appendCommentRange(pos, end, kind, hasTrailingNewLine, state, comments) {
- if (!comments) {
- comments = [];
- }
- comments.push({ pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine, kind: kind });
- return comments;
- }
- function getLeadingCommentRanges(text, pos) {
- return reduceEachLeadingCommentRange(text, pos, appendCommentRange, undefined, undefined);
- }
- ts.getLeadingCommentRanges = getLeadingCommentRanges;
- function getTrailingCommentRanges(text, pos) {
- return reduceEachTrailingCommentRange(text, pos, appendCommentRange, undefined, undefined);
- }
- ts.getTrailingCommentRanges = getTrailingCommentRanges;
- function getShebang(text) {
- return shebangTriviaRegex.test(text)
- ? shebangTriviaRegex.exec(text)[0]
- : undefined;
- }
- ts.getShebang = getShebang;
- function isIdentifierStart(ch, languageVersion) {
- return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 ||
- ch === 36 || ch === 95 ||
- ch > 127 && isUnicodeIdentifierStart(ch, languageVersion);
- }
- ts.isIdentifierStart = isIdentifierStart;
- function isIdentifierPart(ch, languageVersion) {
- return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 ||
- ch >= 48 && ch <= 57 || ch === 36 || ch === 95 ||
- ch > 127 && isUnicodeIdentifierPart(ch, languageVersion);
- }
- ts.isIdentifierPart = isIdentifierPart;
- function isIdentifierText(name, languageVersion) {
- if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) {
- return false;
- }
- for (var i = 1, n = name.length; i < n; i++) {
- if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) {
- return false;
- }
- }
- return true;
- }
- ts.isIdentifierText = isIdentifierText;
- function createScanner(languageVersion, skipTrivia, languageVariant, text, onError, start, length) {
- if (languageVariant === void 0) { languageVariant = 0; }
- var pos;
- var end;
- var startPos;
- var tokenPos;
- var token;
- var tokenValue;
- var precedingLineBreak;
- var hasExtendedUnicodeEscape;
- var tokenIsUnterminated;
- setText(text, start, length);
- return {
- getStartPos: function () { return startPos; },
- getTextPos: function () { return pos; },
- getToken: function () { return token; },
- getTokenPos: function () { return tokenPos; },
- getTokenText: function () { return text.substring(tokenPos, pos); },
- getTokenValue: function () { return tokenValue; },
- hasExtendedUnicodeEscape: function () { return hasExtendedUnicodeEscape; },
- hasPrecedingLineBreak: function () { return precedingLineBreak; },
- isIdentifier: function () { return token === 69 || token > 105; },
- isReservedWord: function () { return token >= 70 && token <= 105; },
- isUnterminated: function () { return tokenIsUnterminated; },
- reScanGreaterToken: reScanGreaterToken,
- reScanSlashToken: reScanSlashToken,
- reScanTemplateToken: reScanTemplateToken,
- scanJsxIdentifier: scanJsxIdentifier,
- scanJsxAttributeValue: scanJsxAttributeValue,
- reScanJsxToken: reScanJsxToken,
- scanJsxToken: scanJsxToken,
- scanJSDocToken: scanJSDocToken,
- scan: scan,
- getText: getText,
- setText: setText,
- setScriptTarget: setScriptTarget,
- setLanguageVariant: setLanguageVariant,
- setOnError: setOnError,
- setTextPos: setTextPos,
- tryScan: tryScan,
- lookAhead: lookAhead,
- scanRange: scanRange
- };
- function error(message, length) {
- if (onError) {
- onError(message, length || 0);
- }
- }
- function scanNumber() {
- var start = pos;
- while (isDigit(text.charCodeAt(pos)))
- pos++;
- if (text.charCodeAt(pos) === 46) {
- pos++;
- while (isDigit(text.charCodeAt(pos)))
- pos++;
- }
- var end = pos;
- if (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101) {
- pos++;
- if (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45)
- pos++;
- if (isDigit(text.charCodeAt(pos))) {
- pos++;
- while (isDigit(text.charCodeAt(pos)))
- pos++;
- end = pos;
- }
- else {
- error(ts.Diagnostics.Digit_expected);
- }
- }
- return "" + +(text.substring(start, end));
- }
- function scanOctalDigits() {
- var start = pos;
- while (isOctalDigit(text.charCodeAt(pos))) {
- pos++;
- }
- return +(text.substring(start, pos));
- }
- function scanExactNumberOfHexDigits(count) {
- return scanHexDigits(count, false);
- }
- function scanMinimumNumberOfHexDigits(count) {
- return scanHexDigits(count, true);
- }
- function scanHexDigits(minCount, scanAsManyAsPossible) {
- var digits = 0;
- var value = 0;
- while (digits < minCount || scanAsManyAsPossible) {
- var ch = text.charCodeAt(pos);
- if (ch >= 48 && ch <= 57) {
- value = value * 16 + ch - 48;
- }
- else if (ch >= 65 && ch <= 70) {
- value = value * 16 + ch - 65 + 10;
- }
- else if (ch >= 97 && ch <= 102) {
- value = value * 16 + ch - 97 + 10;
- }
- else {
- break;
- }
- pos++;
- digits++;
- }
- if (digits < minCount) {
- value = -1;
- }
- return value;
- }
- function scanString(allowEscapes) {
- if (allowEscapes === void 0) { allowEscapes = true; }
- var quote = text.charCodeAt(pos);
- pos++;
- var result = "";
- var start = pos;
- while (true) {
- if (pos >= end) {
- result += text.substring(start, pos);
- tokenIsUnterminated = true;
- error(ts.Diagnostics.Unterminated_string_literal);
- break;
- }
- var ch = text.charCodeAt(pos);
- if (ch === quote) {
- result += text.substring(start, pos);
- pos++;
- break;
- }
- if (ch === 92 && allowEscapes) {
- result += text.substring(start, pos);
- result += scanEscapeSequence();
- start = pos;
- continue;
- }
- if (isLineBreak(ch)) {
- result += text.substring(start, pos);
- tokenIsUnterminated = true;
- error(ts.Diagnostics.Unterminated_string_literal);
- break;
- }
- pos++;
- }
- return result;
- }
- function scanTemplateAndSetTokenValue() {
- var startedWithBacktick = text.charCodeAt(pos) === 96;
- pos++;
- var start = pos;
- var contents = "";
- var resultingToken;
- while (true) {
- if (pos >= end) {
- contents += text.substring(start, pos);
- tokenIsUnterminated = true;
- error(ts.Diagnostics.Unterminated_template_literal);
- resultingToken = startedWithBacktick ? 11 : 14;
- break;
- }
- var currChar = text.charCodeAt(pos);
- if (currChar === 96) {
- contents += text.substring(start, pos);
- pos++;
- resultingToken = startedWithBacktick ? 11 : 14;
- break;
- }
- if (currChar === 36 && pos + 1 < end && text.charCodeAt(pos + 1) === 123) {
- contents += text.substring(start, pos);
- pos += 2;
- resultingToken = startedWithBacktick ? 12 : 13;
- break;
- }
- if (currChar === 92) {
- contents += text.substring(start, pos);
- contents += scanEscapeSequence();
- start = pos;
- continue;
- }
- if (currChar === 13) {
- contents += text.substring(start, pos);
- pos++;
- if (pos < end && text.charCodeAt(pos) === 10) {
- pos++;
- }
- contents += "\n";
- start = pos;
- continue;
- }
- pos++;
- }
- ts.Debug.assert(resultingToken !== undefined);
- tokenValue = contents;
- return resultingToken;
- }
- function scanEscapeSequence() {
- pos++;
- if (pos >= end) {
- error(ts.Diagnostics.Unexpected_end_of_text);
- return "";
- }
- var ch = text.charCodeAt(pos);
- pos++;
- switch (ch) {
- case 48:
- return "\0";
- case 98:
- return "\b";
- case 116:
- return "\t";
- case 110:
- return "\n";
- case 118:
- return "\v";
- case 102:
- return "\f";
- case 114:
- return "\r";
- case 39:
- return "\'";
- case 34:
- return "\"";
- case 117:
- if (pos < end && text.charCodeAt(pos) === 123) {
- hasExtendedUnicodeEscape = true;
- pos++;
- return scanExtendedUnicodeEscape();
- }
- return scanHexadecimalEscape(4);
- case 120:
- return scanHexadecimalEscape(2);
- case 13:
- if (pos < end && text.charCodeAt(pos) === 10) {
- pos++;
- }
- case 10:
- case 8232:
- case 8233:
- return "";
- default:
- return String.fromCharCode(ch);
- }
- }
- function scanHexadecimalEscape(numDigits) {
- var escapedValue = scanExactNumberOfHexDigits(numDigits);
- if (escapedValue >= 0) {
- return String.fromCharCode(escapedValue);
- }
- else {
- error(ts.Diagnostics.Hexadecimal_digit_expected);
- return "";
- }
- }
- function scanExtendedUnicodeEscape() {
- var escapedValue = scanMinimumNumberOfHexDigits(1);
- var isInvalidExtendedEscape = false;
- if (escapedValue < 0) {
- error(ts.Diagnostics.Hexadecimal_digit_expected);
- isInvalidExtendedEscape = true;
- }
- else if (escapedValue > 0x10FFFF) {
- error(ts.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
- isInvalidExtendedEscape = true;
- }
- if (pos >= end) {
- error(ts.Diagnostics.Unexpected_end_of_text);
- isInvalidExtendedEscape = true;
- }
- else if (text.charCodeAt(pos) === 125) {
- pos++;
- }
- else {
- error(ts.Diagnostics.Unterminated_Unicode_escape_sequence);
- isInvalidExtendedEscape = true;
- }
- if (isInvalidExtendedEscape) {
- return "";
- }
- return utf16EncodeAsString(escapedValue);
- }
- function utf16EncodeAsString(codePoint) {
- ts.Debug.assert(0x0 <= codePoint && codePoint <= 0x10FFFF);
- if (codePoint <= 65535) {
- return String.fromCharCode(codePoint);
- }
- var codeUnit1 = Math.floor((codePoint - 65536) / 1024) + 0xD800;
- var codeUnit2 = ((codePoint - 65536) % 1024) + 0xDC00;
- return String.fromCharCode(codeUnit1, codeUnit2);
- }
- function peekUnicodeEscape() {
- if (pos + 5 < end && text.charCodeAt(pos + 1) === 117) {
- var start_1 = pos;
- pos += 2;
- var value = scanExactNumberOfHexDigits(4);
- pos = start_1;
- return value;
- }
- return -1;
- }
- function scanIdentifierParts() {
- var result = "";
- var start = pos;
- while (pos < end) {
- var ch = text.charCodeAt(pos);
- if (isIdentifierPart(ch, languageVersion)) {
- pos++;
- }
- else if (ch === 92) {
- ch = peekUnicodeEscape();
- if (!(ch >= 0 && isIdentifierPart(ch, languageVersion))) {
- break;
- }
- result += text.substring(start, pos);
- result += String.fromCharCode(ch);
- pos += 6;
- start = pos;
- }
- else {
- break;
- }
- }
- result += text.substring(start, pos);
- return result;
- }
- function getIdentifierToken() {
- var len = tokenValue.length;
- if (len >= 2 && len <= 11) {
- var ch = tokenValue.charCodeAt(0);
- if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) {
- return token = textToToken[tokenValue];
- }
- }
- return token = 69;
- }
- function scanBinaryOrOctalDigits(base) {
- ts.Debug.assert(base === 2 || base === 8, "Expected either base 2 or base 8");
- var value = 0;
- var numberOfDigits = 0;
- while (true) {
- var ch = text.charCodeAt(pos);
- var valueOfCh = ch - 48;
- if (!isDigit(ch) || valueOfCh >= base) {
- break;
- }
- value = value * base + valueOfCh;
- pos++;
- numberOfDigits++;
- }
- if (numberOfDigits === 0) {
- return -1;
- }
- return value;
- }
- function scan() {
- startPos = pos;
- hasExtendedUnicodeEscape = false;
- precedingLineBreak = false;
- tokenIsUnterminated = false;
- while (true) {
- tokenPos = pos;
- if (pos >= end) {
- return token = 1;
- }
- var ch = text.charCodeAt(pos);
- if (ch === 35 && pos === 0 && isShebangTrivia(text, pos)) {
- pos = scanShebangTrivia(text, pos);
- if (skipTrivia) {
- continue;
- }
- else {
- return token = 6;
- }
- }
- switch (ch) {
- case 10:
- case 13:
- precedingLineBreak = true;
- if (skipTrivia) {
- pos++;
- continue;
- }
- else {
- if (ch === 13 && pos + 1 < end && text.charCodeAt(pos + 1) === 10) {
- pos += 2;
- }
- else {
- pos++;
- }
- return token = 4;
- }
- case 9:
- case 11:
- case 12:
- case 32:
- if (skipTrivia) {
- pos++;
- continue;
- }
- else {
- while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) {
- pos++;
- }
- return token = 5;
- }
- case 33:
- if (text.charCodeAt(pos + 1) === 61) {
- if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 33;
- }
- return pos += 2, token = 31;
- }
- pos++;
- return token = 49;
- case 34:
- case 39:
- tokenValue = scanString();
- return token = 9;
- case 96:
- return token = scanTemplateAndSetTokenValue();
- case 37:
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 62;
- }
- pos++;
- return token = 40;
- case 38:
- if (text.charCodeAt(pos + 1) === 38) {
- return pos += 2, token = 51;
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 66;
- }
- pos++;
- return token = 46;
- case 40:
- pos++;
- return token = 17;
- case 41:
- pos++;
- return token = 18;
- case 42:
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 59;
- }
- if (text.charCodeAt(pos + 1) === 42) {
- if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 60;
- }
- return pos += 2, token = 38;
- }
- pos++;
- return token = 37;
- case 43:
- if (text.charCodeAt(pos + 1) === 43) {
- return pos += 2, token = 41;
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 57;
- }
- pos++;
- return token = 35;
- case 44:
- pos++;
- return token = 24;
- case 45:
- if (text.charCodeAt(pos + 1) === 45) {
- return pos += 2, token = 42;
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 58;
- }
- pos++;
- return token = 36;
- case 46:
- if (isDigit(text.charCodeAt(pos + 1))) {
- tokenValue = scanNumber();
- return token = 8;
- }
- if (text.charCodeAt(pos + 1) === 46 && text.charCodeAt(pos + 2) === 46) {
- return pos += 3, token = 22;
- }
- pos++;
- return token = 21;
- case 47:
- if (text.charCodeAt(pos + 1) === 47) {
- pos += 2;
- while (pos < end) {
- if (isLineBreak(text.charCodeAt(pos))) {
- break;
- }
- pos++;
- }
- if (skipTrivia) {
- continue;
- }
- else {
- return token = 2;
- }
- }
- if (text.charCodeAt(pos + 1) === 42) {
- pos += 2;
- var commentClosed = false;
- while (pos < end) {
- var ch_2 = text.charCodeAt(pos);
- if (ch_2 === 42 && text.charCodeAt(pos + 1) === 47) {
- pos += 2;
- commentClosed = true;
- break;
- }
- if (isLineBreak(ch_2)) {
- precedingLineBreak = true;
- }
- pos++;
- }
- if (!commentClosed) {
- error(ts.Diagnostics.Asterisk_Slash_expected);
- }
- if (skipTrivia) {
- continue;
- }
- else {
- tokenIsUnterminated = !commentClosed;
- return token = 3;
- }
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 61;
- }
- pos++;
- return token = 39;
- case 48:
- if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) {
- pos += 2;
- var value = scanMinimumNumberOfHexDigits(1);
- if (value < 0) {
- error(ts.Diagnostics.Hexadecimal_digit_expected);
- value = 0;
- }
- tokenValue = "" + value;
- return token = 8;
- }
- else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) {
- pos += 2;
- var value = scanBinaryOrOctalDigits(2);
- if (value < 0) {
- error(ts.Diagnostics.Binary_digit_expected);
- value = 0;
- }
- tokenValue = "" + value;
- return token = 8;
- }
- else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) {
- pos += 2;
- var value = scanBinaryOrOctalDigits(8);
- if (value < 0) {
- error(ts.Diagnostics.Octal_digit_expected);
- value = 0;
- }
- tokenValue = "" + value;
- return token = 8;
- }
- if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) {
- tokenValue = "" + scanOctalDigits();
- return token = 8;
- }
- case 49:
- case 50:
- case 51:
- case 52:
- case 53:
- case 54:
- case 55:
- case 56:
- case 57:
- tokenValue = scanNumber();
- return token = 8;
- case 58:
- pos++;
- return token = 54;
- case 59:
- pos++;
- return token = 23;
- case 60:
- if (isConflictMarkerTrivia(text, pos)) {
- pos = scanConflictMarkerTrivia(text, pos, error);
- if (skipTrivia) {
- continue;
- }
- else {
- return token = 7;
- }
- }
- if (text.charCodeAt(pos + 1) === 60) {
- if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 63;
- }
- return pos += 2, token = 43;
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 28;
- }
- if (languageVariant === 1 &&
- text.charCodeAt(pos + 1) === 47 &&
- text.charCodeAt(pos + 2) !== 42) {
- return pos += 2, token = 26;
- }
- pos++;
- return token = 25;
- case 61:
- if (isConflictMarkerTrivia(text, pos)) {
- pos = scanConflictMarkerTrivia(text, pos, error);
- if (skipTrivia) {
- continue;
- }
- else {
- return token = 7;
- }
- }
- if (text.charCodeAt(pos + 1) === 61) {
- if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 32;
- }
- return pos += 2, token = 30;
- }
- if (text.charCodeAt(pos + 1) === 62) {
- return pos += 2, token = 34;
- }
- pos++;
- return token = 56;
- case 62:
- if (isConflictMarkerTrivia(text, pos)) {
- pos = scanConflictMarkerTrivia(text, pos, error);
- if (skipTrivia) {
- continue;
- }
- else {
- return token = 7;
- }
- }
- pos++;
- return token = 27;
- case 63:
- pos++;
- return token = 53;
- case 91:
- pos++;
- return token = 19;
- case 93:
- pos++;
- return token = 20;
- case 94:
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 68;
- }
- pos++;
- return token = 48;
- case 123:
- pos++;
- return token = 15;
- case 124:
- if (text.charCodeAt(pos + 1) === 124) {
- return pos += 2, token = 52;
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 67;
- }
- pos++;
- return token = 47;
- case 125:
- pos++;
- return token = 16;
- case 126:
- pos++;
- return token = 50;
- case 64:
- pos++;
- return token = 55;
- case 92:
- var cookedChar = peekUnicodeEscape();
- if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) {
- pos += 6;
- tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts();
- return token = getIdentifierToken();
- }
- error(ts.Diagnostics.Invalid_character);
- pos++;
- return token = 0;
- default:
- if (isIdentifierStart(ch, languageVersion)) {
- pos++;
- while (pos < end && isIdentifierPart(ch = text.charCodeAt(pos), languageVersion))
- pos++;
- tokenValue = text.substring(tokenPos, pos);
- if (ch === 92) {
- tokenValue += scanIdentifierParts();
- }
- return token = getIdentifierToken();
- }
- else if (isWhiteSpaceSingleLine(ch)) {
- pos++;
- continue;
- }
- else if (isLineBreak(ch)) {
- precedingLineBreak = true;
- pos++;
- continue;
- }
- error(ts.Diagnostics.Invalid_character);
- pos++;
- return token = 0;
- }
- }
- }
- function reScanGreaterToken() {
- if (token === 27) {
- if (text.charCodeAt(pos) === 62) {
- if (text.charCodeAt(pos + 1) === 62) {
- if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 65;
- }
- return pos += 2, token = 45;
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 64;
- }
- pos++;
- return token = 44;
- }
- if (text.charCodeAt(pos) === 61) {
- pos++;
- return token = 29;
- }
- }
- return token;
- }
- function reScanSlashToken() {
- if (token === 39 || token === 61) {
- var p = tokenPos + 1;
- var inEscape = false;
- var inCharacterClass = false;
- while (true) {
- if (p >= end) {
- tokenIsUnterminated = true;
- error(ts.Diagnostics.Unterminated_regular_expression_literal);
- break;
- }
- var ch = text.charCodeAt(p);
- if (isLineBreak(ch)) {
- tokenIsUnterminated = true;
- error(ts.Diagnostics.Unterminated_regular_expression_literal);
- break;
- }
- if (inEscape) {
- inEscape = false;
- }
- else if (ch === 47 && !inCharacterClass) {
- p++;
- break;
- }
- else if (ch === 91) {
- inCharacterClass = true;
- }
- else if (ch === 92) {
- inEscape = true;
- }
- else if (ch === 93) {
- inCharacterClass = false;
- }
- p++;
- }
- while (p < end && isIdentifierPart(text.charCodeAt(p), languageVersion)) {
- p++;
- }
- pos = p;
- tokenValue = text.substring(tokenPos, pos);
- token = 10;
- }
- return token;
- }
- function reScanTemplateToken() {
- ts.Debug.assert(token === 16, "'reScanTemplateToken' should only be called on a '}'");
- pos = tokenPos;
- return token = scanTemplateAndSetTokenValue();
- }
- function reScanJsxToken() {
- pos = tokenPos = startPos;
- return token = scanJsxToken();
- }
- function scanJsxToken() {
- startPos = tokenPos = pos;
- if (pos >= end) {
- return token = 1;
- }
- var char = text.charCodeAt(pos);
- if (char === 60) {
- if (text.charCodeAt(pos + 1) === 47) {
- pos += 2;
- return token = 26;
- }
- pos++;
- return token = 25;
- }
- if (char === 123) {
- pos++;
- return token = 15;
- }
- while (pos < end) {
- pos++;
- char = text.charCodeAt(pos);
- if ((char === 123) || (char === 60)) {
- break;
- }
- }
- return token = 244;
- }
- function scanJsxIdentifier() {
- if (tokenIsIdentifierOrKeyword(token)) {
- var firstCharPosition = pos;
- while (pos < end) {
- var ch = text.charCodeAt(pos);
- if (ch === 45 || ((firstCharPosition === pos) ? isIdentifierStart(ch, languageVersion) : isIdentifierPart(ch, languageVersion))) {
- pos++;
- }
- else {
- break;
- }
- }
- tokenValue += text.substr(firstCharPosition, pos - firstCharPosition);
- }
- return token;
- }
- function scanJsxAttributeValue() {
- startPos = pos;
- switch (text.charCodeAt(pos)) {
- case 34:
- case 39:
- tokenValue = scanString(false);
- return token = 9;
- default:
- return scan();
- }
- }
- function scanJSDocToken() {
- if (pos >= end) {
- return token = 1;
- }
- startPos = pos;
- tokenPos = pos;
- var ch = text.charCodeAt(pos);
- switch (ch) {
- case 9:
- case 11:
- case 12:
- case 32:
- while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) {
- pos++;
- }
- return token = 5;
- case 64:
- pos++;
- return token = 55;
- case 10:
- case 13:
- pos++;
- return token = 4;
- case 42:
- pos++;
- return token = 37;
- case 123:
- pos++;
- return token = 15;
- case 125:
- pos++;
- return token = 16;
- case 91:
- pos++;
- return token = 19;
- case 93:
- pos++;
- return token = 20;
- case 61:
- pos++;
- return token = 56;
- case 44:
- pos++;
- return token = 24;
- }
- if (isIdentifierStart(ch, 2)) {
- pos++;
- while (isIdentifierPart(text.charCodeAt(pos), 2) && pos < end) {
- pos++;
- }
- return token = 69;
- }
- else {
- return pos += 1, token = 0;
- }
- }
- function speculationHelper(callback, isLookahead) {
- var savePos = pos;
- var saveStartPos = startPos;
- var saveTokenPos = tokenPos;
- var saveToken = token;
- var saveTokenValue = tokenValue;
- var savePrecedingLineBreak = precedingLineBreak;
- var result = callback();
- if (!result || isLookahead) {
- pos = savePos;
- startPos = saveStartPos;
- tokenPos = saveTokenPos;
- token = saveToken;
- tokenValue = saveTokenValue;
- precedingLineBreak = savePrecedingLineBreak;
- }
- return result;
- }
- function scanRange(start, length, callback) {
- var saveEnd = end;
- var savePos = pos;
- var saveStartPos = startPos;
- var saveTokenPos = tokenPos;
- var saveToken = token;
- var savePrecedingLineBreak = precedingLineBreak;
- var saveTokenValue = tokenValue;
- var saveHasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
- var saveTokenIsUnterminated = tokenIsUnterminated;
- setText(text, start, length);
- var result = callback();
- end = saveEnd;
- pos = savePos;
- startPos = saveStartPos;
- tokenPos = saveTokenPos;
- token = saveToken;
- precedingLineBreak = savePrecedingLineBreak;
- tokenValue = saveTokenValue;
- hasExtendedUnicodeEscape = saveHasExtendedUnicodeEscape;
- tokenIsUnterminated = saveTokenIsUnterminated;
- return result;
- }
- function lookAhead(callback) {
- return speculationHelper(callback, true);
- }
- function tryScan(callback) {
- return speculationHelper(callback, false);
- }
- function getText() {
- return text;
- }
- function setText(newText, start, length) {
- text = newText || "";
- end = length === undefined ? text.length : start + length;
- setTextPos(start || 0);
- }
- function setOnError(errorCallback) {
- onError = errorCallback;
- }
- function setScriptTarget(scriptTarget) {
- languageVersion = scriptTarget;
- }
- function setLanguageVariant(variant) {
- languageVariant = variant;
- }
- function setTextPos(textPos) {
- ts.Debug.assert(textPos >= 0);
- pos = textPos;
- startPos = textPos;
- tokenPos = textPos;
- token = 0;
- precedingLineBreak = false;
- tokenValue = undefined;
- hasExtendedUnicodeEscape = false;
- tokenIsUnterminated = false;
- }
- }
- ts.createScanner = createScanner;
-})(ts || (ts = {}));
-var ts;
-(function (ts) {
- ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" };
- ts.optionDeclarations = [
- {
- name: "charset",
- type: "string"
- },
- ts.compileOnSaveCommandLineOption,
- {
- name: "declaration",
- shortName: "d",
- type: "boolean",
- description: ts.Diagnostics.Generates_corresponding_d_ts_file
- },
- {
- name: "declarationDir",
- type: "string",
- isFilePath: true,
- paramType: ts.Diagnostics.DIRECTORY
- },
- {
- name: "diagnostics",
- type: "boolean"
- },
- {
- name: "extendedDiagnostics",
- type: "boolean",
- experimental: true
- },
- {
- name: "emitBOM",
- type: "boolean"
- },
- {
- name: "help",
- shortName: "h",
- type: "boolean",
- description: ts.Diagnostics.Print_this_message
- },
- {
- name: "help",
- shortName: "?",
- type: "boolean"
- },
- {
- name: "init",
- type: "boolean",
- description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file
- },
- {
- name: "inlineSourceMap",
- type: "boolean"
- },
- {
- name: "inlineSources",
- type: "boolean"
- },
- {
- name: "jsx",
- type: ts.createMap({
- "preserve": 1,
- "react": 2
- }),
- paramType: ts.Diagnostics.KIND,
- description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react
- },
- {
- name: "reactNamespace",
- type: "string",
- description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit
- },
- {
- name: "listFiles",
- type: "boolean"
- },
- {
- name: "locale",
- type: "string"
- },
- {
- name: "mapRoot",
- type: "string",
- isFilePath: true,
- description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,
- paramType: ts.Diagnostics.LOCATION
- },
- {
- name: "module",
- shortName: "m",
- type: ts.createMap({
- "none": ts.ModuleKind.None,
- "commonjs": ts.ModuleKind.CommonJS,
- "amd": ts.ModuleKind.AMD,
- "system": ts.ModuleKind.System,
- "umd": ts.ModuleKind.UMD,
- "es6": ts.ModuleKind.ES6,
- "es2015": ts.ModuleKind.ES2015
- }),
- description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015,
- paramType: ts.Diagnostics.KIND
- },
- {
- name: "newLine",
- type: ts.createMap({
- "crlf": 0,
- "lf": 1
- }),
- description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix,
- paramType: ts.Diagnostics.NEWLINE
- },
- {
- name: "noEmit",
- type: "boolean",
- description: ts.Diagnostics.Do_not_emit_outputs
- },
- {
- name: "noEmitHelpers",
- type: "boolean"
- },
- {
- name: "noEmitOnError",
- type: "boolean",
- description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported
- },
- {
- name: "noErrorTruncation",
- type: "boolean"
- },
- {
- name: "noImplicitAny",
- type: "boolean",
- description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type
- },
- {
- name: "noImplicitThis",
- type: "boolean",
- description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type
- },
- {
- name: "noUnusedLocals",
- type: "boolean",
- description: ts.Diagnostics.Report_errors_on_unused_locals
- },
- {
- name: "noUnusedParameters",
- type: "boolean",
- description: ts.Diagnostics.Report_errors_on_unused_parameters
- },
- {
- name: "noLib",
- type: "boolean"
- },
- {
- name: "noResolve",
- type: "boolean"
- },
- {
- name: "skipDefaultLibCheck",
- type: "boolean"
- },
- {
- name: "skipLibCheck",
- type: "boolean",
- description: ts.Diagnostics.Skip_type_checking_of_declaration_files
- },
- {
- name: "out",
- type: "string",
- isFilePath: false,
- paramType: ts.Diagnostics.FILE
- },
- {
- name: "outFile",
- type: "string",
- isFilePath: true,
- description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file,
- paramType: ts.Diagnostics.FILE
- },
- {
- name: "outDir",
- type: "string",
- isFilePath: true,
- description: ts.Diagnostics.Redirect_output_structure_to_the_directory,
- paramType: ts.Diagnostics.DIRECTORY
- },
- {
- name: "preserveConstEnums",
- type: "boolean",
- description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code
- },
- {
- name: "pretty",
- description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental,
- type: "boolean"
- },
- {
- name: "project",
- shortName: "p",
- type: "string",
- isFilePath: true,
- description: ts.Diagnostics.Compile_the_project_in_the_given_directory,
- paramType: ts.Diagnostics.DIRECTORY
- },
- {
- name: "removeComments",
- type: "boolean",
- description: ts.Diagnostics.Do_not_emit_comments_to_output
- },
- {
- name: "rootDir",
- type: "string",
- isFilePath: true,
- paramType: ts.Diagnostics.LOCATION,
- description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir
- },
- {
- name: "isolatedModules",
- type: "boolean"
- },
- {
- name: "sourceMap",
- type: "boolean",
- description: ts.Diagnostics.Generates_corresponding_map_file
- },
- {
- name: "sourceRoot",
- type: "string",
- isFilePath: true,
- description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations,
- paramType: ts.Diagnostics.LOCATION
- },
- {
- name: "suppressExcessPropertyErrors",
- type: "boolean",
- description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals,
- experimental: true
- },
- {
- name: "suppressImplicitAnyIndexErrors",
- type: "boolean",
- description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures
- },
- {
- name: "stripInternal",
- type: "boolean",
- description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation,
- experimental: true
- },
- {
- name: "target",
- shortName: "t",
- type: ts.createMap({
- "es3": 0,
- "es5": 1,
- "es6": 2,
- "es2015": 2
- }),
- description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015,
- paramType: ts.Diagnostics.VERSION
- },
- {
- name: "version",
- shortName: "v",
- type: "boolean",
- description: ts.Diagnostics.Print_the_compiler_s_version
- },
- {
- name: "watch",
- shortName: "w",
- type: "boolean",
- description: ts.Diagnostics.Watch_input_files
- },
- {
- name: "experimentalDecorators",
- type: "boolean",
- description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators
- },
- {
- name: "emitDecoratorMetadata",
- type: "boolean",
- experimental: true,
- description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators
- },
- {
- name: "moduleResolution",
- type: ts.createMap({
- "node": ts.ModuleResolutionKind.NodeJs,
- "classic": ts.ModuleResolutionKind.Classic
- }),
- description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6,
- paramType: ts.Diagnostics.STRATEGY
- },
- {
- name: "allowUnusedLabels",
- type: "boolean",
- description: ts.Diagnostics.Do_not_report_errors_on_unused_labels
- },
- {
- name: "noImplicitReturns",
- type: "boolean",
- description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value
- },
- {
- name: "noFallthroughCasesInSwitch",
- type: "boolean",
- description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement
- },
- {
- name: "allowUnreachableCode",
- type: "boolean",
- description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code
- },
- {
- name: "forceConsistentCasingInFileNames",
- type: "boolean",
- description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file
- },
- {
- name: "baseUrl",
- type: "string",
- isFilePath: true,
- description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names
- },
- {
- name: "paths",
- type: "object",
- isTSConfigOnly: true
- },
- {
- name: "rootDirs",
- type: "list",
- isTSConfigOnly: true,
- element: {
- name: "rootDirs",
- type: "string",
- isFilePath: true
- }
- },
- {
- name: "typeRoots",
- type: "list",
- element: {
- name: "typeRoots",
- type: "string",
- isFilePath: true
- }
- },
- {
- name: "types",
- type: "list",
- element: {
- name: "types",
- type: "string"
- },
- description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation
- },
- {
- name: "traceResolution",
- type: "boolean",
- description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process
- },
- {
- name: "allowJs",
- type: "boolean",
- description: ts.Diagnostics.Allow_javascript_files_to_be_compiled
- },
- {
- name: "allowSyntheticDefaultImports",
- type: "boolean",
- description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking
- },
- {
- name: "noImplicitUseStrict",
- type: "boolean",
- description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output
- },
- {
- name: "maxNodeModuleJsDepth",
- type: "number",
- description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files
- },
- {
- name: "listEmittedFiles",
- type: "boolean"
- },
- {
- name: "lib",
- type: "list",
- element: {
- name: "lib",
- type: ts.createMap({
- "es5": "lib.es5.d.ts",
- "es6": "lib.es2015.d.ts",
- "es2015": "lib.es2015.d.ts",
- "es7": "lib.es2016.d.ts",
- "es2016": "lib.es2016.d.ts",
- "es2017": "lib.es2017.d.ts",
- "dom": "lib.dom.d.ts",
- "dom.iterable": "lib.dom.iterable.d.ts",
- "webworker": "lib.webworker.d.ts",
- "scripthost": "lib.scripthost.d.ts",
- "es2015.core": "lib.es2015.core.d.ts",
- "es2015.collection": "lib.es2015.collection.d.ts",
- "es2015.generator": "lib.es2015.generator.d.ts",
- "es2015.iterable": "lib.es2015.iterable.d.ts",
- "es2015.promise": "lib.es2015.promise.d.ts",
- "es2015.proxy": "lib.es2015.proxy.d.ts",
- "es2015.reflect": "lib.es2015.reflect.d.ts",
- "es2015.symbol": "lib.es2015.symbol.d.ts",
- "es2015.symbol.wellknown": "lib.es2015.symbol.wellknown.d.ts",
- "es2016.array.include": "lib.es2016.array.include.d.ts",
- "es2017.object": "lib.es2017.object.d.ts",
- "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts"
- })
- },
- description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon
- },
- {
- name: "disableSizeLimit",
- type: "boolean"
- },
- {
- name: "strictNullChecks",
- type: "boolean",
- description: ts.Diagnostics.Enable_strict_null_checks
- },
- {
- name: "importHelpers",
- type: "boolean",
- description: ts.Diagnostics.Import_emit_helpers_from_tslib
- },
- {
- name: "alwaysStrict",
- type: "boolean",
- description: ts.Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file
- }
- ];
- ts.typingOptionDeclarations = [
- {
- name: "enableAutoDiscovery",
- type: "boolean"
- },
- {
- name: "include",
- type: "list",
- element: {
- name: "include",
- type: "string"
- }
- },
- {
- name: "exclude",
- type: "list",
- element: {
- name: "exclude",
- type: "string"
- }
- }
- ];
- ts.defaultInitCompilerOptions = {
- module: ts.ModuleKind.CommonJS,
- target: 1,
- noImplicitAny: false,
- sourceMap: false
- };
- var optionNameMapCache;
- function getOptionNameMap() {
- if (optionNameMapCache) {
- return optionNameMapCache;
- }
- var optionNameMap = ts.createMap();
- var shortOptionNames = ts.createMap();
- ts.forEach(ts.optionDeclarations, function (option) {
- optionNameMap[option.name.toLowerCase()] = option;
- if (option.shortName) {
- shortOptionNames[option.shortName] = option.name;
- }
- });
- optionNameMapCache = { optionNameMap: optionNameMap, shortOptionNames: shortOptionNames };
- return optionNameMapCache;
- }
- ts.getOptionNameMap = getOptionNameMap;
- function createCompilerDiagnosticForInvalidCustomType(opt) {
- var namesOfType = [];
- for (var key in opt.type) {
- namesOfType.push(" '" + key + "'");
- }
- return ts.createCompilerDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
- }
- ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
- function parseCustomTypeOption(opt, value, errors) {
- var key = trimString((value || "")).toLowerCase();
- var map = opt.type;
- if (key in map) {
- return map[key];
- }
- else {
- errors.push(createCompilerDiagnosticForInvalidCustomType(opt));
- }
- }
- ts.parseCustomTypeOption = parseCustomTypeOption;
- function parseListTypeOption(opt, value, errors) {
- if (value === void 0) { value = ""; }
- value = trimString(value);
- if (ts.startsWith(value, "-")) {
- return undefined;
- }
- if (value === "") {
- return [];
- }
- var values = value.split(",");
- switch (opt.element.type) {
- case "number":
- return ts.map(values, parseInt);
- case "string":
- return ts.map(values, function (v) { return v || ""; });
- default:
- return ts.filter(ts.map(values, function (v) { return parseCustomTypeOption(opt.element, v, errors); }), function (v) { return !!v; });
- }
- }
- ts.parseListTypeOption = parseListTypeOption;
- function parseCommandLine(commandLine, readFile) {
- var options = {};
- var fileNames = [];
- var errors = [];
- var _a = getOptionNameMap(), optionNameMap = _a.optionNameMap, shortOptionNames = _a.shortOptionNames;
- parseStrings(commandLine);
- return {
- options: options,
- fileNames: fileNames,
- errors: errors
- };
- function parseStrings(args) {
- var i = 0;
- while (i < args.length) {
- var s = args[i];
- i++;
- if (s.charCodeAt(0) === 64) {
- parseResponseFile(s.slice(1));
- }
- else if (s.charCodeAt(0) === 45) {
- s = s.slice(s.charCodeAt(1) === 45 ? 2 : 1).toLowerCase();
- if (s in shortOptionNames) {
- s = shortOptionNames[s];
- }
- if (s in optionNameMap) {
- var opt = optionNameMap[s];
- if (opt.isTSConfigOnly) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name));
- }
- else {
- if (!args[i] && opt.type !== "boolean") {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_expects_an_argument, opt.name));
- }
- switch (opt.type) {
- case "number":
- options[opt.name] = parseInt(args[i]);
- i++;
- break;
- case "boolean":
- options[opt.name] = true;
- break;
- case "string":
- options[opt.name] = args[i] || "";
- i++;
- break;
- case "list":
- var result = parseListTypeOption(opt, args[i], errors);
- options[opt.name] = result || [];
- if (result) {
- i++;
- }
- break;
- default:
- options[opt.name] = parseCustomTypeOption(opt, args[i], errors);
- i++;
- break;
- }
- }
- }
- else {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_compiler_option_0, s));
- }
- }
- else {
- fileNames.push(s);
- }
- }
- }
- function parseResponseFile(fileName) {
- var text = readFile ? readFile(fileName) : ts.sys.readFile(fileName);
- if (!text) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, fileName));
- return;
- }
- var args = [];
- var pos = 0;
- while (true) {
- while (pos < text.length && text.charCodeAt(pos) <= 32)
- pos++;
- if (pos >= text.length)
- break;
- var start = pos;
- if (text.charCodeAt(start) === 34) {
- pos++;
- while (pos < text.length && text.charCodeAt(pos) !== 34)
- pos++;
- if (pos < text.length) {
- args.push(text.substring(start + 1, pos));
- pos++;
- }
- else {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unterminated_quoted_string_in_response_file_0, fileName));
- }
- }
- else {
- while (text.charCodeAt(pos) > 32)
- pos++;
- args.push(text.substring(start, pos));
- }
- }
- parseStrings(args);
- }
- }
- ts.parseCommandLine = parseCommandLine;
- function readConfigFile(fileName, readFile) {
- var text = "";
- try {
- text = readFile(fileName);
- }
- catch (e) {
- return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) };
- }
- return parseConfigFileTextToJson(fileName, text);
- }
- ts.readConfigFile = readConfigFile;
- function parseConfigFileTextToJson(fileName, jsonText, stripComments) {
- if (stripComments === void 0) { stripComments = true; }
- try {
- var jsonTextToParse = stripComments ? removeComments(jsonText) : jsonText;
- return { config: /\S/.test(jsonTextToParse) ? JSON.parse(jsonTextToParse) : {} };
- }
- catch (e) {
- return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Failed_to_parse_file_0_Colon_1, fileName, e.message) };
- }
- }
- ts.parseConfigFileTextToJson = parseConfigFileTextToJson;
- function generateTSConfig(options, fileNames) {
- var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions);
- var configurations = {
- compilerOptions: serializeCompilerOptions(compilerOptions)
- };
- if (fileNames && fileNames.length) {
- configurations.files = fileNames;
- }
- return configurations;
- function getCustomTypeMapOfCommandLineOption(optionDefinition) {
- if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") {
- return undefined;
- }
- else if (optionDefinition.type === "list") {
- return getCustomTypeMapOfCommandLineOption(optionDefinition.element);
- }
- else {
- return optionDefinition.type;
- }
- }
- function getNameOfCompilerOptionValue(value, customTypeMap) {
- for (var key in customTypeMap) {
- if (customTypeMap[key] === value) {
- return key;
- }
- }
- return undefined;
- }
- function serializeCompilerOptions(options) {
- var result = ts.createMap();
- var optionsNameMap = getOptionNameMap().optionNameMap;
- for (var name_5 in options) {
- if (ts.hasProperty(options, name_5)) {
- switch (name_5) {
- case "init":
- case "watch":
- case "version":
- case "help":
- case "project":
- break;
- default:
- var value = options[name_5];
- var optionDefinition = optionsNameMap[name_5.toLowerCase()];
- if (optionDefinition) {
- var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition);
- if (!customTypeMap) {
- result[name_5] = value;
- }
- else {
- if (optionDefinition.type === "list") {
- var convertedValue = [];
- for (var _i = 0, _a = value; _i < _a.length; _i++) {
- var element = _a[_i];
- convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap));
- }
- result[name_5] = convertedValue;
- }
- else {
- result[name_5] = getNameOfCompilerOptionValue(value, customTypeMap);
- }
- }
- }
- break;
- }
- }
- }
- return result;
- }
- }
- ts.generateTSConfig = generateTSConfig;
- function removeComments(jsonText) {
- var output = "";
- var scanner = ts.createScanner(1, false, 0, jsonText);
- var token;
- while ((token = scanner.scan()) !== 1) {
- switch (token) {
- case 2:
- case 3:
- output += scanner.getTokenText().replace(/\S/g, " ");
- break;
- default:
- output += scanner.getTokenText();
- break;
- }
- }
- return output;
- }
- function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack) {
- if (existingOptions === void 0) { existingOptions = {}; }
- if (resolutionStack === void 0) { resolutionStack = []; }
- var errors = [];
- var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames);
- var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName);
- if (resolutionStack.indexOf(resolvedPath) >= 0) {
- return {
- options: {},
- fileNames: [],
- typingOptions: {},
- raw: json,
- errors: [ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> "))],
- wildcardDirectories: {}
- };
- }
- var options = convertCompilerOptionsFromJsonWorker(json["compilerOptions"], basePath, errors, configFileName);
- var typingOptions = convertTypingOptionsFromJsonWorker(json["typingOptions"], basePath, errors, configFileName);
- if (json["extends"]) {
- var _a = [undefined, undefined, undefined, {}], include = _a[0], exclude = _a[1], files = _a[2], baseOptions = _a[3];
- if (typeof json["extends"] === "string") {
- _b = (tryExtendsName(json["extends"]) || [include, exclude, files, baseOptions]), include = _b[0], exclude = _b[1], files = _b[2], baseOptions = _b[3];
- }
- else {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", "string"));
- }
- if (include && !json["include"]) {
- json["include"] = include;
- }
- if (exclude && !json["exclude"]) {
- json["exclude"] = exclude;
- }
- if (files && !json["files"]) {
- json["files"] = files;
- }
- options = ts.assign({}, baseOptions, options);
- }
- options = ts.extend(existingOptions, options);
- options.configFilePath = configFileName;
- var _c = getFileNames(errors), fileNames = _c.fileNames, wildcardDirectories = _c.wildcardDirectories;
- var compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors);
- return {
- options: options,
- fileNames: fileNames,
- typingOptions: typingOptions,
- raw: json,
- errors: errors,
- wildcardDirectories: wildcardDirectories,
- compileOnSave: compileOnSave
- };
- function tryExtendsName(extendedConfig) {
- if (!(ts.isRootedDiskPath(extendedConfig) || ts.startsWith(ts.normalizeSlashes(extendedConfig), "./") || ts.startsWith(ts.normalizeSlashes(extendedConfig), "../"))) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.The_path_in_an_extends_options_must_be_relative_or_rooted));
- return;
- }
- var extendedConfigPath = ts.toPath(extendedConfig, basePath, getCanonicalFileName);
- if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json")) {
- extendedConfigPath = extendedConfigPath + ".json";
- if (!host.fileExists(extendedConfigPath)) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_does_not_exist, extendedConfig));
- return;
- }
- }
- var extendedResult = readConfigFile(extendedConfigPath, function (path) { return host.readFile(path); });
- if (extendedResult.error) {
- errors.push(extendedResult.error);
- return;
- }
- var extendedDirname = ts.getDirectoryPath(extendedConfigPath);
- var relativeDifference = ts.convertToRelativePath(extendedDirname, basePath, getCanonicalFileName);
- var updatePath = function (path) { return ts.isRootedDiskPath(path) ? path : ts.combinePaths(relativeDifference, path); };
- var result = parseJsonConfigFileContent(extendedResult.config, host, extendedDirname, undefined, ts.getBaseFileName(extendedConfigPath), resolutionStack.concat([resolvedPath]));
- errors.push.apply(errors, result.errors);
- var _a = ts.map(["include", "exclude", "files"], function (key) {
- if (!json[key] && extendedResult.config[key]) {
- return ts.map(extendedResult.config[key], updatePath);
- }
- }), include = _a[0], exclude = _a[1], files = _a[2];
- return [include, exclude, files, result.options];
- }
- function getFileNames(errors) {
- var fileNames;
- if (ts.hasProperty(json, "files")) {
- if (ts.isArray(json["files"])) {
- fileNames = json["files"];
- }
- else {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "files", "Array"));
- }
- }
- var includeSpecs;
- if (ts.hasProperty(json, "include")) {
- if (ts.isArray(json["include"])) {
- includeSpecs = json["include"];
- }
- else {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "include", "Array"));
- }
- }
- var excludeSpecs;
- if (ts.hasProperty(json, "exclude")) {
- if (ts.isArray(json["exclude"])) {
- excludeSpecs = json["exclude"];
- }
- else {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "exclude", "Array"));
- }
- }
- else if (ts.hasProperty(json, "excludes")) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));
- }
- else {
- excludeSpecs = ["node_modules", "bower_components", "jspm_packages"];
- var outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"];
- if (outDir) {
- excludeSpecs.push(outDir);
- }
- }
- if (fileNames === undefined && includeSpecs === undefined) {
- includeSpecs = ["**/*"];
- }
- return matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors);
- }
- var _b;
- }
- ts.parseJsonConfigFileContent = parseJsonConfigFileContent;
- function convertCompileOnSaveOptionFromJson(jsonOption, basePath, errors) {
- if (!ts.hasProperty(jsonOption, ts.compileOnSaveCommandLineOption.name)) {
- return false;
- }
- var result = convertJsonOption(ts.compileOnSaveCommandLineOption, jsonOption["compileOnSave"], basePath, errors);
- if (typeof result === "boolean" && result) {
- return result;
- }
- return false;
- }
- ts.convertCompileOnSaveOptionFromJson = convertCompileOnSaveOptionFromJson;
- function convertCompilerOptionsFromJson(jsonOptions, basePath, configFileName) {
- var errors = [];
- var options = convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName);
- return { options: options, errors: errors };
- }
- ts.convertCompilerOptionsFromJson = convertCompilerOptionsFromJson;
- function convertTypingOptionsFromJson(jsonOptions, basePath, configFileName) {
- var errors = [];
- var options = convertTypingOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName);
- return { options: options, errors: errors };
- }
- ts.convertTypingOptionsFromJson = convertTypingOptionsFromJson;
- function convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) {
- var options = ts.getBaseFileName(configFileName) === "jsconfig.json"
- ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true }
- : {};
- convertOptionsFromJson(ts.optionDeclarations, jsonOptions, basePath, options, ts.Diagnostics.Unknown_compiler_option_0, errors);
- return options;
- }
- function convertTypingOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) {
- var options = ts.getBaseFileName(configFileName) === "jsconfig.json"
- ? { enableAutoDiscovery: true, include: [], exclude: [] }
- : { enableAutoDiscovery: false, include: [], exclude: [] };
- convertOptionsFromJson(ts.typingOptionDeclarations, jsonOptions, basePath, options, ts.Diagnostics.Unknown_typing_option_0, errors);
- return options;
- }
- function convertOptionsFromJson(optionDeclarations, jsonOptions, basePath, defaultOptions, diagnosticMessage, errors) {
- if (!jsonOptions) {
- return;
- }
- var optionNameMap = ts.arrayToMap(optionDeclarations, function (opt) { return opt.name; });
- for (var id in jsonOptions) {
- if (id in optionNameMap) {
- var opt = optionNameMap[id];
- defaultOptions[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors);
- }
- else {
- errors.push(ts.createCompilerDiagnostic(diagnosticMessage, id));
- }
- }
- }
- function convertJsonOption(opt, value, basePath, errors) {
- var optType = opt.type;
- var expectedType = typeof optType === "string" ? optType : "string";
- if (optType === "list" && ts.isArray(value)) {
- return convertJsonOptionOfListType(opt, value, basePath, errors);
- }
- else if (typeof value === expectedType) {
- if (typeof optType !== "string") {
- return convertJsonOptionOfCustomType(opt, value, errors);
- }
- else {
- if (opt.isFilePath) {
- value = ts.normalizePath(ts.combinePaths(basePath, value));
- if (value === "") {
- value = ".";
- }
- }
- }
- return value;
- }
- else {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, opt.name, expectedType));
- }
- }
- function convertJsonOptionOfCustomType(opt, value, errors) {
- var key = value.toLowerCase();
- if (key in opt.type) {
- return opt.type[key];
- }
- else {
- errors.push(createCompilerDiagnosticForInvalidCustomType(opt));
- }
- }
- function convertJsonOptionOfListType(option, values, basePath, errors) {
- return ts.filter(ts.map(values, function (v) { return convertJsonOption(option.element, v, basePath, errors); }), function (v) { return !!v; });
- }
- function trimString(s) {
- return typeof s.trim === "function" ? s.trim() : s.replace(/^[\s]+|[\s]+$/g, "");
- }
- var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/;
- var invalidMultipleRecursionPatterns = /(^|\/)\*\*\/(.*\/)?\*\*($|\/)/;
- var invalidDotDotAfterRecursiveWildcardPattern = /(^|\/)\*\*\/(.*\/)?\.\.($|\/)/;
- var watchRecursivePattern = /\/[^/]*?[*?][^/]*\//;
- var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/;
- function matchFileNames(fileNames, include, exclude, basePath, options, host, errors) {
- basePath = ts.normalizePath(basePath);
- var keyMapper = host.useCaseSensitiveFileNames ? caseSensitiveKeyMapper : caseInsensitiveKeyMapper;
- var literalFileMap = ts.createMap();
- var wildcardFileMap = ts.createMap();
- if (include) {
- include = validateSpecs(include, errors, false);
- }
- if (exclude) {
- exclude = validateSpecs(exclude, errors, true);
- }
- var wildcardDirectories = getWildcardDirectories(include, exclude, basePath, host.useCaseSensitiveFileNames);
- var supportedExtensions = ts.getSupportedExtensions(options);
- if (fileNames) {
- for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) {
- var fileName = fileNames_1[_i];
- var file = ts.combinePaths(basePath, fileName);
- literalFileMap[keyMapper(file)] = file;
- }
- }
- if (include && include.length > 0) {
- for (var _a = 0, _b = host.readDirectory(basePath, supportedExtensions, exclude, include); _a < _b.length; _a++) {
- var file = _b[_a];
- if (hasFileWithHigherPriorityExtension(file, literalFileMap, wildcardFileMap, supportedExtensions, keyMapper)) {
- continue;
- }
- removeWildcardFilesWithLowerPriorityExtension(file, wildcardFileMap, supportedExtensions, keyMapper);
- var key = keyMapper(file);
- if (!(key in literalFileMap) && !(key in wildcardFileMap)) {
- wildcardFileMap[key] = file;
- }
- }
- }
- var literalFiles = ts.reduceProperties(literalFileMap, addFileToOutput, []);
- var wildcardFiles = ts.reduceProperties(wildcardFileMap, addFileToOutput, []);
- wildcardFiles.sort(host.useCaseSensitiveFileNames ? ts.compareStrings : ts.compareStringsCaseInsensitive);
- return {
- fileNames: literalFiles.concat(wildcardFiles),
- wildcardDirectories: wildcardDirectories
- };
- }
- function validateSpecs(specs, errors, allowTrailingRecursion) {
- var validSpecs = [];
- for (var _i = 0, specs_2 = specs; _i < specs_2.length; _i++) {
- var spec = specs_2[_i];
- if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec));
- }
- else if (invalidMultipleRecursionPatterns.test(spec)) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0, spec));
- }
- else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) {
- errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec));
- }
- else {
- validSpecs.push(spec);
- }
- }
- return validSpecs;
- }
- function getWildcardDirectories(include, exclude, path, useCaseSensitiveFileNames) {
- var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude");
- var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i");
- var wildcardDirectories = ts.createMap();
- if (include !== undefined) {
- var recursiveKeys = [];
- for (var _i = 0, include_1 = include; _i < include_1.length; _i++) {
- var file = include_1[_i];
- var name_6 = ts.normalizePath(ts.combinePaths(path, file));
- if (excludeRegex && excludeRegex.test(name_6)) {
- continue;
- }
- var match = wildcardDirectoryPattern.exec(name_6);
- if (match) {
- var key = useCaseSensitiveFileNames ? match[0] : match[0].toLowerCase();
- var flags = watchRecursivePattern.test(name_6) ? 1 : 0;
- var existingFlags = wildcardDirectories[key];
- if (existingFlags === undefined || existingFlags < flags) {
- wildcardDirectories[key] = flags;
- if (flags === 1) {
- recursiveKeys.push(key);
- }
- }
- }
- }
- for (var key in wildcardDirectories) {
- for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) {
- var recursiveKey = recursiveKeys_1[_a];
- if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) {
- delete wildcardDirectories[key];
- }
- }
- }
- }
- return wildcardDirectories;
- }
- function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) {
- var extensionPriority = ts.getExtensionPriority(file, extensions);
- var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority);
- for (var i = 0; i < adjustedExtensionPriority; i++) {
- var higherPriorityExtension = extensions[i];
- var higherPriorityPath = keyMapper(ts.changeExtension(file, higherPriorityExtension));
- if (higherPriorityPath in literalFiles || higherPriorityPath in wildcardFiles) {
- return true;
- }
- }
- return false;
- }
- function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) {
- var extensionPriority = ts.getExtensionPriority(file, extensions);
- var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority);
- for (var i = nextExtensionPriority; i < extensions.length; i++) {
- var lowerPriorityExtension = extensions[i];
- var lowerPriorityPath = keyMapper(ts.changeExtension(file, lowerPriorityExtension));
- delete wildcardFiles[lowerPriorityPath];
- }
- }
- function addFileToOutput(output, file) {
- output.push(file);
- return output;
- }
- function caseSensitiveKeyMapper(key) {
- return key;
- }
- function caseInsensitiveKeyMapper(key) {
- return key.toLowerCase();
- }
-})(ts || (ts = {}));
-var ts;
-(function (ts) {
- var JsTyping;
- (function (JsTyping) {
- ;
- ;
- var safeList;
- var EmptySafeList = ts.createMap();
- function discoverTypings(host, fileNames, projectRootPath, safeListPath, packageNameToTypingLocation, typingOptions, compilerOptions) {
- var inferredTypings = ts.createMap();
- if (!typingOptions || !typingOptions.enableAutoDiscovery) {
- return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] };
- }
- fileNames = ts.filter(ts.map(fileNames, ts.normalizePath), function (f) {
- var kind = ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f));
- return kind === 1 || kind === 2;
- });
- if (!safeList) {
- var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); });
- safeList = result.config ? ts.createMap(result.config) : EmptySafeList;
- }
- var filesToWatch = [];
- var searchDirs = [];
- var exclude = [];
- mergeTypings(typingOptions.include);
- exclude = typingOptions.exclude || [];
- var possibleSearchDirs = ts.map(fileNames, ts.getDirectoryPath);
- if (projectRootPath !== undefined) {
- possibleSearchDirs.push(projectRootPath);
- }
- searchDirs = ts.deduplicate(possibleSearchDirs);
- for (var _i = 0, searchDirs_1 = searchDirs; _i < searchDirs_1.length; _i++) {
- var searchDir = searchDirs_1[_i];
- var packageJsonPath = ts.combinePaths(searchDir, "package.json");
- getTypingNamesFromJson(packageJsonPath, filesToWatch);
- var bowerJsonPath = ts.combinePaths(searchDir, "bower.json");
- getTypingNamesFromJson(bowerJsonPath, filesToWatch);
- var nodeModulesPath = ts.combinePaths(searchDir, "node_modules");
- getTypingNamesFromNodeModuleFolder(nodeModulesPath);
- }
- getTypingNamesFromSourceFileNames(fileNames);
- for (var name_7 in packageNameToTypingLocation) {
- if (name_7 in inferredTypings && !inferredTypings[name_7]) {
- inferredTypings[name_7] = packageNameToTypingLocation[name_7];
- }
- }
- for (var _a = 0, exclude_1 = exclude; _a < exclude_1.length; _a++) {
- var excludeTypingName = exclude_1[_a];
- delete inferredTypings[excludeTypingName];
- }
- var newTypingNames = [];
- var cachedTypingPaths = [];
- for (var typing in inferredTypings) {
- if (inferredTypings[typing] !== undefined) {
- cachedTypingPaths.push(inferredTypings[typing]);
- }
- else {
- newTypingNames.push(typing);
- }
- }
- return { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };
- function mergeTypings(typingNames) {
- if (!typingNames) {
- return;
- }
- for (var _i = 0, typingNames_1 = typingNames; _i < typingNames_1.length; _i++) {
- var typing = typingNames_1[_i];
- if (!(typing in inferredTypings)) {
- inferredTypings[typing] = undefined;
- }
- }
- }
- function getTypingNamesFromJson(jsonPath, filesToWatch) {
- var result = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); });
- if (result.config) {
- var jsonConfig = result.config;
- filesToWatch.push(jsonPath);
- if (jsonConfig.dependencies) {
- mergeTypings(ts.getOwnKeys(jsonConfig.dependencies));
- }
- if (jsonConfig.devDependencies) {
- mergeTypings(ts.getOwnKeys(jsonConfig.devDependencies));
- }
- if (jsonConfig.optionalDependencies) {
- mergeTypings(ts.getOwnKeys(jsonConfig.optionalDependencies));
- }
- if (jsonConfig.peerDependencies) {
- mergeTypings(ts.getOwnKeys(jsonConfig.peerDependencies));
- }
- }
- }
- function getTypingNamesFromSourceFileNames(fileNames) {
- var jsFileNames = ts.filter(fileNames, ts.hasJavaScriptFileExtension);
- var inferredTypingNames = ts.map(jsFileNames, function (f) { return ts.removeFileExtension(ts.getBaseFileName(f.toLowerCase())); });
- var cleanedTypingNames = ts.map(inferredTypingNames, function (f) { return f.replace(/((?:\.|-)min(?=\.|$))|((?:-|\.)\d+)/g, ""); });
- if (safeList !== EmptySafeList) {
- mergeTypings(ts.filter(cleanedTypingNames, function (f) { return f in safeList; }));
- }
- var hasJsxFile = ts.forEach(fileNames, function (f) { return ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)) === 2; });
- if (hasJsxFile) {
- mergeTypings(["react"]);
- }
- }
- function getTypingNamesFromNodeModuleFolder(nodeModulesPath) {
- if (!host.directoryExists(nodeModulesPath)) {
- return;
- }
- var typingNames = [];
- var fileNames = host.readDirectory(nodeModulesPath, [".json"], undefined, undefined, 2);
- for (var _i = 0, fileNames_2 = fileNames; _i < fileNames_2.length; _i++) {
- var fileName = fileNames_2[_i];
- var normalizedFileName = ts.normalizePath(fileName);
- if (ts.getBaseFileName(normalizedFileName) !== "package.json") {
- continue;
- }
- var result = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); });
- if (!result.config) {
- continue;
- }
- var packageJson = result.config;
- if (packageJson._requiredBy &&
- ts.filter(packageJson._requiredBy, function (r) { return r[0] === "#" || r === "/"; }).length === 0) {
- continue;
- }
- if (!packageJson.name) {
- continue;
- }
- if (packageJson.typings) {
- var absolutePath = ts.getNormalizedAbsolutePath(packageJson.typings, ts.getDirectoryPath(normalizedFileName));
- inferredTypings[packageJson.name] = absolutePath;
- }
- else {
- typingNames.push(packageJson.name);
- }
- }
- mergeTypings(typingNames);
- }
- }
- JsTyping.discoverTypings = discoverTypings;
- })(JsTyping = ts.JsTyping || (ts.JsTyping = {}));
-})(ts || (ts = {}));
-var ts;
-(function (ts) {
- var server;
- (function (server) {
- (function (LogLevel) {
- LogLevel[LogLevel["terse"] = 0] = "terse";
- LogLevel[LogLevel["normal"] = 1] = "normal";
- LogLevel[LogLevel["requestTime"] = 2] = "requestTime";
- LogLevel[LogLevel["verbose"] = 3] = "verbose";
- })(server.LogLevel || (server.LogLevel = {}));
- var LogLevel = server.LogLevel;
- server.emptyArray = [];
- var Msg;
- (function (Msg) {
- Msg.Err = "Err";
- Msg.Info = "Info";
- Msg.Perf = "Perf";
- })(Msg = server.Msg || (server.Msg = {}));
- function getProjectRootPath(project) {
- switch (project.projectKind) {
- case server.ProjectKind.Configured:
- return ts.getDirectoryPath(project.getProjectName());
- case server.ProjectKind.Inferred:
- return "";
- case server.ProjectKind.External:
- var projectName = ts.normalizeSlashes(project.getProjectName());
- return project.projectService.host.fileExists(projectName) ? ts.getDirectoryPath(projectName) : projectName;
- }
- }
- function createInstallTypingsRequest(project, typingOptions, cachePath) {
- return {
- projectName: project.getProjectName(),
- fileNames: project.getFileNames(),
- compilerOptions: project.getCompilerOptions(),
- typingOptions: typingOptions,
- projectRootPath: getProjectRootPath(project),
- cachePath: cachePath,
- kind: "discover"
- };
- }
- server.createInstallTypingsRequest = createInstallTypingsRequest;
- var Errors;
- (function (Errors) {
- function ThrowNoProject() {
- throw new Error("No Project.");
- }
- Errors.ThrowNoProject = ThrowNoProject;
- function ThrowProjectLanguageServiceDisabled() {
- throw new Error("The project's language service is disabled.");
- }
- Errors.ThrowProjectLanguageServiceDisabled = ThrowProjectLanguageServiceDisabled;
- function ThrowProjectDoesNotContainDocument(fileName, project) {
- throw new Error("Project '" + project.getProjectName() + "' does not contain document '" + fileName + "'");
- }
- Errors.ThrowProjectDoesNotContainDocument = ThrowProjectDoesNotContainDocument;
- })(Errors = server.Errors || (server.Errors = {}));
- function getDefaultFormatCodeSettings(host) {
- return {
- indentSize: 4,
- tabSize: 4,
- newLineCharacter: host.newLine || "\n",
- convertTabsToSpaces: true,
- indentStyle: ts.IndentStyle.Smart,
- insertSpaceAfterCommaDelimiter: true,
- insertSpaceAfterSemicolonInForStatements: true,
- insertSpaceBeforeAndAfterBinaryOperators: true,
- insertSpaceAfterKeywordsInControlFlowStatements: true,
- insertSpaceAfterFunctionKeywordForAnonymousFunctions: false,
- insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false,
- insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false,
- insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false,
- insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false,
- placeOpenBraceOnNewLineForFunctions: false,
- placeOpenBraceOnNewLineForControlBlocks: false
- };
- }
- server.getDefaultFormatCodeSettings = getDefaultFormatCodeSettings;
- function mergeMaps(target, source) {
- for (var key in source) {
- if (ts.hasProperty(source, key)) {
- target[key] = source[key];
- }
- }
- }
- server.mergeMaps = mergeMaps;
- function removeItemFromSet(items, itemToRemove) {
- if (items.length === 0) {
- return;
- }
- var index = items.indexOf(itemToRemove);
- if (index < 0) {
- return;
- }
- if (index === items.length - 1) {
- items.pop();
- }
- else {
- items[index] = items.pop();
- }
- }
- server.removeItemFromSet = removeItemFromSet;
- function toNormalizedPath(fileName) {
- return ts.normalizePath(fileName);
- }
- server.toNormalizedPath = toNormalizedPath;
- function normalizedPathToPath(normalizedPath, currentDirectory, getCanonicalFileName) {
- var f = ts.isRootedDiskPath(normalizedPath) ? normalizedPath : ts.getNormalizedAbsolutePath(normalizedPath, currentDirectory);
- return getCanonicalFileName(f);
- }
- server.normalizedPathToPath = normalizedPathToPath;
- function asNormalizedPath(fileName) {
- return fileName;
- }
- server.asNormalizedPath = asNormalizedPath;
- function createNormalizedPathMap() {
- var map = Object.create(null);
- return {
- get: function (path) {
- return map[path];
- },
- set: function (path, value) {
- map[path] = value;
- },
- contains: function (path) {
- return ts.hasProperty(map, path);
- },
- remove: function (path) {
- delete map[path];
- }
- };
- }
- server.createNormalizedPathMap = createNormalizedPathMap;
- function throwLanguageServiceIsDisabledError() {
- throw new Error("LanguageService is disabled");
- }
- server.nullLanguageService = {
- cleanupSemanticCache: throwLanguageServiceIsDisabledError,
- getSyntacticDiagnostics: throwLanguageServiceIsDisabledError,
- getSemanticDiagnostics: throwLanguageServiceIsDisabledError,
- getCompilerOptionsDiagnostics: throwLanguageServiceIsDisabledError,
- getSyntacticClassifications: throwLanguageServiceIsDisabledError,
- getEncodedSyntacticClassifications: throwLanguageServiceIsDisabledError,
- getSemanticClassifications: throwLanguageServiceIsDisabledError,
- getEncodedSemanticClassifications: throwLanguageServiceIsDisabledError,
- getCompletionsAtPosition: throwLanguageServiceIsDisabledError,
- findReferences: throwLanguageServiceIsDisabledError,
- getCompletionEntryDetails: throwLanguageServiceIsDisabledError,
- getQuickInfoAtPosition: throwLanguageServiceIsDisabledError,
- findRenameLocations: throwLanguageServiceIsDisabledError,
- getNameOrDottedNameSpan: throwLanguageServiceIsDisabledError,
- getBreakpointStatementAtPosition: throwLanguageServiceIsDisabledError,
- getBraceMatchingAtPosition: throwLanguageServiceIsDisabledError,
- getSignatureHelpItems: throwLanguageServiceIsDisabledError,
- getDefinitionAtPosition: throwLanguageServiceIsDisabledError,
- getRenameInfo: throwLanguageServiceIsDisabledError,
- getTypeDefinitionAtPosition: throwLanguageServiceIsDisabledError,
- getReferencesAtPosition: throwLanguageServiceIsDisabledError,
- getDocumentHighlights: throwLanguageServiceIsDisabledError,
- getOccurrencesAtPosition: throwLanguageServiceIsDisabledError,
- getNavigateToItems: throwLanguageServiceIsDisabledError,
- getNavigationBarItems: throwLanguageServiceIsDisabledError,
- getNavigationTree: throwLanguageServiceIsDisabledError,
- getOutliningSpans: throwLanguageServiceIsDisabledError,
- getTodoComments: throwLanguageServiceIsDisabledError,
- getIndentationAtPosition: throwLanguageServiceIsDisabledError,
- getFormattingEditsForRange: throwLanguageServiceIsDisabledError,
- getFormattingEditsForDocument: throwLanguageServiceIsDisabledError,
- getFormattingEditsAfterKeystroke: throwLanguageServiceIsDisabledError,
- getDocCommentTemplateAtPosition: throwLanguageServiceIsDisabledError,
- isValidBraceCompletionAtPosition: throwLanguageServiceIsDisabledError,
- getEmitOutput: throwLanguageServiceIsDisabledError,
- getProgram: throwLanguageServiceIsDisabledError,
- getNonBoundSourceFile: throwLanguageServiceIsDisabledError,
- dispose: throwLanguageServiceIsDisabledError,
- getCompletionEntrySymbol: throwLanguageServiceIsDisabledError,
- getImplementationAtPosition: throwLanguageServiceIsDisabledError,
- getSourceFile: throwLanguageServiceIsDisabledError,
- getCodeFixesAtPosition: throwLanguageServiceIsDisabledError
- };
- server.nullLanguageServiceHost = {
- setCompilationSettings: function () { return undefined; },
- notifyFileRemoved: function () { return undefined; }
- };
- function isInferredProjectName(name) {
- return /dev\/null\/inferredProject\d+\*/.test(name);
- }
- server.isInferredProjectName = isInferredProjectName;
- function makeInferredProjectName(counter) {
- return "/dev/null/inferredProject" + counter + "*";
- }
- server.makeInferredProjectName = makeInferredProjectName;
- var ThrottledOperations = (function () {
- function ThrottledOperations(host) {
- this.host = host;
- this.pendingTimeouts = ts.createMap();
- }
- ThrottledOperations.prototype.schedule = function (operationId, delay, cb) {
- if (ts.hasProperty(this.pendingTimeouts, operationId)) {
- this.host.clearTimeout(this.pendingTimeouts[operationId]);
- }
- this.pendingTimeouts[operationId] = this.host.setTimeout(ThrottledOperations.run, delay, this, operationId, cb);
- };
- ThrottledOperations.run = function (self, operationId, cb) {
- delete self.pendingTimeouts[operationId];
- cb();
- };
- return ThrottledOperations;
- }());
- server.ThrottledOperations = ThrottledOperations;
- var GcTimer = (function () {
- function GcTimer(host, delay, logger) {
- this.host = host;
- this.delay = delay;
- this.logger = logger;
- }
- GcTimer.prototype.scheduleCollect = function () {
- if (!this.host.gc || this.timerId != undefined) {
- return;
- }
- this.timerId = this.host.setTimeout(GcTimer.run, this.delay, this);
- };
- GcTimer.run = function (self) {
- self.timerId = undefined;
- var log = self.logger.hasLevel(LogLevel.requestTime);
- var before = log && self.host.getMemoryUsage();
- self.host.gc();
- if (log) {
- var after = self.host.getMemoryUsage();
- self.logger.perftrc("GC::before " + before + ", after " + after);
- }
- };
- return GcTimer;
- }());
- server.GcTimer = GcTimer;
- })(server = ts.server || (ts.server = {}));
-})(ts || (ts = {}));
-var ts;
-(function (ts) {
- function trace(host, message) {
+ function trace(host) {
host.trace(ts.formatMessage.apply(undefined, arguments));
}
ts.trace = trace;
@@ -6668,11 +4583,11 @@ var ts;
ts.getSourceFileOfNode = getSourceFileOfNode;
function isStatementWithLocals(node) {
switch (node.kind) {
- case 199:
- case 227:
- case 206:
+ case 200:
+ case 228:
case 207:
case 208:
+ case 209:
return true;
}
return false;
@@ -6793,13 +4708,13 @@ var ts;
switch (node.kind) {
case 9:
return getQuotedEscapedLiteralText('"', node.text, '"');
- case 11:
- return getQuotedEscapedLiteralText("`", node.text, "`");
case 12:
- return getQuotedEscapedLiteralText("`", node.text, "${");
+ return getQuotedEscapedLiteralText("`", node.text, "`");
case 13:
- return getQuotedEscapedLiteralText("}", node.text, "${");
+ return getQuotedEscapedLiteralText("`", node.text, "${");
case 14:
+ return getQuotedEscapedLiteralText("}", node.text, "${");
+ case 15:
return getQuotedEscapedLiteralText("}", node.text, "`");
case 8:
return node.text;
@@ -6841,7 +4756,7 @@ var ts;
}
ts.isBlockOrCatchScoped = isBlockOrCatchScoped;
function isAmbientModule(node) {
- return node && node.kind === 225 &&
+ return node && node.kind === 226 &&
(node.name.kind === 9 || isGlobalScopeAugmentation(node));
}
ts.isAmbientModule = isAmbientModule;
@@ -6850,11 +4765,11 @@ var ts;
}
ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;
function isShorthandAmbientModule(node) {
- return node.kind === 225 && (!node.body);
+ return node.kind === 226 && (!node.body);
}
function isBlockScopedContainerTopLevel(node) {
return node.kind === 256 ||
- node.kind === 225 ||
+ node.kind === 226 ||
isFunctionLike(node);
}
ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel;
@@ -6869,7 +4784,7 @@ var ts;
switch (node.parent.kind) {
case 256:
return ts.isExternalModule(node.parent);
- case 226:
+ case 227:
return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent);
}
return false;
@@ -6878,21 +4793,21 @@ var ts;
function isBlockScope(node, parentNode) {
switch (node.kind) {
case 256:
- case 227:
+ case 228:
case 252:
- case 225:
- case 206:
+ case 226:
case 207:
case 208:
- case 148:
- case 147:
+ case 209:
case 149:
+ case 148:
case 150:
- case 220:
- case 179:
+ case 151:
+ case 221:
case 180:
+ case 181:
return true;
- case 199:
+ case 200:
return parentNode && !isFunctionLike(parentNode);
}
return false;
@@ -6910,7 +4825,7 @@ var ts;
ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer;
function isCatchClauseVariableDeclaration(declaration) {
return declaration &&
- declaration.kind === 218 &&
+ declaration.kind === 219 &&
declaration.parent &&
declaration.parent.kind === 252;
}
@@ -6947,7 +4862,7 @@ var ts;
ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition;
function getErrorSpanForArrowFunction(sourceFile, node) {
var pos = ts.skipTrivia(sourceFile.text, node.pos);
- if (node.body && node.body.kind === 199) {
+ if (node.body && node.body.kind === 200) {
var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line;
var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line;
if (startLine < endLine) {
@@ -6965,23 +4880,23 @@ var ts;
return ts.createTextSpan(0, 0);
}
return getSpanOfTokenAtPosition(sourceFile, pos_1);
- case 218:
- case 169:
- case 221:
- case 192:
+ case 219:
+ case 170:
case 222:
- case 225:
- case 224:
- case 255:
- case 220:
- case 179:
- case 147:
- case 149:
- case 150:
+ case 193:
case 223:
+ case 226:
+ case 225:
+ case 255:
+ case 221:
+ case 180:
+ case 148:
+ case 150:
+ case 151:
+ case 224:
errorNode = node.name;
break;
- case 180:
+ case 181:
return getErrorSpanForArrowFunction(sourceFile, node);
}
if (errorNode === undefined) {
@@ -7002,7 +4917,7 @@ var ts;
}
ts.isDeclarationFile = isDeclarationFile;
function isConstEnumDeclaration(node) {
- return node.kind === 224 && isConst(node);
+ return node.kind === 225 && isConst(node);
}
ts.isConstEnumDeclaration = isConstEnumDeclaration;
function isConst(node) {
@@ -7015,11 +4930,11 @@ var ts;
}
ts.isLet = isLet;
function isSuperCall(n) {
- return n.kind === 174 && n.expression.kind === 95;
+ return n.kind === 175 && n.expression.kind === 96;
}
ts.isSuperCall = isSuperCall;
function isPrologueDirective(node) {
- return node.kind === 202 && node.expression.kind === 9;
+ return node.kind === 203 && node.expression.kind === 9;
}
ts.isPrologueDirective = isPrologueDirective;
function getLeadingCommentRangesOfNode(node, sourceFileOfNode) {
@@ -7035,10 +4950,10 @@ var ts;
}
ts.getJsDocComments = getJsDocComments;
function getJsDocCommentsFromText(node, text) {
- var commentRanges = (node.kind === 142 ||
- node.kind === 141 ||
- node.kind === 179 ||
- node.kind === 180) ?
+ var commentRanges = (node.kind === 143 ||
+ node.kind === 142 ||
+ node.kind === 180 ||
+ node.kind === 181) ?
ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
getLeadingCommentRangesOfNodeFromText(node, text);
return ts.filter(commentRanges, isJsDocComment);
@@ -7053,69 +4968,69 @@ var ts;
ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/;
ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/;
function isPartOfTypeNode(node) {
- if (154 <= node.kind && node.kind <= 166) {
+ if (155 <= node.kind && node.kind <= 167) {
return true;
}
switch (node.kind) {
- case 117:
- case 130:
- case 132:
- case 120:
+ case 118:
+ case 131:
case 133:
- case 135:
- case 127:
+ case 121:
+ case 134:
+ case 136:
+ case 128:
return true;
- case 103:
- return node.parent.kind !== 183;
- case 194:
+ case 104:
+ return node.parent.kind !== 184;
+ case 195:
return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
- case 69:
- if (node.parent.kind === 139 && node.parent.right === node) {
+ case 70:
+ if (node.parent.kind === 140 && node.parent.right === node) {
node = node.parent;
}
- else if (node.parent.kind === 172 && node.parent.name === node) {
+ else if (node.parent.kind === 173 && node.parent.name === node) {
node = node.parent;
}
- ts.Debug.assert(node.kind === 69 || node.kind === 139 || node.kind === 172, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
- case 139:
- case 172:
- case 97:
+ ts.Debug.assert(node.kind === 70 || node.kind === 140 || node.kind === 173, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
+ case 140:
+ case 173:
+ case 98:
var parent_2 = node.parent;
- if (parent_2.kind === 158) {
+ if (parent_2.kind === 159) {
return false;
}
- if (154 <= parent_2.kind && parent_2.kind <= 166) {
+ if (155 <= parent_2.kind && parent_2.kind <= 167) {
return true;
}
switch (parent_2.kind) {
- case 194:
+ case 195:
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_2);
- case 141:
- return node === parent_2.constraint;
- case 145:
- case 144:
case 142:
- case 218:
+ return node === parent_2.constraint;
+ case 146:
+ case 145:
+ case 143:
+ case 219:
return node === parent_2.type;
- case 220:
- case 179:
+ case 221:
case 180:
+ case 181:
+ case 149:
case 148:
case 147:
- case 146:
- case 149:
case 150:
- return node === parent_2.type;
case 151:
+ return node === parent_2.type;
case 152:
case 153:
+ case 154:
return node === parent_2.type;
- case 177:
+ case 178:
return node === parent_2.type;
- case 174:
case 175:
- return parent_2.typeArguments && ts.indexOf(parent_2.typeArguments, node) >= 0;
case 176:
+ return parent_2.typeArguments && ts.indexOf(parent_2.typeArguments, node) >= 0;
+ case 177:
return false;
}
}
@@ -7126,22 +5041,22 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 211:
+ case 212:
return visitor(node);
- case 227:
- case 199:
- case 203:
+ case 228:
+ case 200:
case 204:
case 205:
case 206:
case 207:
case 208:
- case 212:
+ case 209:
case 213:
+ case 214:
case 249:
case 250:
- case 214:
- case 216:
+ case 215:
+ case 217:
case 252:
return ts.forEachChild(node, traverse);
}
@@ -7152,24 +5067,24 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 190:
+ case 191:
visitor(node);
var operand = node.expression;
if (operand) {
traverse(operand);
}
- case 224:
- case 222:
case 225:
case 223:
- case 221:
- case 192:
+ case 226:
+ case 224:
+ case 222:
+ case 193:
return;
default:
if (isFunctionLike(node)) {
- var name_8 = node.name;
- if (name_8 && name_8.kind === 140) {
- traverse(name_8.expression);
+ var name_4 = node.name;
+ if (name_4 && name_4.kind === 141) {
+ traverse(name_4.expression);
return;
}
}
@@ -7183,14 +5098,14 @@ var ts;
function isVariableLike(node) {
if (node) {
switch (node.kind) {
- case 169:
+ case 170:
case 255:
- case 142:
+ case 143:
case 253:
+ case 146:
case 145:
- case 144:
case 254:
- case 218:
+ case 219:
return true;
}
}
@@ -7198,11 +5113,11 @@ var ts;
}
ts.isVariableLike = isVariableLike;
function isAccessor(node) {
- return node && (node.kind === 149 || node.kind === 150);
+ return node && (node.kind === 150 || node.kind === 151);
}
ts.isAccessor = isAccessor;
function isClassLike(node) {
- return node && (node.kind === 221 || node.kind === 192);
+ return node && (node.kind === 222 || node.kind === 193);
}
ts.isClassLike = isClassLike;
function isFunctionLike(node) {
@@ -7211,19 +5126,19 @@ var ts;
ts.isFunctionLike = isFunctionLike;
function isFunctionLikeKind(kind) {
switch (kind) {
- case 148:
- case 179:
- case 220:
- case 180:
- case 147:
- case 146:
case 149:
+ case 180:
+ case 221:
+ case 181:
+ case 148:
+ case 147:
case 150:
case 151:
case 152:
case 153:
- case 156:
+ case 154:
case 157:
+ case 158:
return true;
}
return false;
@@ -7231,13 +5146,13 @@ var ts;
ts.isFunctionLikeKind = isFunctionLikeKind;
function introducesArgumentsExoticObject(node) {
switch (node.kind) {
- case 147:
- case 146:
case 148:
+ case 147:
case 149:
case 150:
- case 220:
- case 179:
+ case 151:
+ case 221:
+ case 180:
return true;
}
return false;
@@ -7245,30 +5160,30 @@ var ts;
ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject;
function isIterationStatement(node, lookInLabeledStatements) {
switch (node.kind) {
- case 206:
case 207:
case 208:
- case 204:
+ case 209:
case 205:
+ case 206:
return true;
- case 214:
+ case 215:
return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements);
}
return false;
}
ts.isIterationStatement = isIterationStatement;
function isFunctionBlock(node) {
- return node && node.kind === 199 && isFunctionLike(node.parent);
+ return node && node.kind === 200 && isFunctionLike(node.parent);
}
ts.isFunctionBlock = isFunctionBlock;
function isObjectLiteralMethod(node) {
- return node && node.kind === 147 && node.parent.kind === 171;
+ return node && node.kind === 148 && node.parent.kind === 172;
}
ts.isObjectLiteralMethod = isObjectLiteralMethod;
function isObjectLiteralOrClassExpressionMethod(node) {
- return node.kind === 147 &&
- (node.parent.kind === 171 ||
- node.parent.kind === 192);
+ return node.kind === 148 &&
+ (node.parent.kind === 172 ||
+ node.parent.kind === 193);
}
ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod;
function isIdentifierTypePredicate(predicate) {
@@ -7304,38 +5219,38 @@ var ts;
return undefined;
}
switch (node.kind) {
- case 140:
+ case 141:
if (isClassLike(node.parent.parent)) {
return node;
}
node = node.parent;
break;
- case 143:
- if (node.parent.kind === 142 && isClassElement(node.parent.parent)) {
+ case 144:
+ if (node.parent.kind === 143 && isClassElement(node.parent.parent)) {
node = node.parent.parent;
}
else if (isClassElement(node.parent)) {
node = node.parent;
}
break;
- case 180:
+ case 181:
if (!includeArrowFunctions) {
continue;
}
- case 220:
- case 179:
- case 225:
- case 145:
- case 144:
- case 147:
+ case 221:
+ case 180:
+ case 226:
case 146:
+ case 145:
case 148:
+ case 147:
case 149:
case 150:
case 151:
case 152:
case 153:
- case 224:
+ case 154:
+ case 225:
case 256:
return node;
}
@@ -7349,25 +5264,25 @@ var ts;
return node;
}
switch (node.kind) {
- case 140:
+ case 141:
node = node.parent;
break;
- case 220:
- case 179:
+ case 221:
case 180:
+ case 181:
if (!stopOnFunctions) {
continue;
}
- case 145:
- case 144:
- case 147:
case 146:
+ case 145:
case 148:
+ case 147:
case 149:
case 150:
+ case 151:
return node;
- case 143:
- if (node.parent.kind === 142 && isClassElement(node.parent.parent)) {
+ case 144:
+ if (node.parent.kind === 143 && isClassElement(node.parent.parent)) {
node = node.parent.parent;
}
else if (isClassElement(node.parent)) {
@@ -7379,14 +5294,14 @@ var ts;
}
ts.getSuperContainer = getSuperContainer;
function getImmediatelyInvokedFunctionExpression(func) {
- if (func.kind === 179 || func.kind === 180) {
+ if (func.kind === 180 || func.kind === 181) {
var prev = func;
var parent_3 = func.parent;
- while (parent_3.kind === 178) {
+ while (parent_3.kind === 179) {
prev = parent_3;
parent_3 = parent_3.parent;
}
- if (parent_3.kind === 174 && parent_3.expression === prev) {
+ if (parent_3.kind === 175 && parent_3.expression === prev) {
return parent_3;
}
}
@@ -7394,20 +5309,20 @@ var ts;
ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression;
function isSuperProperty(node) {
var kind = node.kind;
- return (kind === 172 || kind === 173)
- && node.expression.kind === 95;
+ return (kind === 173 || kind === 174)
+ && node.expression.kind === 96;
}
ts.isSuperProperty = isSuperProperty;
function getEntityNameFromTypeNode(node) {
if (node) {
switch (node.kind) {
- case 155:
+ case 156:
return node.typeName;
- case 194:
+ case 195:
ts.Debug.assert(isEntityNameExpression(node.expression));
return node.expression;
- case 69:
- case 139:
+ case 70:
+ case 140:
return node;
}
}
@@ -7416,10 +5331,10 @@ var ts;
ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode;
function isCallLikeExpression(node) {
switch (node.kind) {
- case 174:
case 175:
case 176:
- case 143:
+ case 177:
+ case 144:
return true;
default:
return false;
@@ -7427,7 +5342,7 @@ var ts;
}
ts.isCallLikeExpression = isCallLikeExpression;
function getInvokedExpression(node) {
- if (node.kind === 176) {
+ if (node.kind === 177) {
return node.tag;
}
return node.expression;
@@ -7435,21 +5350,21 @@ var ts;
ts.getInvokedExpression = getInvokedExpression;
function nodeCanBeDecorated(node) {
switch (node.kind) {
- case 221:
+ case 222:
return true;
- case 145:
- return node.parent.kind === 221;
- case 149:
+ case 146:
+ return node.parent.kind === 222;
case 150:
- case 147:
+ case 151:
+ case 148:
return node.body !== undefined
- && node.parent.kind === 221;
- case 142:
+ && node.parent.kind === 222;
+ case 143:
return node.parent.body !== undefined
- && (node.parent.kind === 148
- || node.parent.kind === 147
- || node.parent.kind === 150)
- && node.parent.parent.kind === 221;
+ && (node.parent.kind === 149
+ || node.parent.kind === 148
+ || node.parent.kind === 151)
+ && node.parent.parent.kind === 222;
}
return false;
}
@@ -7465,18 +5380,18 @@ var ts;
ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated;
function childIsDecorated(node) {
switch (node.kind) {
- case 221:
+ case 222:
return ts.forEach(node.members, nodeOrChildIsDecorated);
- case 147:
- case 150:
+ case 148:
+ case 151:
return ts.forEach(node.parameters, nodeIsDecorated);
}
}
ts.childIsDecorated = childIsDecorated;
function isJSXTagName(node) {
var parent = node.parent;
- if (parent.kind === 243 ||
- parent.kind === 242 ||
+ if (parent.kind === 244 ||
+ parent.kind === 243 ||
parent.kind === 245) {
return parent.tagName === node;
}
@@ -7485,97 +5400,97 @@ var ts;
ts.isJSXTagName = isJSXTagName;
function isPartOfExpression(node) {
switch (node.kind) {
- case 97:
- case 95:
- case 93:
- case 99:
- case 84:
- case 10:
- case 170:
+ case 98:
+ case 96:
+ case 94:
+ case 100:
+ case 85:
+ case 11:
case 171:
case 172:
case 173:
case 174:
case 175:
case 176:
- case 195:
case 177:
case 196:
case 178:
+ case 197:
case 179:
- case 192:
case 180:
- case 183:
+ case 193:
case 181:
+ case 184:
case 182:
- case 185:
+ case 183:
case 186:
case 187:
case 188:
- case 191:
case 189:
- case 11:
- case 193:
- case 241:
- case 242:
+ case 192:
case 190:
- case 184:
+ case 12:
+ case 194:
+ case 242:
+ case 243:
+ case 191:
+ case 185:
return true;
- case 139:
- while (node.parent.kind === 139) {
+ case 140:
+ while (node.parent.kind === 140) {
node = node.parent;
}
- return node.parent.kind === 158 || isJSXTagName(node);
- case 69:
- if (node.parent.kind === 158 || isJSXTagName(node)) {
+ return node.parent.kind === 159 || isJSXTagName(node);
+ case 70:
+ if (node.parent.kind === 159 || isJSXTagName(node)) {
return true;
}
case 8:
case 9:
- case 97:
+ case 98:
var parent_4 = node.parent;
switch (parent_4.kind) {
- case 218:
- case 142:
+ case 219:
+ case 143:
+ case 146:
case 145:
- case 144:
case 255:
case 253:
- case 169:
+ case 170:
return parent_4.initializer === node;
- case 202:
case 203:
case 204:
case 205:
- case 211:
+ case 206:
case 212:
case 213:
+ case 214:
case 249:
- case 215:
- case 213:
+ case 216:
+ case 214:
return parent_4.expression === node;
- case 206:
+ case 207:
var forStatement = parent_4;
- return (forStatement.initializer === node && forStatement.initializer.kind !== 219) ||
+ return (forStatement.initializer === node && forStatement.initializer.kind !== 220) ||
forStatement.condition === node ||
forStatement.incrementor === node;
- case 207:
case 208:
+ case 209:
var forInStatement = parent_4;
- return (forInStatement.initializer === node && forInStatement.initializer.kind !== 219) ||
+ return (forInStatement.initializer === node && forInStatement.initializer.kind !== 220) ||
forInStatement.expression === node;
- case 177:
- case 195:
+ case 178:
+ case 196:
return node === parent_4.expression;
- case 197:
+ case 198:
return node === parent_4.expression;
- case 140:
+ case 141:
return node === parent_4.expression;
- case 143:
+ case 144:
case 248:
case 247:
return true;
- case 194:
+ case 195:
return parent_4.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_4);
default:
if (isPartOfExpression(parent_4)) {
@@ -7593,7 +5508,7 @@ var ts;
}
ts.isInstantiatedModule = isInstantiatedModule;
function isExternalModuleImportEqualsDeclaration(node) {
- return node.kind === 229 && node.moduleReference.kind === 240;
+ return node.kind === 230 && node.moduleReference.kind === 241;
}
ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration;
function getExternalModuleImportEqualsDeclarationExpression(node) {
@@ -7602,7 +5517,7 @@ var ts;
}
ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
function isInternalModuleImportEqualsDeclaration(node) {
- return node.kind === 229 && node.moduleReference.kind !== 240;
+ return node.kind === 230 && node.moduleReference.kind !== 241;
}
ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration;
function isSourceFileJavaScript(file) {
@@ -7614,8 +5529,8 @@ var ts;
}
ts.isInJavaScriptFile = isInJavaScriptFile;
function isRequireCall(expression, checkArgumentIsStringLiteral) {
- var isRequire = expression.kind === 174 &&
- expression.expression.kind === 69 &&
+ var isRequire = expression.kind === 175 &&
+ expression.expression.kind === 70 &&
expression.expression.text === "require" &&
expression.arguments.length === 1;
return isRequire && (!checkArgumentIsStringLiteral || expression.arguments[0].kind === 9);
@@ -7626,9 +5541,9 @@ var ts;
}
ts.isSingleOrDoubleQuote = isSingleOrDoubleQuote;
function isDeclarationOfFunctionExpression(s) {
- if (s.valueDeclaration && s.valueDeclaration.kind === 218) {
+ if (s.valueDeclaration && s.valueDeclaration.kind === 219) {
var declaration = s.valueDeclaration;
- return declaration.initializer && declaration.initializer.kind === 179;
+ return declaration.initializer && declaration.initializer.kind === 180;
}
return false;
}
@@ -7637,15 +5552,15 @@ var ts;
if (!isInJavaScriptFile(expression)) {
return 0;
}
- if (expression.kind !== 187) {
+ if (expression.kind !== 188) {
return 0;
}
var expr = expression;
- if (expr.operatorToken.kind !== 56 || expr.left.kind !== 172) {
+ if (expr.operatorToken.kind !== 57 || expr.left.kind !== 173) {
return 0;
}
var lhs = expr.left;
- if (lhs.expression.kind === 69) {
+ if (lhs.expression.kind === 70) {
var lhsId = lhs.expression;
if (lhsId.text === "exports") {
return 1;
@@ -7654,12 +5569,12 @@ var ts;
return 2;
}
}
- else if (lhs.expression.kind === 97) {
+ else if (lhs.expression.kind === 98) {
return 4;
}
- else if (lhs.expression.kind === 172) {
+ else if (lhs.expression.kind === 173) {
var innerPropertyAccess = lhs.expression;
- if (innerPropertyAccess.expression.kind === 69) {
+ if (innerPropertyAccess.expression.kind === 70) {
var innerPropertyAccessIdentifier = innerPropertyAccess.expression;
if (innerPropertyAccessIdentifier.text === "module" && innerPropertyAccess.name.text === "exports") {
return 1;
@@ -7673,35 +5588,35 @@ var ts;
}
ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind;
function getExternalModuleName(node) {
- if (node.kind === 230) {
+ if (node.kind === 231) {
return node.moduleSpecifier;
}
- if (node.kind === 229) {
+ if (node.kind === 230) {
var reference = node.moduleReference;
- if (reference.kind === 240) {
+ if (reference.kind === 241) {
return reference.expression;
}
}
- if (node.kind === 236) {
+ if (node.kind === 237) {
return node.moduleSpecifier;
}
- if (node.kind === 225 && node.name.kind === 9) {
+ if (node.kind === 226 && node.name.kind === 9) {
return node.name;
}
}
ts.getExternalModuleName = getExternalModuleName;
function getNamespaceDeclarationNode(node) {
- if (node.kind === 229) {
+ if (node.kind === 230) {
return node;
}
var importClause = node.importClause;
- if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 232) {
+ if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 233) {
return importClause.namedBindings;
}
}
ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode;
function isDefaultImport(node) {
- return node.kind === 230
+ return node.kind === 231
&& node.importClause
&& !!node.importClause.name;
}
@@ -7709,13 +5624,13 @@ var ts;
function hasQuestionToken(node) {
if (node) {
switch (node.kind) {
- case 142:
+ case 143:
+ case 148:
case 147:
- case 146:
case 254:
case 253:
+ case 146:
case 145:
- case 144:
return node.questionToken !== undefined;
}
}
@@ -7776,24 +5691,24 @@ var ts;
if (checkParentVariableStatement) {
var isInitializerOfVariableDeclarationInStatement = isVariableLike(node.parent) &&
(node.parent).initializer === node &&
- node.parent.parent.parent.kind === 200;
+ node.parent.parent.parent.kind === 201;
var isVariableOfVariableDeclarationStatement = isVariableLike(node) &&
- node.parent.parent.kind === 200;
+ node.parent.parent.kind === 201;
var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? node.parent.parent.parent :
isVariableOfVariableDeclarationStatement ? node.parent.parent :
undefined;
if (variableStatementNode) {
result = append(result, getJSDocs(variableStatementNode, checkParentVariableStatement, getDocs, getTags));
}
- if (node.kind === 225 &&
- node.parent && node.parent.kind === 225) {
+ if (node.kind === 226 &&
+ node.parent && node.parent.kind === 226) {
result = append(result, getJSDocs(node.parent, checkParentVariableStatement, getDocs, getTags));
}
var parent_5 = node.parent;
var isSourceOfAssignmentExpressionStatement = parent_5 && parent_5.parent &&
- parent_5.kind === 187 &&
- parent_5.operatorToken.kind === 56 &&
- parent_5.parent.kind === 202;
+ parent_5.kind === 188 &&
+ parent_5.operatorToken.kind === 57 &&
+ parent_5.parent.kind === 203;
if (isSourceOfAssignmentExpressionStatement) {
result = append(result, getJSDocs(parent_5.parent, checkParentVariableStatement, getDocs, getTags));
}
@@ -7801,7 +5716,7 @@ var ts;
if (isPropertyAssignmentExpression) {
result = append(result, getJSDocs(parent_5, checkParentVariableStatement, getDocs, getTags));
}
- if (node.kind === 142) {
+ if (node.kind === 143) {
var paramTags = getJSDocParameterTag(node, checkParentVariableStatement);
if (paramTags) {
result = append(result, getTags(paramTags));
@@ -7831,9 +5746,9 @@ var ts;
return [paramTags[i]];
}
}
- else if (param.name.kind === 69) {
- var name_9 = param.name.text;
- var paramTags = ts.filter(tags, function (tag) { return tag.kind === 275 && tag.parameterName.text === name_9; });
+ else if (param.name.kind === 70) {
+ var name_5 = param.name.text;
+ var paramTags = ts.filter(tags, function (tag) { return tag.kind === 275 && tag.parameterName.text === name_5; });
if (paramTags) {
return paramTags;
}
@@ -7855,7 +5770,7 @@ var ts;
}
ts.getJSDocTemplateTag = getJSDocTemplateTag;
function getCorrespondingJSDocParameterTag(parameter) {
- if (parameter.name && parameter.name.kind === 69) {
+ if (parameter.name && parameter.name.kind === 70) {
var parameterName = parameter.name.text;
var jsDocTags = getJSDocTags(parameter.parent, true);
if (!jsDocTags) {
@@ -7900,12 +5815,12 @@ var ts;
}
ts.isDeclaredRestParam = isDeclaredRestParam;
function isAssignmentTarget(node) {
- while (node.parent.kind === 178) {
+ while (node.parent.kind === 179) {
node = node.parent;
}
while (true) {
var parent_6 = node.parent;
- if (parent_6.kind === 170 || parent_6.kind === 191) {
+ if (parent_6.kind === 171 || parent_6.kind === 192) {
node = parent_6;
continue;
}
@@ -7913,10 +5828,10 @@ var ts;
node = parent_6.parent;
continue;
}
- return parent_6.kind === 187 &&
+ return parent_6.kind === 188 &&
isAssignmentOperator(parent_6.operatorToken.kind) &&
parent_6.left === node ||
- (parent_6.kind === 207 || parent_6.kind === 208) &&
+ (parent_6.kind === 208 || parent_6.kind === 209) &&
parent_6.initializer === node;
}
}
@@ -7941,11 +5856,11 @@ var ts;
}
ts.isInAmbientContext = isInAmbientContext;
function isDeclarationName(name) {
- if (name.kind !== 69 && name.kind !== 9 && name.kind !== 8) {
+ if (name.kind !== 70 && name.kind !== 9 && name.kind !== 8) {
return false;
}
var parent = name.parent;
- if (parent.kind === 234 || parent.kind === 238) {
+ if (parent.kind === 235 || parent.kind === 239) {
if (parent.propertyName) {
return true;
}
@@ -7958,48 +5873,48 @@ var ts;
ts.isDeclarationName = isDeclarationName;
function isLiteralComputedPropertyDeclarationName(node) {
return (node.kind === 9 || node.kind === 8) &&
- node.parent.kind === 140 &&
+ node.parent.kind === 141 &&
isDeclaration(node.parent.parent);
}
ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName;
function isIdentifierName(node) {
var parent = node.parent;
switch (parent.kind) {
- case 145:
- case 144:
- case 147:
case 146:
- case 149:
+ case 145:
+ case 148:
+ case 147:
case 150:
+ case 151:
case 255:
case 253:
- case 172:
+ case 173:
return parent.name === node;
- case 139:
+ case 140:
if (parent.right === node) {
- while (parent.kind === 139) {
+ while (parent.kind === 140) {
parent = parent.parent;
}
- return parent.kind === 158;
+ return parent.kind === 159;
}
return false;
- case 169:
- case 234:
+ case 170:
+ case 235:
return parent.propertyName === node;
- case 238:
+ case 239:
return true;
}
return false;
}
ts.isIdentifierName = isIdentifierName;
function isAliasSymbolDeclaration(node) {
- return node.kind === 229 ||
- node.kind === 228 ||
- node.kind === 231 && !!node.name ||
- node.kind === 232 ||
- node.kind === 234 ||
- node.kind === 238 ||
- node.kind === 235 && exportAssignmentIsAlias(node);
+ return node.kind === 230 ||
+ node.kind === 229 ||
+ node.kind === 232 && !!node.name ||
+ node.kind === 233 ||
+ node.kind === 235 ||
+ node.kind === 239 ||
+ node.kind === 236 && exportAssignmentIsAlias(node);
}
ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration;
function exportAssignmentIsAlias(node) {
@@ -8007,17 +5922,17 @@ var ts;
}
ts.exportAssignmentIsAlias = exportAssignmentIsAlias;
function getClassExtendsHeritageClauseElement(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 83);
+ var heritageClause = getHeritageClause(node.heritageClauses, 84);
return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined;
}
ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement;
function getClassImplementsHeritageClauseElements(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 106);
+ var heritageClause = getHeritageClause(node.heritageClauses, 107);
return heritageClause ? heritageClause.types : undefined;
}
ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements;
function getInterfaceBaseTypeNodes(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 83);
+ var heritageClause = getHeritageClause(node.heritageClauses, 84);
return heritageClause ? heritageClause.types : undefined;
}
ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes;
@@ -8085,7 +6000,7 @@ var ts;
}
ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath;
function isKeyword(token) {
- return 70 <= token && token <= 138;
+ return 71 <= token && token <= 139;
}
ts.isKeyword = isKeyword;
function isTrivia(token) {
@@ -8105,7 +6020,7 @@ var ts;
}
ts.hasDynamicName = hasDynamicName;
function isDynamicName(name) {
- return name.kind === 140 &&
+ return name.kind === 141 &&
!isStringOrNumericLiteral(name.expression.kind) &&
!isWellKnownSymbolSyntactically(name.expression);
}
@@ -8115,10 +6030,10 @@ var ts;
}
ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically;
function getPropertyNameForPropertyNameNode(name) {
- if (name.kind === 69 || name.kind === 9 || name.kind === 8 || name.kind === 142) {
+ if (name.kind === 70 || name.kind === 9 || name.kind === 8 || name.kind === 143) {
return name.text;
}
- if (name.kind === 140) {
+ if (name.kind === 141) {
var nameExpression = name.expression;
if (isWellKnownSymbolSyntactically(nameExpression)) {
var rightHandSideName = nameExpression.name.text;
@@ -8136,22 +6051,26 @@ var ts;
}
ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName;
function isESSymbolIdentifier(node) {
- return node.kind === 69 && node.text === "Symbol";
+ return node.kind === 70 && node.text === "Symbol";
}
ts.isESSymbolIdentifier = isESSymbolIdentifier;
+ function isPushOrUnshiftIdentifier(node) {
+ return node.text === "push" || node.text === "unshift";
+ }
+ ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier;
function isModifierKind(token) {
switch (token) {
- case 115:
- case 118:
- case 74:
- case 122:
- case 77:
- case 82:
- case 112:
- case 110:
- case 111:
- case 128:
+ case 116:
+ case 119:
+ case 75:
+ case 123:
+ case 78:
+ case 83:
case 113:
+ case 111:
+ case 112:
+ case 129:
+ case 114:
return true;
}
return false;
@@ -8159,11 +6078,11 @@ var ts;
ts.isModifierKind = isModifierKind;
function isParameterDeclaration(node) {
var root = getRootDeclaration(node);
- return root.kind === 142;
+ return root.kind === 143;
}
ts.isParameterDeclaration = isParameterDeclaration;
function getRootDeclaration(node) {
- while (node.kind === 169) {
+ while (node.kind === 170) {
node = node.parent.parent;
}
return node;
@@ -8171,14 +6090,14 @@ var ts;
ts.getRootDeclaration = getRootDeclaration;
function nodeStartsNewLexicalEnvironment(node) {
var kind = node.kind;
- return kind === 148
- || kind === 179
- || kind === 220
+ return kind === 149
|| kind === 180
- || kind === 147
- || kind === 149
+ || kind === 221
+ || kind === 181
+ || kind === 148
|| kind === 150
- || kind === 225
+ || kind === 151
+ || kind === 226
|| kind === 256;
}
ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment;
@@ -8228,40 +6147,45 @@ var ts;
return node ? ts.getNodeId(node) : 0;
}
ts.getOriginalNodeId = getOriginalNodeId;
+ (function (Associativity) {
+ Associativity[Associativity["Left"] = 0] = "Left";
+ Associativity[Associativity["Right"] = 1] = "Right";
+ })(ts.Associativity || (ts.Associativity = {}));
+ var Associativity = ts.Associativity;
function getExpressionAssociativity(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 175 && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 176 && expression.arguments !== undefined;
return getOperatorAssociativity(expression.kind, operator, hasArguments);
}
ts.getExpressionAssociativity = getExpressionAssociativity;
function getOperatorAssociativity(kind, operator, hasArguments) {
switch (kind) {
- case 175:
+ case 176:
return hasArguments ? 0 : 1;
- case 185:
- case 182:
+ case 186:
case 183:
- case 181:
case 184:
- case 188:
- case 190:
+ case 182:
+ case 185:
+ case 189:
+ case 191:
return 1;
- case 187:
+ case 188:
switch (operator) {
- case 38:
- case 56:
+ case 39:
case 57:
case 58:
- case 60:
case 59:
case 61:
+ case 60:
case 62:
case 63:
case 64:
case 65:
case 66:
- case 68:
case 67:
+ case 69:
+ case 68:
return 1;
}
}
@@ -8270,15 +6194,15 @@ var ts;
ts.getOperatorAssociativity = getOperatorAssociativity;
function getExpressionPrecedence(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 175 && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 176 && expression.arguments !== undefined;
return getOperatorPrecedence(expression.kind, operator, hasArguments);
}
ts.getExpressionPrecedence = getExpressionPrecedence;
function getOperator(expression) {
- if (expression.kind === 187) {
+ if (expression.kind === 188) {
return expression.operatorToken.kind;
}
- else if (expression.kind === 185 || expression.kind === 186) {
+ else if (expression.kind === 186 || expression.kind === 187) {
return expression.operator;
}
else {
@@ -8288,106 +6212,106 @@ var ts;
ts.getOperator = getOperator;
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
switch (nodeKind) {
- case 97:
- case 95:
- case 69:
- case 93:
- case 99:
- case 84:
+ case 98:
+ case 96:
+ case 70:
+ case 94:
+ case 100:
+ case 85:
case 8:
case 9:
- case 170:
case 171:
- case 179:
- case 180:
- case 192:
- case 241:
- case 242:
- case 10:
- case 11:
- case 189:
- case 178:
- case 193:
- return 19;
- case 176:
case 172:
- case 173:
- return 18;
- case 175:
- return hasArguments ? 18 : 17;
- case 174:
- return 17;
- case 186:
- return 16;
- case 185:
- case 182:
- case 183:
+ case 180:
case 181:
- case 184:
- return 15;
+ case 193:
+ case 242:
+ case 243:
+ case 11:
+ case 12:
+ case 190:
+ case 179:
+ case 194:
+ return 19;
+ case 177:
+ case 173:
+ case 174:
+ return 18;
+ case 176:
+ return hasArguments ? 18 : 17;
+ case 175:
+ return 17;
case 187:
+ return 16;
+ case 186:
+ case 183:
+ case 184:
+ case 182:
+ case 185:
+ return 15;
+ case 188:
switch (operatorKind) {
- case 49:
case 50:
+ case 51:
return 15;
- case 38:
- case 37:
case 39:
+ case 38:
case 40:
+ case 41:
return 14;
- case 35:
case 36:
+ case 37:
return 13;
- case 43:
case 44:
case 45:
+ case 46:
return 12;
- case 25:
- case 28:
- case 27:
+ case 26:
case 29:
- case 90:
- case 91:
- return 11;
+ case 28:
case 30:
- case 32:
+ case 91:
+ case 92:
+ return 11;
case 31:
case 33:
+ case 32:
+ case 34:
return 10;
- case 46:
- return 9;
- case 48:
- return 8;
case 47:
+ return 9;
+ case 49:
+ return 8;
+ case 48:
return 7;
- case 51:
- return 6;
case 52:
+ return 6;
+ case 53:
return 5;
- case 56:
case 57:
case 58:
- case 60:
case 59:
case 61:
+ case 60:
case 62:
case 63:
case 64:
case 65:
case 66:
- case 68:
case 67:
+ case 69:
+ case 68:
return 3;
- case 24:
+ case 25:
return 0;
default:
return -1;
}
- case 188:
+ case 189:
return 4;
- case 190:
- return 2;
case 191:
+ return 2;
+ case 192:
return 1;
default:
return -1;
@@ -8651,7 +6575,7 @@ var ts;
function forEachTransformedEmitFile(host, sourceFiles, action, emitOnlyDtsFiles) {
var options = host.getCompilerOptions();
if (options.outFile || options.out) {
- onBundledEmit(host, sourceFiles);
+ onBundledEmit(sourceFiles);
}
else {
for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) {
@@ -8678,7 +6602,7 @@ var ts;
var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (options.declaration || emitOnlyDtsFiles) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined;
action(jsFilePath, sourceMapFilePath, declarationFilePath, [sourceFile], false);
}
- function onBundledEmit(host, sourceFiles) {
+ function onBundledEmit(sourceFiles) {
if (sourceFiles.length) {
var jsFilePath = options.outFile || options.out;
var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options);
@@ -8767,7 +6691,7 @@ var ts;
ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap;
function getFirstConstructorWithBody(node) {
return ts.forEach(node.members, function (member) {
- if (member.kind === 148 && nodeIsPresent(member.body)) {
+ if (member.kind === 149 && nodeIsPresent(member.body)) {
return member;
}
});
@@ -8794,11 +6718,11 @@ var ts;
}
ts.parameterIsThisKeyword = parameterIsThisKeyword;
function isThisIdentifier(node) {
- return node && node.kind === 69 && identifierIsThisKeyword(node);
+ return node && node.kind === 70 && identifierIsThisKeyword(node);
}
ts.isThisIdentifier = isThisIdentifier;
function identifierIsThisKeyword(id) {
- return id.originalKeywordKind === 97;
+ return id.originalKeywordKind === 98;
}
ts.identifierIsThisKeyword = identifierIsThisKeyword;
function getAllAccessorDeclarations(declarations, accessor) {
@@ -8808,10 +6732,10 @@ var ts;
var setAccessor;
if (hasDynamicName(accessor)) {
firstAccessor = accessor;
- if (accessor.kind === 149) {
+ if (accessor.kind === 150) {
getAccessor = accessor;
}
- else if (accessor.kind === 150) {
+ else if (accessor.kind === 151) {
setAccessor = accessor;
}
else {
@@ -8820,7 +6744,7 @@ var ts;
}
else {
ts.forEach(declarations, function (member) {
- if ((member.kind === 149 || member.kind === 150)
+ if ((member.kind === 150 || member.kind === 151)
&& hasModifier(member, 32) === hasModifier(accessor, 32)) {
var memberName = getPropertyNameForPropertyNameNode(member.name);
var accessorName = getPropertyNameForPropertyNameNode(accessor.name);
@@ -8831,10 +6755,10 @@ var ts;
else if (!secondAccessor) {
secondAccessor = member;
}
- if (member.kind === 149 && !getAccessor) {
+ if (member.kind === 150 && !getAccessor) {
getAccessor = member;
}
- if (member.kind === 150 && !setAccessor) {
+ if (member.kind === 151 && !setAccessor) {
setAccessor = member;
}
}
@@ -9026,34 +6950,34 @@ var ts;
ts.getModifierFlags = getModifierFlags;
function modifierToFlag(token) {
switch (token) {
- case 113: return 32;
- case 112: return 4;
- case 111: return 16;
- case 110: return 8;
- case 115: return 128;
- case 82: return 1;
- case 122: return 2;
- case 74: return 2048;
- case 77: return 512;
- case 118: return 256;
- case 128: return 64;
+ case 114: return 32;
+ case 113: return 4;
+ case 112: return 16;
+ case 111: return 8;
+ case 116: return 128;
+ case 83: return 1;
+ case 123: return 2;
+ case 75: return 2048;
+ case 78: return 512;
+ case 119: return 256;
+ case 129: return 64;
}
return 0;
}
ts.modifierToFlag = modifierToFlag;
function isLogicalOperator(token) {
- return token === 52
- || token === 51
- || token === 49;
+ return token === 53
+ || token === 52
+ || token === 50;
}
ts.isLogicalOperator = isLogicalOperator;
function isAssignmentOperator(token) {
- return token >= 56 && token <= 68;
+ return token >= 57 && token <= 69;
}
ts.isAssignmentOperator = isAssignmentOperator;
function tryGetClassExtendingExpressionWithTypeArguments(node) {
- if (node.kind === 194 &&
- node.parent.token === 83 &&
+ if (node.kind === 195 &&
+ node.parent.token === 84 &&
isClassLike(node.parent.parent)) {
return node.parent.parent;
}
@@ -9061,10 +6985,10 @@ var ts;
ts.tryGetClassExtendingExpressionWithTypeArguments = tryGetClassExtendingExpressionWithTypeArguments;
function isDestructuringAssignment(node) {
if (isBinaryExpression(node)) {
- if (node.operatorToken.kind === 56) {
+ if (node.operatorToken.kind === 57) {
var kind = node.left.kind;
- return kind === 171
- || kind === 170;
+ return kind === 172
+ || kind === 171;
}
}
return false;
@@ -9075,7 +6999,7 @@ var ts;
}
ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments;
function isSupportedExpressionWithTypeArgumentsRest(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
return true;
}
else if (isPropertyAccessExpression(node)) {
@@ -9090,21 +7014,21 @@ var ts;
}
ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause;
function isEntityNameExpression(node) {
- return node.kind === 69 ||
- node.kind === 172 && isEntityNameExpression(node.expression);
+ return node.kind === 70 ||
+ node.kind === 173 && isEntityNameExpression(node.expression);
}
ts.isEntityNameExpression = isEntityNameExpression;
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
- return (node.parent.kind === 139 && node.parent.right === node) ||
- (node.parent.kind === 172 && node.parent.name === node);
+ return (node.parent.kind === 140 && node.parent.right === node) ||
+ (node.parent.kind === 173 && node.parent.name === node);
}
ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess;
function isEmptyObjectLiteralOrArrayLiteral(expression) {
var kind = expression.kind;
- if (kind === 171) {
+ if (kind === 172) {
return expression.properties.length === 0;
}
- if (kind === 170) {
+ if (kind === 171) {
return expression.elements.length === 0;
}
return false;
@@ -9228,49 +7152,49 @@ var ts;
var kind = node.kind;
if (kind === 9
|| kind === 8
- || kind === 10
|| kind === 11
- || kind === 69
- || kind === 97
- || kind === 95
- || kind === 99
- || kind === 84
- || kind === 93) {
+ || kind === 12
+ || kind === 70
+ || kind === 98
+ || kind === 96
+ || kind === 100
+ || kind === 85
+ || kind === 94) {
return true;
}
- else if (kind === 172) {
+ else if (kind === 173) {
return isSimpleExpressionWorker(node.expression, depth + 1);
}
- else if (kind === 173) {
+ else if (kind === 174) {
return isSimpleExpressionWorker(node.expression, depth + 1)
&& isSimpleExpressionWorker(node.argumentExpression, depth + 1);
}
- else if (kind === 185
- || kind === 186) {
+ else if (kind === 186
+ || kind === 187) {
return isSimpleExpressionWorker(node.operand, depth + 1);
}
- else if (kind === 187) {
- return node.operatorToken.kind !== 38
+ else if (kind === 188) {
+ return node.operatorToken.kind !== 39
&& isSimpleExpressionWorker(node.left, depth + 1)
&& isSimpleExpressionWorker(node.right, depth + 1);
}
- else if (kind === 188) {
+ else if (kind === 189) {
return isSimpleExpressionWorker(node.condition, depth + 1)
&& isSimpleExpressionWorker(node.whenTrue, depth + 1)
&& isSimpleExpressionWorker(node.whenFalse, depth + 1);
}
- else if (kind === 183
- || kind === 182
- || kind === 181) {
+ else if (kind === 184
+ || kind === 183
+ || kind === 182) {
return isSimpleExpressionWorker(node.expression, depth + 1);
}
- else if (kind === 170) {
+ else if (kind === 171) {
return node.elements.length === 0;
}
- else if (kind === 171) {
+ else if (kind === 172) {
return node.properties.length === 0;
}
- else if (kind === 174) {
+ else if (kind === 175) {
if (!isSimpleExpressionWorker(node.expression, depth + 1)) {
return false;
}
@@ -9292,9 +7216,9 @@ var ts;
if (syntaxKindCache[kind]) {
return syntaxKindCache[kind];
}
- for (var name_10 in syntaxKindEnum) {
- if (syntaxKindEnum[name_10] === kind) {
- return syntaxKindCache[kind] = kind.toString() + " (" + name_10 + ")";
+ for (var name_6 in syntaxKindEnum) {
+ if (syntaxKindEnum[name_6] === kind) {
+ return syntaxKindCache[kind] = kind.toString() + " (" + name_6 + ")";
}
}
}
@@ -9376,7 +7300,7 @@ var ts;
return ts.positionIsSynthesized(range.pos) ? -1 : ts.skipTrivia(sourceFile.text, range.pos);
}
ts.getStartPositionOfRange = getStartPositionOfRange;
- function collectExternalModuleInfo(sourceFile, resolver) {
+ function collectExternalModuleInfo(sourceFile) {
var externalImports = [];
var exportSpecifiers = ts.createMap();
var exportEquals = undefined;
@@ -9384,38 +7308,33 @@ var ts;
for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
var node = _a[_i];
switch (node.kind) {
+ case 231:
+ externalImports.push(node);
+ break;
case 230:
- if (!node.importClause ||
- resolver.isReferencedAliasDeclaration(node.importClause, true)) {
+ if (node.moduleReference.kind === 241) {
externalImports.push(node);
}
break;
- case 229:
- if (node.moduleReference.kind === 240 && resolver.isReferencedAliasDeclaration(node)) {
- externalImports.push(node);
- }
- break;
- case 236:
+ case 237:
if (node.moduleSpecifier) {
if (!node.exportClause) {
- if (resolver.moduleExportsSomeValue(node.moduleSpecifier)) {
- externalImports.push(node);
- hasExportStarsToExportValues = true;
- }
+ externalImports.push(node);
+ hasExportStarsToExportValues = true;
}
- else if (resolver.isValueAliasDeclaration(node)) {
+ else {
externalImports.push(node);
}
}
else {
for (var _b = 0, _c = node.exportClause.elements; _b < _c.length; _b++) {
var specifier = _c[_b];
- var name_11 = (specifier.propertyName || specifier.name).text;
- (exportSpecifiers[name_11] || (exportSpecifiers[name_11] = [])).push(specifier);
+ var name_7 = (specifier.propertyName || specifier.name).text;
+ (exportSpecifiers[name_7] || (exportSpecifiers[name_7] = [])).push(specifier);
}
}
break;
- case 235:
+ case 236:
if (node.isExportEquals && !exportEquals) {
exportEquals = node;
}
@@ -9436,7 +7355,7 @@ var ts;
if (node.symbol) {
for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 221 && declaration !== node) {
+ if (declaration.kind === 222 && declaration !== node) {
return true;
}
}
@@ -9454,15 +7373,15 @@ var ts;
}
ts.isNodeArray = isNodeArray;
function isNoSubstitutionTemplateLiteral(node) {
- return node.kind === 11;
+ return node.kind === 12;
}
ts.isNoSubstitutionTemplateLiteral = isNoSubstitutionTemplateLiteral;
function isLiteralKind(kind) {
- return 8 <= kind && kind <= 11;
+ return 8 <= kind && kind <= 12;
}
ts.isLiteralKind = isLiteralKind;
function isTextualLiteralKind(kind) {
- return kind === 9 || kind === 11;
+ return kind === 9 || kind === 12;
}
ts.isTextualLiteralKind = isTextualLiteralKind;
function isLiteralExpression(node) {
@@ -9470,21 +7389,21 @@ var ts;
}
ts.isLiteralExpression = isLiteralExpression;
function isTemplateLiteralKind(kind) {
- return 11 <= kind && kind <= 14;
+ return 12 <= kind && kind <= 15;
}
ts.isTemplateLiteralKind = isTemplateLiteralKind;
function isTemplateHead(node) {
- return node.kind === 12;
+ return node.kind === 13;
}
ts.isTemplateHead = isTemplateHead;
function isTemplateMiddleOrTemplateTail(node) {
var kind = node.kind;
- return kind === 13
- || kind === 14;
+ return kind === 14
+ || kind === 15;
}
ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail;
function isIdentifier(node) {
- return node.kind === 69;
+ return node.kind === 70;
}
ts.isIdentifier = isIdentifier;
function isGeneratedIdentifier(node) {
@@ -9496,87 +7415,87 @@ var ts;
}
ts.isModifier = isModifier;
function isQualifiedName(node) {
- return node.kind === 139;
+ return node.kind === 140;
}
ts.isQualifiedName = isQualifiedName;
function isComputedPropertyName(node) {
- return node.kind === 140;
+ return node.kind === 141;
}
ts.isComputedPropertyName = isComputedPropertyName;
function isEntityName(node) {
var kind = node.kind;
- return kind === 139
- || kind === 69;
+ return kind === 140
+ || kind === 70;
}
ts.isEntityName = isEntityName;
function isPropertyName(node) {
var kind = node.kind;
- return kind === 69
+ return kind === 70
|| kind === 9
|| kind === 8
- || kind === 140;
+ || kind === 141;
}
ts.isPropertyName = isPropertyName;
function isModuleName(node) {
var kind = node.kind;
- return kind === 69
+ return kind === 70
|| kind === 9;
}
ts.isModuleName = isModuleName;
function isBindingName(node) {
var kind = node.kind;
- return kind === 69
- || kind === 167
- || kind === 168;
+ return kind === 70
+ || kind === 168
+ || kind === 169;
}
ts.isBindingName = isBindingName;
function isTypeParameter(node) {
- return node.kind === 141;
+ return node.kind === 142;
}
ts.isTypeParameter = isTypeParameter;
function isParameter(node) {
- return node.kind === 142;
+ return node.kind === 143;
}
ts.isParameter = isParameter;
function isDecorator(node) {
- return node.kind === 143;
+ return node.kind === 144;
}
ts.isDecorator = isDecorator;
function isMethodDeclaration(node) {
- return node.kind === 147;
+ return node.kind === 148;
}
ts.isMethodDeclaration = isMethodDeclaration;
function isClassElement(node) {
var kind = node.kind;
- return kind === 148
- || kind === 145
- || kind === 147
- || kind === 149
+ return kind === 149
+ || kind === 146
+ || kind === 148
|| kind === 150
- || kind === 153
- || kind === 198;
+ || kind === 151
+ || kind === 154
+ || kind === 199;
}
ts.isClassElement = isClassElement;
function isObjectLiteralElementLike(node) {
var kind = node.kind;
return kind === 253
|| kind === 254
- || kind === 147
- || kind === 149
+ || kind === 148
|| kind === 150
- || kind === 239;
+ || kind === 151
+ || kind === 240;
}
ts.isObjectLiteralElementLike = isObjectLiteralElementLike;
function isTypeNodeKind(kind) {
- return (kind >= 154 && kind <= 166)
- || kind === 117
- || kind === 130
- || kind === 120
- || kind === 132
+ return (kind >= 155 && kind <= 167)
+ || kind === 118
+ || kind === 131
+ || kind === 121
|| kind === 133
- || kind === 103
- || kind === 127
- || kind === 194;
+ || kind === 134
+ || kind === 104
+ || kind === 128
+ || kind === 195;
}
function isTypeNode(node) {
return isTypeNodeKind(node.kind);
@@ -9585,94 +7504,94 @@ var ts;
function isBindingPattern(node) {
if (node) {
var kind = node.kind;
- return kind === 168
- || kind === 167;
+ return kind === 169
+ || kind === 168;
}
return false;
}
ts.isBindingPattern = isBindingPattern;
function isBindingElement(node) {
- return node.kind === 169;
+ return node.kind === 170;
}
ts.isBindingElement = isBindingElement;
function isArrayBindingElement(node) {
var kind = node.kind;
- return kind === 169
- || kind === 193;
+ return kind === 170
+ || kind === 194;
}
ts.isArrayBindingElement = isArrayBindingElement;
function isPropertyAccessExpression(node) {
- return node.kind === 172;
+ return node.kind === 173;
}
ts.isPropertyAccessExpression = isPropertyAccessExpression;
function isElementAccessExpression(node) {
- return node.kind === 173;
+ return node.kind === 174;
}
ts.isElementAccessExpression = isElementAccessExpression;
function isBinaryExpression(node) {
- return node.kind === 187;
+ return node.kind === 188;
}
ts.isBinaryExpression = isBinaryExpression;
function isConditionalExpression(node) {
- return node.kind === 188;
+ return node.kind === 189;
}
ts.isConditionalExpression = isConditionalExpression;
function isCallExpression(node) {
- return node.kind === 174;
+ return node.kind === 175;
}
ts.isCallExpression = isCallExpression;
function isTemplateLiteral(node) {
var kind = node.kind;
- return kind === 189
- || kind === 11;
+ return kind === 190
+ || kind === 12;
}
ts.isTemplateLiteral = isTemplateLiteral;
function isSpreadElementExpression(node) {
- return node.kind === 191;
+ return node.kind === 192;
}
ts.isSpreadElementExpression = isSpreadElementExpression;
function isExpressionWithTypeArguments(node) {
- return node.kind === 194;
+ return node.kind === 195;
}
ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments;
function isLeftHandSideExpressionKind(kind) {
- return kind === 172
- || kind === 173
- || kind === 175
+ return kind === 173
|| kind === 174
- || kind === 241
- || kind === 242
|| kind === 176
- || kind === 170
- || kind === 178
+ || kind === 175
+ || kind === 242
+ || kind === 243
+ || kind === 177
|| kind === 171
- || kind === 192
|| kind === 179
- || kind === 69
- || kind === 10
+ || kind === 172
+ || kind === 193
+ || kind === 180
+ || kind === 70
+ || kind === 11
|| kind === 8
|| kind === 9
- || kind === 11
- || kind === 189
- || kind === 84
- || kind === 93
- || kind === 97
- || kind === 99
- || kind === 95
- || kind === 196;
+ || kind === 12
+ || kind === 190
+ || kind === 85
+ || kind === 94
+ || kind === 98
+ || kind === 100
+ || kind === 96
+ || kind === 197;
}
function isLeftHandSideExpression(node) {
return isLeftHandSideExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind);
}
ts.isLeftHandSideExpression = isLeftHandSideExpression;
function isUnaryExpressionKind(kind) {
- return kind === 185
- || kind === 186
- || kind === 181
+ return kind === 186
+ || kind === 187
|| kind === 182
|| kind === 183
|| kind === 184
- || kind === 177
+ || kind === 185
+ || kind === 178
|| isLeftHandSideExpressionKind(kind);
}
function isUnaryExpression(node) {
@@ -9680,13 +7599,13 @@ var ts;
}
ts.isUnaryExpression = isUnaryExpression;
function isExpressionKind(kind) {
- return kind === 188
- || kind === 190
- || kind === 180
- || kind === 187
+ return kind === 189
|| kind === 191
- || kind === 195
- || kind === 193
+ || kind === 181
+ || kind === 188
+ || kind === 192
+ || kind === 196
+ || kind === 194
|| isUnaryExpressionKind(kind);
}
function isExpression(node) {
@@ -9695,8 +7614,8 @@ var ts;
ts.isExpression = isExpression;
function isAssertionExpression(node) {
var kind = node.kind;
- return kind === 177
- || kind === 195;
+ return kind === 178
+ || kind === 196;
}
ts.isAssertionExpression = isAssertionExpression;
function isPartiallyEmittedExpression(node) {
@@ -9713,15 +7632,15 @@ var ts;
}
ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode;
function isOmittedExpression(node) {
- return node.kind === 193;
+ return node.kind === 194;
}
ts.isOmittedExpression = isOmittedExpression;
function isTemplateSpan(node) {
- return node.kind === 197;
+ return node.kind === 198;
}
ts.isTemplateSpan = isTemplateSpan;
function isBlock(node) {
- return node.kind === 199;
+ return node.kind === 200;
}
ts.isBlock = isBlock;
function isConciseBody(node) {
@@ -9739,118 +7658,118 @@ var ts;
}
ts.isForInitializer = isForInitializer;
function isVariableDeclaration(node) {
- return node.kind === 218;
+ return node.kind === 219;
}
ts.isVariableDeclaration = isVariableDeclaration;
function isVariableDeclarationList(node) {
- return node.kind === 219;
+ return node.kind === 220;
}
ts.isVariableDeclarationList = isVariableDeclarationList;
function isCaseBlock(node) {
- return node.kind === 227;
+ return node.kind === 228;
}
ts.isCaseBlock = isCaseBlock;
function isModuleBody(node) {
var kind = node.kind;
- return kind === 226
- || kind === 225;
+ return kind === 227
+ || kind === 226;
}
ts.isModuleBody = isModuleBody;
function isImportEqualsDeclaration(node) {
- return node.kind === 229;
+ return node.kind === 230;
}
ts.isImportEqualsDeclaration = isImportEqualsDeclaration;
function isImportClause(node) {
- return node.kind === 231;
+ return node.kind === 232;
}
ts.isImportClause = isImportClause;
function isNamedImportBindings(node) {
var kind = node.kind;
- return kind === 233
- || kind === 232;
+ return kind === 234
+ || kind === 233;
}
ts.isNamedImportBindings = isNamedImportBindings;
function isImportSpecifier(node) {
- return node.kind === 234;
+ return node.kind === 235;
}
ts.isImportSpecifier = isImportSpecifier;
function isNamedExports(node) {
- return node.kind === 237;
+ return node.kind === 238;
}
ts.isNamedExports = isNamedExports;
function isExportSpecifier(node) {
- return node.kind === 238;
+ return node.kind === 239;
}
ts.isExportSpecifier = isExportSpecifier;
function isModuleOrEnumDeclaration(node) {
- return node.kind === 225 || node.kind === 224;
+ return node.kind === 226 || node.kind === 225;
}
ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration;
function isDeclarationKind(kind) {
- return kind === 180
- || kind === 169
- || kind === 221
- || kind === 192
- || kind === 148
- || kind === 224
- || kind === 255
- || kind === 238
- || kind === 220
- || kind === 179
- || kind === 149
- || kind === 231
- || kind === 229
- || kind === 234
+ return kind === 181
+ || kind === 170
|| kind === 222
- || kind === 147
- || kind === 146
+ || kind === 193
+ || kind === 149
|| kind === 225
- || kind === 228
- || kind === 232
- || kind === 142
- || kind === 253
- || kind === 145
- || kind === 144
+ || kind === 255
+ || kind === 239
+ || kind === 221
+ || kind === 180
|| kind === 150
- || kind === 254
+ || kind === 232
+ || kind === 230
+ || kind === 235
|| kind === 223
- || kind === 141
- || kind === 218
+ || kind === 148
+ || kind === 147
+ || kind === 226
+ || kind === 229
+ || kind === 233
+ || kind === 143
+ || kind === 253
+ || kind === 146
+ || kind === 145
+ || kind === 151
+ || kind === 254
+ || kind === 224
+ || kind === 142
+ || kind === 219
|| kind === 279;
}
function isDeclarationStatementKind(kind) {
- return kind === 220
- || kind === 239
- || kind === 221
+ return kind === 221
+ || kind === 240
|| kind === 222
|| kind === 223
|| kind === 224
|| kind === 225
+ || kind === 226
+ || kind === 231
|| kind === 230
- || kind === 229
+ || kind === 237
|| kind === 236
- || kind === 235
- || kind === 228;
+ || kind === 229;
}
function isStatementKindButNotDeclarationKind(kind) {
- return kind === 210
- || kind === 209
- || kind === 217
- || kind === 204
- || kind === 202
- || kind === 201
- || kind === 207
- || kind === 208
- || kind === 206
- || kind === 203
- || kind === 214
- || kind === 211
- || kind === 213
- || kind === 215
- || kind === 216
- || kind === 200
+ return kind === 211
+ || kind === 210
+ || kind === 218
|| kind === 205
+ || kind === 203
+ || kind === 202
+ || kind === 208
+ || kind === 209
+ || kind === 207
+ || kind === 204
+ || kind === 215
|| kind === 212
+ || kind === 214
+ || kind === 216
+ || kind === 217
+ || kind === 201
+ || kind === 206
+ || kind === 213
|| kind === 287;
}
function isDeclaration(node) {
@@ -9869,18 +7788,18 @@ var ts;
var kind = node.kind;
return isStatementKindButNotDeclarationKind(kind)
|| isDeclarationStatementKind(kind)
- || kind === 199;
+ || kind === 200;
}
ts.isStatement = isStatement;
function isModuleReference(node) {
var kind = node.kind;
- return kind === 240
- || kind === 139
- || kind === 69;
+ return kind === 241
+ || kind === 140
+ || kind === 70;
}
ts.isModuleReference = isModuleReference;
function isJsxOpeningElement(node) {
- return node.kind === 243;
+ return node.kind === 244;
}
ts.isJsxOpeningElement = isJsxOpeningElement;
function isJsxClosingElement(node) {
@@ -9889,17 +7808,17 @@ var ts;
ts.isJsxClosingElement = isJsxClosingElement;
function isJsxTagNameExpression(node) {
var kind = node.kind;
- return kind === 97
- || kind === 69
- || kind === 172;
+ return kind === 98
+ || kind === 70
+ || kind === 173;
}
ts.isJsxTagNameExpression = isJsxTagNameExpression;
function isJsxChild(node) {
var kind = node.kind;
- return kind === 241
+ return kind === 242
|| kind === 248
- || kind === 242
- || kind === 244;
+ || kind === 243
+ || kind === 10;
}
ts.isJsxChild = isJsxChild;
function isJsxAttributeLike(node) {
@@ -9959,7 +7878,16 @@ var ts;
})(ts || (ts = {}));
(function (ts) {
function getDefaultLibFileName(options) {
- return options.target === 2 ? "lib.es6.d.ts" : "lib.d.ts";
+ switch (options.target) {
+ case 4:
+ return "lib.es2017.d.ts";
+ case 3:
+ return "lib.es2016.d.ts";
+ case 2:
+ return "lib.es6.d.ts";
+ default:
+ return "lib.d.ts";
+ }
}
ts.getDefaultLibFileName = getDefaultLibFileName;
function textSpanEnd(span) {
@@ -10078,9 +8006,9 @@ var ts;
}
ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
function getTypeParameterOwner(d) {
- if (d && d.kind === 141) {
+ if (d && d.kind === 142) {
for (var current = d; current; current = current.parent) {
- if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 222) {
+ if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 223) {
return current;
}
}
@@ -10088,11 +8016,11 @@ var ts;
}
ts.getTypeParameterOwner = getTypeParameterOwner;
function isParameterPropertyDeclaration(node) {
- return ts.hasModifier(node, 92) && node.parent.kind === 148 && ts.isClassLike(node.parent.parent);
+ return ts.hasModifier(node, 92) && node.parent.kind === 149 && ts.isClassLike(node.parent.parent);
}
ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration;
function walkUpBindingElementsAndPatterns(node) {
- while (node && (node.kind === 169 || ts.isBindingPattern(node))) {
+ while (node && (node.kind === 170 || ts.isBindingPattern(node))) {
node = node.parent;
}
return node;
@@ -10100,14 +8028,14 @@ var ts;
function getCombinedModifierFlags(node) {
node = walkUpBindingElementsAndPatterns(node);
var flags = ts.getModifierFlags(node);
- if (node.kind === 218) {
+ if (node.kind === 219) {
node = node.parent;
}
- if (node && node.kind === 219) {
+ if (node && node.kind === 220) {
flags |= ts.getModifierFlags(node);
node = node.parent;
}
- if (node && node.kind === 200) {
+ if (node && node.kind === 201) {
flags |= ts.getModifierFlags(node);
}
return flags;
@@ -10116,14 +8044,14 @@ var ts;
function getCombinedNodeFlags(node) {
node = walkUpBindingElementsAndPatterns(node);
var flags = node.flags;
- if (node.kind === 218) {
+ if (node.kind === 219) {
node = node.parent;
}
- if (node && node.kind === 219) {
+ if (node && node.kind === 220) {
flags |= node.flags;
node = node.parent;
}
- if (node && node.kind === 200) {
+ if (node && node.kind === 201) {
flags |= node.flags;
}
return flags;
@@ -10131,6 +8059,1554 @@ var ts;
ts.getCombinedNodeFlags = getCombinedNodeFlags;
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ function tokenIsIdentifierOrKeyword(token) {
+ return token >= 70;
+ }
+ ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword;
+ var textToToken = ts.createMap({
+ "abstract": 116,
+ "any": 118,
+ "as": 117,
+ "boolean": 121,
+ "break": 71,
+ "case": 72,
+ "catch": 73,
+ "class": 74,
+ "continue": 76,
+ "const": 75,
+ "constructor": 122,
+ "debugger": 77,
+ "declare": 123,
+ "default": 78,
+ "delete": 79,
+ "do": 80,
+ "else": 81,
+ "enum": 82,
+ "export": 83,
+ "extends": 84,
+ "false": 85,
+ "finally": 86,
+ "for": 87,
+ "from": 137,
+ "function": 88,
+ "get": 124,
+ "if": 89,
+ "implements": 107,
+ "import": 90,
+ "in": 91,
+ "instanceof": 92,
+ "interface": 108,
+ "is": 125,
+ "let": 109,
+ "module": 126,
+ "namespace": 127,
+ "never": 128,
+ "new": 93,
+ "null": 94,
+ "number": 131,
+ "package": 110,
+ "private": 111,
+ "protected": 112,
+ "public": 113,
+ "readonly": 129,
+ "require": 130,
+ "global": 138,
+ "return": 95,
+ "set": 132,
+ "static": 114,
+ "string": 133,
+ "super": 96,
+ "switch": 97,
+ "symbol": 134,
+ "this": 98,
+ "throw": 99,
+ "true": 100,
+ "try": 101,
+ "type": 135,
+ "typeof": 102,
+ "undefined": 136,
+ "var": 103,
+ "void": 104,
+ "while": 105,
+ "with": 106,
+ "yield": 115,
+ "async": 119,
+ "await": 120,
+ "of": 139,
+ "{": 16,
+ "}": 17,
+ "(": 18,
+ ")": 19,
+ "[": 20,
+ "]": 21,
+ ".": 22,
+ "...": 23,
+ ";": 24,
+ ",": 25,
+ "<": 26,
+ ">": 28,
+ "<=": 29,
+ ">=": 30,
+ "==": 31,
+ "!=": 32,
+ "===": 33,
+ "!==": 34,
+ "=>": 35,
+ "+": 36,
+ "-": 37,
+ "**": 39,
+ "*": 38,
+ "/": 40,
+ "%": 41,
+ "++": 42,
+ "--": 43,
+ "<<": 44,
+ "": 27,
+ ">>": 45,
+ ">>>": 46,
+ "&": 47,
+ "|": 48,
+ "^": 49,
+ "!": 50,
+ "~": 51,
+ "&&": 52,
+ "||": 53,
+ "?": 54,
+ ":": 55,
+ "=": 57,
+ "+=": 58,
+ "-=": 59,
+ "*=": 60,
+ "**=": 61,
+ "/=": 62,
+ "%=": 63,
+ "<<=": 64,
+ ">>=": 65,
+ ">>>=": 66,
+ "&=": 67,
+ "|=": 68,
+ "^=": 69,
+ "@": 56,
+ });
+ var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
+ var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
+ var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
+ var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
+ function lookupInUnicodeMap(code, map) {
+ if (code < map[0]) {
+ return false;
+ }
+ var lo = 0;
+ var hi = map.length;
+ var mid;
+ while (lo + 1 < hi) {
+ mid = lo + (hi - lo) / 2;
+ mid -= mid % 2;
+ if (map[mid] <= code && code <= map[mid + 1]) {
+ return true;
+ }
+ if (code < map[mid]) {
+ hi = mid;
+ }
+ else {
+ lo = mid + 2;
+ }
+ }
+ return false;
+ }
+ function isUnicodeIdentifierStart(code, languageVersion) {
+ return languageVersion >= 1 ?
+ lookupInUnicodeMap(code, unicodeES5IdentifierStart) :
+ lookupInUnicodeMap(code, unicodeES3IdentifierStart);
+ }
+ ts.isUnicodeIdentifierStart = isUnicodeIdentifierStart;
+ function isUnicodeIdentifierPart(code, languageVersion) {
+ return languageVersion >= 1 ?
+ lookupInUnicodeMap(code, unicodeES5IdentifierPart) :
+ lookupInUnicodeMap(code, unicodeES3IdentifierPart);
+ }
+ function makeReverseMap(source) {
+ var result = [];
+ for (var name_8 in source) {
+ result[source[name_8]] = name_8;
+ }
+ return result;
+ }
+ var tokenStrings = makeReverseMap(textToToken);
+ function tokenToString(t) {
+ return tokenStrings[t];
+ }
+ ts.tokenToString = tokenToString;
+ function stringToToken(s) {
+ return textToToken[s];
+ }
+ ts.stringToToken = stringToToken;
+ function computeLineStarts(text) {
+ var result = new Array();
+ var pos = 0;
+ var lineStart = 0;
+ while (pos < text.length) {
+ var ch = text.charCodeAt(pos);
+ pos++;
+ switch (ch) {
+ case 13:
+ if (text.charCodeAt(pos) === 10) {
+ pos++;
+ }
+ case 10:
+ result.push(lineStart);
+ lineStart = pos;
+ break;
+ default:
+ if (ch > 127 && isLineBreak(ch)) {
+ result.push(lineStart);
+ lineStart = pos;
+ }
+ break;
+ }
+ }
+ result.push(lineStart);
+ return result;
+ }
+ ts.computeLineStarts = computeLineStarts;
+ function getPositionOfLineAndCharacter(sourceFile, line, character) {
+ return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character);
+ }
+ ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter;
+ function computePositionOfLineAndCharacter(lineStarts, line, character) {
+ ts.Debug.assert(line >= 0 && line < lineStarts.length);
+ return lineStarts[line] + character;
+ }
+ ts.computePositionOfLineAndCharacter = computePositionOfLineAndCharacter;
+ function getLineStarts(sourceFile) {
+ return sourceFile.lineMap || (sourceFile.lineMap = computeLineStarts(sourceFile.text));
+ }
+ ts.getLineStarts = getLineStarts;
+ function computeLineAndCharacterOfPosition(lineStarts, position) {
+ var lineNumber = ts.binarySearch(lineStarts, position);
+ if (lineNumber < 0) {
+ lineNumber = ~lineNumber - 1;
+ ts.Debug.assert(lineNumber !== -1, "position cannot precede the beginning of the file");
+ }
+ return {
+ line: lineNumber,
+ character: position - lineStarts[lineNumber]
+ };
+ }
+ ts.computeLineAndCharacterOfPosition = computeLineAndCharacterOfPosition;
+ function getLineAndCharacterOfPosition(sourceFile, position) {
+ return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position);
+ }
+ ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition;
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+ function isWhiteSpace(ch) {
+ return isWhiteSpaceSingleLine(ch) || isLineBreak(ch);
+ }
+ ts.isWhiteSpace = isWhiteSpace;
+ function isWhiteSpaceSingleLine(ch) {
+ return ch === 32 ||
+ ch === 9 ||
+ ch === 11 ||
+ ch === 12 ||
+ ch === 160 ||
+ ch === 133 ||
+ ch === 5760 ||
+ ch >= 8192 && ch <= 8203 ||
+ ch === 8239 ||
+ ch === 8287 ||
+ ch === 12288 ||
+ ch === 65279;
+ }
+ ts.isWhiteSpaceSingleLine = isWhiteSpaceSingleLine;
+ function isLineBreak(ch) {
+ return ch === 10 ||
+ ch === 13 ||
+ ch === 8232 ||
+ ch === 8233;
+ }
+ ts.isLineBreak = isLineBreak;
+ function isDigit(ch) {
+ return ch >= 48 && ch <= 57;
+ }
+ function isOctalDigit(ch) {
+ return ch >= 48 && ch <= 55;
+ }
+ ts.isOctalDigit = isOctalDigit;
+ function couldStartTrivia(text, pos) {
+ var ch = text.charCodeAt(pos);
+ switch (ch) {
+ case 13:
+ case 10:
+ case 9:
+ case 11:
+ case 12:
+ case 32:
+ case 47:
+ case 60:
+ case 61:
+ case 62:
+ return true;
+ case 35:
+ return pos === 0;
+ default:
+ return ch > 127;
+ }
+ }
+ ts.couldStartTrivia = couldStartTrivia;
+ function skipTrivia(text, pos, stopAfterLineBreak, stopAtComments) {
+ if (stopAtComments === void 0) { stopAtComments = false; }
+ if (ts.positionIsSynthesized(pos)) {
+ return pos;
+ }
+ while (true) {
+ var ch = text.charCodeAt(pos);
+ switch (ch) {
+ case 13:
+ if (text.charCodeAt(pos + 1) === 10) {
+ pos++;
+ }
+ case 10:
+ pos++;
+ if (stopAfterLineBreak) {
+ return pos;
+ }
+ continue;
+ case 9:
+ case 11:
+ case 12:
+ case 32:
+ pos++;
+ continue;
+ case 47:
+ if (stopAtComments) {
+ break;
+ }
+ if (text.charCodeAt(pos + 1) === 47) {
+ pos += 2;
+ while (pos < text.length) {
+ if (isLineBreak(text.charCodeAt(pos))) {
+ break;
+ }
+ pos++;
+ }
+ continue;
+ }
+ if (text.charCodeAt(pos + 1) === 42) {
+ pos += 2;
+ while (pos < text.length) {
+ if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) {
+ pos += 2;
+ break;
+ }
+ pos++;
+ }
+ continue;
+ }
+ break;
+ case 60:
+ case 61:
+ case 62:
+ if (isConflictMarkerTrivia(text, pos)) {
+ pos = scanConflictMarkerTrivia(text, pos);
+ continue;
+ }
+ break;
+ case 35:
+ if (pos === 0 && isShebangTrivia(text, pos)) {
+ pos = scanShebangTrivia(text, pos);
+ continue;
+ }
+ break;
+ default:
+ if (ch > 127 && (isWhiteSpace(ch))) {
+ pos++;
+ continue;
+ }
+ break;
+ }
+ return pos;
+ }
+ }
+ ts.skipTrivia = skipTrivia;
+ var mergeConflictMarkerLength = "<<<<<<<".length;
+ function isConflictMarkerTrivia(text, pos) {
+ ts.Debug.assert(pos >= 0);
+ if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) {
+ var ch = text.charCodeAt(pos);
+ if ((pos + mergeConflictMarkerLength) < text.length) {
+ for (var i = 0, n = mergeConflictMarkerLength; i < n; i++) {
+ if (text.charCodeAt(pos + i) !== ch) {
+ return false;
+ }
+ }
+ return ch === 61 ||
+ text.charCodeAt(pos + mergeConflictMarkerLength) === 32;
+ }
+ }
+ return false;
+ }
+ function scanConflictMarkerTrivia(text, pos, error) {
+ if (error) {
+ error(ts.Diagnostics.Merge_conflict_marker_encountered, mergeConflictMarkerLength);
+ }
+ var ch = text.charCodeAt(pos);
+ var len = text.length;
+ if (ch === 60 || ch === 62) {
+ while (pos < len && !isLineBreak(text.charCodeAt(pos))) {
+ pos++;
+ }
+ }
+ else {
+ ts.Debug.assert(ch === 61);
+ while (pos < len) {
+ var ch_1 = text.charCodeAt(pos);
+ if (ch_1 === 62 && isConflictMarkerTrivia(text, pos)) {
+ break;
+ }
+ pos++;
+ }
+ }
+ return pos;
+ }
+ var shebangTriviaRegex = /^#!.*/;
+ function isShebangTrivia(text, pos) {
+ ts.Debug.assert(pos === 0);
+ return shebangTriviaRegex.test(text);
+ }
+ function scanShebangTrivia(text, pos) {
+ var shebang = shebangTriviaRegex.exec(text)[0];
+ pos = pos + shebang.length;
+ return pos;
+ }
+ function iterateCommentRanges(reduce, text, pos, trailing, cb, state, initial) {
+ var pendingPos;
+ var pendingEnd;
+ var pendingKind;
+ var pendingHasTrailingNewLine;
+ var hasPendingCommentRange = false;
+ var collecting = trailing || pos === 0;
+ var accumulator = initial;
+ scan: while (pos >= 0 && pos < text.length) {
+ var ch = text.charCodeAt(pos);
+ switch (ch) {
+ case 13:
+ if (text.charCodeAt(pos + 1) === 10) {
+ pos++;
+ }
+ case 10:
+ pos++;
+ if (trailing) {
+ break scan;
+ }
+ collecting = true;
+ if (hasPendingCommentRange) {
+ pendingHasTrailingNewLine = true;
+ }
+ continue;
+ case 9:
+ case 11:
+ case 12:
+ case 32:
+ pos++;
+ continue;
+ case 47:
+ var nextChar = text.charCodeAt(pos + 1);
+ var hasTrailingNewLine = false;
+ if (nextChar === 47 || nextChar === 42) {
+ var kind = nextChar === 47 ? 2 : 3;
+ var startPos = pos;
+ pos += 2;
+ if (nextChar === 47) {
+ while (pos < text.length) {
+ if (isLineBreak(text.charCodeAt(pos))) {
+ hasTrailingNewLine = true;
+ break;
+ }
+ pos++;
+ }
+ }
+ else {
+ while (pos < text.length) {
+ if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) {
+ pos += 2;
+ break;
+ }
+ pos++;
+ }
+ }
+ if (collecting) {
+ if (hasPendingCommentRange) {
+ accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator);
+ if (!reduce && accumulator) {
+ return accumulator;
+ }
+ hasPendingCommentRange = false;
+ }
+ pendingPos = startPos;
+ pendingEnd = pos;
+ pendingKind = kind;
+ pendingHasTrailingNewLine = hasTrailingNewLine;
+ hasPendingCommentRange = true;
+ }
+ continue;
+ }
+ break scan;
+ default:
+ if (ch > 127 && (isWhiteSpace(ch))) {
+ if (hasPendingCommentRange && isLineBreak(ch)) {
+ pendingHasTrailingNewLine = true;
+ }
+ pos++;
+ continue;
+ }
+ break scan;
+ }
+ }
+ if (hasPendingCommentRange) {
+ accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator);
+ }
+ return accumulator;
+ }
+ function forEachLeadingCommentRange(text, pos, cb, state) {
+ return iterateCommentRanges(false, text, pos, false, cb, state);
+ }
+ ts.forEachLeadingCommentRange = forEachLeadingCommentRange;
+ function forEachTrailingCommentRange(text, pos, cb, state) {
+ return iterateCommentRanges(false, text, pos, true, cb, state);
+ }
+ ts.forEachTrailingCommentRange = forEachTrailingCommentRange;
+ function reduceEachLeadingCommentRange(text, pos, cb, state, initial) {
+ return iterateCommentRanges(true, text, pos, false, cb, state, initial);
+ }
+ ts.reduceEachLeadingCommentRange = reduceEachLeadingCommentRange;
+ function reduceEachTrailingCommentRange(text, pos, cb, state, initial) {
+ return iterateCommentRanges(true, text, pos, true, cb, state, initial);
+ }
+ ts.reduceEachTrailingCommentRange = reduceEachTrailingCommentRange;
+ function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments) {
+ if (!comments) {
+ comments = [];
+ }
+ comments.push({ pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine, kind: kind });
+ return comments;
+ }
+ function getLeadingCommentRanges(text, pos) {
+ return reduceEachLeadingCommentRange(text, pos, appendCommentRange, undefined, undefined);
+ }
+ ts.getLeadingCommentRanges = getLeadingCommentRanges;
+ function getTrailingCommentRanges(text, pos) {
+ return reduceEachTrailingCommentRange(text, pos, appendCommentRange, undefined, undefined);
+ }
+ ts.getTrailingCommentRanges = getTrailingCommentRanges;
+ function getShebang(text) {
+ return shebangTriviaRegex.test(text)
+ ? shebangTriviaRegex.exec(text)[0]
+ : undefined;
+ }
+ ts.getShebang = getShebang;
+ function isIdentifierStart(ch, languageVersion) {
+ return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 ||
+ ch === 36 || ch === 95 ||
+ ch > 127 && isUnicodeIdentifierStart(ch, languageVersion);
+ }
+ ts.isIdentifierStart = isIdentifierStart;
+ function isIdentifierPart(ch, languageVersion) {
+ return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 ||
+ ch >= 48 && ch <= 57 || ch === 36 || ch === 95 ||
+ ch > 127 && isUnicodeIdentifierPart(ch, languageVersion);
+ }
+ ts.isIdentifierPart = isIdentifierPart;
+ function isIdentifierText(name, languageVersion) {
+ if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) {
+ return false;
+ }
+ for (var i = 1, n = name.length; i < n; i++) {
+ if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ ts.isIdentifierText = isIdentifierText;
+ function createScanner(languageVersion, skipTrivia, languageVariant, text, onError, start, length) {
+ if (languageVariant === void 0) { languageVariant = 0; }
+ var pos;
+ var end;
+ var startPos;
+ var tokenPos;
+ var token;
+ var tokenValue;
+ var precedingLineBreak;
+ var hasExtendedUnicodeEscape;
+ var tokenIsUnterminated;
+ setText(text, start, length);
+ return {
+ getStartPos: function () { return startPos; },
+ getTextPos: function () { return pos; },
+ getToken: function () { return token; },
+ getTokenPos: function () { return tokenPos; },
+ getTokenText: function () { return text.substring(tokenPos, pos); },
+ getTokenValue: function () { return tokenValue; },
+ hasExtendedUnicodeEscape: function () { return hasExtendedUnicodeEscape; },
+ hasPrecedingLineBreak: function () { return precedingLineBreak; },
+ isIdentifier: function () { return token === 70 || token > 106; },
+ isReservedWord: function () { return token >= 71 && token <= 106; },
+ isUnterminated: function () { return tokenIsUnterminated; },
+ reScanGreaterToken: reScanGreaterToken,
+ reScanSlashToken: reScanSlashToken,
+ reScanTemplateToken: reScanTemplateToken,
+ scanJsxIdentifier: scanJsxIdentifier,
+ scanJsxAttributeValue: scanJsxAttributeValue,
+ reScanJsxToken: reScanJsxToken,
+ scanJsxToken: scanJsxToken,
+ scanJSDocToken: scanJSDocToken,
+ scan: scan,
+ getText: getText,
+ setText: setText,
+ setScriptTarget: setScriptTarget,
+ setLanguageVariant: setLanguageVariant,
+ setOnError: setOnError,
+ setTextPos: setTextPos,
+ tryScan: tryScan,
+ lookAhead: lookAhead,
+ scanRange: scanRange,
+ };
+ function error(message, length) {
+ if (onError) {
+ onError(message, length || 0);
+ }
+ }
+ function scanNumber() {
+ var start = pos;
+ while (isDigit(text.charCodeAt(pos)))
+ pos++;
+ if (text.charCodeAt(pos) === 46) {
+ pos++;
+ while (isDigit(text.charCodeAt(pos)))
+ pos++;
+ }
+ var end = pos;
+ if (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101) {
+ pos++;
+ if (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45)
+ pos++;
+ if (isDigit(text.charCodeAt(pos))) {
+ pos++;
+ while (isDigit(text.charCodeAt(pos)))
+ pos++;
+ end = pos;
+ }
+ else {
+ error(ts.Diagnostics.Digit_expected);
+ }
+ }
+ return "" + +(text.substring(start, end));
+ }
+ function scanOctalDigits() {
+ var start = pos;
+ while (isOctalDigit(text.charCodeAt(pos))) {
+ pos++;
+ }
+ return +(text.substring(start, pos));
+ }
+ function scanExactNumberOfHexDigits(count) {
+ return scanHexDigits(count, false);
+ }
+ function scanMinimumNumberOfHexDigits(count) {
+ return scanHexDigits(count, true);
+ }
+ function scanHexDigits(minCount, scanAsManyAsPossible) {
+ var digits = 0;
+ var value = 0;
+ while (digits < minCount || scanAsManyAsPossible) {
+ var ch = text.charCodeAt(pos);
+ if (ch >= 48 && ch <= 57) {
+ value = value * 16 + ch - 48;
+ }
+ else if (ch >= 65 && ch <= 70) {
+ value = value * 16 + ch - 65 + 10;
+ }
+ else if (ch >= 97 && ch <= 102) {
+ value = value * 16 + ch - 97 + 10;
+ }
+ else {
+ break;
+ }
+ pos++;
+ digits++;
+ }
+ if (digits < minCount) {
+ value = -1;
+ }
+ return value;
+ }
+ function scanString(allowEscapes) {
+ if (allowEscapes === void 0) { allowEscapes = true; }
+ var quote = text.charCodeAt(pos);
+ pos++;
+ var result = "";
+ var start = pos;
+ while (true) {
+ if (pos >= end) {
+ result += text.substring(start, pos);
+ tokenIsUnterminated = true;
+ error(ts.Diagnostics.Unterminated_string_literal);
+ break;
+ }
+ var ch = text.charCodeAt(pos);
+ if (ch === quote) {
+ result += text.substring(start, pos);
+ pos++;
+ break;
+ }
+ if (ch === 92 && allowEscapes) {
+ result += text.substring(start, pos);
+ result += scanEscapeSequence();
+ start = pos;
+ continue;
+ }
+ if (isLineBreak(ch)) {
+ result += text.substring(start, pos);
+ tokenIsUnterminated = true;
+ error(ts.Diagnostics.Unterminated_string_literal);
+ break;
+ }
+ pos++;
+ }
+ return result;
+ }
+ function scanTemplateAndSetTokenValue() {
+ var startedWithBacktick = text.charCodeAt(pos) === 96;
+ pos++;
+ var start = pos;
+ var contents = "";
+ var resultingToken;
+ while (true) {
+ if (pos >= end) {
+ contents += text.substring(start, pos);
+ tokenIsUnterminated = true;
+ error(ts.Diagnostics.Unterminated_template_literal);
+ resultingToken = startedWithBacktick ? 12 : 15;
+ break;
+ }
+ var currChar = text.charCodeAt(pos);
+ if (currChar === 96) {
+ contents += text.substring(start, pos);
+ pos++;
+ resultingToken = startedWithBacktick ? 12 : 15;
+ break;
+ }
+ if (currChar === 36 && pos + 1 < end && text.charCodeAt(pos + 1) === 123) {
+ contents += text.substring(start, pos);
+ pos += 2;
+ resultingToken = startedWithBacktick ? 13 : 14;
+ break;
+ }
+ if (currChar === 92) {
+ contents += text.substring(start, pos);
+ contents += scanEscapeSequence();
+ start = pos;
+ continue;
+ }
+ if (currChar === 13) {
+ contents += text.substring(start, pos);
+ pos++;
+ if (pos < end && text.charCodeAt(pos) === 10) {
+ pos++;
+ }
+ contents += "\n";
+ start = pos;
+ continue;
+ }
+ pos++;
+ }
+ ts.Debug.assert(resultingToken !== undefined);
+ tokenValue = contents;
+ return resultingToken;
+ }
+ function scanEscapeSequence() {
+ pos++;
+ if (pos >= end) {
+ error(ts.Diagnostics.Unexpected_end_of_text);
+ return "";
+ }
+ var ch = text.charCodeAt(pos);
+ pos++;
+ switch (ch) {
+ case 48:
+ return "\0";
+ case 98:
+ return "\b";
+ case 116:
+ return "\t";
+ case 110:
+ return "\n";
+ case 118:
+ return "\v";
+ case 102:
+ return "\f";
+ case 114:
+ return "\r";
+ case 39:
+ return "\'";
+ case 34:
+ return "\"";
+ case 117:
+ if (pos < end && text.charCodeAt(pos) === 123) {
+ hasExtendedUnicodeEscape = true;
+ pos++;
+ return scanExtendedUnicodeEscape();
+ }
+ return scanHexadecimalEscape(4);
+ case 120:
+ return scanHexadecimalEscape(2);
+ case 13:
+ if (pos < end && text.charCodeAt(pos) === 10) {
+ pos++;
+ }
+ case 10:
+ case 8232:
+ case 8233:
+ return "";
+ default:
+ return String.fromCharCode(ch);
+ }
+ }
+ function scanHexadecimalEscape(numDigits) {
+ var escapedValue = scanExactNumberOfHexDigits(numDigits);
+ if (escapedValue >= 0) {
+ return String.fromCharCode(escapedValue);
+ }
+ else {
+ error(ts.Diagnostics.Hexadecimal_digit_expected);
+ return "";
+ }
+ }
+ function scanExtendedUnicodeEscape() {
+ var escapedValue = scanMinimumNumberOfHexDigits(1);
+ var isInvalidExtendedEscape = false;
+ if (escapedValue < 0) {
+ error(ts.Diagnostics.Hexadecimal_digit_expected);
+ isInvalidExtendedEscape = true;
+ }
+ else if (escapedValue > 0x10FFFF) {
+ error(ts.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
+ isInvalidExtendedEscape = true;
+ }
+ if (pos >= end) {
+ error(ts.Diagnostics.Unexpected_end_of_text);
+ isInvalidExtendedEscape = true;
+ }
+ else if (text.charCodeAt(pos) === 125) {
+ pos++;
+ }
+ else {
+ error(ts.Diagnostics.Unterminated_Unicode_escape_sequence);
+ isInvalidExtendedEscape = true;
+ }
+ if (isInvalidExtendedEscape) {
+ return "";
+ }
+ return utf16EncodeAsString(escapedValue);
+ }
+ function utf16EncodeAsString(codePoint) {
+ ts.Debug.assert(0x0 <= codePoint && codePoint <= 0x10FFFF);
+ if (codePoint <= 65535) {
+ return String.fromCharCode(codePoint);
+ }
+ var codeUnit1 = Math.floor((codePoint - 65536) / 1024) + 0xD800;
+ var codeUnit2 = ((codePoint - 65536) % 1024) + 0xDC00;
+ return String.fromCharCode(codeUnit1, codeUnit2);
+ }
+ function peekUnicodeEscape() {
+ if (pos + 5 < end && text.charCodeAt(pos + 1) === 117) {
+ var start_1 = pos;
+ pos += 2;
+ var value = scanExactNumberOfHexDigits(4);
+ pos = start_1;
+ return value;
+ }
+ return -1;
+ }
+ function scanIdentifierParts() {
+ var result = "";
+ var start = pos;
+ while (pos < end) {
+ var ch = text.charCodeAt(pos);
+ if (isIdentifierPart(ch, languageVersion)) {
+ pos++;
+ }
+ else if (ch === 92) {
+ ch = peekUnicodeEscape();
+ if (!(ch >= 0 && isIdentifierPart(ch, languageVersion))) {
+ break;
+ }
+ result += text.substring(start, pos);
+ result += String.fromCharCode(ch);
+ pos += 6;
+ start = pos;
+ }
+ else {
+ break;
+ }
+ }
+ result += text.substring(start, pos);
+ return result;
+ }
+ function getIdentifierToken() {
+ var len = tokenValue.length;
+ if (len >= 2 && len <= 11) {
+ var ch = tokenValue.charCodeAt(0);
+ if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) {
+ return token = textToToken[tokenValue];
+ }
+ }
+ return token = 70;
+ }
+ function scanBinaryOrOctalDigits(base) {
+ ts.Debug.assert(base === 2 || base === 8, "Expected either base 2 or base 8");
+ var value = 0;
+ var numberOfDigits = 0;
+ while (true) {
+ var ch = text.charCodeAt(pos);
+ var valueOfCh = ch - 48;
+ if (!isDigit(ch) || valueOfCh >= base) {
+ break;
+ }
+ value = value * base + valueOfCh;
+ pos++;
+ numberOfDigits++;
+ }
+ if (numberOfDigits === 0) {
+ return -1;
+ }
+ return value;
+ }
+ function scan() {
+ startPos = pos;
+ hasExtendedUnicodeEscape = false;
+ precedingLineBreak = false;
+ tokenIsUnterminated = false;
+ while (true) {
+ tokenPos = pos;
+ if (pos >= end) {
+ return token = 1;
+ }
+ var ch = text.charCodeAt(pos);
+ if (ch === 35 && pos === 0 && isShebangTrivia(text, pos)) {
+ pos = scanShebangTrivia(text, pos);
+ if (skipTrivia) {
+ continue;
+ }
+ else {
+ return token = 6;
+ }
+ }
+ switch (ch) {
+ case 10:
+ case 13:
+ precedingLineBreak = true;
+ if (skipTrivia) {
+ pos++;
+ continue;
+ }
+ else {
+ if (ch === 13 && pos + 1 < end && text.charCodeAt(pos + 1) === 10) {
+ pos += 2;
+ }
+ else {
+ pos++;
+ }
+ return token = 4;
+ }
+ case 9:
+ case 11:
+ case 12:
+ case 32:
+ if (skipTrivia) {
+ pos++;
+ continue;
+ }
+ else {
+ while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) {
+ pos++;
+ }
+ return token = 5;
+ }
+ case 33:
+ if (text.charCodeAt(pos + 1) === 61) {
+ if (text.charCodeAt(pos + 2) === 61) {
+ return pos += 3, token = 34;
+ }
+ return pos += 2, token = 32;
+ }
+ pos++;
+ return token = 50;
+ case 34:
+ case 39:
+ tokenValue = scanString();
+ return token = 9;
+ case 96:
+ return token = scanTemplateAndSetTokenValue();
+ case 37:
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 63;
+ }
+ pos++;
+ return token = 41;
+ case 38:
+ if (text.charCodeAt(pos + 1) === 38) {
+ return pos += 2, token = 52;
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 67;
+ }
+ pos++;
+ return token = 47;
+ case 40:
+ pos++;
+ return token = 18;
+ case 41:
+ pos++;
+ return token = 19;
+ case 42:
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 60;
+ }
+ if (text.charCodeAt(pos + 1) === 42) {
+ if (text.charCodeAt(pos + 2) === 61) {
+ return pos += 3, token = 61;
+ }
+ return pos += 2, token = 39;
+ }
+ pos++;
+ return token = 38;
+ case 43:
+ if (text.charCodeAt(pos + 1) === 43) {
+ return pos += 2, token = 42;
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 58;
+ }
+ pos++;
+ return token = 36;
+ case 44:
+ pos++;
+ return token = 25;
+ case 45:
+ if (text.charCodeAt(pos + 1) === 45) {
+ return pos += 2, token = 43;
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 59;
+ }
+ pos++;
+ return token = 37;
+ case 46:
+ if (isDigit(text.charCodeAt(pos + 1))) {
+ tokenValue = scanNumber();
+ return token = 8;
+ }
+ if (text.charCodeAt(pos + 1) === 46 && text.charCodeAt(pos + 2) === 46) {
+ return pos += 3, token = 23;
+ }
+ pos++;
+ return token = 22;
+ case 47:
+ if (text.charCodeAt(pos + 1) === 47) {
+ pos += 2;
+ while (pos < end) {
+ if (isLineBreak(text.charCodeAt(pos))) {
+ break;
+ }
+ pos++;
+ }
+ if (skipTrivia) {
+ continue;
+ }
+ else {
+ return token = 2;
+ }
+ }
+ if (text.charCodeAt(pos + 1) === 42) {
+ pos += 2;
+ var commentClosed = false;
+ while (pos < end) {
+ var ch_2 = text.charCodeAt(pos);
+ if (ch_2 === 42 && text.charCodeAt(pos + 1) === 47) {
+ pos += 2;
+ commentClosed = true;
+ break;
+ }
+ if (isLineBreak(ch_2)) {
+ precedingLineBreak = true;
+ }
+ pos++;
+ }
+ if (!commentClosed) {
+ error(ts.Diagnostics.Asterisk_Slash_expected);
+ }
+ if (skipTrivia) {
+ continue;
+ }
+ else {
+ tokenIsUnterminated = !commentClosed;
+ return token = 3;
+ }
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 62;
+ }
+ pos++;
+ return token = 40;
+ case 48:
+ if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) {
+ pos += 2;
+ var value = scanMinimumNumberOfHexDigits(1);
+ if (value < 0) {
+ error(ts.Diagnostics.Hexadecimal_digit_expected);
+ value = 0;
+ }
+ tokenValue = "" + value;
+ return token = 8;
+ }
+ else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) {
+ pos += 2;
+ var value = scanBinaryOrOctalDigits(2);
+ if (value < 0) {
+ error(ts.Diagnostics.Binary_digit_expected);
+ value = 0;
+ }
+ tokenValue = "" + value;
+ return token = 8;
+ }
+ else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) {
+ pos += 2;
+ var value = scanBinaryOrOctalDigits(8);
+ if (value < 0) {
+ error(ts.Diagnostics.Octal_digit_expected);
+ value = 0;
+ }
+ tokenValue = "" + value;
+ return token = 8;
+ }
+ if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) {
+ tokenValue = "" + scanOctalDigits();
+ return token = 8;
+ }
+ case 49:
+ case 50:
+ case 51:
+ case 52:
+ case 53:
+ case 54:
+ case 55:
+ case 56:
+ case 57:
+ tokenValue = scanNumber();
+ return token = 8;
+ case 58:
+ pos++;
+ return token = 55;
+ case 59:
+ pos++;
+ return token = 24;
+ case 60:
+ if (isConflictMarkerTrivia(text, pos)) {
+ pos = scanConflictMarkerTrivia(text, pos, error);
+ if (skipTrivia) {
+ continue;
+ }
+ else {
+ return token = 7;
+ }
+ }
+ if (text.charCodeAt(pos + 1) === 60) {
+ if (text.charCodeAt(pos + 2) === 61) {
+ return pos += 3, token = 64;
+ }
+ return pos += 2, token = 44;
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 29;
+ }
+ if (languageVariant === 1 &&
+ text.charCodeAt(pos + 1) === 47 &&
+ text.charCodeAt(pos + 2) !== 42) {
+ return pos += 2, token = 27;
+ }
+ pos++;
+ return token = 26;
+ case 61:
+ if (isConflictMarkerTrivia(text, pos)) {
+ pos = scanConflictMarkerTrivia(text, pos, error);
+ if (skipTrivia) {
+ continue;
+ }
+ else {
+ return token = 7;
+ }
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ if (text.charCodeAt(pos + 2) === 61) {
+ return pos += 3, token = 33;
+ }
+ return pos += 2, token = 31;
+ }
+ if (text.charCodeAt(pos + 1) === 62) {
+ return pos += 2, token = 35;
+ }
+ pos++;
+ return token = 57;
+ case 62:
+ if (isConflictMarkerTrivia(text, pos)) {
+ pos = scanConflictMarkerTrivia(text, pos, error);
+ if (skipTrivia) {
+ continue;
+ }
+ else {
+ return token = 7;
+ }
+ }
+ pos++;
+ return token = 28;
+ case 63:
+ pos++;
+ return token = 54;
+ case 91:
+ pos++;
+ return token = 20;
+ case 93:
+ pos++;
+ return token = 21;
+ case 94:
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 69;
+ }
+ pos++;
+ return token = 49;
+ case 123:
+ pos++;
+ return token = 16;
+ case 124:
+ if (text.charCodeAt(pos + 1) === 124) {
+ return pos += 2, token = 53;
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 68;
+ }
+ pos++;
+ return token = 48;
+ case 125:
+ pos++;
+ return token = 17;
+ case 126:
+ pos++;
+ return token = 51;
+ case 64:
+ pos++;
+ return token = 56;
+ case 92:
+ var cookedChar = peekUnicodeEscape();
+ if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) {
+ pos += 6;
+ tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts();
+ return token = getIdentifierToken();
+ }
+ error(ts.Diagnostics.Invalid_character);
+ pos++;
+ return token = 0;
+ default:
+ if (isIdentifierStart(ch, languageVersion)) {
+ pos++;
+ while (pos < end && isIdentifierPart(ch = text.charCodeAt(pos), languageVersion))
+ pos++;
+ tokenValue = text.substring(tokenPos, pos);
+ if (ch === 92) {
+ tokenValue += scanIdentifierParts();
+ }
+ return token = getIdentifierToken();
+ }
+ else if (isWhiteSpaceSingleLine(ch)) {
+ pos++;
+ continue;
+ }
+ else if (isLineBreak(ch)) {
+ precedingLineBreak = true;
+ pos++;
+ continue;
+ }
+ error(ts.Diagnostics.Invalid_character);
+ pos++;
+ return token = 0;
+ }
+ }
+ }
+ function reScanGreaterToken() {
+ if (token === 28) {
+ if (text.charCodeAt(pos) === 62) {
+ if (text.charCodeAt(pos + 1) === 62) {
+ if (text.charCodeAt(pos + 2) === 61) {
+ return pos += 3, token = 66;
+ }
+ return pos += 2, token = 46;
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 65;
+ }
+ pos++;
+ return token = 45;
+ }
+ if (text.charCodeAt(pos) === 61) {
+ pos++;
+ return token = 30;
+ }
+ }
+ return token;
+ }
+ function reScanSlashToken() {
+ if (token === 40 || token === 62) {
+ var p = tokenPos + 1;
+ var inEscape = false;
+ var inCharacterClass = false;
+ while (true) {
+ if (p >= end) {
+ tokenIsUnterminated = true;
+ error(ts.Diagnostics.Unterminated_regular_expression_literal);
+ break;
+ }
+ var ch = text.charCodeAt(p);
+ if (isLineBreak(ch)) {
+ tokenIsUnterminated = true;
+ error(ts.Diagnostics.Unterminated_regular_expression_literal);
+ break;
+ }
+ if (inEscape) {
+ inEscape = false;
+ }
+ else if (ch === 47 && !inCharacterClass) {
+ p++;
+ break;
+ }
+ else if (ch === 91) {
+ inCharacterClass = true;
+ }
+ else if (ch === 92) {
+ inEscape = true;
+ }
+ else if (ch === 93) {
+ inCharacterClass = false;
+ }
+ p++;
+ }
+ while (p < end && isIdentifierPart(text.charCodeAt(p), languageVersion)) {
+ p++;
+ }
+ pos = p;
+ tokenValue = text.substring(tokenPos, pos);
+ token = 11;
+ }
+ return token;
+ }
+ function reScanTemplateToken() {
+ ts.Debug.assert(token === 17, "'reScanTemplateToken' should only be called on a '}'");
+ pos = tokenPos;
+ return token = scanTemplateAndSetTokenValue();
+ }
+ function reScanJsxToken() {
+ pos = tokenPos = startPos;
+ return token = scanJsxToken();
+ }
+ function scanJsxToken() {
+ startPos = tokenPos = pos;
+ if (pos >= end) {
+ return token = 1;
+ }
+ var char = text.charCodeAt(pos);
+ if (char === 60) {
+ if (text.charCodeAt(pos + 1) === 47) {
+ pos += 2;
+ return token = 27;
+ }
+ pos++;
+ return token = 26;
+ }
+ if (char === 123) {
+ pos++;
+ return token = 16;
+ }
+ while (pos < end) {
+ pos++;
+ char = text.charCodeAt(pos);
+ if ((char === 123) || (char === 60)) {
+ break;
+ }
+ }
+ return token = 10;
+ }
+ function scanJsxIdentifier() {
+ if (tokenIsIdentifierOrKeyword(token)) {
+ var firstCharPosition = pos;
+ while (pos < end) {
+ var ch = text.charCodeAt(pos);
+ if (ch === 45 || ((firstCharPosition === pos) ? isIdentifierStart(ch, languageVersion) : isIdentifierPart(ch, languageVersion))) {
+ pos++;
+ }
+ else {
+ break;
+ }
+ }
+ tokenValue += text.substr(firstCharPosition, pos - firstCharPosition);
+ }
+ return token;
+ }
+ function scanJsxAttributeValue() {
+ startPos = pos;
+ switch (text.charCodeAt(pos)) {
+ case 34:
+ case 39:
+ tokenValue = scanString(false);
+ return token = 9;
+ default:
+ return scan();
+ }
+ }
+ function scanJSDocToken() {
+ if (pos >= end) {
+ return token = 1;
+ }
+ startPos = pos;
+ tokenPos = pos;
+ var ch = text.charCodeAt(pos);
+ switch (ch) {
+ case 9:
+ case 11:
+ case 12:
+ case 32:
+ while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) {
+ pos++;
+ }
+ return token = 5;
+ case 64:
+ pos++;
+ return token = 56;
+ case 10:
+ case 13:
+ pos++;
+ return token = 4;
+ case 42:
+ pos++;
+ return token = 38;
+ case 123:
+ pos++;
+ return token = 16;
+ case 125:
+ pos++;
+ return token = 17;
+ case 91:
+ pos++;
+ return token = 20;
+ case 93:
+ pos++;
+ return token = 21;
+ case 61:
+ pos++;
+ return token = 57;
+ case 44:
+ pos++;
+ return token = 25;
+ }
+ if (isIdentifierStart(ch, 4)) {
+ pos++;
+ while (isIdentifierPart(text.charCodeAt(pos), 4) && pos < end) {
+ pos++;
+ }
+ return token = 70;
+ }
+ else {
+ return pos += 1, token = 0;
+ }
+ }
+ function speculationHelper(callback, isLookahead) {
+ var savePos = pos;
+ var saveStartPos = startPos;
+ var saveTokenPos = tokenPos;
+ var saveToken = token;
+ var saveTokenValue = tokenValue;
+ var savePrecedingLineBreak = precedingLineBreak;
+ var result = callback();
+ if (!result || isLookahead) {
+ pos = savePos;
+ startPos = saveStartPos;
+ tokenPos = saveTokenPos;
+ token = saveToken;
+ tokenValue = saveTokenValue;
+ precedingLineBreak = savePrecedingLineBreak;
+ }
+ return result;
+ }
+ function scanRange(start, length, callback) {
+ var saveEnd = end;
+ var savePos = pos;
+ var saveStartPos = startPos;
+ var saveTokenPos = tokenPos;
+ var saveToken = token;
+ var savePrecedingLineBreak = precedingLineBreak;
+ var saveTokenValue = tokenValue;
+ var saveHasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
+ var saveTokenIsUnterminated = tokenIsUnterminated;
+ setText(text, start, length);
+ var result = callback();
+ end = saveEnd;
+ pos = savePos;
+ startPos = saveStartPos;
+ tokenPos = saveTokenPos;
+ token = saveToken;
+ precedingLineBreak = savePrecedingLineBreak;
+ tokenValue = saveTokenValue;
+ hasExtendedUnicodeEscape = saveHasExtendedUnicodeEscape;
+ tokenIsUnterminated = saveTokenIsUnterminated;
+ return result;
+ }
+ function lookAhead(callback) {
+ return speculationHelper(callback, true);
+ }
+ function tryScan(callback) {
+ return speculationHelper(callback, false);
+ }
+ function getText() {
+ return text;
+ }
+ function setText(newText, start, length) {
+ text = newText || "";
+ end = length === undefined ? text.length : start + length;
+ setTextPos(start || 0);
+ }
+ function setOnError(errorCallback) {
+ onError = errorCallback;
+ }
+ function setScriptTarget(scriptTarget) {
+ languageVersion = scriptTarget;
+ }
+ function setLanguageVariant(variant) {
+ languageVariant = variant;
+ }
+ function setTextPos(textPos) {
+ ts.Debug.assert(textPos >= 0);
+ pos = textPos;
+ startPos = textPos;
+ tokenPos = textPos;
+ token = 0;
+ precedingLineBreak = false;
+ tokenValue = undefined;
+ hasExtendedUnicodeEscape = false;
+ tokenIsUnterminated = false;
+ }
+ }
+ ts.createScanner = createScanner;
+})(ts || (ts = {}));
+var ts;
(function (ts) {
var NodeConstructor;
var SourceFileConstructor;
@@ -10216,7 +9692,7 @@ var ts;
return node;
}
else if (typeof value === "boolean") {
- return createNode(value ? 99 : 84, location, undefined);
+ return createNode(value ? 100 : 85, location, undefined);
}
else if (typeof value === "string") {
var node = createNode(9, location, undefined);
@@ -10233,7 +9709,7 @@ var ts;
ts.createLiteral = createLiteral;
var nextAutoGenerateId = 0;
function createIdentifier(text, location) {
- var node = createNode(69, location);
+ var node = createNode(70, location);
node.text = ts.escapeIdentifier(text);
node.originalKeywordKind = ts.stringToToken(text);
node.autoGenerateKind = 0;
@@ -10242,7 +9718,7 @@ var ts;
}
ts.createIdentifier = createIdentifier;
function createTempVariable(recordTempVariable, location) {
- var name = createNode(69, location);
+ var name = createNode(70, location);
name.text = "";
name.originalKeywordKind = 0;
name.autoGenerateKind = 1;
@@ -10255,7 +9731,7 @@ var ts;
}
ts.createTempVariable = createTempVariable;
function createLoopVariable(location) {
- var name = createNode(69, location);
+ var name = createNode(70, location);
name.text = "";
name.originalKeywordKind = 0;
name.autoGenerateKind = 2;
@@ -10265,7 +9741,7 @@ var ts;
}
ts.createLoopVariable = createLoopVariable;
function createUniqueName(text, location) {
- var name = createNode(69, location);
+ var name = createNode(70, location);
name.text = text;
name.originalKeywordKind = 0;
name.autoGenerateKind = 3;
@@ -10275,7 +9751,7 @@ var ts;
}
ts.createUniqueName = createUniqueName;
function getGeneratedNameForNode(node, location) {
- var name = createNode(69, location);
+ var name = createNode(70, location);
name.original = node;
name.text = "";
name.originalKeywordKind = 0;
@@ -10290,22 +9766,22 @@ var ts;
}
ts.createToken = createToken;
function createSuper() {
- var node = createNode(95);
+ var node = createNode(96);
return node;
}
ts.createSuper = createSuper;
function createThis(location) {
- var node = createNode(97, location);
+ var node = createNode(98, location);
return node;
}
ts.createThis = createThis;
function createNull() {
- var node = createNode(93);
+ var node = createNode(94);
return node;
}
ts.createNull = createNull;
function createComputedPropertyName(expression, location) {
- var node = createNode(140, location);
+ var node = createNode(141, location);
node.expression = expression;
return node;
}
@@ -10322,7 +9798,7 @@ var ts;
}
ts.createParameter = createParameter;
function createParameterDeclaration(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer, location, flags) {
- var node = createNode(142, location, flags);
+ var node = createNode(143, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.dotDotDotToken = dotDotDotToken;
@@ -10341,7 +9817,7 @@ var ts;
}
ts.updateParameterDeclaration = updateParameterDeclaration;
function createProperty(decorators, modifiers, name, questionToken, type, initializer, location) {
- var node = createNode(145, location);
+ var node = createNode(146, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -10359,7 +9835,7 @@ var ts;
}
ts.updateProperty = updateProperty;
function createMethod(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
- var node = createNode(147, location, flags);
+ var node = createNode(148, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.asteriskToken = asteriskToken;
@@ -10379,7 +9855,7 @@ var ts;
}
ts.updateMethod = updateMethod;
function createConstructor(decorators, modifiers, parameters, body, location, flags) {
- var node = createNode(148, location, flags);
+ var node = createNode(149, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.typeParameters = undefined;
@@ -10397,7 +9873,7 @@ var ts;
}
ts.updateConstructor = updateConstructor;
function createGetAccessor(decorators, modifiers, name, parameters, type, body, location, flags) {
- var node = createNode(149, location, flags);
+ var node = createNode(150, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -10416,7 +9892,7 @@ var ts;
}
ts.updateGetAccessor = updateGetAccessor;
function createSetAccessor(decorators, modifiers, name, parameters, body, location, flags) {
- var node = createNode(150, location, flags);
+ var node = createNode(151, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -10434,7 +9910,7 @@ var ts;
}
ts.updateSetAccessor = updateSetAccessor;
function createObjectBindingPattern(elements, location) {
- var node = createNode(167, location);
+ var node = createNode(168, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -10447,7 +9923,7 @@ var ts;
}
ts.updateObjectBindingPattern = updateObjectBindingPattern;
function createArrayBindingPattern(elements, location) {
- var node = createNode(168, location);
+ var node = createNode(169, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -10460,7 +9936,7 @@ var ts;
}
ts.updateArrayBindingPattern = updateArrayBindingPattern;
function createBindingElement(propertyName, dotDotDotToken, name, initializer, location) {
- var node = createNode(169, location);
+ var node = createNode(170, location);
node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName;
node.dotDotDotToken = dotDotDotToken;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -10476,7 +9952,7 @@ var ts;
}
ts.updateBindingElement = updateBindingElement;
function createArrayLiteral(elements, location, multiLine) {
- var node = createNode(170, location);
+ var node = createNode(171, location);
node.elements = parenthesizeListElements(createNodeArray(elements));
if (multiLine) {
node.multiLine = true;
@@ -10492,7 +9968,7 @@ var ts;
}
ts.updateArrayLiteral = updateArrayLiteral;
function createObjectLiteral(properties, location, multiLine) {
- var node = createNode(171, location);
+ var node = createNode(172, location);
node.properties = createNodeArray(properties);
if (multiLine) {
node.multiLine = true;
@@ -10508,7 +9984,7 @@ var ts;
}
ts.updateObjectLiteral = updateObjectLiteral;
function createPropertyAccess(expression, name, location, flags) {
- var node = createNode(172, location, flags);
+ var node = createNode(173, location, flags);
node.expression = parenthesizeForAccess(expression);
(node.emitNode || (node.emitNode = {})).flags |= 1048576;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -10525,7 +10001,7 @@ var ts;
}
ts.updatePropertyAccess = updatePropertyAccess;
function createElementAccess(expression, index, location) {
- var node = createNode(173, location);
+ var node = createNode(174, location);
node.expression = parenthesizeForAccess(expression);
node.argumentExpression = typeof index === "number" ? createLiteral(index) : index;
return node;
@@ -10539,7 +10015,7 @@ var ts;
}
ts.updateElementAccess = updateElementAccess;
function createCall(expression, typeArguments, argumentsArray, location, flags) {
- var node = createNode(174, location, flags);
+ var node = createNode(175, location, flags);
node.expression = parenthesizeForAccess(expression);
if (typeArguments) {
node.typeArguments = createNodeArray(typeArguments);
@@ -10556,7 +10032,7 @@ var ts;
}
ts.updateCall = updateCall;
function createNew(expression, typeArguments, argumentsArray, location, flags) {
- var node = createNode(175, location, flags);
+ var node = createNode(176, location, flags);
node.expression = parenthesizeForNew(expression);
node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined;
node.arguments = argumentsArray ? parenthesizeListElements(createNodeArray(argumentsArray)) : undefined;
@@ -10571,7 +10047,7 @@ var ts;
}
ts.updateNew = updateNew;
function createTaggedTemplate(tag, template, location) {
- var node = createNode(176, location);
+ var node = createNode(177, location);
node.tag = parenthesizeForAccess(tag);
node.template = template;
return node;
@@ -10585,7 +10061,7 @@ var ts;
}
ts.updateTaggedTemplate = updateTaggedTemplate;
function createParen(expression, location) {
- var node = createNode(178, location);
+ var node = createNode(179, location);
node.expression = expression;
return node;
}
@@ -10597,9 +10073,9 @@ var ts;
return node;
}
ts.updateParen = updateParen;
- function createFunctionExpression(asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
- var node = createNode(179, location, flags);
- node.modifiers = undefined;
+ function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
+ var node = createNode(180, location, flags);
+ node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.asteriskToken = asteriskToken;
node.name = typeof name === "string" ? createIdentifier(name) : name;
node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined;
@@ -10609,20 +10085,20 @@ var ts;
return node;
}
ts.createFunctionExpression = createFunctionExpression;
- function updateFunctionExpression(node, name, typeParameters, parameters, type, body) {
- if (node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) {
- return updateNode(createFunctionExpression(node.asteriskToken, name, typeParameters, parameters, type, body, node, node.flags), node);
+ function updateFunctionExpression(node, modifiers, name, typeParameters, parameters, type, body) {
+ if (node.name !== name || node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) {
+ return updateNode(createFunctionExpression(modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, node, node.flags), node);
}
return node;
}
ts.updateFunctionExpression = updateFunctionExpression;
function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body, location, flags) {
- var node = createNode(180, location, flags);
+ var node = createNode(181, location, flags);
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined;
node.parameters = createNodeArray(parameters);
node.type = type;
- node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(34);
+ node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(35);
node.body = parenthesizeConciseBody(body);
return node;
}
@@ -10635,7 +10111,7 @@ var ts;
}
ts.updateArrowFunction = updateArrowFunction;
function createDelete(expression, location) {
- var node = createNode(181, location);
+ var node = createNode(182, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -10648,7 +10124,7 @@ var ts;
}
ts.updateDelete = updateDelete;
function createTypeOf(expression, location) {
- var node = createNode(182, location);
+ var node = createNode(183, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -10661,7 +10137,7 @@ var ts;
}
ts.updateTypeOf = updateTypeOf;
function createVoid(expression, location) {
- var node = createNode(183, location);
+ var node = createNode(184, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -10674,7 +10150,7 @@ var ts;
}
ts.updateVoid = updateVoid;
function createAwait(expression, location) {
- var node = createNode(184, location);
+ var node = createNode(185, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -10687,7 +10163,7 @@ var ts;
}
ts.updateAwait = updateAwait;
function createPrefix(operator, operand, location) {
- var node = createNode(185, location);
+ var node = createNode(186, location);
node.operator = operator;
node.operand = parenthesizePrefixOperand(operand);
return node;
@@ -10701,7 +10177,7 @@ var ts;
}
ts.updatePrefix = updatePrefix;
function createPostfix(operand, operator, location) {
- var node = createNode(186, location);
+ var node = createNode(187, location);
node.operand = parenthesizePostfixOperand(operand);
node.operator = operator;
return node;
@@ -10717,7 +10193,7 @@ var ts;
function createBinary(left, operator, right, location) {
var operatorToken = typeof operator === "number" ? createToken(operator) : operator;
var operatorKind = operatorToken.kind;
- var node = createNode(187, location);
+ var node = createNode(188, location);
node.left = parenthesizeBinaryOperand(operatorKind, left, true, undefined);
node.operatorToken = operatorToken;
node.right = parenthesizeBinaryOperand(operatorKind, right, false, node.left);
@@ -10732,7 +10208,7 @@ var ts;
}
ts.updateBinary = updateBinary;
function createConditional(condition, questionToken, whenTrue, colonToken, whenFalse, location) {
- var node = createNode(188, location);
+ var node = createNode(189, location);
node.condition = condition;
node.questionToken = questionToken;
node.whenTrue = whenTrue;
@@ -10749,7 +10225,7 @@ var ts;
}
ts.updateConditional = updateConditional;
function createTemplateExpression(head, templateSpans, location) {
- var node = createNode(189, location);
+ var node = createNode(190, location);
node.head = head;
node.templateSpans = createNodeArray(templateSpans);
return node;
@@ -10763,7 +10239,7 @@ var ts;
}
ts.updateTemplateExpression = updateTemplateExpression;
function createYield(asteriskToken, expression, location) {
- var node = createNode(190, location);
+ var node = createNode(191, location);
node.asteriskToken = asteriskToken;
node.expression = expression;
return node;
@@ -10777,7 +10253,7 @@ var ts;
}
ts.updateYield = updateYield;
function createSpread(expression, location) {
- var node = createNode(191, location);
+ var node = createNode(192, location);
node.expression = parenthesizeExpressionForList(expression);
return node;
}
@@ -10790,7 +10266,7 @@ var ts;
}
ts.updateSpread = updateSpread;
function createClassExpression(modifiers, name, typeParameters, heritageClauses, members, location) {
- var node = createNode(192, location);
+ var node = createNode(193, location);
node.decorators = undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = name;
@@ -10808,12 +10284,12 @@ var ts;
}
ts.updateClassExpression = updateClassExpression;
function createOmittedExpression(location) {
- var node = createNode(193, location);
+ var node = createNode(194, location);
return node;
}
ts.createOmittedExpression = createOmittedExpression;
function createExpressionWithTypeArguments(typeArguments, expression, location) {
- var node = createNode(194, location);
+ var node = createNode(195, location);
node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined;
node.expression = parenthesizeForAccess(expression);
return node;
@@ -10827,7 +10303,7 @@ var ts;
}
ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments;
function createTemplateSpan(expression, literal, location) {
- var node = createNode(197, location);
+ var node = createNode(198, location);
node.expression = expression;
node.literal = literal;
return node;
@@ -10841,7 +10317,7 @@ var ts;
}
ts.updateTemplateSpan = updateTemplateSpan;
function createBlock(statements, location, multiLine, flags) {
- var block = createNode(199, location, flags);
+ var block = createNode(200, location, flags);
block.statements = createNodeArray(statements);
if (multiLine) {
block.multiLine = true;
@@ -10857,7 +10333,7 @@ var ts;
}
ts.updateBlock = updateBlock;
function createVariableStatement(modifiers, declarationList, location, flags) {
- var node = createNode(200, location, flags);
+ var node = createNode(201, location, flags);
node.decorators = undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
@@ -10872,7 +10348,7 @@ var ts;
}
ts.updateVariableStatement = updateVariableStatement;
function createVariableDeclarationList(declarations, location, flags) {
- var node = createNode(219, location, flags);
+ var node = createNode(220, location, flags);
node.declarations = createNodeArray(declarations);
return node;
}
@@ -10885,7 +10361,7 @@ var ts;
}
ts.updateVariableDeclarationList = updateVariableDeclarationList;
function createVariableDeclaration(name, type, initializer, location, flags) {
- var node = createNode(218, location, flags);
+ var node = createNode(219, location, flags);
node.name = typeof name === "string" ? createIdentifier(name) : name;
node.type = type;
node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined;
@@ -10900,11 +10376,11 @@ var ts;
}
ts.updateVariableDeclaration = updateVariableDeclaration;
function createEmptyStatement(location) {
- return createNode(201, location);
+ return createNode(202, location);
}
ts.createEmptyStatement = createEmptyStatement;
function createStatement(expression, location, flags) {
- var node = createNode(202, location, flags);
+ var node = createNode(203, location, flags);
node.expression = parenthesizeExpressionForExpressionStatement(expression);
return node;
}
@@ -10917,7 +10393,7 @@ var ts;
}
ts.updateStatement = updateStatement;
function createIf(expression, thenStatement, elseStatement, location) {
- var node = createNode(203, location);
+ var node = createNode(204, location);
node.expression = expression;
node.thenStatement = thenStatement;
node.elseStatement = elseStatement;
@@ -10932,7 +10408,7 @@ var ts;
}
ts.updateIf = updateIf;
function createDo(statement, expression, location) {
- var node = createNode(204, location);
+ var node = createNode(205, location);
node.statement = statement;
node.expression = expression;
return node;
@@ -10946,7 +10422,7 @@ var ts;
}
ts.updateDo = updateDo;
function createWhile(expression, statement, location) {
- var node = createNode(205, location);
+ var node = createNode(206, location);
node.expression = expression;
node.statement = statement;
return node;
@@ -10960,7 +10436,7 @@ var ts;
}
ts.updateWhile = updateWhile;
function createFor(initializer, condition, incrementor, statement, location) {
- var node = createNode(206, location, undefined);
+ var node = createNode(207, location, undefined);
node.initializer = initializer;
node.condition = condition;
node.incrementor = incrementor;
@@ -10976,7 +10452,7 @@ var ts;
}
ts.updateFor = updateFor;
function createForIn(initializer, expression, statement, location) {
- var node = createNode(207, location);
+ var node = createNode(208, location);
node.initializer = initializer;
node.expression = expression;
node.statement = statement;
@@ -10991,7 +10467,7 @@ var ts;
}
ts.updateForIn = updateForIn;
function createForOf(initializer, expression, statement, location) {
- var node = createNode(208, location);
+ var node = createNode(209, location);
node.initializer = initializer;
node.expression = expression;
node.statement = statement;
@@ -11006,7 +10482,7 @@ var ts;
}
ts.updateForOf = updateForOf;
function createContinue(label, location) {
- var node = createNode(209, location);
+ var node = createNode(210, location);
if (label) {
node.label = label;
}
@@ -11021,7 +10497,7 @@ var ts;
}
ts.updateContinue = updateContinue;
function createBreak(label, location) {
- var node = createNode(210, location);
+ var node = createNode(211, location);
if (label) {
node.label = label;
}
@@ -11036,7 +10512,7 @@ var ts;
}
ts.updateBreak = updateBreak;
function createReturn(expression, location) {
- var node = createNode(211, location);
+ var node = createNode(212, location);
node.expression = expression;
return node;
}
@@ -11049,7 +10525,7 @@ var ts;
}
ts.updateReturn = updateReturn;
function createWith(expression, statement, location) {
- var node = createNode(212, location);
+ var node = createNode(213, location);
node.expression = expression;
node.statement = statement;
return node;
@@ -11063,7 +10539,7 @@ var ts;
}
ts.updateWith = updateWith;
function createSwitch(expression, caseBlock, location) {
- var node = createNode(213, location);
+ var node = createNode(214, location);
node.expression = parenthesizeExpressionForList(expression);
node.caseBlock = caseBlock;
return node;
@@ -11077,7 +10553,7 @@ var ts;
}
ts.updateSwitch = updateSwitch;
function createLabel(label, statement, location) {
- var node = createNode(214, location);
+ var node = createNode(215, location);
node.label = typeof label === "string" ? createIdentifier(label) : label;
node.statement = statement;
return node;
@@ -11091,7 +10567,7 @@ var ts;
}
ts.updateLabel = updateLabel;
function createThrow(expression, location) {
- var node = createNode(215, location);
+ var node = createNode(216, location);
node.expression = expression;
return node;
}
@@ -11104,7 +10580,7 @@ var ts;
}
ts.updateThrow = updateThrow;
function createTry(tryBlock, catchClause, finallyBlock, location) {
- var node = createNode(216, location);
+ var node = createNode(217, location);
node.tryBlock = tryBlock;
node.catchClause = catchClause;
node.finallyBlock = finallyBlock;
@@ -11119,7 +10595,7 @@ var ts;
}
ts.updateTry = updateTry;
function createCaseBlock(clauses, location) {
- var node = createNode(227, location);
+ var node = createNode(228, location);
node.clauses = createNodeArray(clauses);
return node;
}
@@ -11132,7 +10608,7 @@ var ts;
}
ts.updateCaseBlock = updateCaseBlock;
function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
- var node = createNode(220, location, flags);
+ var node = createNode(221, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.asteriskToken = asteriskToken;
@@ -11152,7 +10628,7 @@ var ts;
}
ts.updateFunctionDeclaration = updateFunctionDeclaration;
function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, location) {
- var node = createNode(221, location);
+ var node = createNode(222, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = name;
@@ -11170,7 +10646,7 @@ var ts;
}
ts.updateClassDeclaration = updateClassDeclaration;
function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, location) {
- var node = createNode(230, location);
+ var node = createNode(231, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.importClause = importClause;
@@ -11186,7 +10662,7 @@ var ts;
}
ts.updateImportDeclaration = updateImportDeclaration;
function createImportClause(name, namedBindings, location) {
- var node = createNode(231, location);
+ var node = createNode(232, location);
node.name = name;
node.namedBindings = namedBindings;
return node;
@@ -11200,7 +10676,7 @@ var ts;
}
ts.updateImportClause = updateImportClause;
function createNamespaceImport(name, location) {
- var node = createNode(232, location);
+ var node = createNode(233, location);
node.name = name;
return node;
}
@@ -11213,7 +10689,7 @@ var ts;
}
ts.updateNamespaceImport = updateNamespaceImport;
function createNamedImports(elements, location) {
- var node = createNode(233, location);
+ var node = createNode(234, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -11226,7 +10702,7 @@ var ts;
}
ts.updateNamedImports = updateNamedImports;
function createImportSpecifier(propertyName, name, location) {
- var node = createNode(234, location);
+ var node = createNode(235, location);
node.propertyName = propertyName;
node.name = name;
return node;
@@ -11240,7 +10716,7 @@ var ts;
}
ts.updateImportSpecifier = updateImportSpecifier;
function createExportAssignment(decorators, modifiers, isExportEquals, expression, location) {
- var node = createNode(235, location);
+ var node = createNode(236, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.isExportEquals = isExportEquals;
@@ -11256,7 +10732,7 @@ var ts;
}
ts.updateExportAssignment = updateExportAssignment;
function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, location) {
- var node = createNode(236, location);
+ var node = createNode(237, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.exportClause = exportClause;
@@ -11272,7 +10748,7 @@ var ts;
}
ts.updateExportDeclaration = updateExportDeclaration;
function createNamedExports(elements, location) {
- var node = createNode(237, location);
+ var node = createNode(238, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -11285,7 +10761,7 @@ var ts;
}
ts.updateNamedExports = updateNamedExports;
function createExportSpecifier(name, propertyName, location) {
- var node = createNode(238, location);
+ var node = createNode(239, location);
node.name = typeof name === "string" ? createIdentifier(name) : name;
node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName;
return node;
@@ -11299,7 +10775,7 @@ var ts;
}
ts.updateExportSpecifier = updateExportSpecifier;
function createJsxElement(openingElement, children, closingElement, location) {
- var node = createNode(241, location);
+ var node = createNode(242, location);
node.openingElement = openingElement;
node.children = createNodeArray(children);
node.closingElement = closingElement;
@@ -11314,7 +10790,7 @@ var ts;
}
ts.updateJsxElement = updateJsxElement;
function createJsxSelfClosingElement(tagName, attributes, location) {
- var node = createNode(242, location);
+ var node = createNode(243, location);
node.tagName = tagName;
node.attributes = createNodeArray(attributes);
return node;
@@ -11328,7 +10804,7 @@ var ts;
}
ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement;
function createJsxOpeningElement(tagName, attributes, location) {
- var node = createNode(243, location);
+ var node = createNode(244, location);
node.tagName = tagName;
node.attributes = createNodeArray(attributes);
return node;
@@ -11562,47 +11038,47 @@ var ts;
}
ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression;
function createComma(left, right) {
- return createBinary(left, 24, right);
+ return createBinary(left, 25, right);
}
ts.createComma = createComma;
function createLessThan(left, right, location) {
- return createBinary(left, 25, right, location);
+ return createBinary(left, 26, right, location);
}
ts.createLessThan = createLessThan;
function createAssignment(left, right, location) {
- return createBinary(left, 56, right, location);
+ return createBinary(left, 57, right, location);
}
ts.createAssignment = createAssignment;
function createStrictEquality(left, right) {
- return createBinary(left, 32, right);
+ return createBinary(left, 33, right);
}
ts.createStrictEquality = createStrictEquality;
function createStrictInequality(left, right) {
- return createBinary(left, 33, right);
+ return createBinary(left, 34, right);
}
ts.createStrictInequality = createStrictInequality;
function createAdd(left, right) {
- return createBinary(left, 35, right);
+ return createBinary(left, 36, right);
}
ts.createAdd = createAdd;
function createSubtract(left, right) {
- return createBinary(left, 36, right);
+ return createBinary(left, 37, right);
}
ts.createSubtract = createSubtract;
function createPostfixIncrement(operand, location) {
- return createPostfix(operand, 41, location);
+ return createPostfix(operand, 42, location);
}
ts.createPostfixIncrement = createPostfixIncrement;
function createLogicalAnd(left, right) {
- return createBinary(left, 51, right);
+ return createBinary(left, 52, right);
}
ts.createLogicalAnd = createLogicalAnd;
function createLogicalOr(left, right) {
- return createBinary(left, 52, right);
+ return createBinary(left, 53, right);
}
ts.createLogicalOr = createLogicalOr;
function createLogicalNot(operand) {
- return createPrefix(49, operand);
+ return createPrefix(50, operand);
}
ts.createLogicalNot = createLogicalNot;
function createVoidZero() {
@@ -11621,7 +11097,7 @@ var ts;
}
ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName;
function createRestParameter(name) {
- return createParameterDeclaration(undefined, undefined, createToken(22), name, undefined, undefined, undefined);
+ return createParameterDeclaration(undefined, undefined, createToken(23), name, undefined, undefined, undefined);
}
ts.createRestParameter = createRestParameter;
function createFunctionCall(func, thisArg, argumentsList, location) {
@@ -11735,7 +11211,7 @@ var ts;
}
ts.createDecorateHelper = createDecorateHelper;
function createAwaiterHelper(externalHelpersModuleName, hasLexicalArguments, promiseConstructor, body) {
- var generatorFunc = createFunctionExpression(createToken(37), undefined, undefined, [], undefined, body);
+ var generatorFunc = createFunctionExpression(undefined, createToken(38), undefined, undefined, [], undefined, body);
(generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 2097152;
return createCall(createHelperName(externalHelpersModuleName, "__awaiter"), undefined, [
createThis(),
@@ -11779,7 +11255,7 @@ var ts;
setter
]))))));
return createVariableStatement(undefined, createConstDeclarationList([
- createVariableDeclaration("_super", undefined, createCall(createParen(createFunctionExpression(undefined, undefined, undefined, [
+ createVariableDeclaration("_super", undefined, createCall(createParen(createFunctionExpression(undefined, undefined, undefined, undefined, [
createParameter("geti"),
createParameter("seti")
], undefined, createBlock([
@@ -11801,19 +11277,19 @@ var ts;
function shouldBeCapturedInTempVariable(node, cacheIdentifiers) {
var target = skipParentheses(node);
switch (target.kind) {
- case 69:
+ case 70:
return cacheIdentifiers;
- case 97:
+ case 98:
case 8:
case 9:
return false;
- case 170:
+ case 171:
var elements = target.elements;
if (elements.length === 0) {
return false;
}
return true;
- case 171:
+ case 172:
return target.properties.length > 0;
default:
return true;
@@ -11827,13 +11303,13 @@ var ts;
thisArg = createThis();
target = callee;
}
- else if (callee.kind === 95) {
+ else if (callee.kind === 96) {
thisArg = createThis();
target = languageVersion < 2 ? createIdentifier("_super", callee) : callee;
}
else {
switch (callee.kind) {
- case 172: {
+ case 173: {
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
thisArg = createTempVariable(recordTempVariable);
target = createPropertyAccess(createAssignment(thisArg, callee.expression, callee.expression), callee.name, callee);
@@ -11844,7 +11320,7 @@ var ts;
}
break;
}
- case 173: {
+ case 174: {
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
thisArg = createTempVariable(recordTempVariable);
target = createElementAccess(createAssignment(thisArg, callee.expression, callee.expression), callee.argumentExpression, callee);
@@ -11894,14 +11370,14 @@ var ts;
ts.createExpressionForPropertyName = createExpressionForPropertyName;
function createExpressionForObjectLiteralElementLike(node, property, receiver) {
switch (property.kind) {
- case 149:
case 150:
+ case 151:
return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine);
case 253:
return createExpressionForPropertyAssignment(property, receiver);
case 254:
return createExpressionForShorthandPropertyAssignment(property, receiver);
- case 147:
+ case 148:
return createExpressionForMethodDeclaration(property, receiver);
}
}
@@ -11911,13 +11387,13 @@ var ts;
if (property === firstAccessor) {
var properties_1 = [];
if (getAccessor) {
- var getterFunction = createFunctionExpression(undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body, getAccessor);
+ var getterFunction = createFunctionExpression(getAccessor.modifiers, undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body, getAccessor);
setOriginalNode(getterFunction, getAccessor);
var getter = createPropertyAssignment("get", getterFunction);
properties_1.push(getter);
}
if (setAccessor) {
- var setterFunction = createFunctionExpression(undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body, setAccessor);
+ var setterFunction = createFunctionExpression(setAccessor.modifiers, undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body, setAccessor);
setOriginalNode(setterFunction, setAccessor);
var setter = createPropertyAssignment("set", setterFunction);
properties_1.push(setter);
@@ -11940,13 +11416,13 @@ var ts;
return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, property.name, property.name), getSynthesizedClone(property.name), property), property));
}
function createExpressionForMethodDeclaration(method, receiver) {
- return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, method.name, method.name), setOriginalNode(createFunctionExpression(method.asteriskToken, undefined, undefined, method.parameters, undefined, method.body, method), method), method), method));
+ return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, method.name, method.name), setOriginalNode(createFunctionExpression(method.modifiers, method.asteriskToken, undefined, undefined, method.parameters, undefined, method.body, method), method), method), method));
}
function isUseStrictPrologue(node) {
return node.expression.text === "use strict";
}
function addPrologueDirectives(target, source, ensureUseStrict, visitor) {
- ts.Debug.assert(target.length === 0, "PrologueDirectives should be at the first statement in the target statements array");
+ ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array");
var foundUseStrict = false;
var statementOffset = 0;
var numStatements = source.length;
@@ -11959,16 +11435,20 @@ var ts;
target.push(statement);
}
else {
- if (ensureUseStrict && !foundUseStrict) {
- target.push(startOnNewLine(createStatement(createLiteral("use strict"))));
- foundUseStrict = true;
- }
- if (getEmitFlags(statement) & 8388608) {
- target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement);
- }
- else {
- break;
- }
+ break;
+ }
+ statementOffset++;
+ }
+ if (ensureUseStrict && !foundUseStrict) {
+ target.push(startOnNewLine(createStatement(createLiteral("use strict"))));
+ }
+ while (statementOffset < numStatements) {
+ var statement = source[statementOffset];
+ if (getEmitFlags(statement) & 8388608) {
+ target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement);
+ }
+ else {
+ break;
}
statementOffset++;
}
@@ -11999,7 +11479,7 @@ var ts;
ts.ensureUseStrict = ensureUseStrict;
function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
var skipped = skipPartiallyEmittedExpressions(operand);
- if (skipped.kind === 178) {
+ if (skipped.kind === 179) {
return operand;
}
return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand)
@@ -12008,15 +11488,15 @@ var ts;
}
ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand;
function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
- var binaryOperatorPrecedence = ts.getOperatorPrecedence(187, binaryOperator);
- var binaryOperatorAssociativity = ts.getOperatorAssociativity(187, binaryOperator);
+ var binaryOperatorPrecedence = ts.getOperatorPrecedence(188, binaryOperator);
+ var binaryOperatorAssociativity = ts.getOperatorAssociativity(188, binaryOperator);
var emittedOperand = skipPartiallyEmittedExpressions(operand);
var operandPrecedence = ts.getExpressionPrecedence(emittedOperand);
switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) {
case -1:
if (!isLeftSideOfBinary
&& binaryOperatorAssociativity === 1
- && operand.kind === 190) {
+ && operand.kind === 191) {
return false;
}
return true;
@@ -12032,7 +11512,7 @@ var ts;
if (operatorHasAssociativeProperty(binaryOperator)) {
return false;
}
- if (binaryOperator === 35) {
+ if (binaryOperator === 36) {
var leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0;
if (ts.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) {
return false;
@@ -12045,17 +11525,17 @@ var ts;
}
}
function operatorHasAssociativeProperty(binaryOperator) {
- return binaryOperator === 37
+ return binaryOperator === 38
+ || binaryOperator === 48
|| binaryOperator === 47
- || binaryOperator === 46
- || binaryOperator === 48;
+ || binaryOperator === 49;
}
function getLiteralKindOfBinaryPlusOperand(node) {
node = skipPartiallyEmittedExpressions(node);
if (ts.isLiteralKind(node.kind)) {
return node.kind;
}
- if (node.kind === 187 && node.operatorToken.kind === 35) {
+ if (node.kind === 188 && node.operatorToken.kind === 36) {
if (node.cachedLiteralKind !== undefined) {
return node.cachedLiteralKind;
}
@@ -12072,9 +11552,9 @@ var ts;
function parenthesizeForNew(expression) {
var emittedExpression = skipPartiallyEmittedExpressions(expression);
switch (emittedExpression.kind) {
- case 174:
- return createParen(expression);
case 175:
+ return createParen(expression);
+ case 176:
return emittedExpression.arguments
? expression
: createParen(expression);
@@ -12085,7 +11565,7 @@ var ts;
function parenthesizeForAccess(expression) {
var emittedExpression = skipPartiallyEmittedExpressions(expression);
if (ts.isLeftHandSideExpression(emittedExpression)
- && (emittedExpression.kind !== 175 || emittedExpression.arguments)
+ && (emittedExpression.kind !== 176 || emittedExpression.arguments)
&& emittedExpression.kind !== 8) {
return expression;
}
@@ -12123,7 +11603,7 @@ var ts;
function parenthesizeExpressionForList(expression) {
var emittedExpression = skipPartiallyEmittedExpressions(expression);
var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression);
- var commaPrecedence = ts.getOperatorPrecedence(187, 24);
+ var commaPrecedence = ts.getOperatorPrecedence(188, 25);
return expressionPrecedence > commaPrecedence
? expression
: createParen(expression, expression);
@@ -12134,7 +11614,7 @@ var ts;
if (ts.isCallExpression(emittedExpression)) {
var callee = emittedExpression.expression;
var kind = skipPartiallyEmittedExpressions(callee).kind;
- if (kind === 179 || kind === 180) {
+ if (kind === 180 || kind === 181) {
var mutableCall = getMutableClone(emittedExpression);
mutableCall.expression = createParen(callee, callee);
return recreatePartiallyEmittedExpressions(expression, mutableCall);
@@ -12142,7 +11622,7 @@ var ts;
}
else {
var leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind;
- if (leftmostExpressionKind === 171 || leftmostExpressionKind === 179) {
+ if (leftmostExpressionKind === 172 || leftmostExpressionKind === 180) {
return createParen(expression, expression);
}
}
@@ -12160,18 +11640,18 @@ var ts;
function getLeftmostExpression(node) {
while (true) {
switch (node.kind) {
- case 186:
+ case 187:
node = node.operand;
continue;
- case 187:
+ case 188:
node = node.left;
continue;
- case 188:
+ case 189:
node = node.condition;
continue;
+ case 175:
case 174:
case 173:
- case 172:
node = node.expression;
continue;
case 288:
@@ -12183,12 +11663,19 @@ var ts;
}
function parenthesizeConciseBody(body) {
var emittedBody = skipPartiallyEmittedExpressions(body);
- if (emittedBody.kind === 171) {
+ if (emittedBody.kind === 172) {
return createParen(body, body);
}
return body;
}
ts.parenthesizeConciseBody = parenthesizeConciseBody;
+ (function (OuterExpressionKinds) {
+ OuterExpressionKinds[OuterExpressionKinds["Parentheses"] = 1] = "Parentheses";
+ OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 2] = "Assertions";
+ OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 4] = "PartiallyEmittedExpressions";
+ OuterExpressionKinds[OuterExpressionKinds["All"] = 7] = "All";
+ })(ts.OuterExpressionKinds || (ts.OuterExpressionKinds = {}));
+ var OuterExpressionKinds = ts.OuterExpressionKinds;
function skipOuterExpressions(node, kinds) {
if (kinds === void 0) { kinds = 7; }
var previousNode;
@@ -12208,7 +11695,7 @@ var ts;
}
ts.skipOuterExpressions = skipOuterExpressions;
function skipParentheses(node) {
- while (node.kind === 178) {
+ while (node.kind === 179) {
node = node.expression;
}
return node;
@@ -12368,13 +11855,13 @@ var ts;
function getLocalNameForExternalImport(node, sourceFile) {
var namespaceDeclaration = ts.getNamespaceDeclarationNode(node);
if (namespaceDeclaration && !ts.isDefaultImport(node)) {
- var name_12 = namespaceDeclaration.name;
- return ts.isGeneratedIdentifier(name_12) ? name_12 : createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name));
+ var name_9 = namespaceDeclaration.name;
+ return ts.isGeneratedIdentifier(name_9) ? name_9 : createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name));
}
- if (node.kind === 230 && node.importClause) {
+ if (node.kind === 231 && node.importClause) {
return getGeneratedNameForNode(node);
}
- if (node.kind === 236 && node.moduleSpecifier) {
+ if (node.kind === 237 && node.moduleSpecifier) {
return getGeneratedNameForNode(node);
}
return undefined;
@@ -12423,10 +11910,10 @@ var ts;
if (kind === 256) {
return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end);
}
- else if (kind === 69) {
+ else if (kind === 70) {
return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, pos, end);
}
- else if (kind < 139) {
+ else if (kind < 140) {
return new (TokenConstructor || (TokenConstructor = ts.objectAllocator.getTokenConstructor()))(kind, pos, end);
}
else {
@@ -12462,10 +11949,10 @@ var ts;
var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode;
var cbNodes = cbNodeArray || cbNode;
switch (node.kind) {
- case 139:
+ case 140:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.right);
- case 141:
+ case 142:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.constraint) ||
visitNode(cbNode, node.expression);
@@ -12476,12 +11963,12 @@ var ts;
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.equalsToken) ||
visitNode(cbNode, node.objectAssignmentInitializer);
- case 142:
+ case 143:
+ case 146:
case 145:
- case 144:
case 253:
- case 218:
- case 169:
+ case 219:
+ case 170:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.propertyName) ||
@@ -12490,24 +11977,24 @@ var ts;
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
- case 156:
case 157:
- case 151:
+ case 158:
case 152:
case 153:
+ case 154:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNodes(cbNodes, node.typeParameters) ||
visitNodes(cbNodes, node.parameters) ||
visitNode(cbNode, node.type);
- case 147:
- case 146:
case 148:
+ case 147:
case 149:
case 150:
- case 179:
- case 220:
+ case 151:
case 180:
+ case 221:
+ case 181:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.asteriskToken) ||
@@ -12518,163 +12005,156 @@ var ts;
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.equalsGreaterThanToken) ||
visitNode(cbNode, node.body);
- case 155:
+ case 156:
return visitNode(cbNode, node.typeName) ||
visitNodes(cbNodes, node.typeArguments);
- case 154:
+ case 155:
return visitNode(cbNode, node.parameterName) ||
visitNode(cbNode, node.type);
- case 158:
- return visitNode(cbNode, node.exprName);
case 159:
- return visitNodes(cbNodes, node.members);
+ return visitNode(cbNode, node.exprName);
case 160:
- return visitNode(cbNode, node.elementType);
+ return visitNodes(cbNodes, node.members);
case 161:
- return visitNodes(cbNodes, node.elementTypes);
+ return visitNode(cbNode, node.elementType);
case 162:
+ return visitNodes(cbNodes, node.elementTypes);
case 163:
- return visitNodes(cbNodes, node.types);
case 164:
+ return visitNodes(cbNodes, node.types);
+ case 165:
return visitNode(cbNode, node.type);
- case 166:
- return visitNode(cbNode, node.literal);
case 167:
+ return visitNode(cbNode, node.literal);
case 168:
- return visitNodes(cbNodes, node.elements);
- case 170:
+ case 169:
return visitNodes(cbNodes, node.elements);
case 171:
- return visitNodes(cbNodes, node.properties);
+ return visitNodes(cbNodes, node.elements);
case 172:
- return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.name);
+ return visitNodes(cbNodes, node.properties);
case 173:
return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.argumentExpression);
+ visitNode(cbNode, node.name);
case 174:
+ return visitNode(cbNode, node.expression) ||
+ visitNode(cbNode, node.argumentExpression);
case 175:
+ case 176:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNodes, node.typeArguments) ||
visitNodes(cbNodes, node.arguments);
- case 176:
+ case 177:
return visitNode(cbNode, node.tag) ||
visitNode(cbNode, node.template);
- case 177:
+ case 178:
return visitNode(cbNode, node.type) ||
visitNode(cbNode, node.expression);
- case 178:
- return visitNode(cbNode, node.expression);
- case 181:
+ case 179:
return visitNode(cbNode, node.expression);
case 182:
return visitNode(cbNode, node.expression);
case 183:
return visitNode(cbNode, node.expression);
- case 185:
- return visitNode(cbNode, node.operand);
- case 190:
- return visitNode(cbNode, node.asteriskToken) ||
- visitNode(cbNode, node.expression);
case 184:
return visitNode(cbNode, node.expression);
case 186:
return visitNode(cbNode, node.operand);
+ case 191:
+ return visitNode(cbNode, node.asteriskToken) ||
+ visitNode(cbNode, node.expression);
+ case 185:
+ return visitNode(cbNode, node.expression);
case 187:
+ return visitNode(cbNode, node.operand);
+ case 188:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.operatorToken) ||
visitNode(cbNode, node.right);
- case 195:
+ case 196:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.type);
- case 196:
+ case 197:
return visitNode(cbNode, node.expression);
- case 188:
+ case 189:
return visitNode(cbNode, node.condition) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.whenTrue) ||
visitNode(cbNode, node.colonToken) ||
visitNode(cbNode, node.whenFalse);
- case 191:
+ case 192:
return visitNode(cbNode, node.expression);
- case 199:
- case 226:
+ case 200:
+ case 227:
return visitNodes(cbNodes, node.statements);
case 256:
return visitNodes(cbNodes, node.statements) ||
visitNode(cbNode, node.endOfFileToken);
- case 200:
+ case 201:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.declarationList);
- case 219:
+ case 220:
return visitNodes(cbNodes, node.declarations);
- case 202:
- return visitNode(cbNode, node.expression);
case 203:
+ return visitNode(cbNode, node.expression);
+ case 204:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.thenStatement) ||
visitNode(cbNode, node.elseStatement);
- case 204:
+ case 205:
return visitNode(cbNode, node.statement) ||
visitNode(cbNode, node.expression);
- case 205:
- return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.statement);
case 206:
- return visitNode(cbNode, node.initializer) ||
- visitNode(cbNode, node.condition) ||
- visitNode(cbNode, node.incrementor) ||
+ return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
case 207:
return visitNode(cbNode, node.initializer) ||
- visitNode(cbNode, node.expression) ||
+ visitNode(cbNode, node.condition) ||
+ visitNode(cbNode, node.incrementor) ||
visitNode(cbNode, node.statement);
case 208:
return visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
case 209:
- case 210:
- return visitNode(cbNode, node.label);
- case 211:
- return visitNode(cbNode, node.expression);
- case 212:
- return visitNode(cbNode, node.expression) ||
+ return visitNode(cbNode, node.initializer) ||
+ visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
+ case 210:
+ case 211:
+ return visitNode(cbNode, node.label);
+ case 212:
+ return visitNode(cbNode, node.expression);
case 213:
+ return visitNode(cbNode, node.expression) ||
+ visitNode(cbNode, node.statement);
+ case 214:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.caseBlock);
- case 227:
+ case 228:
return visitNodes(cbNodes, node.clauses);
case 249:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNodes, node.statements);
case 250:
return visitNodes(cbNodes, node.statements);
- case 214:
+ case 215:
return visitNode(cbNode, node.label) ||
visitNode(cbNode, node.statement);
- case 215:
- return visitNode(cbNode, node.expression);
case 216:
+ return visitNode(cbNode, node.expression);
+ case 217:
return visitNode(cbNode, node.tryBlock) ||
visitNode(cbNode, node.catchClause) ||
visitNode(cbNode, node.finallyBlock);
case 252:
return visitNode(cbNode, node.variableDeclaration) ||
visitNode(cbNode, node.block);
- case 143:
+ case 144:
return visitNode(cbNode, node.expression);
- case 221:
- case 192:
- return visitNodes(cbNodes, node.decorators) ||
- visitNodes(cbNodes, node.modifiers) ||
- visitNode(cbNode, node.name) ||
- visitNodes(cbNodes, node.typeParameters) ||
- visitNodes(cbNodes, node.heritageClauses) ||
- visitNodes(cbNodes, node.members);
case 222:
+ case 193:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
@@ -12686,8 +12166,15 @@ var ts;
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNodes(cbNodes, node.typeParameters) ||
- visitNode(cbNode, node.type);
+ visitNodes(cbNodes, node.heritageClauses) ||
+ visitNodes(cbNodes, node.members);
case 224:
+ return visitNodes(cbNodes, node.decorators) ||
+ visitNodes(cbNodes, node.modifiers) ||
+ visitNode(cbNode, node.name) ||
+ visitNodes(cbNodes, node.typeParameters) ||
+ visitNode(cbNode, node.type);
+ case 225:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
@@ -12695,65 +12182,65 @@ var ts;
case 255:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.initializer);
- case 225:
+ case 226:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.body);
- case 229:
+ case 230:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.moduleReference);
- case 230:
+ case 231:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.importClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 231:
+ case 232:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.namedBindings);
- case 228:
- return visitNode(cbNode, node.name);
- case 232:
+ case 229:
return visitNode(cbNode, node.name);
case 233:
- case 237:
+ return visitNode(cbNode, node.name);
+ case 234:
+ case 238:
return visitNodes(cbNodes, node.elements);
- case 236:
+ case 237:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.exportClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 234:
- case 238:
+ case 235:
+ case 239:
return visitNode(cbNode, node.propertyName) ||
visitNode(cbNode, node.name);
- case 235:
+ case 236:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.expression);
- case 189:
+ case 190:
return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans);
- case 197:
+ case 198:
return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal);
- case 140:
+ case 141:
return visitNode(cbNode, node.expression);
case 251:
return visitNodes(cbNodes, node.types);
- case 194:
+ case 195:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNodes, node.typeArguments);
- case 240:
- return visitNode(cbNode, node.expression);
- case 239:
- return visitNodes(cbNodes, node.decorators);
case 241:
+ return visitNode(cbNode, node.expression);
+ case 240:
+ return visitNodes(cbNodes, node.decorators);
+ case 242:
return visitNode(cbNode, node.openingElement) ||
visitNodes(cbNodes, node.children) ||
visitNode(cbNode, node.closingElement);
- case 242:
case 243:
+ case 244:
return visitNode(cbNode, node.tagName) ||
visitNodes(cbNodes, node.attributes);
case 246:
@@ -12855,7 +12342,7 @@ var ts;
ts.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests;
var Parser;
(function (Parser) {
- var scanner = ts.createScanner(2, true);
+ var scanner = ts.createScanner(4, true);
var disallowInAndDecoratorContext = 32768 | 131072;
var NodeConstructor;
var TokenConstructor;
@@ -12872,9 +12359,9 @@ var ts;
var parsingContext;
var contextFlags;
var parseErrorBeforeNextFinishedNode = false;
- function parseSourceFile(fileName, _sourceText, languageVersion, _syntaxCursor, setParentNodes, scriptKind) {
+ function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind) {
scriptKind = ts.ensureScriptKind(fileName, scriptKind);
- initializeState(fileName, _sourceText, languageVersion, _syntaxCursor, scriptKind);
+ initializeState(sourceText, languageVersion, syntaxCursor, scriptKind);
var result = parseSourceFileWorker(fileName, languageVersion, setParentNodes, scriptKind);
clearState();
return result;
@@ -12883,7 +12370,7 @@ var ts;
function getLanguageVariant(scriptKind) {
return scriptKind === 4 || scriptKind === 2 || scriptKind === 1 ? 1 : 0;
}
- function initializeState(fileName, _sourceText, languageVersion, _syntaxCursor, scriptKind) {
+ function initializeState(_sourceText, languageVersion, _syntaxCursor, scriptKind) {
NodeConstructor = ts.objectAllocator.getNodeConstructor();
TokenConstructor = ts.objectAllocator.getTokenConstructor();
IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor();
@@ -13126,16 +12613,16 @@ var ts;
return speculationHelper(callback, false);
}
function isIdentifier() {
- if (token() === 69) {
+ if (token() === 70) {
return true;
}
- if (token() === 114 && inYieldContext()) {
+ if (token() === 115 && inYieldContext()) {
return false;
}
- if (token() === 119 && inAwaitContext()) {
+ if (token() === 120 && inAwaitContext()) {
return false;
}
- return token() > 105;
+ return token() > 106;
}
function parseExpected(kind, diagnosticMessage, shouldAdvance) {
if (shouldAdvance === void 0) { shouldAdvance = true; }
@@ -13176,20 +12663,20 @@ var ts;
return finishNode(node);
}
function canParseSemicolon() {
- if (token() === 23) {
+ if (token() === 24) {
return true;
}
- return token() === 16 || token() === 1 || scanner.hasPrecedingLineBreak();
+ return token() === 17 || token() === 1 || scanner.hasPrecedingLineBreak();
}
function parseSemicolon() {
if (canParseSemicolon()) {
- if (token() === 23) {
+ if (token() === 24) {
nextToken();
}
return true;
}
else {
- return parseExpected(23);
+ return parseExpected(24);
}
}
function createNode(kind, pos) {
@@ -13197,8 +12684,8 @@ var ts;
if (!(pos >= 0)) {
pos = scanner.getStartPos();
}
- return kind >= 139 ? new NodeConstructor(kind, pos, pos) :
- kind === 69 ? new IdentifierConstructor(kind, pos, pos) :
+ return kind >= 140 ? new NodeConstructor(kind, pos, pos) :
+ kind === 70 ? new IdentifierConstructor(kind, pos, pos) :
new TokenConstructor(kind, pos, pos);
}
function createNodeArray(elements, pos) {
@@ -13239,15 +12726,15 @@ var ts;
function createIdentifier(isIdentifier, diagnosticMessage) {
identifierCount++;
if (isIdentifier) {
- var node = createNode(69);
- if (token() !== 69) {
+ var node = createNode(70);
+ if (token() !== 70) {
node.originalKeywordKind = token();
}
node.text = internIdentifier(scanner.getTokenValue());
nextToken();
return finishNode(node);
}
- return createMissingNode(69, false, diagnosticMessage || ts.Diagnostics.Identifier_expected);
+ return createMissingNode(70, false, diagnosticMessage || ts.Diagnostics.Identifier_expected);
}
function parseIdentifier(diagnosticMessage) {
return createIdentifier(isIdentifier(), diagnosticMessage);
@@ -13264,7 +12751,7 @@ var ts;
if (token() === 9 || token() === 8) {
return parseLiteralNode(true);
}
- if (allowComputedPropertyNames && token() === 19) {
+ if (allowComputedPropertyNames && token() === 20) {
return parseComputedPropertyName();
}
return parseIdentifierName();
@@ -13279,10 +12766,10 @@ var ts;
return token() === 9 || token() === 8 || ts.tokenIsIdentifierOrKeyword(token());
}
function parseComputedPropertyName() {
- var node = createNode(140);
- parseExpected(19);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(141);
parseExpected(20);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(21);
return finishNode(node);
}
function parseContextualModifier(t) {
@@ -13296,20 +12783,20 @@ var ts;
return canFollowModifier();
}
function nextTokenCanFollowModifier() {
- if (token() === 74) {
- return nextToken() === 81;
+ if (token() === 75) {
+ return nextToken() === 82;
}
- if (token() === 82) {
+ if (token() === 83) {
nextToken();
- if (token() === 77) {
+ if (token() === 78) {
return lookAhead(nextTokenIsClassOrFunctionOrAsync);
}
- return token() !== 37 && token() !== 116 && token() !== 15 && canFollowModifier();
+ return token() !== 38 && token() !== 117 && token() !== 16 && canFollowModifier();
}
- if (token() === 77) {
+ if (token() === 78) {
return nextTokenIsClassOrFunctionOrAsync();
}
- if (token() === 113) {
+ if (token() === 114) {
nextToken();
return canFollowModifier();
}
@@ -13319,16 +12806,16 @@ var ts;
return ts.isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 19
- || token() === 15
- || token() === 37
- || token() === 22
+ return token() === 20
+ || token() === 16
+ || token() === 38
+ || token() === 23
|| isLiteralPropertyName();
}
function nextTokenIsClassOrFunctionOrAsync() {
nextToken();
- return token() === 73 || token() === 87 ||
- (token() === 118 && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
+ return token() === 74 || token() === 88 ||
+ (token() === 119 && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
}
function isListElement(parsingContext, inErrorRecovery) {
var node = currentNode(parsingContext);
@@ -13339,21 +12826,21 @@ var ts;
case 0:
case 1:
case 3:
- return !(token() === 23 && inErrorRecovery) && isStartOfStatement();
+ return !(token() === 24 && inErrorRecovery) && isStartOfStatement();
case 2:
- return token() === 71 || token() === 77;
+ return token() === 72 || token() === 78;
case 4:
return lookAhead(isTypeMemberStart);
case 5:
- return lookAhead(isClassMemberStart) || (token() === 23 && !inErrorRecovery);
+ return lookAhead(isClassMemberStart) || (token() === 24 && !inErrorRecovery);
case 6:
- return token() === 19 || isLiteralPropertyName();
+ return token() === 20 || isLiteralPropertyName();
case 12:
- return token() === 19 || token() === 37 || isLiteralPropertyName();
+ return token() === 20 || token() === 38 || isLiteralPropertyName();
case 9:
- return token() === 19 || isLiteralPropertyName();
+ return token() === 20 || isLiteralPropertyName();
case 7:
- if (token() === 15) {
+ if (token() === 16) {
return lookAhead(isValidHeritageClauseObjectLiteral);
}
if (!inErrorRecovery) {
@@ -13365,23 +12852,23 @@ var ts;
case 8:
return isIdentifierOrPattern();
case 10:
- return token() === 24 || token() === 22 || isIdentifierOrPattern();
+ return token() === 25 || token() === 23 || isIdentifierOrPattern();
case 17:
return isIdentifier();
case 11:
case 15:
- return token() === 24 || token() === 22 || isStartOfExpression();
+ return token() === 25 || token() === 23 || isStartOfExpression();
case 16:
return isStartOfParameter();
case 18:
case 19:
- return token() === 24 || isStartOfType();
+ return token() === 25 || isStartOfType();
case 20:
return isHeritageClause();
case 21:
return ts.tokenIsIdentifierOrKeyword(token());
case 13:
- return ts.tokenIsIdentifierOrKeyword(token()) || token() === 15;
+ return ts.tokenIsIdentifierOrKeyword(token()) || token() === 16;
case 14:
return true;
case 22:
@@ -13394,10 +12881,10 @@ var ts;
ts.Debug.fail("Non-exhaustive case in 'isListElement'.");
}
function isValidHeritageClauseObjectLiteral() {
- ts.Debug.assert(token() === 15);
- if (nextToken() === 16) {
+ ts.Debug.assert(token() === 16);
+ if (nextToken() === 17) {
var next = nextToken();
- return next === 24 || next === 15 || next === 83 || next === 106;
+ return next === 25 || next === 16 || next === 84 || next === 107;
}
return true;
}
@@ -13410,8 +12897,8 @@ var ts;
return ts.tokenIsIdentifierOrKeyword(token());
}
function isHeritageClauseExtendsOrImplementsKeyword() {
- if (token() === 106 ||
- token() === 83) {
+ if (token() === 107 ||
+ token() === 84) {
return lookAhead(nextTokenIsStartOfExpression);
}
return false;
@@ -13433,39 +12920,39 @@ var ts;
case 12:
case 9:
case 21:
- return token() === 16;
+ return token() === 17;
case 3:
- return token() === 16 || token() === 71 || token() === 77;
+ return token() === 17 || token() === 72 || token() === 78;
case 7:
- return token() === 15 || token() === 83 || token() === 106;
+ return token() === 16 || token() === 84 || token() === 107;
case 8:
return isVariableDeclaratorListTerminator();
case 17:
- return token() === 27 || token() === 17 || token() === 15 || token() === 83 || token() === 106;
+ return token() === 28 || token() === 18 || token() === 16 || token() === 84 || token() === 107;
case 11:
- return token() === 18 || token() === 23;
+ return token() === 19 || token() === 24;
case 15:
case 19:
case 10:
- return token() === 20;
+ return token() === 21;
case 16:
- return token() === 18 || token() === 20;
+ return token() === 19 || token() === 21;
case 18:
- return token() !== 24;
+ return token() !== 25;
case 20:
- return token() === 15 || token() === 16;
+ return token() === 16 || token() === 17;
case 13:
- return token() === 27 || token() === 39;
+ return token() === 28 || token() === 40;
case 14:
- return token() === 25 && lookAhead(nextTokenIsSlash);
+ return token() === 26 && lookAhead(nextTokenIsSlash);
case 22:
- return token() === 18 || token() === 54 || token() === 16;
+ return token() === 19 || token() === 55 || token() === 17;
case 23:
- return token() === 27 || token() === 16;
+ return token() === 28 || token() === 17;
case 25:
- return token() === 20 || token() === 16;
+ return token() === 21 || token() === 17;
case 24:
- return token() === 16;
+ return token() === 17;
}
}
function isVariableDeclaratorListTerminator() {
@@ -13475,7 +12962,7 @@ var ts;
if (isInOrOfKeyword(token())) {
return true;
}
- if (token() === 34) {
+ if (token() === 35) {
return true;
}
return false;
@@ -13579,17 +13066,17 @@ var ts;
function isReusableClassMember(node) {
if (node) {
switch (node.kind) {
- case 148:
- case 153:
case 149:
+ case 154:
case 150:
- case 145:
- case 198:
+ case 151:
+ case 146:
+ case 199:
return true;
- case 147:
+ case 148:
var methodDeclaration = node;
- var nameIsConstructor = methodDeclaration.name.kind === 69 &&
- methodDeclaration.name.originalKeywordKind === 121;
+ var nameIsConstructor = methodDeclaration.name.kind === 70 &&
+ methodDeclaration.name.originalKeywordKind === 122;
return !nameIsConstructor;
}
}
@@ -13608,35 +13095,35 @@ var ts;
function isReusableStatement(node) {
if (node) {
switch (node.kind) {
- case 220:
+ case 221:
+ case 201:
case 200:
- case 199:
+ case 204:
case 203:
- case 202:
- case 215:
+ case 216:
+ case 212:
+ case 214:
case 211:
- case 213:
case 210:
+ case 208:
case 209:
case 207:
- case 208:
case 206:
- case 205:
- case 212:
- case 201:
- case 216:
- case 214:
- case 204:
+ case 213:
+ case 202:
case 217:
+ case 215:
+ case 205:
+ case 218:
+ case 231:
case 230:
- case 229:
+ case 237:
case 236:
- case 235:
- case 225:
- case 221:
+ case 226:
case 222:
- case 224:
case 223:
+ case 225:
+ case 224:
return true;
}
}
@@ -13648,25 +13135,25 @@ var ts;
function isReusableTypeMember(node) {
if (node) {
switch (node.kind) {
- case 152:
- case 146:
case 153:
- case 144:
- case 151:
+ case 147:
+ case 154:
+ case 145:
+ case 152:
return true;
}
}
return false;
}
function isReusableVariableDeclaration(node) {
- if (node.kind !== 218) {
+ if (node.kind !== 219) {
return false;
}
var variableDeclarator = node;
return variableDeclarator.initializer === undefined;
}
function isReusableParameter(node) {
- if (node.kind !== 142) {
+ if (node.kind !== 143) {
return false;
}
var parameter = node;
@@ -13720,15 +13207,15 @@ var ts;
if (isListElement(kind, false)) {
result.push(parseListElement(kind, parseElement));
commaStart = scanner.getTokenPos();
- if (parseOptional(24)) {
+ if (parseOptional(25)) {
continue;
}
commaStart = -1;
if (isListTerminator(kind)) {
break;
}
- parseExpected(24);
- if (considerSemicolonAsDelimiter && token() === 23 && !scanner.hasPrecedingLineBreak()) {
+ parseExpected(25);
+ if (considerSemicolonAsDelimiter && token() === 24 && !scanner.hasPrecedingLineBreak()) {
nextToken();
}
continue;
@@ -13760,8 +13247,8 @@ var ts;
}
function parseEntityName(allowReservedWords, diagnosticMessage) {
var entity = parseIdentifier(diagnosticMessage);
- while (parseOptional(21)) {
- var node = createNode(139, entity.pos);
+ while (parseOptional(22)) {
+ var node = createNode(140, entity.pos);
node.left = entity;
node.right = parseRightSideOfDot(allowReservedWords);
entity = finishNode(node);
@@ -13772,33 +13259,33 @@ var ts;
if (scanner.hasPrecedingLineBreak() && ts.tokenIsIdentifierOrKeyword(token())) {
var matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);
if (matchesPattern) {
- return createMissingNode(69, true, ts.Diagnostics.Identifier_expected);
+ return createMissingNode(70, true, ts.Diagnostics.Identifier_expected);
}
}
return allowIdentifierNames ? parseIdentifierName() : parseIdentifier();
}
function parseTemplateExpression() {
- var template = createNode(189);
+ var template = createNode(190);
template.head = parseTemplateHead();
- ts.Debug.assert(template.head.kind === 12, "Template head has wrong token kind");
+ ts.Debug.assert(template.head.kind === 13, "Template head has wrong token kind");
var templateSpans = createNodeArray();
do {
templateSpans.push(parseTemplateSpan());
- } while (ts.lastOrUndefined(templateSpans).literal.kind === 13);
+ } while (ts.lastOrUndefined(templateSpans).literal.kind === 14);
templateSpans.end = getNodeEnd();
template.templateSpans = templateSpans;
return finishNode(template);
}
function parseTemplateSpan() {
- var span = createNode(197);
+ var span = createNode(198);
span.expression = allowInAnd(parseExpression);
var literal;
- if (token() === 16) {
+ if (token() === 17) {
reScanTemplateToken();
literal = parseTemplateMiddleOrTemplateTail();
}
else {
- literal = parseExpectedToken(14, false, ts.Diagnostics._0_expected, ts.tokenToString(16));
+ literal = parseExpectedToken(15, false, ts.Diagnostics._0_expected, ts.tokenToString(17));
}
span.literal = literal;
return finishNode(span);
@@ -13808,12 +13295,12 @@ var ts;
}
function parseTemplateHead() {
var fragment = parseLiteralLikeNode(token(), false);
- ts.Debug.assert(fragment.kind === 12, "Template head has wrong token kind");
+ ts.Debug.assert(fragment.kind === 13, "Template head has wrong token kind");
return fragment;
}
function parseTemplateMiddleOrTemplateTail() {
var fragment = parseLiteralLikeNode(token(), false);
- ts.Debug.assert(fragment.kind === 13 || fragment.kind === 14, "Template fragment has wrong token kind");
+ ts.Debug.assert(fragment.kind === 14 || fragment.kind === 15, "Template fragment has wrong token kind");
return fragment;
}
function parseLiteralLikeNode(kind, internName) {
@@ -13838,35 +13325,35 @@ var ts;
}
function parseTypeReference() {
var typeName = parseEntityName(false, ts.Diagnostics.Type_expected);
- var node = createNode(155, typeName.pos);
+ var node = createNode(156, typeName.pos);
node.typeName = typeName;
- if (!scanner.hasPrecedingLineBreak() && token() === 25) {
- node.typeArguments = parseBracketedList(18, parseType, 25, 27);
+ if (!scanner.hasPrecedingLineBreak() && token() === 26) {
+ node.typeArguments = parseBracketedList(18, parseType, 26, 28);
}
return finishNode(node);
}
function parseThisTypePredicate(lhs) {
nextToken();
- var node = createNode(154, lhs.pos);
+ var node = createNode(155, lhs.pos);
node.parameterName = lhs;
node.type = parseType();
return finishNode(node);
}
function parseThisTypeNode() {
- var node = createNode(165);
+ var node = createNode(166);
nextToken();
return finishNode(node);
}
function parseTypeQuery() {
- var node = createNode(158);
- parseExpected(101);
+ var node = createNode(159);
+ parseExpected(102);
node.exprName = parseEntityName(true);
return finishNode(node);
}
function parseTypeParameter() {
- var node = createNode(141);
+ var node = createNode(142);
node.name = parseIdentifier();
- if (parseOptional(83)) {
+ if (parseOptional(84)) {
if (isStartOfType() || !isStartOfExpression()) {
node.constraint = parseType();
}
@@ -13877,34 +13364,34 @@ var ts;
return finishNode(node);
}
function parseTypeParameters() {
- if (token() === 25) {
- return parseBracketedList(17, parseTypeParameter, 25, 27);
+ if (token() === 26) {
+ return parseBracketedList(17, parseTypeParameter, 26, 28);
}
}
function parseParameterType() {
- if (parseOptional(54)) {
+ if (parseOptional(55)) {
return parseType();
}
return undefined;
}
function isStartOfParameter() {
- return token() === 22 || isIdentifierOrPattern() || ts.isModifierKind(token()) || token() === 55 || token() === 97;
+ return token() === 23 || isIdentifierOrPattern() || ts.isModifierKind(token()) || token() === 56 || token() === 98;
}
function parseParameter() {
- var node = createNode(142);
- if (token() === 97) {
+ var node = createNode(143);
+ if (token() === 98) {
node.name = createIdentifier(true, undefined);
node.type = parseParameterType();
return finishNode(node);
}
node.decorators = parseDecorators();
node.modifiers = parseModifiers();
- node.dotDotDotToken = parseOptionalToken(22);
+ node.dotDotDotToken = parseOptionalToken(23);
node.name = parseIdentifierOrPattern();
if (ts.getFullWidth(node.name) === 0 && !ts.hasModifiers(node) && ts.isModifierKind(token())) {
nextToken();
}
- node.questionToken = parseOptionalToken(53);
+ node.questionToken = parseOptionalToken(54);
node.type = parseParameterType();
node.initializer = parseBindingElementInitializer(true);
return addJSDocComment(finishNode(node));
@@ -13916,7 +13403,7 @@ var ts;
return parseInitializer(true);
}
function fillSignature(returnToken, yieldContext, awaitContext, requireCompleteParameterList, signature) {
- var returnTokenRequired = returnToken === 34;
+ var returnTokenRequired = returnToken === 35;
signature.typeParameters = parseTypeParameters();
signature.parameters = parseParameterList(yieldContext, awaitContext, requireCompleteParameterList);
if (returnTokenRequired) {
@@ -13928,7 +13415,7 @@ var ts;
}
}
function parseParameterList(yieldContext, awaitContext, requireCompleteParameterList) {
- if (parseExpected(17)) {
+ if (parseExpected(18)) {
var savedYieldContext = inYieldContext();
var savedAwaitContext = inAwaitContext();
setYieldContext(yieldContext);
@@ -13936,7 +13423,7 @@ var ts;
var result = parseDelimitedList(16, parseParameter);
setYieldContext(savedYieldContext);
setAwaitContext(savedAwaitContext);
- if (!parseExpected(18) && requireCompleteParameterList) {
+ if (!parseExpected(19) && requireCompleteParameterList) {
return undefined;
}
return result;
@@ -13944,29 +13431,29 @@ var ts;
return requireCompleteParameterList ? undefined : createMissingList();
}
function parseTypeMemberSemicolon() {
- if (parseOptional(24)) {
+ if (parseOptional(25)) {
return;
}
parseSemicolon();
}
function parseSignatureMember(kind) {
var node = createNode(kind);
- if (kind === 152) {
- parseExpected(92);
+ if (kind === 153) {
+ parseExpected(93);
}
- fillSignature(54, false, false, false, node);
+ fillSignature(55, false, false, false, node);
parseTypeMemberSemicolon();
return addJSDocComment(finishNode(node));
}
function isIndexSignature() {
- if (token() !== 19) {
+ if (token() !== 20) {
return false;
}
return lookAhead(isUnambiguouslyIndexSignature);
}
function isUnambiguouslyIndexSignature() {
nextToken();
- if (token() === 22 || token() === 20) {
+ if (token() === 23 || token() === 21) {
return true;
}
if (ts.isModifierKind(token())) {
@@ -13981,43 +13468,43 @@ var ts;
else {
nextToken();
}
- if (token() === 54 || token() === 24) {
+ if (token() === 55 || token() === 25) {
return true;
}
- if (token() !== 53) {
+ if (token() !== 54) {
return false;
}
nextToken();
- return token() === 54 || token() === 24 || token() === 20;
+ return token() === 55 || token() === 25 || token() === 21;
}
function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(153, fullStart);
+ var node = createNode(154, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- node.parameters = parseBracketedList(16, parseParameter, 19, 20);
+ node.parameters = parseBracketedList(16, parseParameter, 20, 21);
node.type = parseTypeAnnotation();
parseTypeMemberSemicolon();
return finishNode(node);
}
function parsePropertyOrMethodSignature(fullStart, modifiers) {
var name = parsePropertyName();
- var questionToken = parseOptionalToken(53);
- if (token() === 17 || token() === 25) {
- var method = createNode(146, fullStart);
+ var questionToken = parseOptionalToken(54);
+ if (token() === 18 || token() === 26) {
+ var method = createNode(147, fullStart);
method.modifiers = modifiers;
method.name = name;
method.questionToken = questionToken;
- fillSignature(54, false, false, false, method);
+ fillSignature(55, false, false, false, method);
parseTypeMemberSemicolon();
return addJSDocComment(finishNode(method));
}
else {
- var property = createNode(144, fullStart);
+ var property = createNode(145, fullStart);
property.modifiers = modifiers;
property.name = name;
property.questionToken = questionToken;
property.type = parseTypeAnnotation();
- if (token() === 56) {
+ if (token() === 57) {
property.initializer = parseNonParameterInitializer();
}
parseTypeMemberSemicolon();
@@ -14026,14 +13513,14 @@ var ts;
}
function isTypeMemberStart() {
var idToken;
- if (token() === 17 || token() === 25) {
+ if (token() === 18 || token() === 26) {
return true;
}
while (ts.isModifierKind(token())) {
idToken = token();
nextToken();
}
- if (token() === 19) {
+ if (token() === 20) {
return true;
}
if (isLiteralPropertyName()) {
@@ -14041,22 +13528,22 @@ var ts;
nextToken();
}
if (idToken) {
- return token() === 17 ||
- token() === 25 ||
- token() === 53 ||
+ return token() === 18 ||
+ token() === 26 ||
token() === 54 ||
- token() === 24 ||
+ token() === 55 ||
+ token() === 25 ||
canParseSemicolon();
}
return false;
}
function parseTypeMember() {
- if (token() === 17 || token() === 25) {
- return parseSignatureMember(151);
- }
- if (token() === 92 && lookAhead(isStartOfConstructSignature)) {
+ if (token() === 18 || token() === 26) {
return parseSignatureMember(152);
}
+ if (token() === 93 && lookAhead(isStartOfConstructSignature)) {
+ return parseSignatureMember(153);
+ }
var fullStart = getNodePos();
var modifiers = parseModifiers();
if (isIndexSignature()) {
@@ -14066,18 +13553,18 @@ var ts;
}
function isStartOfConstructSignature() {
nextToken();
- return token() === 17 || token() === 25;
+ return token() === 18 || token() === 26;
}
function parseTypeLiteral() {
- var node = createNode(159);
+ var node = createNode(160);
node.members = parseObjectTypeMembers();
return finishNode(node);
}
function parseObjectTypeMembers() {
var members;
- if (parseExpected(15)) {
+ if (parseExpected(16)) {
members = parseList(4, parseTypeMember);
- parseExpected(16);
+ parseExpected(17);
}
else {
members = createMissingList();
@@ -14085,31 +13572,31 @@ var ts;
return members;
}
function parseTupleType() {
- var node = createNode(161);
- node.elementTypes = parseBracketedList(19, parseType, 19, 20);
+ var node = createNode(162);
+ node.elementTypes = parseBracketedList(19, parseType, 20, 21);
return finishNode(node);
}
function parseParenthesizedType() {
- var node = createNode(164);
- parseExpected(17);
- node.type = parseType();
+ var node = createNode(165);
parseExpected(18);
+ node.type = parseType();
+ parseExpected(19);
return finishNode(node);
}
function parseFunctionOrConstructorType(kind) {
var node = createNode(kind);
- if (kind === 157) {
- parseExpected(92);
+ if (kind === 158) {
+ parseExpected(93);
}
- fillSignature(34, false, false, false, node);
+ fillSignature(35, false, false, false, node);
return finishNode(node);
}
function parseKeywordAndNoDot() {
var node = parseTokenNode();
- return token() === 21 ? undefined : node;
+ return token() === 22 ? undefined : node;
}
function parseLiteralTypeNode() {
- var node = createNode(166);
+ var node = createNode(167);
node.literal = parseSimpleUnaryExpression();
finishNode(node);
return node;
@@ -14119,41 +13606,41 @@ var ts;
}
function parseNonArrayType() {
switch (token()) {
- case 117:
- case 132:
- case 130:
- case 120:
+ case 118:
case 133:
- case 135:
- case 127:
+ case 131:
+ case 121:
+ case 134:
+ case 136:
+ case 128:
var node = tryParse(parseKeywordAndNoDot);
return node || parseTypeReference();
case 9:
case 8:
- case 99:
- case 84:
+ case 100:
+ case 85:
return parseLiteralTypeNode();
- case 36:
+ case 37:
return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode() : parseTypeReference();
- case 103:
- case 93:
+ case 104:
+ case 94:
return parseTokenNode();
- case 97: {
+ case 98: {
var thisKeyword = parseThisTypeNode();
- if (token() === 124 && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 125 && !scanner.hasPrecedingLineBreak()) {
return parseThisTypePredicate(thisKeyword);
}
else {
return thisKeyword;
}
}
- case 101:
+ case 102:
return parseTypeQuery();
- case 15:
+ case 16:
return parseTypeLiteral();
- case 19:
+ case 20:
return parseTupleType();
- case 17:
+ case 18:
return parseParenthesizedType();
default:
return parseTypeReference();
@@ -14161,29 +13648,29 @@ var ts;
}
function isStartOfType() {
switch (token()) {
- case 117:
- case 132:
- case 130:
- case 120:
+ case 118:
case 133:
- case 103:
- case 135:
+ case 131:
+ case 121:
+ case 134:
+ case 104:
+ case 136:
+ case 94:
+ case 98:
+ case 102:
+ case 128:
+ case 16:
+ case 20:
+ case 26:
case 93:
- case 97:
- case 101:
- case 127:
- case 15:
- case 19:
- case 25:
- case 92:
case 9:
case 8:
- case 99:
- case 84:
+ case 100:
+ case 85:
return true;
- case 36:
+ case 37:
return lookAhead(nextTokenIsNumericLiteral);
- case 17:
+ case 18:
return lookAhead(isStartOfParenthesizedOrFunctionType);
default:
return isIdentifier();
@@ -14191,13 +13678,13 @@ var ts;
}
function isStartOfParenthesizedOrFunctionType() {
nextToken();
- return token() === 18 || isStartOfParameter() || isStartOfType();
+ return token() === 19 || isStartOfParameter() || isStartOfType();
}
function parseArrayTypeOrHigher() {
var type = parseNonArrayType();
- while (!scanner.hasPrecedingLineBreak() && parseOptional(19)) {
- parseExpected(20);
- var node = createNode(160, type.pos);
+ while (!scanner.hasPrecedingLineBreak() && parseOptional(20)) {
+ parseExpected(21);
+ var node = createNode(161, type.pos);
node.elementType = type;
type = finishNode(node);
}
@@ -14218,26 +13705,26 @@ var ts;
return type;
}
function parseIntersectionTypeOrHigher() {
- return parseUnionOrIntersectionType(163, parseArrayTypeOrHigher, 46);
+ return parseUnionOrIntersectionType(164, parseArrayTypeOrHigher, 47);
}
function parseUnionTypeOrHigher() {
- return parseUnionOrIntersectionType(162, parseIntersectionTypeOrHigher, 47);
+ return parseUnionOrIntersectionType(163, parseIntersectionTypeOrHigher, 48);
}
function isStartOfFunctionType() {
- if (token() === 25) {
+ if (token() === 26) {
return true;
}
- return token() === 17 && lookAhead(isUnambiguouslyStartOfFunctionType);
+ return token() === 18 && lookAhead(isUnambiguouslyStartOfFunctionType);
}
function skipParameterStart() {
if (ts.isModifierKind(token())) {
parseModifiers();
}
- if (isIdentifier() || token() === 97) {
+ if (isIdentifier() || token() === 98) {
nextToken();
return true;
}
- if (token() === 19 || token() === 15) {
+ if (token() === 20 || token() === 16) {
var previousErrorCount = parseDiagnostics.length;
parseIdentifierOrPattern();
return previousErrorCount === parseDiagnostics.length;
@@ -14246,17 +13733,17 @@ var ts;
}
function isUnambiguouslyStartOfFunctionType() {
nextToken();
- if (token() === 18 || token() === 22) {
+ if (token() === 19 || token() === 23) {
return true;
}
if (skipParameterStart()) {
- if (token() === 54 || token() === 24 ||
- token() === 53 || token() === 56) {
+ if (token() === 55 || token() === 25 ||
+ token() === 54 || token() === 57) {
return true;
}
- if (token() === 18) {
+ if (token() === 19) {
nextToken();
- if (token() === 34) {
+ if (token() === 35) {
return true;
}
}
@@ -14267,7 +13754,7 @@ var ts;
var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix);
var type = parseType();
if (typePredicateVariable) {
- var node = createNode(154, typePredicateVariable.pos);
+ var node = createNode(155, typePredicateVariable.pos);
node.parameterName = typePredicateVariable;
node.type = type;
return finishNode(node);
@@ -14278,7 +13765,7 @@ var ts;
}
function parseTypePredicatePrefix() {
var id = parseIdentifier();
- if (token() === 124 && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 125 && !scanner.hasPrecedingLineBreak()) {
nextToken();
return id;
}
@@ -14288,36 +13775,36 @@ var ts;
}
function parseTypeWorker() {
if (isStartOfFunctionType()) {
- return parseFunctionOrConstructorType(156);
- }
- if (token() === 92) {
return parseFunctionOrConstructorType(157);
}
+ if (token() === 93) {
+ return parseFunctionOrConstructorType(158);
+ }
return parseUnionTypeOrHigher();
}
function parseTypeAnnotation() {
- return parseOptional(54) ? parseType() : undefined;
+ return parseOptional(55) ? parseType() : undefined;
}
function isStartOfLeftHandSideExpression() {
switch (token()) {
- case 97:
- case 95:
- case 93:
- case 99:
- case 84:
+ case 98:
+ case 96:
+ case 94:
+ case 100:
+ case 85:
case 8:
case 9:
- case 11:
case 12:
- case 17:
- case 19:
- case 15:
- case 87:
- case 73:
- case 92:
- case 39:
- case 61:
- case 69:
+ case 13:
+ case 18:
+ case 20:
+ case 16:
+ case 88:
+ case 74:
+ case 93:
+ case 40:
+ case 62:
+ case 70:
return true;
default:
return isIdentifier();
@@ -14328,18 +13815,18 @@ var ts;
return true;
}
switch (token()) {
- case 35:
case 36:
+ case 37:
+ case 51:
case 50:
- case 49:
- case 78:
- case 101:
- case 103:
- case 41:
+ case 79:
+ case 102:
+ case 104:
case 42:
- case 25:
- case 119:
- case 114:
+ case 43:
+ case 26:
+ case 120:
+ case 115:
return true;
default:
if (isBinaryOperator()) {
@@ -14349,10 +13836,10 @@ var ts;
}
}
function isStartOfExpressionStatement() {
- return token() !== 15 &&
- token() !== 87 &&
- token() !== 73 &&
- token() !== 55 &&
+ return token() !== 16 &&
+ token() !== 88 &&
+ token() !== 74 &&
+ token() !== 56 &&
isStartOfExpression();
}
function parseExpression() {
@@ -14362,7 +13849,7 @@ var ts;
}
var expr = parseAssignmentExpressionOrHigher();
var operatorToken;
- while ((operatorToken = parseOptionalToken(24))) {
+ while ((operatorToken = parseOptionalToken(25))) {
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher());
}
if (saveDecoratorContext) {
@@ -14371,12 +13858,12 @@ var ts;
return expr;
}
function parseInitializer(inParameter) {
- if (token() !== 56) {
- if (scanner.hasPrecedingLineBreak() || (inParameter && token() === 15) || !isStartOfExpression()) {
+ if (token() !== 57) {
+ if (scanner.hasPrecedingLineBreak() || (inParameter && token() === 16) || !isStartOfExpression()) {
return undefined;
}
}
- parseExpected(56);
+ parseExpected(57);
return parseAssignmentExpressionOrHigher();
}
function parseAssignmentExpressionOrHigher() {
@@ -14388,7 +13875,7 @@ var ts;
return arrowExpression;
}
var expr = parseBinaryExpressionOrHigher(0);
- if (expr.kind === 69 && token() === 34) {
+ if (expr.kind === 70 && token() === 35) {
return parseSimpleArrowFunctionExpression(expr);
}
if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) {
@@ -14397,7 +13884,7 @@ var ts;
return parseConditionalExpressionRest(expr);
}
function isYieldExpression() {
- if (token() === 114) {
+ if (token() === 115) {
if (inYieldContext()) {
return true;
}
@@ -14410,11 +13897,11 @@ var ts;
return !scanner.hasPrecedingLineBreak() && isIdentifier();
}
function parseYieldExpression() {
- var node = createNode(190);
+ var node = createNode(191);
nextToken();
if (!scanner.hasPrecedingLineBreak() &&
- (token() === 37 || isStartOfExpression())) {
- node.asteriskToken = parseOptionalToken(37);
+ (token() === 38 || isStartOfExpression())) {
+ node.asteriskToken = parseOptionalToken(38);
node.expression = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
@@ -14423,21 +13910,21 @@ var ts;
}
}
function parseSimpleArrowFunctionExpression(identifier, asyncModifier) {
- ts.Debug.assert(token() === 34, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
+ ts.Debug.assert(token() === 35, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
var node;
if (asyncModifier) {
- node = createNode(180, asyncModifier.pos);
+ node = createNode(181, asyncModifier.pos);
node.modifiers = asyncModifier;
}
else {
- node = createNode(180, identifier.pos);
+ node = createNode(181, identifier.pos);
}
- var parameter = createNode(142, identifier.pos);
+ var parameter = createNode(143, identifier.pos);
parameter.name = identifier;
finishNode(parameter);
node.parameters = createNodeArray([parameter], parameter.pos);
node.parameters.end = parameter.end;
- node.equalsGreaterThanToken = parseExpectedToken(34, false, ts.Diagnostics._0_expected, "=>");
+ node.equalsGreaterThanToken = parseExpectedToken(35, false, ts.Diagnostics._0_expected, "=>");
node.body = parseArrowFunctionExpressionBody(!!asyncModifier);
return addJSDocComment(finishNode(node));
}
@@ -14454,78 +13941,78 @@ var ts;
}
var isAsync = !!(ts.getModifierFlags(arrowFunction) & 256);
var lastToken = token();
- arrowFunction.equalsGreaterThanToken = parseExpectedToken(34, false, ts.Diagnostics._0_expected, "=>");
- arrowFunction.body = (lastToken === 34 || lastToken === 15)
+ arrowFunction.equalsGreaterThanToken = parseExpectedToken(35, false, ts.Diagnostics._0_expected, "=>");
+ arrowFunction.body = (lastToken === 35 || lastToken === 16)
? parseArrowFunctionExpressionBody(isAsync)
: parseIdentifier();
return addJSDocComment(finishNode(arrowFunction));
}
function isParenthesizedArrowFunctionExpression() {
- if (token() === 17 || token() === 25 || token() === 118) {
+ if (token() === 18 || token() === 26 || token() === 119) {
return lookAhead(isParenthesizedArrowFunctionExpressionWorker);
}
- if (token() === 34) {
+ if (token() === 35) {
return 1;
}
return 0;
}
function isParenthesizedArrowFunctionExpressionWorker() {
- if (token() === 118) {
+ if (token() === 119) {
nextToken();
if (scanner.hasPrecedingLineBreak()) {
return 0;
}
- if (token() !== 17 && token() !== 25) {
+ if (token() !== 18 && token() !== 26) {
return 0;
}
}
var first = token();
var second = nextToken();
- if (first === 17) {
- if (second === 18) {
+ if (first === 18) {
+ if (second === 19) {
var third = nextToken();
switch (third) {
- case 34:
- case 54:
- case 15:
+ case 35:
+ case 55:
+ case 16:
return 1;
default:
return 0;
}
}
- if (second === 19 || second === 15) {
+ if (second === 20 || second === 16) {
return 2;
}
- if (second === 22) {
+ if (second === 23) {
return 1;
}
if (!isIdentifier()) {
return 0;
}
- if (nextToken() === 54) {
+ if (nextToken() === 55) {
return 1;
}
return 2;
}
else {
- ts.Debug.assert(first === 25);
+ ts.Debug.assert(first === 26);
if (!isIdentifier()) {
return 0;
}
if (sourceFile.languageVariant === 1) {
var isArrowFunctionInJsx = lookAhead(function () {
var third = nextToken();
- if (third === 83) {
+ if (third === 84) {
var fourth = nextToken();
switch (fourth) {
- case 56:
- case 27:
+ case 57:
+ case 28:
return false;
default:
return true;
}
}
- else if (third === 24) {
+ else if (third === 25) {
return true;
}
return false;
@@ -14542,7 +14029,7 @@ var ts;
return parseParenthesizedArrowFunctionExpressionHead(false);
}
function tryParseAsyncSimpleArrowFunctionExpression() {
- if (token() === 118) {
+ if (token() === 119) {
var isUnParenthesizedAsyncArrowFunction = lookAhead(isUnParenthesizedAsyncArrowFunctionWorker);
if (isUnParenthesizedAsyncArrowFunction === 1) {
var asyncModifier = parseModifiersForArrowFunction();
@@ -14553,38 +14040,38 @@ var ts;
return undefined;
}
function isUnParenthesizedAsyncArrowFunctionWorker() {
- if (token() === 118) {
+ if (token() === 119) {
nextToken();
- if (scanner.hasPrecedingLineBreak() || token() === 34) {
+ if (scanner.hasPrecedingLineBreak() || token() === 35) {
return 0;
}
var expr = parseBinaryExpressionOrHigher(0);
- if (!scanner.hasPrecedingLineBreak() && expr.kind === 69 && token() === 34) {
+ if (!scanner.hasPrecedingLineBreak() && expr.kind === 70 && token() === 35) {
return 1;
}
}
return 0;
}
function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) {
- var node = createNode(180);
+ var node = createNode(181);
node.modifiers = parseModifiersForArrowFunction();
var isAsync = !!(ts.getModifierFlags(node) & 256);
- fillSignature(54, false, isAsync, !allowAmbiguity, node);
+ fillSignature(55, false, isAsync, !allowAmbiguity, node);
if (!node.parameters) {
return undefined;
}
- if (!allowAmbiguity && token() !== 34 && token() !== 15) {
+ if (!allowAmbiguity && token() !== 35 && token() !== 16) {
return undefined;
}
return node;
}
function parseArrowFunctionExpressionBody(isAsync) {
- if (token() === 15) {
+ if (token() === 16) {
return parseFunctionBlock(false, isAsync, false);
}
- if (token() !== 23 &&
- token() !== 87 &&
- token() !== 73 &&
+ if (token() !== 24 &&
+ token() !== 88 &&
+ token() !== 74 &&
isStartOfStatement() &&
!isStartOfExpressionStatement()) {
return parseFunctionBlock(false, isAsync, true);
@@ -14594,15 +14081,15 @@ var ts;
: doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
}
function parseConditionalExpressionRest(leftOperand) {
- var questionToken = parseOptionalToken(53);
+ var questionToken = parseOptionalToken(54);
if (!questionToken) {
return leftOperand;
}
- var node = createNode(188, leftOperand.pos);
+ var node = createNode(189, leftOperand.pos);
node.condition = leftOperand;
node.questionToken = questionToken;
node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher);
- node.colonToken = parseExpectedToken(54, false, ts.Diagnostics._0_expected, ts.tokenToString(54));
+ node.colonToken = parseExpectedToken(55, false, ts.Diagnostics._0_expected, ts.tokenToString(55));
node.whenFalse = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
@@ -14611,22 +14098,22 @@ var ts;
return parseBinaryExpressionRest(precedence, leftOperand);
}
function isInOrOfKeyword(t) {
- return t === 90 || t === 138;
+ return t === 91 || t === 139;
}
function parseBinaryExpressionRest(precedence, leftOperand) {
while (true) {
reScanGreaterToken();
var newPrecedence = getBinaryOperatorPrecedence();
- var consumeCurrentOperator = token() === 38 ?
+ var consumeCurrentOperator = token() === 39 ?
newPrecedence >= precedence :
newPrecedence > precedence;
if (!consumeCurrentOperator) {
break;
}
- if (token() === 90 && inDisallowInContext()) {
+ if (token() === 91 && inDisallowInContext()) {
break;
}
- if (token() === 116) {
+ if (token() === 117) {
if (scanner.hasPrecedingLineBreak()) {
break;
}
@@ -14642,92 +14129,92 @@ var ts;
return leftOperand;
}
function isBinaryOperator() {
- if (inDisallowInContext() && token() === 90) {
+ if (inDisallowInContext() && token() === 91) {
return false;
}
return getBinaryOperatorPrecedence() > 0;
}
function getBinaryOperatorPrecedence() {
switch (token()) {
- case 52:
+ case 53:
return 1;
- case 51:
+ case 52:
return 2;
- case 47:
- return 3;
case 48:
+ return 3;
+ case 49:
return 4;
- case 46:
+ case 47:
return 5;
- case 30:
case 31:
case 32:
case 33:
+ case 34:
return 6;
- case 25:
- case 27:
+ case 26:
case 28:
case 29:
+ case 30:
+ case 92:
case 91:
- case 90:
- case 116:
+ case 117:
return 7;
- case 43:
case 44:
case 45:
+ case 46:
return 8;
- case 35:
case 36:
- return 9;
case 37:
- case 39:
- case 40:
- return 10;
+ return 9;
case 38:
+ case 40:
+ case 41:
+ return 10;
+ case 39:
return 11;
}
return -1;
}
function makeBinaryExpression(left, operatorToken, right) {
- var node = createNode(187, left.pos);
+ var node = createNode(188, left.pos);
node.left = left;
node.operatorToken = operatorToken;
node.right = right;
return finishNode(node);
}
function makeAsExpression(left, right) {
- var node = createNode(195, left.pos);
+ var node = createNode(196, left.pos);
node.expression = left;
node.type = right;
return finishNode(node);
}
function parsePrefixUnaryExpression() {
- var node = createNode(185);
+ var node = createNode(186);
node.operator = token();
nextToken();
node.operand = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseDeleteExpression() {
- var node = createNode(181);
- nextToken();
- node.expression = parseSimpleUnaryExpression();
- return finishNode(node);
- }
- function parseTypeOfExpression() {
var node = createNode(182);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
- function parseVoidExpression() {
+ function parseTypeOfExpression() {
var node = createNode(183);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
+ function parseVoidExpression() {
+ var node = createNode(184);
+ nextToken();
+ node.expression = parseSimpleUnaryExpression();
+ return finishNode(node);
+ }
function isAwaitExpression() {
- if (token() === 119) {
+ if (token() === 120) {
if (inAwaitContext()) {
return true;
}
@@ -14736,7 +14223,7 @@ var ts;
return false;
}
function parseAwaitExpression() {
- var node = createNode(184);
+ var node = createNode(185);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
@@ -14744,15 +14231,15 @@ var ts;
function parseUnaryExpressionOrHigher() {
if (isUpdateExpression()) {
var incrementExpression = parseIncrementExpression();
- return token() === 38 ?
+ return token() === 39 ?
parseBinaryExpressionRest(getBinaryOperatorPrecedence(), incrementExpression) :
incrementExpression;
}
var unaryOperator = token();
var simpleUnaryExpression = parseSimpleUnaryExpression();
- if (token() === 38) {
+ if (token() === 39) {
var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos);
- if (simpleUnaryExpression.kind === 177) {
+ if (simpleUnaryExpression.kind === 178) {
parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses);
}
else {
@@ -14763,20 +14250,20 @@ var ts;
}
function parseSimpleUnaryExpression() {
switch (token()) {
- case 35:
case 36:
+ case 37:
+ case 51:
case 50:
- case 49:
return parsePrefixUnaryExpression();
- case 78:
+ case 79:
return parseDeleteExpression();
- case 101:
+ case 102:
return parseTypeOfExpression();
- case 103:
+ case 104:
return parseVoidExpression();
- case 25:
+ case 26:
return parseTypeAssertion();
- case 119:
+ case 120:
if (isAwaitExpression()) {
return parseAwaitExpression();
}
@@ -14786,16 +14273,16 @@ var ts;
}
function isUpdateExpression() {
switch (token()) {
- case 35:
case 36:
+ case 37:
+ case 51:
case 50:
- case 49:
- case 78:
- case 101:
- case 103:
- case 119:
+ case 79:
+ case 102:
+ case 104:
+ case 120:
return false;
- case 25:
+ case 26:
if (sourceFile.languageVariant !== 1) {
return false;
}
@@ -14804,20 +14291,20 @@ var ts;
}
}
function parseIncrementExpression() {
- if (token() === 41 || token() === 42) {
- var node = createNode(185);
+ if (token() === 42 || token() === 43) {
+ var node = createNode(186);
node.operator = token();
nextToken();
node.operand = parseLeftHandSideExpressionOrHigher();
return finishNode(node);
}
- else if (sourceFile.languageVariant === 1 && token() === 25 && lookAhead(nextTokenIsIdentifierOrKeyword)) {
+ else if (sourceFile.languageVariant === 1 && token() === 26 && lookAhead(nextTokenIsIdentifierOrKeyword)) {
return parseJsxElementOrSelfClosingElement(true);
}
var expression = parseLeftHandSideExpressionOrHigher();
ts.Debug.assert(ts.isLeftHandSideExpression(expression));
- if ((token() === 41 || token() === 42) && !scanner.hasPrecedingLineBreak()) {
- var node = createNode(186, expression.pos);
+ if ((token() === 42 || token() === 43) && !scanner.hasPrecedingLineBreak()) {
+ var node = createNode(187, expression.pos);
node.operand = expression;
node.operator = token();
nextToken();
@@ -14826,7 +14313,7 @@ var ts;
return expression;
}
function parseLeftHandSideExpressionOrHigher() {
- var expression = token() === 95
+ var expression = token() === 96
? parseSuperExpression()
: parseMemberExpressionOrHigher();
return parseCallExpressionRest(expression);
@@ -14837,12 +14324,12 @@ var ts;
}
function parseSuperExpression() {
var expression = parseTokenNode();
- if (token() === 17 || token() === 21 || token() === 19) {
+ if (token() === 18 || token() === 22 || token() === 20) {
return expression;
}
- var node = createNode(172, expression.pos);
+ var node = createNode(173, expression.pos);
node.expression = expression;
- parseExpectedToken(21, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
+ parseExpectedToken(22, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
node.name = parseRightSideOfDot(true);
return finishNode(node);
}
@@ -14850,10 +14337,10 @@ var ts;
if (lhs.kind !== rhs.kind) {
return false;
}
- if (lhs.kind === 69) {
+ if (lhs.kind === 70) {
return lhs.text === rhs.text;
}
- if (lhs.kind === 97) {
+ if (lhs.kind === 98) {
return true;
}
return lhs.name.text === rhs.name.text &&
@@ -14862,8 +14349,8 @@ var ts;
function parseJsxElementOrSelfClosingElement(inExpressionContext) {
var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext);
var result;
- if (opening.kind === 243) {
- var node = createNode(241, opening.pos);
+ if (opening.kind === 244) {
+ var node = createNode(242, opening.pos);
node.openingElement = opening;
node.children = parseJsxChildren(node.openingElement.tagName);
node.closingElement = parseJsxClosingElement(inExpressionContext);
@@ -14873,18 +14360,18 @@ var ts;
result = finishNode(node);
}
else {
- ts.Debug.assert(opening.kind === 242);
+ ts.Debug.assert(opening.kind === 243);
result = opening;
}
- if (inExpressionContext && token() === 25) {
+ if (inExpressionContext && token() === 26) {
var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(true); });
if (invalidElement) {
parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element);
- var badNode = createNode(187, result.pos);
+ var badNode = createNode(188, result.pos);
badNode.end = invalidElement.end;
badNode.left = result;
badNode.right = invalidElement;
- badNode.operatorToken = createMissingNode(24, false, undefined);
+ badNode.operatorToken = createMissingNode(25, false, undefined);
badNode.operatorToken.pos = badNode.operatorToken.end = badNode.right.pos;
return badNode;
}
@@ -14892,17 +14379,17 @@ var ts;
return result;
}
function parseJsxText() {
- var node = createNode(244, scanner.getStartPos());
+ var node = createNode(10, scanner.getStartPos());
currentToken = scanner.scanJsxToken();
return finishNode(node);
}
function parseJsxChild() {
switch (token()) {
- case 244:
+ case 10:
return parseJsxText();
- case 15:
+ case 16:
return parseJsxExpression(false);
- case 25:
+ case 26:
return parseJsxElementOrSelfClosingElement(false);
}
ts.Debug.fail("Unknown JSX child kind " + token());
@@ -14913,7 +14400,7 @@ var ts;
parsingContext |= 1 << 14;
while (true) {
currentToken = scanner.reScanJsxToken();
- if (token() === 26) {
+ if (token() === 27) {
break;
}
else if (token() === 1) {
@@ -14928,24 +14415,24 @@ var ts;
}
function parseJsxOpeningOrSelfClosingElement(inExpressionContext) {
var fullStart = scanner.getStartPos();
- parseExpected(25);
+ parseExpected(26);
var tagName = parseJsxElementName();
var attributes = parseList(13, parseJsxAttribute);
var node;
- if (token() === 27) {
- node = createNode(243, fullStart);
+ if (token() === 28) {
+ node = createNode(244, fullStart);
scanJsxText();
}
else {
- parseExpected(39);
+ parseExpected(40);
if (inExpressionContext) {
- parseExpected(27);
+ parseExpected(28);
}
else {
- parseExpected(27, undefined, false);
+ parseExpected(28, undefined, false);
scanJsxText();
}
- node = createNode(242, fullStart);
+ node = createNode(243, fullStart);
}
node.tagName = tagName;
node.attributes = attributes;
@@ -14953,10 +14440,10 @@ var ts;
}
function parseJsxElementName() {
scanJsxIdentifier();
- var expression = token() === 97 ?
+ var expression = token() === 98 ?
parseTokenNode() : parseIdentifierName();
- while (parseOptional(21)) {
- var propertyAccess = createNode(172, expression.pos);
+ while (parseOptional(22)) {
+ var propertyAccess = createNode(173, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(true);
expression = finishNode(propertyAccess);
@@ -14965,27 +14452,27 @@ var ts;
}
function parseJsxExpression(inExpressionContext) {
var node = createNode(248);
- parseExpected(15);
- if (token() !== 16) {
+ parseExpected(16);
+ if (token() !== 17) {
node.expression = parseAssignmentExpressionOrHigher();
}
if (inExpressionContext) {
- parseExpected(16);
+ parseExpected(17);
}
else {
- parseExpected(16, undefined, false);
+ parseExpected(17, undefined, false);
scanJsxText();
}
return finishNode(node);
}
function parseJsxAttribute() {
- if (token() === 15) {
+ if (token() === 16) {
return parseJsxSpreadAttribute();
}
scanJsxIdentifier();
var node = createNode(246);
node.name = parseIdentifierName();
- if (token() === 56) {
+ if (token() === 57) {
switch (scanJsxAttributeValue()) {
case 9:
node.initializer = parseLiteralNode();
@@ -14999,68 +14486,68 @@ var ts;
}
function parseJsxSpreadAttribute() {
var node = createNode(247);
- parseExpected(15);
- parseExpected(22);
- node.expression = parseExpression();
parseExpected(16);
+ parseExpected(23);
+ node.expression = parseExpression();
+ parseExpected(17);
return finishNode(node);
}
function parseJsxClosingElement(inExpressionContext) {
var node = createNode(245);
- parseExpected(26);
+ parseExpected(27);
node.tagName = parseJsxElementName();
if (inExpressionContext) {
- parseExpected(27);
+ parseExpected(28);
}
else {
- parseExpected(27, undefined, false);
+ parseExpected(28, undefined, false);
scanJsxText();
}
return finishNode(node);
}
function parseTypeAssertion() {
- var node = createNode(177);
- parseExpected(25);
+ var node = createNode(178);
+ parseExpected(26);
node.type = parseType();
- parseExpected(27);
+ parseExpected(28);
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseMemberExpressionRest(expression) {
while (true) {
- var dotToken = parseOptionalToken(21);
+ var dotToken = parseOptionalToken(22);
if (dotToken) {
- var propertyAccess = createNode(172, expression.pos);
+ var propertyAccess = createNode(173, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(true);
expression = finishNode(propertyAccess);
continue;
}
- if (token() === 49 && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 50 && !scanner.hasPrecedingLineBreak()) {
nextToken();
- var nonNullExpression = createNode(196, expression.pos);
+ var nonNullExpression = createNode(197, expression.pos);
nonNullExpression.expression = expression;
expression = finishNode(nonNullExpression);
continue;
}
- if (!inDecoratorContext() && parseOptional(19)) {
- var indexedAccess = createNode(173, expression.pos);
+ if (!inDecoratorContext() && parseOptional(20)) {
+ var indexedAccess = createNode(174, expression.pos);
indexedAccess.expression = expression;
- if (token() !== 20) {
+ if (token() !== 21) {
indexedAccess.argumentExpression = allowInAnd(parseExpression);
if (indexedAccess.argumentExpression.kind === 9 || indexedAccess.argumentExpression.kind === 8) {
var literal = indexedAccess.argumentExpression;
literal.text = internIdentifier(literal.text);
}
}
- parseExpected(20);
+ parseExpected(21);
expression = finishNode(indexedAccess);
continue;
}
- if (token() === 11 || token() === 12) {
- var tagExpression = createNode(176, expression.pos);
+ if (token() === 12 || token() === 13) {
+ var tagExpression = createNode(177, expression.pos);
tagExpression.tag = expression;
- tagExpression.template = token() === 11
+ tagExpression.template = token() === 12
? parseLiteralNode()
: parseTemplateExpression();
expression = finishNode(tagExpression);
@@ -15072,20 +14559,20 @@ var ts;
function parseCallExpressionRest(expression) {
while (true) {
expression = parseMemberExpressionRest(expression);
- if (token() === 25) {
+ if (token() === 26) {
var typeArguments = tryParse(parseTypeArgumentsInExpression);
if (!typeArguments) {
return expression;
}
- var callExpr = createNode(174, expression.pos);
+ var callExpr = createNode(175, expression.pos);
callExpr.expression = expression;
callExpr.typeArguments = typeArguments;
callExpr.arguments = parseArgumentList();
expression = finishNode(callExpr);
continue;
}
- else if (token() === 17) {
- var callExpr = createNode(174, expression.pos);
+ else if (token() === 18) {
+ var callExpr = createNode(175, expression.pos);
callExpr.expression = expression;
callExpr.arguments = parseArgumentList();
expression = finishNode(callExpr);
@@ -15095,17 +14582,17 @@ var ts;
}
}
function parseArgumentList() {
- parseExpected(17);
- var result = parseDelimitedList(11, parseArgumentExpression);
parseExpected(18);
+ var result = parseDelimitedList(11, parseArgumentExpression);
+ parseExpected(19);
return result;
}
function parseTypeArgumentsInExpression() {
- if (!parseOptional(25)) {
+ if (!parseOptional(26)) {
return undefined;
}
var typeArguments = parseDelimitedList(18, parseType);
- if (!parseExpected(27)) {
+ if (!parseExpected(28)) {
return undefined;
}
return typeArguments && canFollowTypeArgumentsInExpression()
@@ -15114,27 +14601,27 @@ var ts;
}
function canFollowTypeArgumentsInExpression() {
switch (token()) {
- case 17:
- case 21:
case 18:
- case 20:
+ case 22:
+ case 19:
+ case 21:
+ case 55:
+ case 24:
case 54:
- case 23:
- case 53:
- case 30:
- case 32:
case 31:
case 33:
- case 51:
+ case 32:
+ case 34:
case 52:
- case 48:
- case 46:
+ case 53:
+ case 49:
case 47:
- case 16:
+ case 48:
+ case 17:
case 1:
return true;
- case 24:
- case 15:
+ case 25:
+ case 16:
default:
return false;
}
@@ -15143,80 +14630,80 @@ var ts;
switch (token()) {
case 8:
case 9:
- case 11:
+ case 12:
return parseLiteralNode();
- case 97:
- case 95:
- case 93:
- case 99:
- case 84:
+ case 98:
+ case 96:
+ case 94:
+ case 100:
+ case 85:
return parseTokenNode();
- case 17:
+ case 18:
return parseParenthesizedExpression();
- case 19:
+ case 20:
return parseArrayLiteralExpression();
- case 15:
+ case 16:
return parseObjectLiteralExpression();
- case 118:
+ case 119:
if (!lookAhead(nextTokenIsFunctionKeywordOnSameLine)) {
break;
}
return parseFunctionExpression();
- case 73:
+ case 74:
return parseClassExpression();
- case 87:
+ case 88:
return parseFunctionExpression();
- case 92:
+ case 93:
return parseNewExpression();
- case 39:
- case 61:
- if (reScanSlashToken() === 10) {
+ case 40:
+ case 62:
+ if (reScanSlashToken() === 11) {
return parseLiteralNode();
}
break;
- case 12:
+ case 13:
return parseTemplateExpression();
}
return parseIdentifier(ts.Diagnostics.Expression_expected);
}
function parseParenthesizedExpression() {
- var node = createNode(178);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(179);
parseExpected(18);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
return finishNode(node);
}
function parseSpreadElement() {
- var node = createNode(191);
- parseExpected(22);
+ var node = createNode(192);
+ parseExpected(23);
node.expression = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
function parseArgumentOrArrayLiteralElement() {
- return token() === 22 ? parseSpreadElement() :
- token() === 24 ? createNode(193) :
+ return token() === 23 ? parseSpreadElement() :
+ token() === 25 ? createNode(194) :
parseAssignmentExpressionOrHigher();
}
function parseArgumentExpression() {
return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement);
}
function parseArrayLiteralExpression() {
- var node = createNode(170);
- parseExpected(19);
+ var node = createNode(171);
+ parseExpected(20);
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
}
node.elements = parseDelimitedList(15, parseArgumentOrArrayLiteralElement);
- parseExpected(20);
+ parseExpected(21);
return finishNode(node);
}
function tryParseAccessorDeclaration(fullStart, decorators, modifiers) {
- if (parseContextualModifier(123)) {
- return parseAccessorDeclaration(149, fullStart, decorators, modifiers);
- }
- else if (parseContextualModifier(131)) {
+ if (parseContextualModifier(124)) {
return parseAccessorDeclaration(150, fullStart, decorators, modifiers);
}
+ else if (parseContextualModifier(132)) {
+ return parseAccessorDeclaration(151, fullStart, decorators, modifiers);
+ }
return undefined;
}
function parseObjectLiteralElement() {
@@ -15227,19 +14714,19 @@ var ts;
if (accessor) {
return accessor;
}
- var asteriskToken = parseOptionalToken(37);
+ var asteriskToken = parseOptionalToken(38);
var tokenIsIdentifier = isIdentifier();
var propertyName = parsePropertyName();
- var questionToken = parseOptionalToken(53);
- if (asteriskToken || token() === 17 || token() === 25) {
+ var questionToken = parseOptionalToken(54);
+ if (asteriskToken || token() === 18 || token() === 26) {
return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, propertyName, questionToken);
}
- var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 24 || token() === 16 || token() === 56);
+ var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 25 || token() === 17 || token() === 57);
if (isShorthandPropertyAssignment) {
var shorthandDeclaration = createNode(254, fullStart);
shorthandDeclaration.name = propertyName;
shorthandDeclaration.questionToken = questionToken;
- var equalsToken = parseOptionalToken(56);
+ var equalsToken = parseOptionalToken(57);
if (equalsToken) {
shorthandDeclaration.equalsToken = equalsToken;
shorthandDeclaration.objectAssignmentInitializer = allowInAnd(parseAssignmentExpressionOrHigher);
@@ -15251,19 +14738,19 @@ var ts;
propertyAssignment.modifiers = modifiers;
propertyAssignment.name = propertyName;
propertyAssignment.questionToken = questionToken;
- parseExpected(54);
+ parseExpected(55);
propertyAssignment.initializer = allowInAnd(parseAssignmentExpressionOrHigher);
return addJSDocComment(finishNode(propertyAssignment));
}
}
function parseObjectLiteralExpression() {
- var node = createNode(171);
- parseExpected(15);
+ var node = createNode(172);
+ parseExpected(16);
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
}
node.properties = parseDelimitedList(12, parseObjectLiteralElement, true);
- parseExpected(16);
+ parseExpected(17);
return finishNode(node);
}
function parseFunctionExpression() {
@@ -15271,10 +14758,10 @@ var ts;
if (saveDecoratorContext) {
setDecoratorContext(false);
}
- var node = createNode(179);
+ var node = createNode(180);
node.modifiers = parseModifiers();
- parseExpected(87);
- node.asteriskToken = parseOptionalToken(37);
+ parseExpected(88);
+ node.asteriskToken = parseOptionalToken(38);
var isGenerator = !!node.asteriskToken;
var isAsync = !!(ts.getModifierFlags(node) & 256);
node.name =
@@ -15282,7 +14769,7 @@ var ts;
isGenerator ? doInYieldContext(parseOptionalIdentifier) :
isAsync ? doInAwaitContext(parseOptionalIdentifier) :
parseOptionalIdentifier();
- fillSignature(54, isGenerator, isAsync, false, node);
+ fillSignature(55, isGenerator, isAsync, false, node);
node.body = parseFunctionBlock(isGenerator, isAsync, false);
if (saveDecoratorContext) {
setDecoratorContext(true);
@@ -15293,23 +14780,23 @@ var ts;
return isIdentifier() ? parseIdentifier() : undefined;
}
function parseNewExpression() {
- var node = createNode(175);
- parseExpected(92);
+ var node = createNode(176);
+ parseExpected(93);
node.expression = parseMemberExpressionOrHigher();
node.typeArguments = tryParse(parseTypeArgumentsInExpression);
- if (node.typeArguments || token() === 17) {
+ if (node.typeArguments || token() === 18) {
node.arguments = parseArgumentList();
}
return finishNode(node);
}
function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
- var node = createNode(199);
- if (parseExpected(15, diagnosticMessage) || ignoreMissingOpenBrace) {
+ var node = createNode(200);
+ if (parseExpected(16, diagnosticMessage) || ignoreMissingOpenBrace) {
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
}
node.statements = parseList(1, parseStatement);
- parseExpected(16);
+ parseExpected(17);
}
else {
node.statements = createMissingList();
@@ -15334,47 +14821,47 @@ var ts;
return block;
}
function parseEmptyStatement() {
- var node = createNode(201);
- parseExpected(23);
+ var node = createNode(202);
+ parseExpected(24);
return finishNode(node);
}
function parseIfStatement() {
- var node = createNode(203);
- parseExpected(88);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(204);
+ parseExpected(89);
parseExpected(18);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
node.thenStatement = parseStatement();
- node.elseStatement = parseOptional(80) ? parseStatement() : undefined;
+ node.elseStatement = parseOptional(81) ? parseStatement() : undefined;
return finishNode(node);
}
function parseDoStatement() {
- var node = createNode(204);
- parseExpected(79);
+ var node = createNode(205);
+ parseExpected(80);
node.statement = parseStatement();
- parseExpected(104);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ parseExpected(105);
parseExpected(18);
- parseOptional(23);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
+ parseOptional(24);
return finishNode(node);
}
function parseWhileStatement() {
- var node = createNode(205);
- parseExpected(104);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(206);
+ parseExpected(105);
parseExpected(18);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
node.statement = parseStatement();
return finishNode(node);
}
function parseForOrForInOrForOfStatement() {
var pos = getNodePos();
- parseExpected(86);
- parseExpected(17);
+ parseExpected(87);
+ parseExpected(18);
var initializer = undefined;
- if (token() !== 23) {
- if (token() === 102 || token() === 108 || token() === 74) {
+ if (token() !== 24) {
+ if (token() === 103 || token() === 109 || token() === 75) {
initializer = parseVariableDeclarationList(true);
}
else {
@@ -15382,32 +14869,32 @@ var ts;
}
}
var forOrForInOrForOfStatement;
- if (parseOptional(90)) {
- var forInStatement = createNode(207, pos);
+ if (parseOptional(91)) {
+ var forInStatement = createNode(208, pos);
forInStatement.initializer = initializer;
forInStatement.expression = allowInAnd(parseExpression);
- parseExpected(18);
+ parseExpected(19);
forOrForInOrForOfStatement = forInStatement;
}
- else if (parseOptional(138)) {
- var forOfStatement = createNode(208, pos);
+ else if (parseOptional(139)) {
+ var forOfStatement = createNode(209, pos);
forOfStatement.initializer = initializer;
forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher);
- parseExpected(18);
+ parseExpected(19);
forOrForInOrForOfStatement = forOfStatement;
}
else {
- var forStatement = createNode(206, pos);
+ var forStatement = createNode(207, pos);
forStatement.initializer = initializer;
- parseExpected(23);
- if (token() !== 23 && token() !== 18) {
+ parseExpected(24);
+ if (token() !== 24 && token() !== 19) {
forStatement.condition = allowInAnd(parseExpression);
}
- parseExpected(23);
- if (token() !== 18) {
+ parseExpected(24);
+ if (token() !== 19) {
forStatement.incrementor = allowInAnd(parseExpression);
}
- parseExpected(18);
+ parseExpected(19);
forOrForInOrForOfStatement = forStatement;
}
forOrForInOrForOfStatement.statement = parseStatement();
@@ -15415,7 +14902,7 @@ var ts;
}
function parseBreakOrContinueStatement(kind) {
var node = createNode(kind);
- parseExpected(kind === 210 ? 70 : 75);
+ parseExpected(kind === 211 ? 71 : 76);
if (!canParseSemicolon()) {
node.label = parseIdentifier();
}
@@ -15423,8 +14910,8 @@ var ts;
return finishNode(node);
}
function parseReturnStatement() {
- var node = createNode(211);
- parseExpected(94);
+ var node = createNode(212);
+ parseExpected(95);
if (!canParseSemicolon()) {
node.expression = allowInAnd(parseExpression);
}
@@ -15432,90 +14919,90 @@ var ts;
return finishNode(node);
}
function parseWithStatement() {
- var node = createNode(212);
- parseExpected(105);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(213);
+ parseExpected(106);
parseExpected(18);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
node.statement = parseStatement();
return finishNode(node);
}
function parseCaseClause() {
var node = createNode(249);
- parseExpected(71);
+ parseExpected(72);
node.expression = allowInAnd(parseExpression);
- parseExpected(54);
+ parseExpected(55);
node.statements = parseList(3, parseStatement);
return finishNode(node);
}
function parseDefaultClause() {
var node = createNode(250);
- parseExpected(77);
- parseExpected(54);
+ parseExpected(78);
+ parseExpected(55);
node.statements = parseList(3, parseStatement);
return finishNode(node);
}
function parseCaseOrDefaultClause() {
- return token() === 71 ? parseCaseClause() : parseDefaultClause();
+ return token() === 72 ? parseCaseClause() : parseDefaultClause();
}
function parseSwitchStatement() {
- var node = createNode(213);
- parseExpected(96);
- parseExpected(17);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(214);
+ parseExpected(97);
parseExpected(18);
- var caseBlock = createNode(227, scanner.getStartPos());
- parseExpected(15);
- caseBlock.clauses = parseList(2, parseCaseOrDefaultClause);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(19);
+ var caseBlock = createNode(228, scanner.getStartPos());
parseExpected(16);
+ caseBlock.clauses = parseList(2, parseCaseOrDefaultClause);
+ parseExpected(17);
node.caseBlock = finishNode(caseBlock);
return finishNode(node);
}
function parseThrowStatement() {
- var node = createNode(215);
- parseExpected(98);
+ var node = createNode(216);
+ parseExpected(99);
node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression);
parseSemicolon();
return finishNode(node);
}
function parseTryStatement() {
- var node = createNode(216);
- parseExpected(100);
+ var node = createNode(217);
+ parseExpected(101);
node.tryBlock = parseBlock(false);
- node.catchClause = token() === 72 ? parseCatchClause() : undefined;
- if (!node.catchClause || token() === 85) {
- parseExpected(85);
+ node.catchClause = token() === 73 ? parseCatchClause() : undefined;
+ if (!node.catchClause || token() === 86) {
+ parseExpected(86);
node.finallyBlock = parseBlock(false);
}
return finishNode(node);
}
function parseCatchClause() {
var result = createNode(252);
- parseExpected(72);
- if (parseExpected(17)) {
+ parseExpected(73);
+ if (parseExpected(18)) {
result.variableDeclaration = parseVariableDeclaration();
}
- parseExpected(18);
+ parseExpected(19);
result.block = parseBlock(false);
return finishNode(result);
}
function parseDebuggerStatement() {
- var node = createNode(217);
- parseExpected(76);
+ var node = createNode(218);
+ parseExpected(77);
parseSemicolon();
return finishNode(node);
}
function parseExpressionOrLabeledStatement() {
var fullStart = scanner.getStartPos();
var expression = allowInAnd(parseExpression);
- if (expression.kind === 69 && parseOptional(54)) {
- var labeledStatement = createNode(214, fullStart);
+ if (expression.kind === 70 && parseOptional(55)) {
+ var labeledStatement = createNode(215, fullStart);
labeledStatement.label = expression;
labeledStatement.statement = parseStatement();
return addJSDocComment(finishNode(labeledStatement));
}
else {
- var expressionStatement = createNode(202, fullStart);
+ var expressionStatement = createNode(203, fullStart);
expressionStatement.expression = expression;
parseSemicolon();
return addJSDocComment(finishNode(expressionStatement));
@@ -15527,7 +15014,7 @@ var ts;
}
function nextTokenIsFunctionKeywordOnSameLine() {
nextToken();
- return token() === 87 && !scanner.hasPrecedingLineBreak();
+ return token() === 88 && !scanner.hasPrecedingLineBreak();
}
function nextTokenIsIdentifierOrKeywordOrNumberOnSameLine() {
nextToken();
@@ -15536,47 +15023,47 @@ var ts;
function isDeclaration() {
while (true) {
switch (token()) {
- case 102:
- case 108:
+ case 103:
+ case 109:
+ case 75:
+ case 88:
case 74:
- case 87:
- case 73:
- case 81:
+ case 82:
return true;
- case 107:
- case 134:
+ case 108:
+ case 135:
return nextTokenIsIdentifierOnSameLine();
- case 125:
case 126:
+ case 127:
return nextTokenIsIdentifierOrStringLiteralOnSameLine();
- case 115:
- case 118:
- case 122:
- case 110:
+ case 116:
+ case 119:
+ case 123:
case 111:
case 112:
- case 128:
+ case 113:
+ case 129:
nextToken();
if (scanner.hasPrecedingLineBreak()) {
return false;
}
continue;
- case 137:
+ case 138:
nextToken();
- return token() === 15 || token() === 69 || token() === 82;
- case 89:
+ return token() === 16 || token() === 70 || token() === 83;
+ case 90:
nextToken();
- return token() === 9 || token() === 37 ||
- token() === 15 || ts.tokenIsIdentifierOrKeyword(token());
- case 82:
+ return token() === 9 || token() === 38 ||
+ token() === 16 || ts.tokenIsIdentifierOrKeyword(token());
+ case 83:
nextToken();
- if (token() === 56 || token() === 37 ||
- token() === 15 || token() === 77 ||
- token() === 116) {
+ if (token() === 57 || token() === 38 ||
+ token() === 16 || token() === 78 ||
+ token() === 117) {
return true;
}
continue;
- case 113:
+ case 114:
nextToken();
continue;
default:
@@ -15589,46 +15076,46 @@ var ts;
}
function isStartOfStatement() {
switch (token()) {
- case 55:
- case 23:
- case 15:
- case 102:
- case 108:
- case 87:
- case 73:
- case 81:
+ case 56:
+ case 24:
+ case 16:
+ case 103:
+ case 109:
case 88:
- case 79:
- case 104:
- case 86:
- case 75:
- case 70:
- case 94:
- case 105:
- case 96:
- case 98:
- case 100:
- case 76:
- case 72:
- case 85:
- return true;
case 74:
case 82:
case 89:
+ case 80:
+ case 105:
+ case 87:
+ case 76:
+ case 71:
+ case 95:
+ case 106:
+ case 97:
+ case 99:
+ case 101:
+ case 77:
+ case 73:
+ case 86:
+ return true;
+ case 75:
+ case 83:
+ case 90:
return isStartOfDeclaration();
- case 118:
- case 122:
- case 107:
- case 125:
+ case 119:
+ case 123:
+ case 108:
case 126:
- case 134:
- case 137:
+ case 127:
+ case 135:
+ case 138:
return true;
- case 112:
- case 110:
- case 111:
case 113:
- case 128:
+ case 111:
+ case 112:
+ case 114:
+ case 129:
return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);
default:
return isStartOfExpression();
@@ -15636,73 +15123,73 @@ var ts;
}
function nextTokenIsIdentifierOrStartOfDestructuring() {
nextToken();
- return isIdentifier() || token() === 15 || token() === 19;
+ return isIdentifier() || token() === 16 || token() === 20;
}
function isLetDeclaration() {
return lookAhead(nextTokenIsIdentifierOrStartOfDestructuring);
}
function parseStatement() {
switch (token()) {
- case 23:
+ case 24:
return parseEmptyStatement();
- case 15:
+ case 16:
return parseBlock(false);
- case 102:
+ case 103:
return parseVariableStatement(scanner.getStartPos(), undefined, undefined);
- case 108:
+ case 109:
if (isLetDeclaration()) {
return parseVariableStatement(scanner.getStartPos(), undefined, undefined);
}
break;
- case 87:
- return parseFunctionDeclaration(scanner.getStartPos(), undefined, undefined);
- case 73:
- return parseClassDeclaration(scanner.getStartPos(), undefined, undefined);
case 88:
- return parseIfStatement();
- case 79:
- return parseDoStatement();
- case 104:
- return parseWhileStatement();
- case 86:
- return parseForOrForInOrForOfStatement();
- case 75:
- return parseBreakOrContinueStatement(209);
- case 70:
- return parseBreakOrContinueStatement(210);
- case 94:
- return parseReturnStatement();
- case 105:
- return parseWithStatement();
- case 96:
- return parseSwitchStatement();
- case 98:
- return parseThrowStatement();
- case 100:
- case 72:
- case 85:
- return parseTryStatement();
- case 76:
- return parseDebuggerStatement();
- case 55:
- return parseDeclaration();
- case 118:
- case 107:
- case 134:
- case 125:
- case 126:
- case 122:
+ return parseFunctionDeclaration(scanner.getStartPos(), undefined, undefined);
case 74:
- case 81:
- case 82:
+ return parseClassDeclaration(scanner.getStartPos(), undefined, undefined);
case 89:
- case 110:
+ return parseIfStatement();
+ case 80:
+ return parseDoStatement();
+ case 105:
+ return parseWhileStatement();
+ case 87:
+ return parseForOrForInOrForOfStatement();
+ case 76:
+ return parseBreakOrContinueStatement(210);
+ case 71:
+ return parseBreakOrContinueStatement(211);
+ case 95:
+ return parseReturnStatement();
+ case 106:
+ return parseWithStatement();
+ case 97:
+ return parseSwitchStatement();
+ case 99:
+ return parseThrowStatement();
+ case 101:
+ case 73:
+ case 86:
+ return parseTryStatement();
+ case 77:
+ return parseDebuggerStatement();
+ case 56:
+ return parseDeclaration();
+ case 119:
+ case 108:
+ case 135:
+ case 126:
+ case 127:
+ case 123:
+ case 75:
+ case 82:
+ case 83:
+ case 90:
case 111:
case 112:
- case 115:
case 113:
- case 128:
- case 137:
+ case 116:
+ case 114:
+ case 129:
+ case 138:
if (isStartOfDeclaration()) {
return parseDeclaration();
}
@@ -15715,40 +15202,40 @@ var ts;
var decorators = parseDecorators();
var modifiers = parseModifiers();
switch (token()) {
- case 102:
- case 108:
- case 74:
+ case 103:
+ case 109:
+ case 75:
return parseVariableStatement(fullStart, decorators, modifiers);
- case 87:
+ case 88:
return parseFunctionDeclaration(fullStart, decorators, modifiers);
- case 73:
+ case 74:
return parseClassDeclaration(fullStart, decorators, modifiers);
- case 107:
+ case 108:
return parseInterfaceDeclaration(fullStart, decorators, modifiers);
- case 134:
+ case 135:
return parseTypeAliasDeclaration(fullStart, decorators, modifiers);
- case 81:
- return parseEnumDeclaration(fullStart, decorators, modifiers);
- case 137:
- case 125:
- case 126:
- return parseModuleDeclaration(fullStart, decorators, modifiers);
- case 89:
- return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers);
case 82:
+ return parseEnumDeclaration(fullStart, decorators, modifiers);
+ case 138:
+ case 126:
+ case 127:
+ return parseModuleDeclaration(fullStart, decorators, modifiers);
+ case 90:
+ return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers);
+ case 83:
nextToken();
switch (token()) {
- case 77:
- case 56:
+ case 78:
+ case 57:
return parseExportAssignment(fullStart, decorators, modifiers);
- case 116:
+ case 117:
return parseNamespaceExportDeclaration(fullStart, decorators, modifiers);
default:
return parseExportDeclaration(fullStart, decorators, modifiers);
}
default:
if (decorators || modifiers) {
- var node = createMissingNode(239, true, ts.Diagnostics.Declaration_expected);
+ var node = createMissingNode(240, true, ts.Diagnostics.Declaration_expected);
node.pos = fullStart;
node.decorators = decorators;
node.modifiers = modifiers;
@@ -15761,31 +15248,31 @@ var ts;
return !scanner.hasPrecedingLineBreak() && (isIdentifier() || token() === 9);
}
function parseFunctionBlockOrSemicolon(isGenerator, isAsync, diagnosticMessage) {
- if (token() !== 15 && canParseSemicolon()) {
+ if (token() !== 16 && canParseSemicolon()) {
parseSemicolon();
return;
}
return parseFunctionBlock(isGenerator, isAsync, false, diagnosticMessage);
}
function parseArrayBindingElement() {
- if (token() === 24) {
- return createNode(193);
+ if (token() === 25) {
+ return createNode(194);
}
- var node = createNode(169);
- node.dotDotDotToken = parseOptionalToken(22);
+ var node = createNode(170);
+ node.dotDotDotToken = parseOptionalToken(23);
node.name = parseIdentifierOrPattern();
node.initializer = parseBindingElementInitializer(false);
return finishNode(node);
}
function parseObjectBindingElement() {
- var node = createNode(169);
+ var node = createNode(170);
var tokenIsIdentifier = isIdentifier();
var propertyName = parsePropertyName();
- if (tokenIsIdentifier && token() !== 54) {
+ if (tokenIsIdentifier && token() !== 55) {
node.name = propertyName;
}
else {
- parseExpected(54);
+ parseExpected(55);
node.propertyName = propertyName;
node.name = parseIdentifierOrPattern();
}
@@ -15793,33 +15280,33 @@ var ts;
return finishNode(node);
}
function parseObjectBindingPattern() {
- var node = createNode(167);
- parseExpected(15);
- node.elements = parseDelimitedList(9, parseObjectBindingElement);
+ var node = createNode(168);
parseExpected(16);
+ node.elements = parseDelimitedList(9, parseObjectBindingElement);
+ parseExpected(17);
return finishNode(node);
}
function parseArrayBindingPattern() {
- var node = createNode(168);
- parseExpected(19);
- node.elements = parseDelimitedList(10, parseArrayBindingElement);
+ var node = createNode(169);
parseExpected(20);
+ node.elements = parseDelimitedList(10, parseArrayBindingElement);
+ parseExpected(21);
return finishNode(node);
}
function isIdentifierOrPattern() {
- return token() === 15 || token() === 19 || isIdentifier();
+ return token() === 16 || token() === 20 || isIdentifier();
}
function parseIdentifierOrPattern() {
- if (token() === 19) {
+ if (token() === 20) {
return parseArrayBindingPattern();
}
- if (token() === 15) {
+ if (token() === 16) {
return parseObjectBindingPattern();
}
return parseIdentifier();
}
function parseVariableDeclaration() {
- var node = createNode(218);
+ var node = createNode(219);
node.name = parseIdentifierOrPattern();
node.type = parseTypeAnnotation();
if (!isInOrOfKeyword(token())) {
@@ -15828,21 +15315,21 @@ var ts;
return finishNode(node);
}
function parseVariableDeclarationList(inForStatementInitializer) {
- var node = createNode(219);
+ var node = createNode(220);
switch (token()) {
- case 102:
+ case 103:
break;
- case 108:
+ case 109:
node.flags |= 1;
break;
- case 74:
+ case 75:
node.flags |= 2;
break;
default:
ts.Debug.fail();
}
nextToken();
- if (token() === 138 && lookAhead(canFollowContextualOfKeyword)) {
+ if (token() === 139 && lookAhead(canFollowContextualOfKeyword)) {
node.declarations = createMissingList();
}
else {
@@ -15854,10 +15341,10 @@ var ts;
return finishNode(node);
}
function canFollowContextualOfKeyword() {
- return nextTokenIsIdentifier() && nextToken() === 18;
+ return nextTokenIsIdentifier() && nextToken() === 19;
}
function parseVariableStatement(fullStart, decorators, modifiers) {
- var node = createNode(200, fullStart);
+ var node = createNode(201, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
node.declarationList = parseVariableDeclarationList(false);
@@ -15865,29 +15352,29 @@ var ts;
return addJSDocComment(finishNode(node));
}
function parseFunctionDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(220, fullStart);
+ var node = createNode(221, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(87);
- node.asteriskToken = parseOptionalToken(37);
+ parseExpected(88);
+ node.asteriskToken = parseOptionalToken(38);
node.name = ts.hasModifier(node, 512) ? parseOptionalIdentifier() : parseIdentifier();
var isGenerator = !!node.asteriskToken;
var isAsync = ts.hasModifier(node, 256);
- fillSignature(54, isGenerator, isAsync, false, node);
+ fillSignature(55, isGenerator, isAsync, false, node);
node.body = parseFunctionBlockOrSemicolon(isGenerator, isAsync, ts.Diagnostics.or_expected);
return addJSDocComment(finishNode(node));
}
function parseConstructorDeclaration(pos, decorators, modifiers) {
- var node = createNode(148, pos);
+ var node = createNode(149, pos);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(121);
- fillSignature(54, false, false, false, node);
+ parseExpected(122);
+ fillSignature(55, false, false, false, node);
node.body = parseFunctionBlockOrSemicolon(false, false, ts.Diagnostics.or_expected);
return addJSDocComment(finishNode(node));
}
function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) {
- var method = createNode(147, fullStart);
+ var method = createNode(148, fullStart);
method.decorators = decorators;
method.modifiers = modifiers;
method.asteriskToken = asteriskToken;
@@ -15895,12 +15382,12 @@ var ts;
method.questionToken = questionToken;
var isGenerator = !!asteriskToken;
var isAsync = ts.hasModifier(method, 256);
- fillSignature(54, isGenerator, isAsync, false, method);
+ fillSignature(55, isGenerator, isAsync, false, method);
method.body = parseFunctionBlockOrSemicolon(isGenerator, isAsync, diagnosticMessage);
return addJSDocComment(finishNode(method));
}
function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) {
- var property = createNode(145, fullStart);
+ var property = createNode(146, fullStart);
property.decorators = decorators;
property.modifiers = modifiers;
property.name = name;
@@ -15913,10 +15400,10 @@ var ts;
return addJSDocComment(finishNode(property));
}
function parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers) {
- var asteriskToken = parseOptionalToken(37);
+ var asteriskToken = parseOptionalToken(38);
var name = parsePropertyName();
- var questionToken = parseOptionalToken(53);
- if (asteriskToken || token() === 17 || token() === 25) {
+ var questionToken = parseOptionalToken(54);
+ if (asteriskToken || token() === 18 || token() === 26) {
return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, ts.Diagnostics.or_expected);
}
else {
@@ -15931,17 +15418,17 @@ var ts;
node.decorators = decorators;
node.modifiers = modifiers;
node.name = parsePropertyName();
- fillSignature(54, false, false, false, node);
+ fillSignature(55, false, false, false, node);
node.body = parseFunctionBlockOrSemicolon(false, false);
return addJSDocComment(finishNode(node));
}
function isClassMemberModifier(idToken) {
switch (idToken) {
- case 112:
- case 110:
- case 111:
case 113:
- case 128:
+ case 111:
+ case 112:
+ case 114:
+ case 129:
return true;
default:
return false;
@@ -15949,7 +15436,7 @@ var ts;
}
function isClassMemberStart() {
var idToken;
- if (token() === 55) {
+ if (token() === 56) {
return true;
}
while (ts.isModifierKind(token())) {
@@ -15959,26 +15446,26 @@ var ts;
}
nextToken();
}
- if (token() === 37) {
+ if (token() === 38) {
return true;
}
if (isLiteralPropertyName()) {
idToken = token();
nextToken();
}
- if (token() === 19) {
+ if (token() === 20) {
return true;
}
if (idToken !== undefined) {
- if (!ts.isKeyword(idToken) || idToken === 131 || idToken === 123) {
+ if (!ts.isKeyword(idToken) || idToken === 132 || idToken === 124) {
return true;
}
switch (token()) {
- case 17:
- case 25:
+ case 18:
+ case 26:
+ case 55:
+ case 57:
case 54:
- case 56:
- case 53:
return true;
default:
return canParseSemicolon();
@@ -15990,10 +15477,10 @@ var ts;
var decorators;
while (true) {
var decoratorStart = getNodePos();
- if (!parseOptional(55)) {
+ if (!parseOptional(56)) {
break;
}
- var decorator = createNode(143, decoratorStart);
+ var decorator = createNode(144, decoratorStart);
decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher);
finishNode(decorator);
if (!decorators) {
@@ -16013,7 +15500,7 @@ var ts;
while (true) {
var modifierStart = scanner.getStartPos();
var modifierKind = token();
- if (token() === 74 && permitInvalidConstAsModifier) {
+ if (token() === 75 && permitInvalidConstAsModifier) {
if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) {
break;
}
@@ -16038,7 +15525,7 @@ var ts;
}
function parseModifiersForArrowFunction() {
var modifiers;
- if (token() === 118) {
+ if (token() === 119) {
var modifierStart = scanner.getStartPos();
var modifierKind = token();
nextToken();
@@ -16049,8 +15536,8 @@ var ts;
return modifiers;
}
function parseClassElement() {
- if (token() === 23) {
- var result = createNode(198);
+ if (token() === 24) {
+ var result = createNode(199);
nextToken();
return finishNode(result);
}
@@ -16061,7 +15548,7 @@ var ts;
if (accessor) {
return accessor;
}
- if (token() === 121) {
+ if (token() === 122) {
return parseConstructorDeclaration(fullStart, decorators, modifiers);
}
if (isIndexSignature()) {
@@ -16070,33 +15557,33 @@ var ts;
if (ts.tokenIsIdentifierOrKeyword(token()) ||
token() === 9 ||
token() === 8 ||
- token() === 37 ||
- token() === 19) {
+ token() === 38 ||
+ token() === 20) {
return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers);
}
if (decorators || modifiers) {
- var name_13 = createMissingNode(69, true, ts.Diagnostics.Declaration_expected);
- return parsePropertyDeclaration(fullStart, decorators, modifiers, name_13, undefined);
+ var name_10 = createMissingNode(70, true, ts.Diagnostics.Declaration_expected);
+ return parsePropertyDeclaration(fullStart, decorators, modifiers, name_10, undefined);
}
ts.Debug.fail("Should not have attempted to parse class member declaration.");
}
function parseClassExpression() {
- return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 192);
+ return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 193);
}
function parseClassDeclaration(fullStart, decorators, modifiers) {
- return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 221);
+ return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 222);
}
function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) {
var node = createNode(kind, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(73);
+ parseExpected(74);
node.name = parseNameOfClassDeclarationOrExpression();
node.typeParameters = parseTypeParameters();
- node.heritageClauses = parseHeritageClauses(true);
- if (parseExpected(15)) {
+ node.heritageClauses = parseHeritageClauses();
+ if (parseExpected(16)) {
node.members = parseClassMembers();
- parseExpected(16);
+ parseExpected(17);
}
else {
node.members = createMissingList();
@@ -16109,16 +15596,16 @@ var ts;
: undefined;
}
function isImplementsClause() {
- return token() === 106 && lookAhead(nextTokenIsIdentifierOrKeyword);
+ return token() === 107 && lookAhead(nextTokenIsIdentifierOrKeyword);
}
- function parseHeritageClauses(isClassHeritageClause) {
+ function parseHeritageClauses() {
if (isHeritageClause()) {
return parseList(20, parseHeritageClause);
}
return undefined;
}
function parseHeritageClause() {
- if (token() === 83 || token() === 106) {
+ if (token() === 84 || token() === 107) {
var node = createNode(251);
node.token = token();
nextToken();
@@ -16128,38 +15615,38 @@ var ts;
return undefined;
}
function parseExpressionWithTypeArguments() {
- var node = createNode(194);
+ var node = createNode(195);
node.expression = parseLeftHandSideExpressionOrHigher();
- if (token() === 25) {
- node.typeArguments = parseBracketedList(18, parseType, 25, 27);
+ if (token() === 26) {
+ node.typeArguments = parseBracketedList(18, parseType, 26, 28);
}
return finishNode(node);
}
function isHeritageClause() {
- return token() === 83 || token() === 106;
+ return token() === 84 || token() === 107;
}
function parseClassMembers() {
return parseList(5, parseClassElement);
}
function parseInterfaceDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(222, fullStart);
+ var node = createNode(223, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(107);
+ parseExpected(108);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
- node.heritageClauses = parseHeritageClauses(false);
+ node.heritageClauses = parseHeritageClauses();
node.members = parseObjectTypeMembers();
return addJSDocComment(finishNode(node));
}
function parseTypeAliasDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(223, fullStart);
+ var node = createNode(224, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(134);
+ parseExpected(135);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
- parseExpected(56);
+ parseExpected(57);
node.type = parseType();
parseSemicolon();
return addJSDocComment(finishNode(node));
@@ -16171,14 +15658,14 @@ var ts;
return addJSDocComment(finishNode(node));
}
function parseEnumDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(224, fullStart);
+ var node = createNode(225, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- parseExpected(81);
+ parseExpected(82);
node.name = parseIdentifier();
- if (parseExpected(15)) {
+ if (parseExpected(16)) {
node.members = parseDelimitedList(6, parseEnumMember);
- parseExpected(16);
+ parseExpected(17);
}
else {
node.members = createMissingList();
@@ -16186,10 +15673,10 @@ var ts;
return addJSDocComment(finishNode(node));
}
function parseModuleBlock() {
- var node = createNode(226, scanner.getStartPos());
- if (parseExpected(15)) {
+ var node = createNode(227, scanner.getStartPos());
+ if (parseExpected(16)) {
node.statements = parseList(1, parseStatement);
- parseExpected(16);
+ parseExpected(17);
}
else {
node.statements = createMissingList();
@@ -16197,29 +15684,29 @@ var ts;
return finishNode(node);
}
function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) {
- var node = createNode(225, fullStart);
+ var node = createNode(226, fullStart);
var namespaceFlag = flags & 16;
node.decorators = decorators;
node.modifiers = modifiers;
node.flags |= flags;
node.name = parseIdentifier();
- node.body = parseOptional(21)
+ node.body = parseOptional(22)
? parseModuleOrNamespaceDeclaration(getNodePos(), undefined, undefined, 4 | namespaceFlag)
: parseModuleBlock();
return addJSDocComment(finishNode(node));
}
function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(225, fullStart);
+ var node = createNode(226, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- if (token() === 137) {
+ if (token() === 138) {
node.name = parseIdentifier();
node.flags |= 512;
}
else {
node.name = parseLiteralNode(true);
}
- if (token() === 15) {
+ if (token() === 16) {
node.body = parseModuleBlock();
}
else {
@@ -16229,14 +15716,14 @@ var ts;
}
function parseModuleDeclaration(fullStart, decorators, modifiers) {
var flags = 0;
- if (token() === 137) {
+ if (token() === 138) {
return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers);
}
- else if (parseOptional(126)) {
+ else if (parseOptional(127)) {
flags |= 16;
}
else {
- parseExpected(125);
+ parseExpected(126);
if (token() === 9) {
return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers);
}
@@ -16244,63 +15731,63 @@ var ts;
return parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags);
}
function isExternalModuleReference() {
- return token() === 129 &&
+ return token() === 130 &&
lookAhead(nextTokenIsOpenParen);
}
function nextTokenIsOpenParen() {
- return nextToken() === 17;
+ return nextToken() === 18;
}
function nextTokenIsSlash() {
- return nextToken() === 39;
+ return nextToken() === 40;
}
function parseNamespaceExportDeclaration(fullStart, decorators, modifiers) {
- var exportDeclaration = createNode(228, fullStart);
+ var exportDeclaration = createNode(229, fullStart);
exportDeclaration.decorators = decorators;
exportDeclaration.modifiers = modifiers;
- parseExpected(116);
- parseExpected(126);
+ parseExpected(117);
+ parseExpected(127);
exportDeclaration.name = parseIdentifier();
- parseExpected(23);
+ parseExpected(24);
return finishNode(exportDeclaration);
}
function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) {
- parseExpected(89);
+ parseExpected(90);
var afterImportPos = scanner.getStartPos();
var identifier;
if (isIdentifier()) {
identifier = parseIdentifier();
- if (token() !== 24 && token() !== 136) {
- var importEqualsDeclaration = createNode(229, fullStart);
+ if (token() !== 25 && token() !== 137) {
+ var importEqualsDeclaration = createNode(230, fullStart);
importEqualsDeclaration.decorators = decorators;
importEqualsDeclaration.modifiers = modifiers;
importEqualsDeclaration.name = identifier;
- parseExpected(56);
+ parseExpected(57);
importEqualsDeclaration.moduleReference = parseModuleReference();
parseSemicolon();
return addJSDocComment(finishNode(importEqualsDeclaration));
}
}
- var importDeclaration = createNode(230, fullStart);
+ var importDeclaration = createNode(231, fullStart);
importDeclaration.decorators = decorators;
importDeclaration.modifiers = modifiers;
if (identifier ||
- token() === 37 ||
- token() === 15) {
+ token() === 38 ||
+ token() === 16) {
importDeclaration.importClause = parseImportClause(identifier, afterImportPos);
- parseExpected(136);
+ parseExpected(137);
}
importDeclaration.moduleSpecifier = parseModuleSpecifier();
parseSemicolon();
return finishNode(importDeclaration);
}
function parseImportClause(identifier, fullStart) {
- var importClause = createNode(231, fullStart);
+ var importClause = createNode(232, fullStart);
if (identifier) {
importClause.name = identifier;
}
if (!importClause.name ||
- parseOptional(24)) {
- importClause.namedBindings = token() === 37 ? parseNamespaceImport() : parseNamedImportsOrExports(233);
+ parseOptional(25)) {
+ importClause.namedBindings = token() === 38 ? parseNamespaceImport() : parseNamedImportsOrExports(234);
}
return finishNode(importClause);
}
@@ -16310,11 +15797,11 @@ var ts;
: parseEntityName(false);
}
function parseExternalModuleReference() {
- var node = createNode(240);
- parseExpected(129);
- parseExpected(17);
- node.expression = parseModuleSpecifier();
+ var node = createNode(241);
+ parseExpected(130);
parseExpected(18);
+ node.expression = parseModuleSpecifier();
+ parseExpected(19);
return finishNode(node);
}
function parseModuleSpecifier() {
@@ -16328,22 +15815,22 @@ var ts;
}
}
function parseNamespaceImport() {
- var namespaceImport = createNode(232);
- parseExpected(37);
- parseExpected(116);
+ var namespaceImport = createNode(233);
+ parseExpected(38);
+ parseExpected(117);
namespaceImport.name = parseIdentifier();
return finishNode(namespaceImport);
}
function parseNamedImportsOrExports(kind) {
var node = createNode(kind);
- node.elements = parseBracketedList(21, kind === 233 ? parseImportSpecifier : parseExportSpecifier, 15, 16);
+ node.elements = parseBracketedList(21, kind === 234 ? parseImportSpecifier : parseExportSpecifier, 16, 17);
return finishNode(node);
}
function parseExportSpecifier() {
- return parseImportOrExportSpecifier(238);
+ return parseImportOrExportSpecifier(239);
}
function parseImportSpecifier() {
- return parseImportOrExportSpecifier(234);
+ return parseImportOrExportSpecifier(235);
}
function parseImportOrExportSpecifier(kind) {
var node = createNode(kind);
@@ -16351,9 +15838,9 @@ var ts;
var checkIdentifierStart = scanner.getTokenPos();
var checkIdentifierEnd = scanner.getTextPos();
var identifierName = parseIdentifierName();
- if (token() === 116) {
+ if (token() === 117) {
node.propertyName = identifierName;
- parseExpected(116);
+ parseExpected(117);
checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();
checkIdentifierStart = scanner.getTokenPos();
checkIdentifierEnd = scanner.getTextPos();
@@ -16362,23 +15849,23 @@ var ts;
else {
node.name = identifierName;
}
- if (kind === 234 && checkIdentifierIsKeyword) {
+ if (kind === 235 && checkIdentifierIsKeyword) {
parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected);
}
return finishNode(node);
}
function parseExportDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(236, fullStart);
+ var node = createNode(237, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- if (parseOptional(37)) {
- parseExpected(136);
+ if (parseOptional(38)) {
+ parseExpected(137);
node.moduleSpecifier = parseModuleSpecifier();
}
else {
- node.exportClause = parseNamedImportsOrExports(237);
- if (token() === 136 || (token() === 9 && !scanner.hasPrecedingLineBreak())) {
- parseExpected(136);
+ node.exportClause = parseNamedImportsOrExports(238);
+ if (token() === 137 || (token() === 9 && !scanner.hasPrecedingLineBreak())) {
+ parseExpected(137);
node.moduleSpecifier = parseModuleSpecifier();
}
}
@@ -16386,14 +15873,14 @@ var ts;
return finishNode(node);
}
function parseExportAssignment(fullStart, decorators, modifiers) {
- var node = createNode(235, fullStart);
+ var node = createNode(236, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- if (parseOptional(56)) {
+ if (parseOptional(57)) {
node.isExportEquals = true;
}
else {
- parseExpected(77);
+ parseExpected(78);
}
node.expression = parseAssignmentExpressionOrHigher();
parseSemicolon();
@@ -16465,36 +15952,72 @@ var ts;
function setExternalModuleIndicator(sourceFile) {
sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) {
return ts.hasModifier(node, 1)
- || node.kind === 229 && node.moduleReference.kind === 240
- || node.kind === 230
- || node.kind === 235
+ || node.kind === 230 && node.moduleReference.kind === 241
+ || node.kind === 231
|| node.kind === 236
+ || node.kind === 237
? node
: undefined;
});
}
+ var ParsingContext;
+ (function (ParsingContext) {
+ ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements";
+ ParsingContext[ParsingContext["BlockStatements"] = 1] = "BlockStatements";
+ ParsingContext[ParsingContext["SwitchClauses"] = 2] = "SwitchClauses";
+ ParsingContext[ParsingContext["SwitchClauseStatements"] = 3] = "SwitchClauseStatements";
+ ParsingContext[ParsingContext["TypeMembers"] = 4] = "TypeMembers";
+ ParsingContext[ParsingContext["ClassMembers"] = 5] = "ClassMembers";
+ ParsingContext[ParsingContext["EnumMembers"] = 6] = "EnumMembers";
+ ParsingContext[ParsingContext["HeritageClauseElement"] = 7] = "HeritageClauseElement";
+ ParsingContext[ParsingContext["VariableDeclarations"] = 8] = "VariableDeclarations";
+ ParsingContext[ParsingContext["ObjectBindingElements"] = 9] = "ObjectBindingElements";
+ ParsingContext[ParsingContext["ArrayBindingElements"] = 10] = "ArrayBindingElements";
+ ParsingContext[ParsingContext["ArgumentExpressions"] = 11] = "ArgumentExpressions";
+ ParsingContext[ParsingContext["ObjectLiteralMembers"] = 12] = "ObjectLiteralMembers";
+ ParsingContext[ParsingContext["JsxAttributes"] = 13] = "JsxAttributes";
+ ParsingContext[ParsingContext["JsxChildren"] = 14] = "JsxChildren";
+ ParsingContext[ParsingContext["ArrayLiteralMembers"] = 15] = "ArrayLiteralMembers";
+ ParsingContext[ParsingContext["Parameters"] = 16] = "Parameters";
+ ParsingContext[ParsingContext["TypeParameters"] = 17] = "TypeParameters";
+ ParsingContext[ParsingContext["TypeArguments"] = 18] = "TypeArguments";
+ ParsingContext[ParsingContext["TupleElementTypes"] = 19] = "TupleElementTypes";
+ ParsingContext[ParsingContext["HeritageClauses"] = 20] = "HeritageClauses";
+ ParsingContext[ParsingContext["ImportOrExportSpecifiers"] = 21] = "ImportOrExportSpecifiers";
+ ParsingContext[ParsingContext["JSDocFunctionParameters"] = 22] = "JSDocFunctionParameters";
+ ParsingContext[ParsingContext["JSDocTypeArguments"] = 23] = "JSDocTypeArguments";
+ ParsingContext[ParsingContext["JSDocRecordMembers"] = 24] = "JSDocRecordMembers";
+ ParsingContext[ParsingContext["JSDocTupleTypes"] = 25] = "JSDocTupleTypes";
+ ParsingContext[ParsingContext["Count"] = 26] = "Count";
+ })(ParsingContext || (ParsingContext = {}));
+ var Tristate;
+ (function (Tristate) {
+ Tristate[Tristate["False"] = 0] = "False";
+ Tristate[Tristate["True"] = 1] = "True";
+ Tristate[Tristate["Unknown"] = 2] = "Unknown";
+ })(Tristate || (Tristate = {}));
var JSDocParser;
(function (JSDocParser) {
function isJSDocType() {
switch (token()) {
- case 37:
- case 53:
- case 17:
- case 19:
- case 49:
- case 15:
- case 87:
- case 22:
- case 92:
- case 97:
+ case 38:
+ case 54:
+ case 18:
+ case 20:
+ case 50:
+ case 16:
+ case 88:
+ case 23:
+ case 93:
+ case 98:
return true;
}
return ts.tokenIsIdentifierOrKeyword(token());
}
JSDocParser.isJSDocType = isJSDocType;
function parseJSDocTypeExpressionForTests(content, start, length) {
- initializeState("file.js", content, 2, undefined, 1);
- sourceFile = createSourceFile("file.js", 2, 1);
+ initializeState(content, 4, undefined, 1);
+ sourceFile = createSourceFile("file.js", 4, 1);
scanner.setText(content, start, length);
currentToken = scanner.scan();
var jsDocTypeExpression = parseJSDocTypeExpression();
@@ -16505,21 +16028,21 @@ var ts;
JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests;
function parseJSDocTypeExpression() {
var result = createNode(257, scanner.getTokenPos());
- parseExpected(15);
- result.type = parseJSDocTopLevelType();
parseExpected(16);
+ result.type = parseJSDocTopLevelType();
+ parseExpected(17);
fixupParentReferences(result);
return finishNode(result);
}
JSDocParser.parseJSDocTypeExpression = parseJSDocTypeExpression;
function parseJSDocTopLevelType() {
var type = parseJSDocType();
- if (token() === 47) {
+ if (token() === 48) {
var unionType = createNode(261, type.pos);
unionType.types = parseJSDocTypeList(type);
type = finishNode(unionType);
}
- if (token() === 56) {
+ if (token() === 57) {
var optionalType = createNode(268, type.pos);
nextToken();
optionalType.type = type;
@@ -16530,20 +16053,20 @@ var ts;
function parseJSDocType() {
var type = parseBasicTypeExpression();
while (true) {
- if (token() === 19) {
+ if (token() === 20) {
var arrayType = createNode(260, type.pos);
arrayType.elementType = type;
nextToken();
- parseExpected(20);
+ parseExpected(21);
type = finishNode(arrayType);
}
- else if (token() === 53) {
+ else if (token() === 54) {
var nullableType = createNode(263, type.pos);
nullableType.type = type;
nextToken();
type = finishNode(nullableType);
}
- else if (token() === 49) {
+ else if (token() === 50) {
var nonNullableType = createNode(264, type.pos);
nonNullableType.type = type;
nextToken();
@@ -16557,40 +16080,40 @@ var ts;
}
function parseBasicTypeExpression() {
switch (token()) {
- case 37:
+ case 38:
return parseJSDocAllType();
- case 53:
+ case 54:
return parseJSDocUnknownOrNullableType();
- case 17:
+ case 18:
return parseJSDocUnionType();
- case 19:
+ case 20:
return parseJSDocTupleType();
- case 49:
+ case 50:
return parseJSDocNonNullableType();
- case 15:
+ case 16:
return parseJSDocRecordType();
- case 87:
+ case 88:
return parseJSDocFunctionType();
- case 22:
+ case 23:
return parseJSDocVariadicType();
- case 92:
- return parseJSDocConstructorType();
- case 97:
- return parseJSDocThisType();
- case 117:
- case 132:
- case 130:
- case 120:
- case 133:
- case 103:
case 93:
- case 135:
- case 127:
+ return parseJSDocConstructorType();
+ case 98:
+ return parseJSDocThisType();
+ case 118:
+ case 133:
+ case 131:
+ case 121:
+ case 134:
+ case 104:
+ case 94:
+ case 136:
+ case 128:
return parseTokenNode();
case 9:
case 8:
- case 99:
- case 84:
+ case 100:
+ case 85:
return parseJSDocLiteralType();
}
return parseJSDocTypeReference();
@@ -16598,14 +16121,14 @@ var ts;
function parseJSDocThisType() {
var result = createNode(272);
nextToken();
- parseExpected(54);
+ parseExpected(55);
result.type = parseJSDocType();
return finishNode(result);
}
function parseJSDocConstructorType() {
var result = createNode(271);
nextToken();
- parseExpected(54);
+ parseExpected(55);
result.type = parseJSDocType();
return finishNode(result);
}
@@ -16618,33 +16141,33 @@ var ts;
function parseJSDocFunctionType() {
var result = createNode(269);
nextToken();
- parseExpected(17);
+ parseExpected(18);
result.parameters = parseDelimitedList(22, parseJSDocParameter);
checkForTrailingComma(result.parameters);
- parseExpected(18);
- if (token() === 54) {
+ parseExpected(19);
+ if (token() === 55) {
nextToken();
result.type = parseJSDocType();
}
return finishNode(result);
}
function parseJSDocParameter() {
- var parameter = createNode(142);
+ var parameter = createNode(143);
parameter.type = parseJSDocType();
- if (parseOptional(56)) {
- parameter.questionToken = createNode(56);
+ if (parseOptional(57)) {
+ parameter.questionToken = createNode(57);
}
return finishNode(parameter);
}
function parseJSDocTypeReference() {
var result = createNode(267);
result.name = parseSimplePropertyName();
- if (token() === 25) {
+ if (token() === 26) {
result.typeArguments = parseTypeArguments();
}
else {
- while (parseOptional(21)) {
- if (token() === 25) {
+ while (parseOptional(22)) {
+ if (token() === 26) {
result.typeArguments = parseTypeArguments();
break;
}
@@ -16660,7 +16183,7 @@ var ts;
var typeArguments = parseDelimitedList(23, parseJSDocType);
checkForTrailingComma(typeArguments);
checkForEmptyTypeArgumentList(typeArguments);
- parseExpected(27);
+ parseExpected(28);
return typeArguments;
}
function checkForEmptyTypeArgumentList(typeArguments) {
@@ -16671,7 +16194,7 @@ var ts;
}
}
function parseQualifiedName(left) {
- var result = createNode(139, left.pos);
+ var result = createNode(140, left.pos);
result.left = left;
result.right = parseIdentifierName();
return finishNode(result);
@@ -16692,7 +16215,7 @@ var ts;
nextToken();
result.types = parseDelimitedList(25, parseJSDocType);
checkForTrailingComma(result.types);
- parseExpected(20);
+ parseExpected(21);
return finishNode(result);
}
function checkForTrailingComma(list) {
@@ -16705,13 +16228,13 @@ var ts;
var result = createNode(261);
nextToken();
result.types = parseJSDocTypeList(parseJSDocType());
- parseExpected(18);
+ parseExpected(19);
return finishNode(result);
}
function parseJSDocTypeList(firstType) {
ts.Debug.assert(!!firstType);
var types = createNodeArray([firstType], firstType.pos);
- while (parseOptional(47)) {
+ while (parseOptional(48)) {
types.push(parseJSDocType());
}
types.end = scanner.getStartPos();
@@ -16730,12 +16253,12 @@ var ts;
function parseJSDocUnknownOrNullableType() {
var pos = scanner.getStartPos();
nextToken();
- if (token() === 24 ||
- token() === 16 ||
- token() === 18 ||
- token() === 27 ||
- token() === 56 ||
- token() === 47) {
+ if (token() === 25 ||
+ token() === 17 ||
+ token() === 19 ||
+ token() === 28 ||
+ token() === 57 ||
+ token() === 48) {
var result = createNode(259, pos);
return finishNode(result);
}
@@ -16746,7 +16269,7 @@ var ts;
}
}
function parseIsolatedJSDocComment(content, start, length) {
- initializeState("file.js", content, 2, undefined, 1);
+ initializeState(content, 4, undefined, 1);
sourceFile = { languageVariant: 0, text: content };
var jsDoc = parseJSDocCommentWorker(start, length);
var diagnostics = parseDiagnostics;
@@ -16768,6 +16291,12 @@ var ts;
return comment;
}
JSDocParser.parseJSDocComment = parseJSDocComment;
+ var JSDocState;
+ (function (JSDocState) {
+ JSDocState[JSDocState["BeginningOfLine"] = 0] = "BeginningOfLine";
+ JSDocState[JSDocState["SawAsterisk"] = 1] = "SawAsterisk";
+ JSDocState[JSDocState["SavingComments"] = 2] = "SavingComments";
+ })(JSDocState || (JSDocState = {}));
function parseJSDocCommentWorker(start, length) {
var content = sourceText;
start = start || 0;
@@ -16804,7 +16333,7 @@ var ts;
}
while (token() !== 1) {
switch (token()) {
- case 55:
+ case 56:
if (state === 0 || state === 1) {
removeTrailingNewlines(comments);
parseTag(indent);
@@ -16822,7 +16351,7 @@ var ts;
state = 0;
indent = 0;
break;
- case 37:
+ case 38:
var asterisk = scanner.getTokenText();
if (state === 1) {
state = 2;
@@ -16833,7 +16362,7 @@ var ts;
indent += asterisk.length;
}
break;
- case 69:
+ case 70:
pushComment(scanner.getTokenText());
state = 2;
break;
@@ -16890,8 +16419,8 @@ var ts;
}
}
function parseTag(indent) {
- ts.Debug.assert(token() === 55);
- var atToken = createNode(55, scanner.getTokenPos());
+ ts.Debug.assert(token() === 56);
+ var atToken = createNode(56, scanner.getTokenPos());
atToken.end = scanner.getTextPos();
nextJSDocToken();
var tagName = parseJSDocIdentifierName();
@@ -16942,7 +16471,7 @@ var ts;
comments.push(text);
indent += text.length;
}
- while (token() !== 55 && token() !== 1) {
+ while (token() !== 56 && token() !== 1) {
switch (token()) {
case 4:
if (state >= 1) {
@@ -16951,7 +16480,7 @@ var ts;
}
indent = 0;
break;
- case 55:
+ case 56:
break;
case 5:
if (state === 2) {
@@ -16965,7 +16494,7 @@ var ts;
indent += whitespace.length;
}
break;
- case 37:
+ case 38:
if (state === 0) {
state = 1;
indent += scanner.getTokenText().length;
@@ -16976,7 +16505,7 @@ var ts;
pushComment(scanner.getTokenText());
break;
}
- if (token() === 55) {
+ if (token() === 56) {
break;
}
nextJSDocToken();
@@ -17004,7 +16533,7 @@ var ts;
function tryParseTypeExpression() {
return tryParse(function () {
skipWhitespace();
- if (token() !== 15) {
+ if (token() !== 16) {
return undefined;
}
return parseJSDocTypeExpression();
@@ -17015,14 +16544,14 @@ var ts;
skipWhitespace();
var name;
var isBracketed;
- if (parseOptionalToken(19)) {
+ if (parseOptionalToken(20)) {
name = parseJSDocIdentifierName();
skipWhitespace();
isBracketed = true;
- if (parseOptionalToken(56)) {
+ if (parseOptionalToken(57)) {
parseExpression();
}
- parseExpected(20);
+ parseExpected(21);
}
else if (ts.tokenIsIdentifierOrKeyword(token())) {
name = parseJSDocIdentifierName();
@@ -17099,9 +16628,9 @@ var ts;
if (typeExpression) {
if (typeExpression.type.kind === 267) {
var jsDocTypeReference = typeExpression.type;
- if (jsDocTypeReference.name.kind === 69) {
- var name_14 = jsDocTypeReference.name;
- if (name_14.text === "Object") {
+ if (jsDocTypeReference.name.kind === 70) {
+ var name_11 = jsDocTypeReference.name;
+ if (name_11.text === "Object") {
typedefTag.jsDocTypeLiteral = scanChildTags();
}
}
@@ -17123,7 +16652,7 @@ var ts;
while (token() !== 1 && !parentTagTerminated) {
nextJSDocToken();
switch (token()) {
- case 55:
+ case 56:
if (canParseTag) {
parentTagTerminated = !tryParseChildTag(jsDocTypeLiteral);
if (!parentTagTerminated) {
@@ -17137,13 +16666,13 @@ var ts;
canParseTag = true;
seenAsterisk = false;
break;
- case 37:
+ case 38:
if (seenAsterisk) {
canParseTag = false;
}
seenAsterisk = true;
break;
- case 69:
+ case 70:
canParseTag = false;
case 1:
break;
@@ -17154,8 +16683,8 @@ var ts;
}
}
function tryParseChildTag(parentTag) {
- ts.Debug.assert(token() === 55);
- var atToken = createNode(55, scanner.getStartPos());
+ ts.Debug.assert(token() === 56);
+ var atToken = createNode(56, scanner.getStartPos());
atToken.end = scanner.getTextPos();
nextJSDocToken();
var tagName = parseJSDocIdentifierName();
@@ -17187,17 +16716,17 @@ var ts;
}
var typeParameters = createNodeArray();
while (true) {
- var name_15 = parseJSDocIdentifierName();
+ var name_12 = parseJSDocIdentifierName();
skipWhitespace();
- if (!name_15) {
+ if (!name_12) {
parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected);
return undefined;
}
- var typeParameter = createNode(141, name_15.pos);
- typeParameter.name = name_15;
+ var typeParameter = createNode(142, name_12.pos);
+ typeParameter.name = name_12;
finishNode(typeParameter);
typeParameters.push(typeParameter);
- if (token() === 24) {
+ if (token() === 25) {
nextJSDocToken();
skipWhitespace();
}
@@ -17226,7 +16755,7 @@ var ts;
}
var pos = scanner.getTokenPos();
var end = scanner.getTextPos();
- var result = createNode(69, pos);
+ var result = createNode(70, pos);
result.text = content.substring(pos, end);
finishNode(result, end);
nextJSDocToken();
@@ -17297,8 +16826,8 @@ var ts;
array._children = undefined;
array.pos += delta;
array.end += delta;
- for (var _i = 0, array_8 = array; _i < array_8.length; _i++) {
- var node = array_8[_i];
+ for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {
+ var node = array_9[_i];
visitNode(node);
}
}
@@ -17307,7 +16836,7 @@ var ts;
switch (node.kind) {
case 9:
case 8:
- case 69:
+ case 70:
return true;
}
return false;
@@ -17370,8 +16899,8 @@ var ts;
array.intersectsChange = true;
array._children = undefined;
adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
- for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {
- var node = array_9[_i];
+ for (var _i = 0, array_10 = array; _i < array_10.length; _i++) {
+ var node = array_10[_i];
visitNode(node);
}
return;
@@ -17519,21 +17048,31 @@ var ts;
}
}
}
+ var InvalidPosition;
+ (function (InvalidPosition) {
+ InvalidPosition[InvalidPosition["Value"] = -1] = "Value";
+ })(InvalidPosition || (InvalidPosition = {}));
})(IncrementalParser || (IncrementalParser = {}));
})(ts || (ts = {}));
var ts;
(function (ts) {
+ (function (ModuleInstanceState) {
+ ModuleInstanceState[ModuleInstanceState["NonInstantiated"] = 0] = "NonInstantiated";
+ ModuleInstanceState[ModuleInstanceState["Instantiated"] = 1] = "Instantiated";
+ ModuleInstanceState[ModuleInstanceState["ConstEnumOnly"] = 2] = "ConstEnumOnly";
+ })(ts.ModuleInstanceState || (ts.ModuleInstanceState = {}));
+ var ModuleInstanceState = ts.ModuleInstanceState;
function getModuleInstanceState(node) {
- if (node.kind === 222 || node.kind === 223) {
+ if (node.kind === 223 || node.kind === 224) {
return 0;
}
else if (ts.isConstEnumDeclaration(node)) {
return 2;
}
- else if ((node.kind === 230 || node.kind === 229) && !(ts.hasModifier(node, 1))) {
+ else if ((node.kind === 231 || node.kind === 230) && !(ts.hasModifier(node, 1))) {
return 0;
}
- else if (node.kind === 226) {
+ else if (node.kind === 227) {
var state_1 = 0;
ts.forEachChild(node, function (n) {
switch (getModuleInstanceState(n)) {
@@ -17549,7 +17088,7 @@ var ts;
});
return state_1;
}
- else if (node.kind === 225) {
+ else if (node.kind === 226) {
var body = node.body;
return body ? getModuleInstanceState(body) : 1;
}
@@ -17558,6 +17097,18 @@ var ts;
}
}
ts.getModuleInstanceState = getModuleInstanceState;
+ var ContainerFlags;
+ (function (ContainerFlags) {
+ ContainerFlags[ContainerFlags["None"] = 0] = "None";
+ ContainerFlags[ContainerFlags["IsContainer"] = 1] = "IsContainer";
+ ContainerFlags[ContainerFlags["IsBlockScopedContainer"] = 2] = "IsBlockScopedContainer";
+ ContainerFlags[ContainerFlags["IsControlFlowContainer"] = 4] = "IsControlFlowContainer";
+ ContainerFlags[ContainerFlags["IsFunctionLike"] = 8] = "IsFunctionLike";
+ ContainerFlags[ContainerFlags["IsFunctionExpression"] = 16] = "IsFunctionExpression";
+ ContainerFlags[ContainerFlags["HasLocals"] = 32] = "HasLocals";
+ ContainerFlags[ContainerFlags["IsInterface"] = 64] = "IsInterface";
+ ContainerFlags[ContainerFlags["IsObjectLiteralOrClassExpressionMethod"] = 128] = "IsObjectLiteralOrClassExpressionMethod";
+ })(ContainerFlags || (ContainerFlags = {}));
var binder = createBinder();
function bindSourceFile(file, options) {
ts.performance.mark("beforeBind");
@@ -17655,7 +17206,7 @@ var ts;
if (symbolFlags & 107455) {
var valueDeclaration = symbol.valueDeclaration;
if (!valueDeclaration ||
- (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 225)) {
+ (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 226)) {
symbol.valueDeclaration = node;
}
}
@@ -17665,7 +17216,7 @@ var ts;
if (ts.isAmbientModule(node)) {
return ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + node.name.text + "\"";
}
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
var nameExpression = node.name.expression;
if (ts.isStringOrNumericLiteral(nameExpression.kind)) {
return nameExpression.text;
@@ -17676,21 +17227,21 @@ var ts;
return node.name.text;
}
switch (node.kind) {
- case 148:
+ case 149:
return "__constructor";
- case 156:
- case 151:
- return "__call";
case 157:
case 152:
- return "__new";
+ return "__call";
+ case 158:
case 153:
+ return "__new";
+ case 154:
return "__index";
- case 236:
+ case 237:
return "__export";
- case 235:
+ case 236:
return node.isExportEquals ? "export=" : "default";
- case 187:
+ case 188:
switch (ts.getSpecialPropertyAssignmentKind(node)) {
case 2:
return "export=";
@@ -17702,12 +17253,12 @@ var ts;
}
ts.Debug.fail("Unknown binary declaration kind");
break;
- case 220:
case 221:
+ case 222:
return ts.hasModifier(node, 512) ? "default" : undefined;
case 269:
return ts.isJSDocConstructSignature(node) ? "__new" : "__call";
- case 142:
+ case 143:
ts.Debug.assert(node.parent.kind === 269);
var functionType = node.parent;
var index = ts.indexOf(functionType.parameters, node);
@@ -17715,10 +17266,10 @@ var ts;
case 279:
var parentNode = node.parent && node.parent.parent;
var nameFromParentNode = void 0;
- if (parentNode && parentNode.kind === 200) {
+ if (parentNode && parentNode.kind === 201) {
if (parentNode.declarationList.declarations.length > 0) {
var nameIdentifier = parentNode.declarationList.declarations[0].name;
- if (nameIdentifier.kind === 69) {
+ if (nameIdentifier.kind === 70) {
nameFromParentNode = nameIdentifier.text;
}
}
@@ -17759,7 +17310,7 @@ var ts;
}
else {
if (symbol.declarations && symbol.declarations.length &&
- (isDefaultExport || (node.kind === 235 && !node.isExportEquals))) {
+ (isDefaultExport || (node.kind === 236 && !node.isExportEquals))) {
message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports;
}
}
@@ -17779,7 +17330,7 @@ var ts;
function declareModuleMember(node, symbolFlags, symbolExcludes) {
var hasExportModifier = ts.getCombinedModifierFlags(node) & 1;
if (symbolFlags & 8388608) {
- if (node.kind === 238 || (node.kind === 229 && hasExportModifier)) {
+ if (node.kind === 239 || (node.kind === 230 && hasExportModifier)) {
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
}
else {
@@ -17896,64 +17447,64 @@ var ts;
return;
}
switch (node.kind) {
- case 205:
+ case 206:
bindWhileStatement(node);
break;
- case 204:
+ case 205:
bindDoStatement(node);
break;
- case 206:
+ case 207:
bindForStatement(node);
break;
- case 207:
case 208:
+ case 209:
bindForInOrForOfStatement(node);
break;
- case 203:
+ case 204:
bindIfStatement(node);
break;
- case 211:
- case 215:
+ case 212:
+ case 216:
bindReturnOrThrow(node);
break;
+ case 211:
case 210:
- case 209:
bindBreakOrContinueStatement(node);
break;
- case 216:
+ case 217:
bindTryStatement(node);
break;
- case 213:
+ case 214:
bindSwitchStatement(node);
break;
- case 227:
+ case 228:
bindCaseBlock(node);
break;
case 249:
bindCaseClause(node);
break;
- case 214:
+ case 215:
bindLabeledStatement(node);
break;
- case 185:
+ case 186:
bindPrefixUnaryExpressionFlow(node);
break;
- case 186:
+ case 187:
bindPostfixUnaryExpressionFlow(node);
break;
- case 187:
+ case 188:
bindBinaryExpressionFlow(node);
break;
- case 181:
+ case 182:
bindDeleteExpressionFlow(node);
break;
- case 188:
+ case 189:
bindConditionalExpressionFlow(node);
break;
- case 218:
+ case 219:
bindVariableDeclarationFlow(node);
break;
- case 174:
+ case 175:
bindCallExpressionFlow(node);
break;
default:
@@ -17963,25 +17514,25 @@ var ts;
}
function isNarrowingExpression(expr) {
switch (expr.kind) {
- case 69:
- case 97:
- case 172:
+ case 70:
+ case 98:
+ case 173:
return isNarrowableReference(expr);
- case 174:
+ case 175:
return hasNarrowableArgument(expr);
- case 178:
+ case 179:
return isNarrowingExpression(expr.expression);
- case 187:
+ case 188:
return isNarrowingBinaryExpression(expr);
- case 185:
- return expr.operator === 49 && isNarrowingExpression(expr.operand);
+ case 186:
+ return expr.operator === 50 && isNarrowingExpression(expr.operand);
}
return false;
}
function isNarrowableReference(expr) {
- return expr.kind === 69 ||
- expr.kind === 97 ||
- expr.kind === 172 && isNarrowableReference(expr.expression);
+ return expr.kind === 70 ||
+ expr.kind === 98 ||
+ expr.kind === 173 && isNarrowableReference(expr.expression);
}
function hasNarrowableArgument(expr) {
if (expr.arguments) {
@@ -17992,41 +17543,41 @@ var ts;
}
}
}
- if (expr.expression.kind === 172 &&
+ if (expr.expression.kind === 173 &&
isNarrowableReference(expr.expression.expression)) {
return true;
}
return false;
}
function isNarrowingTypeofOperands(expr1, expr2) {
- return expr1.kind === 182 && isNarrowableOperand(expr1.expression) && expr2.kind === 9;
+ return expr1.kind === 183 && isNarrowableOperand(expr1.expression) && expr2.kind === 9;
}
function isNarrowingBinaryExpression(expr) {
switch (expr.operatorToken.kind) {
- case 56:
+ case 57:
return isNarrowableReference(expr.left);
- case 30:
case 31:
case 32:
case 33:
+ case 34:
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) ||
isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right);
- case 91:
+ case 92:
return isNarrowableOperand(expr.left);
- case 24:
+ case 25:
return isNarrowingExpression(expr.right);
}
return false;
}
function isNarrowableOperand(expr) {
switch (expr.kind) {
- case 178:
+ case 179:
return isNarrowableOperand(expr.expression);
- case 187:
+ case 188:
switch (expr.operatorToken.kind) {
- case 56:
+ case 57:
return isNarrowableOperand(expr.left);
- case 24:
+ case 25:
return isNarrowableOperand(expr.right);
}
}
@@ -18045,7 +17596,7 @@ var ts;
};
}
function setFlowNodeReferenced(flow) {
- flow.flags |= flow.flags & 256 ? 512 : 256;
+ flow.flags |= flow.flags & 512 ? 1024 : 512;
}
function addAntecedent(label, antecedent) {
if (!(antecedent.flags & 1) && !ts.contains(label.antecedents, antecedent)) {
@@ -18060,8 +17611,8 @@ var ts;
if (!expression) {
return flags & 32 ? antecedent : unreachableFlow;
}
- if (expression.kind === 99 && flags & 64 ||
- expression.kind === 84 && flags & 32) {
+ if (expression.kind === 100 && flags & 64 ||
+ expression.kind === 85 && flags & 32) {
return unreachableFlow;
}
if (!isNarrowingExpression(expression)) {
@@ -18095,6 +17646,14 @@ var ts;
node: node
};
}
+ function createFlowArrayMutation(antecedent, node) {
+ setFlowNodeReferenced(antecedent);
+ return {
+ flags: 256,
+ antecedent: antecedent,
+ node: node
+ };
+ }
function finishFlowLabel(flow) {
var antecedents = flow.antecedents;
if (!antecedents) {
@@ -18108,34 +17667,34 @@ var ts;
function isStatementCondition(node) {
var parent = node.parent;
switch (parent.kind) {
- case 203:
- case 205:
case 204:
- return parent.expression === node;
case 206:
- case 188:
+ case 205:
+ return parent.expression === node;
+ case 207:
+ case 189:
return parent.condition === node;
}
return false;
}
function isLogicalExpression(node) {
while (true) {
- if (node.kind === 178) {
+ if (node.kind === 179) {
node = node.expression;
}
- else if (node.kind === 185 && node.operator === 49) {
+ else if (node.kind === 186 && node.operator === 50) {
node = node.operand;
}
else {
- return node.kind === 187 && (node.operatorToken.kind === 51 ||
- node.operatorToken.kind === 52);
+ return node.kind === 188 && (node.operatorToken.kind === 52 ||
+ node.operatorToken.kind === 53);
}
}
}
function isTopLevelLogicalExpression(node) {
- while (node.parent.kind === 178 ||
- node.parent.kind === 185 &&
- node.parent.operator === 49) {
+ while (node.parent.kind === 179 ||
+ node.parent.kind === 186 &&
+ node.parent.operator === 50) {
node = node.parent;
}
return !isStatementCondition(node) && !isLogicalExpression(node.parent);
@@ -18208,7 +17767,7 @@ var ts;
bind(node.expression);
addAntecedent(postLoopLabel, currentFlow);
bind(node.initializer);
- if (node.initializer.kind !== 219) {
+ if (node.initializer.kind !== 220) {
bindAssignmentTargetFlow(node.initializer);
}
bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
@@ -18230,7 +17789,7 @@ var ts;
}
function bindReturnOrThrow(node) {
bind(node.expression);
- if (node.kind === 211) {
+ if (node.kind === 212) {
hasExplicitReturn = true;
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
@@ -18250,7 +17809,7 @@ var ts;
return undefined;
}
function bindbreakOrContinueFlow(node, breakTarget, continueTarget) {
- var flowLabel = node.kind === 210 ? breakTarget : continueTarget;
+ var flowLabel = node.kind === 211 ? breakTarget : continueTarget;
if (flowLabel) {
addAntecedent(flowLabel, currentFlow);
currentFlow = unreachableFlow;
@@ -18270,21 +17829,32 @@ var ts;
}
}
function bindTryStatement(node) {
- var postFinallyLabel = createBranchLabel();
+ var preFinallyLabel = createBranchLabel();
var preTryFlow = currentFlow;
bind(node.tryBlock);
- addAntecedent(postFinallyLabel, currentFlow);
+ addAntecedent(preFinallyLabel, currentFlow);
+ var flowAfterTry = currentFlow;
+ var flowAfterCatch = unreachableFlow;
if (node.catchClause) {
currentFlow = preTryFlow;
bind(node.catchClause);
- addAntecedent(postFinallyLabel, currentFlow);
+ addAntecedent(preFinallyLabel, currentFlow);
+ flowAfterCatch = currentFlow;
}
if (node.finallyBlock) {
- currentFlow = preTryFlow;
+ addAntecedent(preFinallyLabel, preTryFlow);
+ currentFlow = finishFlowLabel(preFinallyLabel);
bind(node.finallyBlock);
+ if (!(currentFlow.flags & 1)) {
+ if ((flowAfterTry.flags & 1) && (flowAfterCatch.flags & 1)) {
+ currentFlow = flowAfterTry === reportedUnreachableFlow || flowAfterCatch === reportedUnreachableFlow
+ ? reportedUnreachableFlow
+ : unreachableFlow;
+ }
+ }
}
- if (!node.finallyBlock || !(currentFlow.flags & 1)) {
- currentFlow = finishFlowLabel(postFinallyLabel);
+ else {
+ currentFlow = finishFlowLabel(preFinallyLabel);
}
}
function bindSwitchStatement(node) {
@@ -18361,7 +17931,7 @@ var ts;
currentFlow = finishFlowLabel(postStatementLabel);
}
function bindDestructuringTargetFlow(node) {
- if (node.kind === 187 && node.operatorToken.kind === 56) {
+ if (node.kind === 188 && node.operatorToken.kind === 57) {
bindAssignmentTargetFlow(node.left);
}
else {
@@ -18372,10 +17942,10 @@ var ts;
if (isNarrowableReference(node)) {
currentFlow = createFlowAssignment(currentFlow, node);
}
- else if (node.kind === 170) {
+ else if (node.kind === 171) {
for (var _i = 0, _a = node.elements; _i < _a.length; _i++) {
var e = _a[_i];
- if (e.kind === 191) {
+ if (e.kind === 192) {
bindAssignmentTargetFlow(e.expression);
}
else {
@@ -18383,7 +17953,7 @@ var ts;
}
}
}
- else if (node.kind === 171) {
+ else if (node.kind === 172) {
for (var _b = 0, _c = node.properties; _b < _c.length; _b++) {
var p = _c[_b];
if (p.kind === 253) {
@@ -18397,7 +17967,7 @@ var ts;
}
function bindLogicalExpression(node, trueTarget, falseTarget) {
var preRightLabel = createBranchLabel();
- if (node.operatorToken.kind === 51) {
+ if (node.operatorToken.kind === 52) {
bindCondition(node.left, preRightLabel, falseTarget);
}
else {
@@ -18408,7 +17978,7 @@ var ts;
bindCondition(node.right, trueTarget, falseTarget);
}
function bindPrefixUnaryExpressionFlow(node) {
- if (node.operator === 49) {
+ if (node.operator === 50) {
var saveTrueTarget = currentTrueTarget;
currentTrueTarget = currentFalseTarget;
currentFalseTarget = saveTrueTarget;
@@ -18418,20 +17988,20 @@ var ts;
}
else {
ts.forEachChild(node, bind);
- if (node.operator === 41 || node.operator === 42) {
+ if (node.operator === 42 || node.operator === 43) {
bindAssignmentTargetFlow(node.operand);
}
}
}
function bindPostfixUnaryExpressionFlow(node) {
ts.forEachChild(node, bind);
- if (node.operator === 41 || node.operator === 42) {
+ if (node.operator === 42 || node.operator === 43) {
bindAssignmentTargetFlow(node.operand);
}
}
function bindBinaryExpressionFlow(node) {
var operator = node.operatorToken.kind;
- if (operator === 51 || operator === 52) {
+ if (operator === 52 || operator === 53) {
if (isTopLevelLogicalExpression(node)) {
var postExpressionLabel = createBranchLabel();
bindLogicalExpression(node, postExpressionLabel, postExpressionLabel);
@@ -18443,14 +18013,20 @@ var ts;
}
else {
ts.forEachChild(node, bind);
- if (operator === 56 && !ts.isAssignmentTarget(node)) {
+ if (operator === 57 && !ts.isAssignmentTarget(node)) {
bindAssignmentTargetFlow(node.left);
+ if (node.left.kind === 174) {
+ var elementAccess = node.left;
+ if (isNarrowableOperand(elementAccess.expression)) {
+ currentFlow = createFlowArrayMutation(currentFlow, node);
+ }
+ }
}
}
}
function bindDeleteExpressionFlow(node) {
ts.forEachChild(node, bind);
- if (node.expression.kind === 172) {
+ if (node.expression.kind === 173) {
bindAssignmentTargetFlow(node.expression);
}
}
@@ -18481,16 +18057,16 @@ var ts;
}
function bindVariableDeclarationFlow(node) {
ts.forEachChild(node, bind);
- if (node.initializer || node.parent.parent.kind === 207 || node.parent.parent.kind === 208) {
+ if (node.initializer || node.parent.parent.kind === 208 || node.parent.parent.kind === 209) {
bindInitializedVariableFlow(node);
}
}
function bindCallExpressionFlow(node) {
var expr = node.expression;
- while (expr.kind === 178) {
+ while (expr.kind === 179) {
expr = expr.expression;
}
- if (expr.kind === 179 || expr.kind === 180) {
+ if (expr.kind === 180 || expr.kind === 181) {
ts.forEach(node.typeArguments, bind);
ts.forEach(node.arguments, bind);
bind(node.expression);
@@ -18498,54 +18074,60 @@ var ts;
else {
ts.forEachChild(node, bind);
}
+ if (node.expression.kind === 173) {
+ var propertyAccess = node.expression;
+ if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) {
+ currentFlow = createFlowArrayMutation(currentFlow, node);
+ }
+ }
}
function getContainerFlags(node) {
switch (node.kind) {
- case 192:
- case 221:
- case 224:
- case 171:
- case 159:
+ case 193:
+ case 222:
+ case 225:
+ case 172:
+ case 160:
case 281:
case 265:
return 1;
- case 222:
+ case 223:
return 1 | 64;
case 269:
- case 225:
- case 223:
+ case 226:
+ case 224:
return 1 | 32;
case 256:
return 1 | 4 | 32;
- case 147:
+ case 148:
if (ts.isObjectLiteralOrClassExpressionMethod(node)) {
return 1 | 4 | 32 | 8 | 128;
}
- case 148:
- case 220:
- case 146:
case 149:
+ case 221:
+ case 147:
case 150:
case 151:
case 152:
case 153:
- case 156:
+ case 154:
case 157:
+ case 158:
return 1 | 4 | 32 | 8;
- case 179:
case 180:
+ case 181:
return 1 | 4 | 32 | 8 | 16;
- case 226:
+ case 227:
return 4;
- case 145:
+ case 146:
return node.initializer ? 4 : 0;
case 252:
- case 206:
case 207:
case 208:
- case 227:
+ case 209:
+ case 228:
return 2;
- case 199:
+ case 200:
return ts.isFunctionLike(node.parent) ? 0 : 2;
}
return 0;
@@ -18561,36 +18143,36 @@ var ts;
}
function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) {
switch (container.kind) {
- case 225:
+ case 226:
return declareModuleMember(node, symbolFlags, symbolExcludes);
case 256:
return declareSourceFileMember(node, symbolFlags, symbolExcludes);
- case 192:
- case 221:
- return declareClassMember(node, symbolFlags, symbolExcludes);
- case 224:
- return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
- case 159:
- case 171:
+ case 193:
case 222:
+ return declareClassMember(node, symbolFlags, symbolExcludes);
+ case 225:
+ return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
+ case 160:
+ case 172:
+ case 223:
case 265:
case 281:
return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
- case 156:
case 157:
- case 151:
+ case 158:
case 152:
case 153:
- case 147:
- case 146:
+ case 154:
case 148:
+ case 147:
case 149:
case 150:
- case 220:
- case 179:
+ case 151:
+ case 221:
case 180:
+ case 181:
case 269:
- case 223:
+ case 224:
return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes);
}
}
@@ -18606,10 +18188,10 @@ var ts;
}
function hasExportDeclarations(node) {
var body = node.kind === 256 ? node : node.body;
- if (body && (body.kind === 256 || body.kind === 226)) {
+ if (body && (body.kind === 256 || body.kind === 227)) {
for (var _i = 0, _a = body.statements; _i < _a.length; _i++) {
var stat = _a[_i];
- if (stat.kind === 236 || stat.kind === 235) {
+ if (stat.kind === 237 || stat.kind === 236) {
return true;
}
}
@@ -18681,15 +18263,20 @@ var ts;
typeLiteralSymbol.members[symbol.name] = symbol;
}
function bindObjectLiteralExpression(node) {
+ var ElementKind;
+ (function (ElementKind) {
+ ElementKind[ElementKind["Property"] = 1] = "Property";
+ ElementKind[ElementKind["Accessor"] = 2] = "Accessor";
+ })(ElementKind || (ElementKind = {}));
if (inStrictMode) {
var seen = ts.createMap();
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var prop = _a[_i];
- if (prop.name.kind !== 69) {
+ if (prop.name.kind !== 70) {
continue;
}
var identifier = prop.name;
- var currentKind = prop.kind === 253 || prop.kind === 254 || prop.kind === 147
+ var currentKind = prop.kind === 253 || prop.kind === 254 || prop.kind === 148
? 1
: 2;
var existingKind = seen[identifier.text];
@@ -18711,7 +18298,7 @@ var ts;
}
function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) {
switch (blockScopeContainer.kind) {
- case 225:
+ case 226:
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
case 256:
@@ -18732,8 +18319,8 @@ var ts;
}
function checkStrictModeIdentifier(node) {
if (inStrictMode &&
- node.originalKeywordKind >= 106 &&
- node.originalKeywordKind <= 114 &&
+ node.originalKeywordKind >= 107 &&
+ node.originalKeywordKind <= 115 &&
!ts.isIdentifierName(node) &&
!ts.isInAmbientContext(node)) {
if (!file.parseDiagnostics.length) {
@@ -18761,17 +18348,17 @@ var ts;
}
}
function checkStrictModeDeleteExpression(node) {
- if (inStrictMode && node.expression.kind === 69) {
+ if (inStrictMode && node.expression.kind === 70) {
var span_2 = ts.getErrorSpanForNode(file, node.expression);
file.bindDiagnostics.push(ts.createFileDiagnostic(file, span_2.start, span_2.length, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode));
}
}
function isEvalOrArgumentsIdentifier(node) {
- return node.kind === 69 &&
+ return node.kind === 70 &&
(node.text === "eval" || node.text === "arguments");
}
function checkStrictModeEvalOrArguments(contextNode, name) {
- if (name && name.kind === 69) {
+ if (name && name.kind === 70) {
var identifier = name;
if (isEvalOrArgumentsIdentifier(identifier)) {
var span_3 = ts.getErrorSpanForNode(file, name);
@@ -18805,7 +18392,7 @@ var ts;
function checkStrictModeFunctionDeclaration(node) {
if (languageVersion < 2) {
if (blockScopeContainer.kind !== 256 &&
- blockScopeContainer.kind !== 225 &&
+ blockScopeContainer.kind !== 226 &&
!ts.isFunctionLike(blockScopeContainer)) {
var errorSpan = ts.getErrorSpanForNode(file, node);
file.bindDiagnostics.push(ts.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node)));
@@ -18824,7 +18411,7 @@ var ts;
}
function checkStrictModePrefixUnaryExpression(node) {
if (inStrictMode) {
- if (node.operator === 41 || node.operator === 42) {
+ if (node.operator === 42 || node.operator === 43) {
checkStrictModeEvalOrArguments(node, node.operand);
}
}
@@ -18848,7 +18435,7 @@ var ts;
node.parent = parent;
var saveInStrictMode = inStrictMode;
bindWorker(node);
- if (node.kind > 138) {
+ if (node.kind > 139) {
var saveParent = parent;
parent = node;
var containerFlags = getContainerFlags(node);
@@ -18885,18 +18472,18 @@ var ts;
}
function bindWorker(node) {
switch (node.kind) {
- case 69:
- case 97:
+ case 70:
+ case 98:
if (currentFlow && (ts.isExpression(node) || parent.kind === 254)) {
node.flowNode = currentFlow;
}
return checkStrictModeIdentifier(node);
- case 172:
+ case 173:
if (currentFlow && isNarrowableReference(node)) {
node.flowNode = currentFlow;
}
break;
- case 187:
+ case 188:
if (ts.isInJavaScriptFile(node)) {
var specialKind = ts.getSpecialPropertyAssignmentKind(node);
switch (specialKind) {
@@ -18921,30 +18508,30 @@ var ts;
return checkStrictModeBinaryExpression(node);
case 252:
return checkStrictModeCatchClause(node);
- case 181:
+ case 182:
return checkStrictModeDeleteExpression(node);
case 8:
return checkStrictModeNumericLiteral(node);
- case 186:
+ case 187:
return checkStrictModePostfixUnaryExpression(node);
- case 185:
+ case 186:
return checkStrictModePrefixUnaryExpression(node);
- case 212:
+ case 213:
return checkStrictModeWithStatement(node);
- case 165:
+ case 166:
seenThisKeyword = true;
return;
- case 154:
+ case 155:
return checkTypePredicate(node);
- case 141:
- return declareSymbolAndAddToSymbolTable(node, 262144, 530920);
case 142:
+ return declareSymbolAndAddToSymbolTable(node, 262144, 530920);
+ case 143:
return bindParameter(node);
- case 218:
- case 169:
+ case 219:
+ case 170:
return bindVariableDeclarationOrBindingElement(node);
+ case 146:
case 145:
- case 144:
case 266:
return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 0);
case 280:
@@ -18957,82 +18544,82 @@ var ts;
case 247:
emitFlags |= 16384;
return;
- case 151:
case 152:
case 153:
+ case 154:
return declareSymbolAndAddToSymbolTable(node, 131072, 0);
- case 147:
- case 146:
- return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263);
- case 220:
- return bindFunctionDeclaration(node);
case 148:
- return declareSymbolAndAddToSymbolTable(node, 16384, 0);
+ case 147:
+ return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263);
+ case 221:
+ return bindFunctionDeclaration(node);
case 149:
- return bindPropertyOrMethodOrAccessor(node, 32768, 41919);
+ return declareSymbolAndAddToSymbolTable(node, 16384, 0);
case 150:
+ return bindPropertyOrMethodOrAccessor(node, 32768, 41919);
+ case 151:
return bindPropertyOrMethodOrAccessor(node, 65536, 74687);
- case 156:
case 157:
+ case 158:
case 269:
return bindFunctionOrConstructorType(node);
- case 159:
+ case 160:
case 281:
case 265:
return bindAnonymousDeclaration(node, 2048, "__type");
- case 171:
+ case 172:
return bindObjectLiteralExpression(node);
- case 179:
case 180:
+ case 181:
return bindFunctionExpression(node);
- case 174:
+ case 175:
if (ts.isInJavaScriptFile(node)) {
bindCallExpression(node);
}
break;
- case 192:
- case 221:
+ case 193:
+ case 222:
inStrictMode = true;
return bindClassLikeDeclaration(node);
- case 222:
+ case 223:
return bindBlockScopedDeclaration(node, 64, 792968);
case 279:
- case 223:
- return bindBlockScopedDeclaration(node, 524288, 793064);
case 224:
- return bindEnumDeclaration(node);
+ return bindBlockScopedDeclaration(node, 524288, 793064);
case 225:
+ return bindEnumDeclaration(node);
+ case 226:
return bindModuleDeclaration(node);
- case 229:
- case 232:
- case 234:
- case 238:
- return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608);
- case 228:
- return bindNamespaceExportDeclaration(node);
- case 231:
- return bindImportClause(node);
- case 236:
- return bindExportDeclaration(node);
+ case 230:
+ case 233:
case 235:
+ case 239:
+ return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608);
+ case 229:
+ return bindNamespaceExportDeclaration(node);
+ case 232:
+ return bindImportClause(node);
+ case 237:
+ return bindExportDeclaration(node);
+ case 236:
return bindExportAssignment(node);
case 256:
updateStrictModeStatementList(node.statements);
return bindSourceFileIfExternalModule();
- case 199:
+ case 200:
if (!ts.isFunctionLike(node.parent)) {
return;
}
- case 226:
+ case 227:
return updateStrictModeStatementList(node.statements);
}
}
function checkTypePredicate(node) {
var parameterName = node.parameterName, type = node.type;
- if (parameterName && parameterName.kind === 69) {
+ if (parameterName && parameterName.kind === 70) {
checkStrictModeIdentifier(parameterName);
}
- if (parameterName && parameterName.kind === 165) {
+ if (parameterName && parameterName.kind === 166) {
seenThisKeyword = true;
}
bind(type);
@@ -19051,7 +18638,7 @@ var ts;
bindAnonymousDeclaration(node, 8388608, getDeclarationName(node));
}
else {
- var flags = node.kind === 235 && ts.exportAssignmentIsAlias(node)
+ var flags = node.kind === 236 && ts.exportAssignmentIsAlias(node)
? 8388608
: 4;
declareSymbol(container.symbol.exports, container.symbol, node, flags, 4 | 8388608 | 32 | 16);
@@ -19095,7 +18682,9 @@ var ts;
function setCommonJsModuleIndicator(node) {
if (!file.commonJsModuleIndicator) {
file.commonJsModuleIndicator = node;
- bindSourceFileAsExternalModule();
+ if (!file.externalModuleIndicator) {
+ bindSourceFileAsExternalModule();
+ }
}
}
function bindExportsPropertyAssignment(node) {
@@ -19108,11 +18697,11 @@ var ts;
}
function bindThisPropertyAssignment(node) {
ts.Debug.assert(ts.isInJavaScriptFile(node));
- if (container.kind === 220 || container.kind === 179) {
+ if (container.kind === 221 || container.kind === 180) {
container.symbol.members = container.symbol.members || ts.createMap();
declareSymbol(container.symbol.members, container.symbol, node, 4, 0 & ~4);
}
- else if (container.kind === 148) {
+ else if (container.kind === 149) {
var saveContainer = container;
container = container.parent;
var symbol = bindPropertyOrMethodOrAccessor(node, 4, 0);
@@ -19152,7 +18741,7 @@ var ts;
emitFlags |= 2048;
}
}
- if (node.kind === 221) {
+ if (node.kind === 222) {
bindBlockScopedDeclaration(node, 32, 899519);
}
else {
@@ -19270,15 +18859,15 @@ var ts;
return false;
}
if (currentFlow === unreachableFlow) {
- var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 201) ||
- node.kind === 221 ||
- (node.kind === 225 && shouldReportErrorOnModuleDeclaration(node)) ||
- (node.kind === 224 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums));
+ var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 202) ||
+ node.kind === 222 ||
+ (node.kind === 226 && shouldReportErrorOnModuleDeclaration(node)) ||
+ (node.kind === 225 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums));
if (reportError) {
currentFlow = reportedUnreachableFlow;
var reportUnreachableCode = !options.allowUnreachableCode &&
!ts.isInAmbientContext(node) &&
- (node.kind !== 200 ||
+ (node.kind !== 201 ||
ts.getCombinedNodeFlags(node.declarationList) & 3 ||
ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; }));
if (reportUnreachableCode) {
@@ -19292,52 +18881,54 @@ var ts;
function computeTransformFlagsForNode(node, subtreeFlags) {
var kind = node.kind;
switch (kind) {
- case 174:
+ case 175:
return computeCallExpression(node, subtreeFlags);
- case 225:
+ case 176:
+ return computeNewExpression(node, subtreeFlags);
+ case 226:
return computeModuleDeclaration(node, subtreeFlags);
- case 178:
- return computeParenthesizedExpression(node, subtreeFlags);
- case 187:
- return computeBinaryExpression(node, subtreeFlags);
- case 202:
- return computeExpressionStatement(node, subtreeFlags);
- case 142:
- return computeParameter(node, subtreeFlags);
- case 180:
- return computeArrowFunction(node, subtreeFlags);
case 179:
+ return computeParenthesizedExpression(node, subtreeFlags);
+ case 188:
+ return computeBinaryExpression(node, subtreeFlags);
+ case 203:
+ return computeExpressionStatement(node, subtreeFlags);
+ case 143:
+ return computeParameter(node, subtreeFlags);
+ case 181:
+ return computeArrowFunction(node, subtreeFlags);
+ case 180:
return computeFunctionExpression(node, subtreeFlags);
- case 220:
- return computeFunctionDeclaration(node, subtreeFlags);
- case 218:
- return computeVariableDeclaration(node, subtreeFlags);
- case 219:
- return computeVariableDeclarationList(node, subtreeFlags);
- case 200:
- return computeVariableStatement(node, subtreeFlags);
- case 214:
- return computeLabeledStatement(node, subtreeFlags);
case 221:
+ return computeFunctionDeclaration(node, subtreeFlags);
+ case 219:
+ return computeVariableDeclaration(node, subtreeFlags);
+ case 220:
+ return computeVariableDeclarationList(node, subtreeFlags);
+ case 201:
+ return computeVariableStatement(node, subtreeFlags);
+ case 215:
+ return computeLabeledStatement(node, subtreeFlags);
+ case 222:
return computeClassDeclaration(node, subtreeFlags);
- case 192:
+ case 193:
return computeClassExpression(node, subtreeFlags);
case 251:
return computeHeritageClause(node, subtreeFlags);
- case 194:
+ case 195:
return computeExpressionWithTypeArguments(node, subtreeFlags);
- case 148:
- return computeConstructor(node, subtreeFlags);
- case 145:
- return computePropertyDeclaration(node, subtreeFlags);
- case 147:
- return computeMethod(node, subtreeFlags);
case 149:
+ return computeConstructor(node, subtreeFlags);
+ case 146:
+ return computePropertyDeclaration(node, subtreeFlags);
+ case 148:
+ return computeMethod(node, subtreeFlags);
case 150:
+ case 151:
return computeAccessor(node, subtreeFlags);
- case 229:
+ case 230:
return computeImportEquals(node, subtreeFlags);
- case 172:
+ case 173:
return computePropertyAccess(node, subtreeFlags);
default:
return computeOther(node, kind, subtreeFlags);
@@ -19348,40 +18939,54 @@ var ts;
var transformFlags = subtreeFlags;
var expression = node.expression;
var expressionKind = expression.kind;
- if (subtreeFlags & 262144
+ if (node.typeArguments) {
+ transformFlags |= 3;
+ }
+ if (subtreeFlags & 1048576
|| isSuperOrSuperProperty(expression, expressionKind)) {
- transformFlags |= 192;
+ transformFlags |= 768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~537133909;
+ return transformFlags & ~537922901;
}
function isSuperOrSuperProperty(node, kind) {
switch (kind) {
- case 95:
+ case 96:
return true;
- case 172:
case 173:
+ case 174:
var expression = node.expression;
var expressionKind = expression.kind;
- return expressionKind === 95;
+ return expressionKind === 96;
}
return false;
}
+ function computeNewExpression(node, subtreeFlags) {
+ var transformFlags = subtreeFlags;
+ if (node.typeArguments) {
+ transformFlags |= 3;
+ }
+ if (subtreeFlags & 1048576) {
+ transformFlags |= 768;
+ }
+ node.transformFlags = transformFlags | 536870912;
+ return transformFlags & ~537922901;
+ }
function computeBinaryExpression(node, subtreeFlags) {
var transformFlags = subtreeFlags;
var operatorTokenKind = node.operatorToken.kind;
var leftKind = node.left.kind;
- if (operatorTokenKind === 56
- && (leftKind === 171
- || leftKind === 170)) {
- transformFlags |= 192 | 256;
+ if (operatorTokenKind === 57
+ && (leftKind === 172
+ || leftKind === 171)) {
+ transformFlags |= 768 | 1024;
}
- else if (operatorTokenKind === 38
- || operatorTokenKind === 60) {
- transformFlags |= 48;
+ else if (operatorTokenKind === 39
+ || operatorTokenKind === 61) {
+ transformFlags |= 192;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeParameter(node, subtreeFlags) {
var transformFlags = subtreeFlags;
@@ -19389,35 +18994,35 @@ var ts;
var name = node.name;
var initializer = node.initializer;
var dotDotDotToken = node.dotDotDotToken;
- if (node.questionToken) {
- transformFlags |= 3;
- }
- if (subtreeFlags & 2048 || ts.isThisIdentifier(name)) {
+ if (node.questionToken
+ || node.type
+ || subtreeFlags & 8192
+ || ts.isThisIdentifier(name)) {
transformFlags |= 3;
}
if (modifierFlags & 92) {
- transformFlags |= 3 | 131072;
+ transformFlags |= 3 | 524288;
}
- if (subtreeFlags & 2097152 || initializer || dotDotDotToken) {
- transformFlags |= 192 | 65536;
+ if (subtreeFlags & 8388608 || initializer || dotDotDotToken) {
+ transformFlags |= 768 | 262144;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~538968917;
+ return transformFlags & ~545262933;
}
function computeParenthesizedExpression(node, subtreeFlags) {
var transformFlags = subtreeFlags;
var expression = node.expression;
var expressionKind = expression.kind;
var expressionTransformFlags = expression.transformFlags;
- if (expressionKind === 195
- || expressionKind === 177) {
+ if (expressionKind === 196
+ || expressionKind === 178) {
transformFlags |= 3;
}
- if (expressionTransformFlags & 256) {
- transformFlags |= 256;
+ if (expressionTransformFlags & 1024) {
+ transformFlags |= 1024;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeClassDeclaration(node, subtreeFlags) {
var transformFlags;
@@ -19426,36 +19031,38 @@ var ts;
transformFlags = 3;
}
else {
- transformFlags = subtreeFlags | 192;
- if ((subtreeFlags & 137216)
- || (modifierFlags & 1)) {
+ transformFlags = subtreeFlags | 768;
+ if ((subtreeFlags & 548864)
+ || (modifierFlags & 1)
+ || node.typeParameters) {
transformFlags |= 3;
}
- if (subtreeFlags & 32768) {
- transformFlags |= 8192;
+ if (subtreeFlags & 131072) {
+ transformFlags |= 32768;
}
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~537590613;
+ return transformFlags & ~539749717;
}
function computeClassExpression(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
- if (subtreeFlags & 137216) {
+ var transformFlags = subtreeFlags | 768;
+ if (subtreeFlags & 548864
+ || node.typeParameters) {
transformFlags |= 3;
}
- if (subtreeFlags & 32768) {
- transformFlags |= 8192;
+ if (subtreeFlags & 131072) {
+ transformFlags |= 32768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~537590613;
+ return transformFlags & ~539749717;
}
function computeHeritageClause(node, subtreeFlags) {
var transformFlags = subtreeFlags;
switch (node.token) {
- case 83:
- transformFlags |= 192;
+ case 84:
+ transformFlags |= 768;
break;
- case 106:
+ case 107:
transformFlags |= 3;
break;
default:
@@ -19463,135 +19070,148 @@ var ts;
break;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeExpressionWithTypeArguments(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
+ var transformFlags = subtreeFlags | 768;
if (node.typeArguments) {
transformFlags |= 3;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeConstructor(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- var body = node.body;
- if (body === undefined) {
+ if (ts.hasModifier(node, 2270)
+ || !node.body) {
transformFlags |= 3;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550593365;
+ return transformFlags & ~591760725;
}
function computeMethod(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
- var modifierFlags = ts.getModifierFlags(node);
- var body = node.body;
- var typeParameters = node.typeParameters;
- var asteriskToken = node.asteriskToken;
- if (!body
- || typeParameters
- || (modifierFlags & (256 | 128))
- || (subtreeFlags & 2048)) {
+ var transformFlags = subtreeFlags | 768;
+ if (node.decorators
+ || ts.hasModifier(node, 2270)
+ || node.typeParameters
+ || node.type
+ || !node.body) {
transformFlags |= 3;
}
- if (asteriskToken && ts.getEmitFlags(node) & 2097152) {
- transformFlags |= 1536;
+ if (ts.hasModifier(node, 256)) {
+ transformFlags |= 48;
+ }
+ if (node.asteriskToken && ts.getEmitFlags(node) & 2097152) {
+ transformFlags |= 6144;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550593365;
+ return transformFlags & ~591760725;
}
function computeAccessor(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- var modifierFlags = ts.getModifierFlags(node);
- var body = node.body;
- if (!body
- || (modifierFlags & (256 | 128))
- || (subtreeFlags & 2048)) {
+ if (node.decorators
+ || ts.hasModifier(node, 2270)
+ || node.type
+ || !node.body) {
transformFlags |= 3;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550593365;
+ return transformFlags & ~591760725;
}
function computePropertyDeclaration(node, subtreeFlags) {
var transformFlags = subtreeFlags | 3;
if (node.initializer) {
- transformFlags |= 4096;
+ transformFlags |= 16384;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeFunctionDeclaration(node, subtreeFlags) {
var transformFlags;
var modifierFlags = ts.getModifierFlags(node);
var body = node.body;
- var asteriskToken = node.asteriskToken;
if (!body || (modifierFlags & 2)) {
transformFlags = 3;
}
else {
- transformFlags = subtreeFlags | 8388608;
+ transformFlags = subtreeFlags | 33554432;
if (modifierFlags & 1) {
- transformFlags |= 3 | 192;
+ transformFlags |= 3 | 768;
}
- if (modifierFlags & 256) {
+ if (modifierFlags & 2270
+ || node.typeParameters
+ || node.type) {
transformFlags |= 3;
}
- if (subtreeFlags & 81920) {
- transformFlags |= 192;
+ if (modifierFlags & 256) {
+ transformFlags |= 48;
}
- if (asteriskToken && ts.getEmitFlags(node) & 2097152) {
- transformFlags |= 1536;
+ if (subtreeFlags & 327680) {
+ transformFlags |= 768;
+ }
+ if (node.asteriskToken && ts.getEmitFlags(node) & 2097152) {
+ transformFlags |= 6144;
}
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550726485;
+ return transformFlags & ~592293205;
}
function computeFunctionExpression(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- var modifierFlags = ts.getModifierFlags(node);
- var asteriskToken = node.asteriskToken;
- if (modifierFlags & 256) {
+ if (ts.hasModifier(node, 2270)
+ || node.typeParameters
+ || node.type) {
transformFlags |= 3;
}
- if (subtreeFlags & 81920) {
- transformFlags |= 192;
+ if (ts.hasModifier(node, 256)) {
+ transformFlags |= 48;
}
- if (asteriskToken && ts.getEmitFlags(node) & 2097152) {
- transformFlags |= 1536;
+ if (subtreeFlags & 327680) {
+ transformFlags |= 768;
+ }
+ if (node.asteriskToken && ts.getEmitFlags(node) & 2097152) {
+ transformFlags |= 6144;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550726485;
+ return transformFlags & ~592293205;
}
function computeArrowFunction(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
- var modifierFlags = ts.getModifierFlags(node);
- if (modifierFlags & 256) {
+ var transformFlags = subtreeFlags | 768;
+ if (ts.hasModifier(node, 2270)
+ || node.typeParameters
+ || node.type) {
transformFlags |= 3;
}
- if (subtreeFlags & 8192) {
- transformFlags |= 16384;
+ if (ts.hasModifier(node, 256)) {
+ transformFlags |= 48;
+ }
+ if (subtreeFlags & 32768) {
+ transformFlags |= 65536;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~550710101;
+ return transformFlags & ~592227669;
}
function computePropertyAccess(node, subtreeFlags) {
var transformFlags = subtreeFlags;
var expression = node.expression;
var expressionKind = expression.kind;
- if (expressionKind === 95) {
- transformFlags |= 8192;
+ if (expressionKind === 96) {
+ transformFlags |= 32768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeVariableDeclaration(node, subtreeFlags) {
var transformFlags = subtreeFlags;
var nameKind = node.name.kind;
- if (nameKind === 167 || nameKind === 168) {
- transformFlags |= 192 | 2097152;
+ if (nameKind === 168 || nameKind === 169) {
+ transformFlags |= 768 | 8388608;
+ }
+ if (node.type) {
+ transformFlags |= 3;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeVariableStatement(node, subtreeFlags) {
var transformFlags;
@@ -19603,23 +19223,23 @@ var ts;
else {
transformFlags = subtreeFlags;
if (modifierFlags & 1) {
- transformFlags |= 192 | 3;
+ transformFlags |= 768 | 3;
}
- if (declarationListTransformFlags & 2097152) {
- transformFlags |= 192;
+ if (declarationListTransformFlags & 8388608) {
+ transformFlags |= 768;
}
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeLabeledStatement(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- if (subtreeFlags & 1048576
+ if (subtreeFlags & 4194304
&& ts.isIterationStatement(node, true)) {
- transformFlags |= 192;
+ transformFlags |= 768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeImportEquals(node, subtreeFlags) {
var transformFlags = subtreeFlags;
@@ -19627,15 +19247,15 @@ var ts;
transformFlags |= 3;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeExpressionStatement(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- if (node.expression.transformFlags & 256) {
- transformFlags |= 192;
+ if (node.expression.transformFlags & 1024) {
+ transformFlags |= 768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536871765;
+ return transformFlags & ~536874325;
}
function computeModuleDeclaration(node, subtreeFlags) {
var transformFlags = 3;
@@ -19644,77 +19264,78 @@ var ts;
transformFlags |= subtreeFlags;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~546335573;
+ return transformFlags & ~574729557;
}
function computeVariableDeclarationList(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 8388608;
- if (subtreeFlags & 2097152) {
- transformFlags |= 192;
+ var transformFlags = subtreeFlags | 33554432;
+ if (subtreeFlags & 8388608) {
+ transformFlags |= 768;
}
if (node.flags & 3) {
- transformFlags |= 192 | 1048576;
+ transformFlags |= 768 | 4194304;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~538968917;
+ return transformFlags & ~545262933;
}
function computeOther(node, kind, subtreeFlags) {
var transformFlags = subtreeFlags;
- var excludeFlags = 536871765;
+ var excludeFlags = 536874325;
switch (kind) {
- case 112:
- case 110:
+ case 119:
+ case 185:
+ transformFlags |= 48;
+ break;
+ case 113:
case 111:
- case 115:
- case 122:
- case 118:
- case 74:
- case 184:
- case 224:
+ case 112:
+ case 116:
+ case 123:
+ case 75:
+ case 225:
case 255:
- case 177:
- case 195:
+ case 178:
case 196:
- case 128:
+ case 197:
+ case 129:
transformFlags |= 3;
break;
- case 241:
case 242:
case 243:
case 244:
+ case 10:
case 245:
case 246:
case 247:
case 248:
transformFlags |= 12;
break;
- case 82:
- transformFlags |= 192 | 3;
+ case 83:
+ transformFlags |= 768 | 3;
break;
- case 77:
- case 11:
+ case 78:
case 12:
case 13:
case 14:
- case 189:
- case 176:
- case 254:
- case 208:
- transformFlags |= 192;
- break;
+ case 15:
case 190:
- transformFlags |= 192 | 4194304;
+ case 177:
+ case 254:
+ case 209:
+ transformFlags |= 768;
break;
- case 117:
- case 130:
- case 127:
- case 132:
- case 120:
+ case 191:
+ transformFlags |= 768 | 16777216;
+ break;
+ case 118:
+ case 131:
+ case 128:
case 133:
- case 103:
- case 141:
- case 144:
- case 146:
- case 151:
+ case 121:
+ case 134:
+ case 104:
+ case 142:
+ case 145:
+ case 147:
case 152:
case 153:
case 154:
@@ -19728,68 +19349,69 @@ var ts;
case 162:
case 163:
case 164:
- case 222:
- case 223:
case 165:
+ case 223:
+ case 224:
case 166:
+ case 167:
transformFlags = 3;
excludeFlags = -3;
break;
- case 140:
- transformFlags |= 524288;
- if (subtreeFlags & 8192) {
+ case 141:
+ transformFlags |= 2097152;
+ if (subtreeFlags & 32768) {
+ transformFlags |= 131072;
+ }
+ break;
+ case 192:
+ transformFlags |= 1048576;
+ break;
+ case 96:
+ transformFlags |= 768;
+ break;
+ case 98:
+ transformFlags |= 32768;
+ break;
+ case 168:
+ case 169:
+ transformFlags |= 768 | 8388608;
+ break;
+ case 144:
+ transformFlags |= 3 | 8192;
+ break;
+ case 172:
+ excludeFlags = 539110741;
+ if (subtreeFlags & 2097152) {
+ transformFlags |= 768;
+ }
+ if (subtreeFlags & 131072) {
transformFlags |= 32768;
}
break;
- case 191:
- transformFlags |= 262144;
- break;
- case 95:
- transformFlags |= 192;
- break;
- case 97:
- transformFlags |= 8192;
- break;
- case 167:
- case 168:
- transformFlags |= 192 | 2097152;
- break;
- case 143:
- transformFlags |= 3 | 2048;
- break;
case 171:
- excludeFlags = 537430869;
- if (subtreeFlags & 524288) {
- transformFlags |= 192;
- }
- if (subtreeFlags & 32768) {
- transformFlags |= 8192;
+ case 176:
+ excludeFlags = 537922901;
+ if (subtreeFlags & 1048576) {
+ transformFlags |= 768;
}
break;
- case 170:
- case 175:
- excludeFlags = 537133909;
- if (subtreeFlags & 262144) {
- transformFlags |= 192;
- }
- break;
- case 204:
case 205:
case 206:
case 207:
- if (subtreeFlags & 1048576) {
- transformFlags |= 192;
+ case 208:
+ if (subtreeFlags & 4194304) {
+ transformFlags |= 768;
}
break;
case 256:
- if (subtreeFlags & 16384) {
- transformFlags |= 192;
+ if (subtreeFlags & 65536) {
+ transformFlags |= 768;
}
break;
- case 211:
- case 209:
+ case 212:
case 210:
- transformFlags |= 8388608;
+ case 211:
+ transformFlags |= 33554432;
break;
}
node.transformFlags = transformFlags | 536870912;
@@ -19889,6 +19511,7 @@ var ts;
var intersectionTypes = ts.createMap();
var stringLiteralTypes = ts.createMap();
var numericLiteralTypes = ts.createMap();
+ var evolvingArrayTypes = [];
var unknownSymbol = createSymbol(4 | 67108864, "unknown");
var resolvingSymbol = createSymbol(67108864, "__resolving__");
var anyType = createIntrinsicType(1, "any");
@@ -19932,6 +19555,7 @@ var ts;
var globalBooleanType;
var globalRegExpType;
var anyArrayType;
+ var autoArrayType;
var anyReadonlyArrayType;
var getGlobalTemplateStringsArrayType;
var getGlobalESSymbolType;
@@ -19972,6 +19596,66 @@ var ts;
var potentialThisCollisions = [];
var awaitedTypeStack = [];
var diagnostics = ts.createDiagnosticCollection();
+ var TypeFacts;
+ (function (TypeFacts) {
+ TypeFacts[TypeFacts["None"] = 0] = "None";
+ TypeFacts[TypeFacts["TypeofEQString"] = 1] = "TypeofEQString";
+ TypeFacts[TypeFacts["TypeofEQNumber"] = 2] = "TypeofEQNumber";
+ TypeFacts[TypeFacts["TypeofEQBoolean"] = 4] = "TypeofEQBoolean";
+ TypeFacts[TypeFacts["TypeofEQSymbol"] = 8] = "TypeofEQSymbol";
+ TypeFacts[TypeFacts["TypeofEQObject"] = 16] = "TypeofEQObject";
+ TypeFacts[TypeFacts["TypeofEQFunction"] = 32] = "TypeofEQFunction";
+ TypeFacts[TypeFacts["TypeofEQHostObject"] = 64] = "TypeofEQHostObject";
+ TypeFacts[TypeFacts["TypeofNEString"] = 128] = "TypeofNEString";
+ TypeFacts[TypeFacts["TypeofNENumber"] = 256] = "TypeofNENumber";
+ TypeFacts[TypeFacts["TypeofNEBoolean"] = 512] = "TypeofNEBoolean";
+ TypeFacts[TypeFacts["TypeofNESymbol"] = 1024] = "TypeofNESymbol";
+ TypeFacts[TypeFacts["TypeofNEObject"] = 2048] = "TypeofNEObject";
+ TypeFacts[TypeFacts["TypeofNEFunction"] = 4096] = "TypeofNEFunction";
+ TypeFacts[TypeFacts["TypeofNEHostObject"] = 8192] = "TypeofNEHostObject";
+ TypeFacts[TypeFacts["EQUndefined"] = 16384] = "EQUndefined";
+ TypeFacts[TypeFacts["EQNull"] = 32768] = "EQNull";
+ TypeFacts[TypeFacts["EQUndefinedOrNull"] = 65536] = "EQUndefinedOrNull";
+ TypeFacts[TypeFacts["NEUndefined"] = 131072] = "NEUndefined";
+ TypeFacts[TypeFacts["NENull"] = 262144] = "NENull";
+ TypeFacts[TypeFacts["NEUndefinedOrNull"] = 524288] = "NEUndefinedOrNull";
+ TypeFacts[TypeFacts["Truthy"] = 1048576] = "Truthy";
+ TypeFacts[TypeFacts["Falsy"] = 2097152] = "Falsy";
+ TypeFacts[TypeFacts["Discriminatable"] = 4194304] = "Discriminatable";
+ TypeFacts[TypeFacts["All"] = 8388607] = "All";
+ TypeFacts[TypeFacts["BaseStringStrictFacts"] = 933633] = "BaseStringStrictFacts";
+ TypeFacts[TypeFacts["BaseStringFacts"] = 3145473] = "BaseStringFacts";
+ TypeFacts[TypeFacts["StringStrictFacts"] = 4079361] = "StringStrictFacts";
+ TypeFacts[TypeFacts["StringFacts"] = 4194049] = "StringFacts";
+ TypeFacts[TypeFacts["EmptyStringStrictFacts"] = 3030785] = "EmptyStringStrictFacts";
+ TypeFacts[TypeFacts["EmptyStringFacts"] = 3145473] = "EmptyStringFacts";
+ TypeFacts[TypeFacts["NonEmptyStringStrictFacts"] = 1982209] = "NonEmptyStringStrictFacts";
+ TypeFacts[TypeFacts["NonEmptyStringFacts"] = 4194049] = "NonEmptyStringFacts";
+ TypeFacts[TypeFacts["BaseNumberStrictFacts"] = 933506] = "BaseNumberStrictFacts";
+ TypeFacts[TypeFacts["BaseNumberFacts"] = 3145346] = "BaseNumberFacts";
+ TypeFacts[TypeFacts["NumberStrictFacts"] = 4079234] = "NumberStrictFacts";
+ TypeFacts[TypeFacts["NumberFacts"] = 4193922] = "NumberFacts";
+ TypeFacts[TypeFacts["ZeroStrictFacts"] = 3030658] = "ZeroStrictFacts";
+ TypeFacts[TypeFacts["ZeroFacts"] = 3145346] = "ZeroFacts";
+ TypeFacts[TypeFacts["NonZeroStrictFacts"] = 1982082] = "NonZeroStrictFacts";
+ TypeFacts[TypeFacts["NonZeroFacts"] = 4193922] = "NonZeroFacts";
+ TypeFacts[TypeFacts["BaseBooleanStrictFacts"] = 933252] = "BaseBooleanStrictFacts";
+ TypeFacts[TypeFacts["BaseBooleanFacts"] = 3145092] = "BaseBooleanFacts";
+ TypeFacts[TypeFacts["BooleanStrictFacts"] = 4078980] = "BooleanStrictFacts";
+ TypeFacts[TypeFacts["BooleanFacts"] = 4193668] = "BooleanFacts";
+ TypeFacts[TypeFacts["FalseStrictFacts"] = 3030404] = "FalseStrictFacts";
+ TypeFacts[TypeFacts["FalseFacts"] = 3145092] = "FalseFacts";
+ TypeFacts[TypeFacts["TrueStrictFacts"] = 1981828] = "TrueStrictFacts";
+ TypeFacts[TypeFacts["TrueFacts"] = 4193668] = "TrueFacts";
+ TypeFacts[TypeFacts["SymbolStrictFacts"] = 1981320] = "SymbolStrictFacts";
+ TypeFacts[TypeFacts["SymbolFacts"] = 4193160] = "SymbolFacts";
+ TypeFacts[TypeFacts["ObjectStrictFacts"] = 6166480] = "ObjectStrictFacts";
+ TypeFacts[TypeFacts["ObjectFacts"] = 8378320] = "ObjectFacts";
+ TypeFacts[TypeFacts["FunctionStrictFacts"] = 6164448] = "FunctionStrictFacts";
+ TypeFacts[TypeFacts["FunctionFacts"] = 8376288] = "FunctionFacts";
+ TypeFacts[TypeFacts["UndefinedFacts"] = 2457472] = "UndefinedFacts";
+ TypeFacts[TypeFacts["NullFacts"] = 2340752] = "NullFacts";
+ })(TypeFacts || (TypeFacts = {}));
var typeofEQFacts = ts.createMap({
"string": 1,
"number": 2,
@@ -20014,6 +19698,13 @@ var ts;
var identityRelation = ts.createMap();
var enumRelation = ts.createMap();
var _displayBuilder;
+ var TypeSystemPropertyName;
+ (function (TypeSystemPropertyName) {
+ TypeSystemPropertyName[TypeSystemPropertyName["Type"] = 0] = "Type";
+ TypeSystemPropertyName[TypeSystemPropertyName["ResolvedBaseConstructorType"] = 1] = "ResolvedBaseConstructorType";
+ TypeSystemPropertyName[TypeSystemPropertyName["DeclaredType"] = 2] = "DeclaredType";
+ TypeSystemPropertyName[TypeSystemPropertyName["ResolvedReturnType"] = 3] = "ResolvedReturnType";
+ })(TypeSystemPropertyName || (TypeSystemPropertyName = {}));
var builtinGlobals = ts.createMap();
builtinGlobals[undefinedSymbol.name] = undefinedSymbol;
initializeTypeChecker();
@@ -20098,7 +19789,7 @@ var ts;
target.flags |= source.flags;
if (source.valueDeclaration &&
(!target.valueDeclaration ||
- (target.valueDeclaration.kind === 225 && source.valueDeclaration.kind !== 225))) {
+ (target.valueDeclaration.kind === 226 && source.valueDeclaration.kind !== 226))) {
target.valueDeclaration = source.valueDeclaration;
}
ts.forEach(source.declarations, function (node) {
@@ -20233,24 +19924,24 @@ var ts;
return ts.indexOf(sourceFiles, declarationFile) <= ts.indexOf(sourceFiles, useFile);
}
if (declaration.pos <= usage.pos) {
- return declaration.kind !== 218 ||
+ return declaration.kind !== 219 ||
!isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
}
return isUsedInFunctionOrNonStaticProperty(declaration, usage);
function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) {
var container = ts.getEnclosingBlockScopeContainer(declaration);
switch (declaration.parent.parent.kind) {
- case 200:
- case 206:
- case 208:
+ case 201:
+ case 207:
+ case 209:
if (isSameScopeDescendentOf(usage, declaration, container)) {
return true;
}
break;
}
switch (declaration.parent.parent.kind) {
- case 207:
case 208:
+ case 209:
if (isSameScopeDescendentOf(usage, declaration.parent.parent.expression, container)) {
return true;
}
@@ -20268,7 +19959,7 @@ var ts;
return true;
}
var initializerOfNonStaticProperty = current.parent &&
- current.parent.kind === 145 &&
+ current.parent.kind === 146 &&
(ts.getModifierFlags(current.parent) & 32) === 0 &&
current.parent.initializer === current;
if (initializerOfNonStaticProperty) {
@@ -20294,15 +19985,15 @@ var ts;
if (meaning & result.flags & 793064 && lastLocation.kind !== 273) {
useResult = result.flags & 262144
? lastLocation === location.type ||
- lastLocation.kind === 142 ||
- lastLocation.kind === 141
+ lastLocation.kind === 143 ||
+ lastLocation.kind === 142
: false;
}
if (meaning & 107455 && result.flags & 1) {
useResult =
- lastLocation.kind === 142 ||
+ lastLocation.kind === 143 ||
(lastLocation === location.type &&
- result.valueDeclaration.kind === 142);
+ result.valueDeclaration.kind === 143);
}
}
if (useResult) {
@@ -20318,7 +20009,7 @@ var ts;
if (!ts.isExternalOrCommonJsModule(location))
break;
isInExternalModule = true;
- case 225:
+ case 226:
var moduleExports = getSymbolOfNode(location).exports;
if (location.kind === 256 || ts.isAmbientModule(location)) {
if (result = moduleExports["default"]) {
@@ -20330,7 +20021,7 @@ var ts;
}
if (moduleExports[name] &&
moduleExports[name].flags === 8388608 &&
- ts.getDeclarationOfKind(moduleExports[name], 238)) {
+ ts.getDeclarationOfKind(moduleExports[name], 239)) {
break;
}
}
@@ -20338,13 +20029,13 @@ var ts;
break loop;
}
break;
- case 224:
+ case 225:
if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) {
break loop;
}
break;
+ case 146:
case 145:
- case 144:
if (ts.isClassLike(location.parent) && !(ts.getModifierFlags(location) & 32)) {
var ctor = findConstructorDeclaration(location.parent);
if (ctor && ctor.locals) {
@@ -20354,9 +20045,9 @@ var ts;
}
}
break;
- case 221:
- case 192:
case 222:
+ case 193:
+ case 223:
if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793064)) {
if (lastLocation && ts.getModifierFlags(lastLocation) & 32) {
error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters);
@@ -20364,7 +20055,7 @@ var ts;
}
break loop;
}
- if (location.kind === 192 && meaning & 32) {
+ if (location.kind === 193 && meaning & 32) {
var className = location.name;
if (className && name === className.text) {
result = location.symbol;
@@ -20372,28 +20063,28 @@ var ts;
}
}
break;
- case 140:
+ case 141:
grandparent = location.parent.parent;
- if (ts.isClassLike(grandparent) || grandparent.kind === 222) {
+ if (ts.isClassLike(grandparent) || grandparent.kind === 223) {
if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793064)) {
error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
return undefined;
}
}
break;
- case 147:
- case 146:
case 148:
+ case 147:
case 149:
case 150:
- case 220:
- case 180:
+ case 151:
+ case 221:
+ case 181:
if (meaning & 3 && name === "arguments") {
result = argumentsSymbol;
break loop;
}
break;
- case 179:
+ case 180:
if (meaning & 3 && name === "arguments") {
result = argumentsSymbol;
break loop;
@@ -20406,8 +20097,8 @@ var ts;
}
}
break;
- case 143:
- if (location.parent && location.parent.kind === 142) {
+ case 144:
+ if (location.parent && location.parent.kind === 143) {
location = location.parent;
}
if (location.parent && ts.isClassElement(location.parent)) {
@@ -20449,7 +20140,7 @@ var ts;
}
if (result && isInExternalModule && (meaning & 107455) === 107455) {
var decls = result.declarations;
- if (decls && decls.length === 1 && decls[0].kind === 228) {
+ if (decls && decls.length === 1 && decls[0].kind === 229) {
error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, name);
}
}
@@ -20457,7 +20148,7 @@ var ts;
return result;
}
function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) {
- if ((errorLocation.kind === 69 && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) {
+ if ((errorLocation.kind === 70 && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) {
return false;
}
var container = ts.getThisContainer(errorLocation, true);
@@ -20495,10 +20186,10 @@ var ts;
}
function getEntityNameForExtendingInterface(node) {
switch (node.kind) {
- case 69:
- case 172:
+ case 70:
+ case 173:
return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined;
- case 194:
+ case 195:
ts.Debug.assert(ts.isEntityNameExpression(node.expression));
return node.expression;
default:
@@ -20519,7 +20210,7 @@ var ts;
ts.Debug.assert((result.flags & 2) !== 0);
var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; });
ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined");
- if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 218), errorLocation)) {
+ if (!ts.isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 219), errorLocation)) {
error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name));
}
}
@@ -20536,10 +20227,10 @@ var ts;
}
function getAnyImportSyntax(node) {
if (ts.isAliasSymbolDeclaration(node)) {
- if (node.kind === 229) {
+ if (node.kind === 230) {
return node;
}
- while (node && node.kind !== 230) {
+ while (node && node.kind !== 231) {
node = node.parent;
}
return node;
@@ -20549,10 +20240,10 @@ var ts;
return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; });
}
function getTargetOfImportEqualsDeclaration(node) {
- if (node.moduleReference.kind === 240) {
+ if (node.moduleReference.kind === 241) {
return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)));
}
- return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node);
+ return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference);
}
function getTargetOfImportClause(node) {
var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
@@ -20610,28 +20301,28 @@ var ts;
var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier);
var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier);
if (targetSymbol) {
- var name_16 = specifier.propertyName || specifier.name;
- if (name_16.text) {
+ var name_13 = specifier.propertyName || specifier.name;
+ if (name_13.text) {
if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
return moduleSymbol;
}
var symbolFromVariable = void 0;
if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports["export="]) {
- symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name_16.text);
+ symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name_13.text);
}
else {
- symbolFromVariable = getPropertyOfVariable(targetSymbol, name_16.text);
+ symbolFromVariable = getPropertyOfVariable(targetSymbol, name_13.text);
}
symbolFromVariable = resolveSymbol(symbolFromVariable);
- var symbolFromModule = getExportOfModule(targetSymbol, name_16.text);
- if (!symbolFromModule && allowSyntheticDefaultImports && name_16.text === "default") {
+ var symbolFromModule = getExportOfModule(targetSymbol, name_13.text);
+ if (!symbolFromModule && allowSyntheticDefaultImports && name_13.text === "default") {
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol);
}
var symbol = symbolFromModule && symbolFromVariable ?
combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) :
symbolFromModule || symbolFromVariable;
if (!symbol) {
- error(name_16, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_16));
+ error(name_13, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_13));
}
return symbol;
}
@@ -20653,19 +20344,19 @@ var ts;
}
function getTargetOfAliasDeclaration(node) {
switch (node.kind) {
- case 229:
+ case 230:
return getTargetOfImportEqualsDeclaration(node);
- case 231:
- return getTargetOfImportClause(node);
case 232:
+ return getTargetOfImportClause(node);
+ case 233:
return getTargetOfNamespaceImport(node);
- case 234:
- return getTargetOfImportSpecifier(node);
- case 238:
- return getTargetOfExportSpecifier(node);
case 235:
+ return getTargetOfImportSpecifier(node);
+ case 239:
+ return getTargetOfExportSpecifier(node);
+ case 236:
return getTargetOfExportAssignment(node);
- case 228:
+ case 229:
return getTargetOfNamespaceExportDeclaration(node);
}
}
@@ -20709,10 +20400,10 @@ var ts;
links.referenced = true;
var node = getDeclarationOfAliasSymbol(symbol);
ts.Debug.assert(!!node);
- if (node.kind === 235) {
+ if (node.kind === 236) {
checkExpressionCached(node.expression);
}
- else if (node.kind === 238) {
+ else if (node.kind === 239) {
checkExpressionCached(node.propertyName || node.name);
}
else if (ts.isInternalModuleImportEqualsDeclaration(node)) {
@@ -20720,15 +20411,15 @@ var ts;
}
}
}
- function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration, dontResolveAlias) {
- if (entityName.kind === 69 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
+ function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, dontResolveAlias) {
+ if (entityName.kind === 70 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
entityName = entityName.parent;
}
- if (entityName.kind === 69 || entityName.parent.kind === 139) {
+ if (entityName.kind === 70 || entityName.parent.kind === 140) {
return resolveEntityName(entityName, 1920, false, dontResolveAlias);
}
else {
- ts.Debug.assert(entityName.parent.kind === 229);
+ ts.Debug.assert(entityName.parent.kind === 230);
return resolveEntityName(entityName, 107455 | 793064 | 1920, false, dontResolveAlias);
}
}
@@ -20740,16 +20431,16 @@ var ts;
return undefined;
}
var symbol;
- if (name.kind === 69) {
+ if (name.kind === 70) {
var message = meaning === 1920 ? ts.Diagnostics.Cannot_find_namespace_0 : ts.Diagnostics.Cannot_find_name_0;
symbol = resolveName(location || name, name.text, meaning, ignoreErrors ? undefined : message, name);
if (!symbol) {
return undefined;
}
}
- else if (name.kind === 139 || name.kind === 172) {
- var left = name.kind === 139 ? name.left : name.expression;
- var right = name.kind === 139 ? name.right : name.name;
+ else if (name.kind === 140 || name.kind === 173) {
+ var left = name.kind === 140 ? name.left : name.expression;
+ var right = name.kind === 140 ? name.right : name.name;
var namespace = resolveEntityName(left, 1920, ignoreErrors, false, location);
if (!namespace || ts.nodeIsMissing(right)) {
return undefined;
@@ -20932,7 +20623,7 @@ var ts;
var members = node.members;
for (var _i = 0, members_1 = members; _i < members_1.length; _i++) {
var member = members_1[_i];
- if (member.kind === 148 && ts.nodeIsPresent(member.body)) {
+ if (member.kind === 149 && ts.nodeIsPresent(member.body)) {
return member;
}
}
@@ -21006,7 +20697,7 @@ var ts;
if (!ts.isExternalOrCommonJsModule(location_1)) {
break;
}
- case 225:
+ case 226:
if (result = callback(getSymbolOfNode(location_1).exports)) {
return result;
}
@@ -21039,7 +20730,7 @@ var ts;
return ts.forEachProperty(symbols, function (symbolFromSymbolTable) {
if (symbolFromSymbolTable.flags & 8388608
&& symbolFromSymbolTable.name !== "export="
- && !ts.getDeclarationOfKind(symbolFromSymbolTable, 238)) {
+ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 239)) {
if (!useOnlyExternalAliasing ||
ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) {
var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
@@ -21070,7 +20761,7 @@ var ts;
if (symbolFromSymbolTable === symbol) {
return true;
}
- symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 238)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
+ symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 239)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
if (symbolFromSymbolTable.flags & meaning) {
qualify = true;
return true;
@@ -21084,10 +20775,10 @@ var ts;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
switch (declaration.kind) {
- case 145:
- case 147:
- case 149:
+ case 146:
+ case 148:
case 150:
+ case 151:
continue;
default:
return false;
@@ -21109,7 +20800,7 @@ var ts;
return {
accessibility: 1,
errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning),
- errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1920) : undefined
+ errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1920) : undefined,
};
}
return hasAccessibleDeclarations;
@@ -21130,7 +20821,7 @@ var ts;
}
return {
accessibility: 1,
- errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning)
+ errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning),
};
}
return { accessibility: 0 };
@@ -21177,11 +20868,11 @@ var ts;
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
var meaning;
- if (entityName.parent.kind === 158 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) {
+ if (entityName.parent.kind === 159 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) {
meaning = 107455 | 1048576;
}
- else if (entityName.kind === 139 || entityName.kind === 172 ||
- entityName.parent.kind === 229) {
+ else if (entityName.kind === 140 || entityName.kind === 173 ||
+ entityName.parent.kind === 230) {
meaning = 1920;
}
else {
@@ -21273,10 +20964,10 @@ var ts;
function getTypeAliasForTypeLiteral(type) {
if (type.symbol && type.symbol.flags & 2048) {
var node = type.symbol.declarations[0].parent;
- while (node.kind === 164) {
+ while (node.kind === 165) {
node = node.parent;
}
- if (node.kind === 223) {
+ if (node.kind === 224) {
return getSymbolOfNode(node);
}
}
@@ -21284,7 +20975,7 @@ var ts;
}
function isTopLevelInExternalModuleAugmentation(node) {
return node && node.parent &&
- node.parent.kind === 226 &&
+ node.parent.kind === 227 &&
ts.isExternalModuleAugmentation(node.parent.parent);
}
function literalTypeToString(type) {
@@ -21298,10 +20989,10 @@ var ts;
return ts.declarationNameToString(declaration.name);
}
switch (declaration.kind) {
- case 192:
+ case 193:
return "(Anonymous class)";
- case 179:
case 180:
+ case 181:
return "(Anonymous function)";
}
}
@@ -21315,17 +21006,17 @@ var ts;
var firstChar = symbolName.charCodeAt(0);
var needsElementAccess = !ts.isIdentifierStart(firstChar, languageVersion);
if (needsElementAccess) {
- writePunctuation(writer, 19);
+ writePunctuation(writer, 20);
if (ts.isSingleOrDoubleQuote(firstChar)) {
writer.writeStringLiteral(symbolName);
}
else {
writer.writeSymbol(symbolName, symbol);
}
- writePunctuation(writer, 20);
+ writePunctuation(writer, 21);
}
else {
- writePunctuation(writer, 21);
+ writePunctuation(writer, 22);
writer.writeSymbol(symbolName, symbol);
}
}
@@ -21401,7 +21092,7 @@ var ts;
}
else if (type.flags & 256) {
buildSymbolDisplay(getParentOfSymbol(type.symbol), writer, enclosingDeclaration, 793064, 0, nextFlags);
- writePunctuation(writer, 21);
+ writePunctuation(writer, 22);
appendSymbolNameOnly(type.symbol, writer);
}
else if (type.flags & (32768 | 65536 | 16 | 16384)) {
@@ -21422,23 +21113,23 @@ var ts;
writer.writeStringLiteral(literalTypeToString(type));
}
else {
- writePunctuation(writer, 15);
- writeSpace(writer);
- writePunctuation(writer, 22);
- writeSpace(writer);
writePunctuation(writer, 16);
+ writeSpace(writer);
+ writePunctuation(writer, 23);
+ writeSpace(writer);
+ writePunctuation(writer, 17);
}
}
function writeTypeList(types, delimiter) {
for (var i = 0; i < types.length; i++) {
if (i > 0) {
- if (delimiter !== 24) {
+ if (delimiter !== 25) {
writeSpace(writer);
}
writePunctuation(writer, delimiter);
writeSpace(writer);
}
- writeType(types[i], delimiter === 24 ? 0 : 64);
+ writeType(types[i], delimiter === 25 ? 0 : 64);
}
}
function writeSymbolTypeReference(symbol, typeArguments, pos, end, flags) {
@@ -21446,29 +21137,29 @@ var ts;
buildSymbolDisplay(symbol, writer, enclosingDeclaration, 793064, 0, flags);
}
if (pos < end) {
- writePunctuation(writer, 25);
+ writePunctuation(writer, 26);
writeType(typeArguments[pos], 256);
pos++;
while (pos < end) {
- writePunctuation(writer, 24);
+ writePunctuation(writer, 25);
writeSpace(writer);
writeType(typeArguments[pos], 0);
pos++;
}
- writePunctuation(writer, 27);
+ writePunctuation(writer, 28);
}
}
function writeTypeReference(type, flags) {
var typeArguments = type.typeArguments || emptyArray;
if (type.target === globalArrayType && !(flags & 1)) {
writeType(typeArguments[0], 64);
- writePunctuation(writer, 19);
writePunctuation(writer, 20);
+ writePunctuation(writer, 21);
}
else if (type.target.flags & 262144) {
- writePunctuation(writer, 19);
- writeTypeList(type.typeArguments.slice(0, getTypeReferenceArity(type)), 24);
writePunctuation(writer, 20);
+ writeTypeList(type.typeArguments.slice(0, getTypeReferenceArity(type)), 25);
+ writePunctuation(writer, 21);
}
else {
var outerTypeParameters = type.target.outerTypeParameters;
@@ -21483,7 +21174,7 @@ var ts;
} while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent_9);
if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) {
writeSymbolTypeReference(parent_9, typeArguments, start, i, flags);
- writePunctuation(writer, 21);
+ writePunctuation(writer, 22);
}
}
}
@@ -21493,16 +21184,16 @@ var ts;
}
function writeUnionOrIntersectionType(type, flags) {
if (flags & 64) {
- writePunctuation(writer, 17);
+ writePunctuation(writer, 18);
}
if (type.flags & 524288) {
- writeTypeList(formatUnionTypes(type.types), 47);
+ writeTypeList(formatUnionTypes(type.types), 48);
}
else {
- writeTypeList(type.types, 46);
+ writeTypeList(type.types, 47);
}
if (flags & 64) {
- writePunctuation(writer, 18);
+ writePunctuation(writer, 19);
}
}
function writeAnonymousType(type, flags) {
@@ -21520,7 +21211,7 @@ var ts;
buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793064, 0, flags);
}
else {
- writeKeyword(writer, 117);
+ writeKeyword(writer, 118);
}
}
else {
@@ -21541,7 +21232,7 @@ var ts;
var isNonLocalFunctionSymbol = !!(symbol.flags & 16) &&
(symbol.parent ||
ts.forEach(symbol.declarations, function (declaration) {
- return declaration.parent.kind === 256 || declaration.parent.kind === 226;
+ return declaration.parent.kind === 256 || declaration.parent.kind === 227;
}));
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
return !!(flags & 2) ||
@@ -21550,37 +21241,37 @@ var ts;
}
}
function writeTypeOfSymbol(type, typeFormatFlags) {
- writeKeyword(writer, 101);
+ writeKeyword(writer, 102);
writeSpace(writer);
buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455, 0, typeFormatFlags);
}
function writeIndexSignature(info, keyword) {
if (info) {
if (info.isReadonly) {
- writeKeyword(writer, 128);
+ writeKeyword(writer, 129);
writeSpace(writer);
}
- writePunctuation(writer, 19);
+ writePunctuation(writer, 20);
writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x");
- writePunctuation(writer, 54);
+ writePunctuation(writer, 55);
writeSpace(writer);
writeKeyword(writer, keyword);
- writePunctuation(writer, 20);
- writePunctuation(writer, 54);
+ writePunctuation(writer, 21);
+ writePunctuation(writer, 55);
writeSpace(writer);
writeType(info.type, 0);
- writePunctuation(writer, 23);
+ writePunctuation(writer, 24);
writer.writeLine();
}
}
function writePropertyWithModifiers(prop) {
if (isReadonlySymbol(prop)) {
- writeKeyword(writer, 128);
+ writeKeyword(writer, 129);
writeSpace(writer);
}
buildSymbolDisplay(prop, writer);
if (prop.flags & 536870912) {
- writePunctuation(writer, 53);
+ writePunctuation(writer, 54);
}
}
function shouldAddParenthesisAroundFunctionType(callSignature, flags) {
@@ -21598,53 +21289,53 @@ var ts;
var resolved = resolveStructuredTypeMembers(type);
if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) {
if (!resolved.callSignatures.length && !resolved.constructSignatures.length) {
- writePunctuation(writer, 15);
writePunctuation(writer, 16);
+ writePunctuation(writer, 17);
return;
}
if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) {
var parenthesizeSignature = shouldAddParenthesisAroundFunctionType(resolved.callSignatures[0], flags);
if (parenthesizeSignature) {
- writePunctuation(writer, 17);
+ writePunctuation(writer, 18);
}
buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, undefined, symbolStack);
if (parenthesizeSignature) {
- writePunctuation(writer, 18);
+ writePunctuation(writer, 19);
}
return;
}
if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) {
if (flags & 64) {
- writePunctuation(writer, 17);
+ writePunctuation(writer, 18);
}
- writeKeyword(writer, 92);
+ writeKeyword(writer, 93);
writeSpace(writer);
buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, undefined, symbolStack);
if (flags & 64) {
- writePunctuation(writer, 18);
+ writePunctuation(writer, 19);
}
return;
}
}
var saveInObjectTypeLiteral = inObjectTypeLiteral;
inObjectTypeLiteral = true;
- writePunctuation(writer, 15);
+ writePunctuation(writer, 16);
writer.writeLine();
writer.increaseIndent();
for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) {
var signature = _a[_i];
buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack);
- writePunctuation(writer, 23);
+ writePunctuation(writer, 24);
writer.writeLine();
}
for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) {
var signature = _c[_b];
buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, 1, symbolStack);
- writePunctuation(writer, 23);
+ writePunctuation(writer, 24);
writer.writeLine();
}
- writeIndexSignature(resolved.stringIndexInfo, 132);
- writeIndexSignature(resolved.numberIndexInfo, 130);
+ writeIndexSignature(resolved.stringIndexInfo, 133);
+ writeIndexSignature(resolved.numberIndexInfo, 131);
for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) {
var p = _e[_d];
var t = getTypeOfSymbol(p);
@@ -21654,21 +21345,21 @@ var ts;
var signature = signatures_1[_f];
writePropertyWithModifiers(p);
buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack);
- writePunctuation(writer, 23);
+ writePunctuation(writer, 24);
writer.writeLine();
}
}
else {
writePropertyWithModifiers(p);
- writePunctuation(writer, 54);
+ writePunctuation(writer, 55);
writeSpace(writer);
writeType(t, 0);
- writePunctuation(writer, 23);
+ writePunctuation(writer, 24);
writer.writeLine();
}
}
writer.decreaseIndent();
- writePunctuation(writer, 16);
+ writePunctuation(writer, 17);
inObjectTypeLiteral = saveInObjectTypeLiteral;
}
}
@@ -21683,7 +21374,7 @@ var ts;
var constraint = getConstraintOfTypeParameter(tp);
if (constraint) {
writeSpace(writer);
- writeKeyword(writer, 83);
+ writeKeyword(writer, 84);
writeSpace(writer);
buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, symbolStack);
}
@@ -21691,7 +21382,7 @@ var ts;
function buildParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack) {
var parameterNode = p.valueDeclaration;
if (ts.isRestParameter(parameterNode)) {
- writePunctuation(writer, 22);
+ writePunctuation(writer, 23);
}
if (ts.isBindingPattern(parameterNode.name)) {
buildBindingPatternDisplay(parameterNode.name, writer, enclosingDeclaration, flags, symbolStack);
@@ -21700,36 +21391,36 @@ var ts;
appendSymbolNameOnly(p, writer);
}
if (isOptionalParameter(parameterNode)) {
- writePunctuation(writer, 53);
+ writePunctuation(writer, 54);
}
- writePunctuation(writer, 54);
+ writePunctuation(writer, 55);
writeSpace(writer);
buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, symbolStack);
}
function buildBindingPatternDisplay(bindingPattern, writer, enclosingDeclaration, flags, symbolStack) {
- if (bindingPattern.kind === 167) {
- writePunctuation(writer, 15);
- buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); });
+ if (bindingPattern.kind === 168) {
writePunctuation(writer, 16);
+ buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); });
+ writePunctuation(writer, 17);
}
- else if (bindingPattern.kind === 168) {
- writePunctuation(writer, 19);
+ else if (bindingPattern.kind === 169) {
+ writePunctuation(writer, 20);
var elements = bindingPattern.elements;
buildDisplayForCommaSeparatedList(elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); });
if (elements && elements.hasTrailingComma) {
- writePunctuation(writer, 24);
+ writePunctuation(writer, 25);
}
- writePunctuation(writer, 20);
+ writePunctuation(writer, 21);
}
}
function buildBindingElementDisplay(bindingElement, writer, enclosingDeclaration, flags, symbolStack) {
if (ts.isOmittedExpression(bindingElement)) {
return;
}
- ts.Debug.assert(bindingElement.kind === 169);
+ ts.Debug.assert(bindingElement.kind === 170);
if (bindingElement.propertyName) {
writer.writeSymbol(ts.getTextOfNode(bindingElement.propertyName), bindingElement.symbol);
- writePunctuation(writer, 54);
+ writePunctuation(writer, 55);
writeSpace(writer);
}
if (ts.isBindingPattern(bindingElement.name)) {
@@ -21737,75 +21428,75 @@ var ts;
}
else {
if (bindingElement.dotDotDotToken) {
- writePunctuation(writer, 22);
+ writePunctuation(writer, 23);
}
appendSymbolNameOnly(bindingElement.symbol, writer);
}
}
function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, symbolStack) {
if (typeParameters && typeParameters.length) {
- writePunctuation(writer, 25);
+ writePunctuation(writer, 26);
buildDisplayForCommaSeparatedList(typeParameters, writer, function (p) { return buildTypeParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack); });
- writePunctuation(writer, 27);
+ writePunctuation(writer, 28);
}
}
function buildDisplayForCommaSeparatedList(list, writer, action) {
for (var i = 0; i < list.length; i++) {
if (i > 0) {
- writePunctuation(writer, 24);
+ writePunctuation(writer, 25);
writeSpace(writer);
}
action(list[i]);
}
}
- function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration, flags, symbolStack) {
+ function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration) {
if (typeParameters && typeParameters.length) {
- writePunctuation(writer, 25);
- var flags_1 = 256;
+ writePunctuation(writer, 26);
+ var flags = 256;
for (var i = 0; i < typeParameters.length; i++) {
if (i > 0) {
- writePunctuation(writer, 24);
+ writePunctuation(writer, 25);
writeSpace(writer);
- flags_1 = 0;
+ flags = 0;
}
- buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, flags_1);
+ buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, flags);
}
- writePunctuation(writer, 27);
+ writePunctuation(writer, 28);
}
}
function buildDisplayForParametersAndDelimiters(thisParameter, parameters, writer, enclosingDeclaration, flags, symbolStack) {
- writePunctuation(writer, 17);
+ writePunctuation(writer, 18);
if (thisParameter) {
buildParameterDisplay(thisParameter, writer, enclosingDeclaration, flags, symbolStack);
}
for (var i = 0; i < parameters.length; i++) {
if (i > 0 || thisParameter) {
- writePunctuation(writer, 24);
+ writePunctuation(writer, 25);
writeSpace(writer);
}
buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, symbolStack);
}
- writePunctuation(writer, 18);
+ writePunctuation(writer, 19);
}
function buildTypePredicateDisplay(predicate, writer, enclosingDeclaration, flags, symbolStack) {
if (ts.isIdentifierTypePredicate(predicate)) {
writer.writeParameter(predicate.parameterName);
}
else {
- writeKeyword(writer, 97);
+ writeKeyword(writer, 98);
}
writeSpace(writer);
- writeKeyword(writer, 124);
+ writeKeyword(writer, 125);
writeSpace(writer);
buildTypeDisplay(predicate.type, writer, enclosingDeclaration, flags, symbolStack);
}
function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) {
if (flags & 8) {
writeSpace(writer);
- writePunctuation(writer, 34);
+ writePunctuation(writer, 35);
}
else {
- writePunctuation(writer, 54);
+ writePunctuation(writer, 55);
}
writeSpace(writer);
if (signature.typePredicate) {
@@ -21818,7 +21509,7 @@ var ts;
}
function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind, symbolStack) {
if (kind === 1) {
- writeKeyword(writer, 92);
+ writeKeyword(writer, 93);
writeSpace(writer);
}
if (signature.target && (flags & 32)) {
@@ -21854,64 +21545,64 @@ var ts;
return false;
function determineIfDeclarationIsVisible() {
switch (node.kind) {
- case 169:
+ case 170:
return isDeclarationVisible(node.parent.parent);
- case 218:
+ case 219:
if (ts.isBindingPattern(node.name) &&
!node.name.elements.length) {
return false;
}
- case 225:
- case 221:
+ case 226:
case 222:
case 223:
- case 220:
case 224:
- case 229:
+ case 221:
+ case 225:
+ case 230:
if (ts.isExternalModuleAugmentation(node)) {
return true;
}
var parent_10 = getDeclarationContainer(node);
if (!(ts.getCombinedModifierFlags(node) & 1) &&
- !(node.kind !== 229 && parent_10.kind !== 256 && ts.isInAmbientContext(parent_10))) {
+ !(node.kind !== 230 && parent_10.kind !== 256 && ts.isInAmbientContext(parent_10))) {
return isGlobalSourceFile(parent_10);
}
return isDeclarationVisible(parent_10);
- case 145:
- case 144:
- case 149:
- case 150:
- case 147:
case 146:
+ case 145:
+ case 150:
+ case 151:
+ case 148:
+ case 147:
if (ts.getModifierFlags(node) & (8 | 16)) {
return false;
}
- case 148:
- case 152:
- case 151:
+ case 149:
case 153:
- case 142:
- case 226:
- case 156:
+ case 152:
+ case 154:
+ case 143:
+ case 227:
case 157:
- case 159:
- case 155:
+ case 158:
case 160:
+ case 156:
case 161:
case 162:
case 163:
case 164:
+ case 165:
return isDeclarationVisible(node.parent);
- case 231:
case 232:
- case 234:
- return false;
- case 141:
- case 256:
- case 228:
- return true;
+ case 233:
case 235:
return false;
+ case 142:
+ case 256:
+ case 229:
+ return true;
+ case 236:
+ return false;
default:
return false;
}
@@ -21919,10 +21610,10 @@ var ts;
}
function collectLinkedAliases(node) {
var exportSymbol;
- if (node.parent && node.parent.kind === 235) {
+ if (node.parent && node.parent.kind === 236) {
exportSymbol = resolveName(node.parent, node.text, 107455 | 793064 | 1920 | 8388608, ts.Diagnostics.Cannot_find_name_0, node);
}
- else if (node.parent.kind === 238) {
+ else if (node.parent.kind === 239) {
var exportSpecifier = node.parent;
exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ?
getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) :
@@ -22001,12 +21692,12 @@ var ts;
node = ts.getRootDeclaration(node);
while (node) {
switch (node.kind) {
- case 218:
case 219:
+ case 220:
+ case 235:
case 234:
case 233:
case 232:
- case 231:
node = node.parent;
break;
default:
@@ -22034,12 +21725,12 @@ var ts;
}
function getTextOfPropertyName(name) {
switch (name.kind) {
- case 69:
+ case 70:
return name.text;
case 9:
case 8:
return name.text;
- case 140:
+ case 141:
if (ts.isStringOrNumericLiteral(name.expression.kind)) {
return name.expression.text;
}
@@ -22047,7 +21738,7 @@ var ts;
return undefined;
}
function isComputedNonLiteralName(name) {
- return name.kind === 140 && !ts.isStringOrNumericLiteral(name.expression.kind);
+ return name.kind === 141 && !ts.isStringOrNumericLiteral(name.expression.kind);
}
function getTypeForBindingElement(declaration) {
var pattern = declaration.parent;
@@ -22062,20 +21753,20 @@ var ts;
return parentType;
}
var type;
- if (pattern.kind === 167) {
- var name_17 = declaration.propertyName || declaration.name;
- if (isComputedNonLiteralName(name_17)) {
+ if (pattern.kind === 168) {
+ var name_14 = declaration.propertyName || declaration.name;
+ if (isComputedNonLiteralName(name_14)) {
return anyType;
}
if (declaration.initializer) {
getContextualType(declaration.initializer);
}
- var text = getTextOfPropertyName(name_17);
+ var text = getTextOfPropertyName(name_14);
type = getTypeOfPropertyOfType(parentType, text) ||
isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1) ||
getIndexTypeOfType(parentType, 0);
if (!type) {
- error(name_17, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_17));
+ error(name_14, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_14));
return unknownType;
}
}
@@ -22118,15 +21809,15 @@ var ts;
if (typeTag && typeTag.typeExpression) {
return typeTag.typeExpression.type;
}
- if (declaration.kind === 218 &&
- declaration.parent.kind === 219 &&
- declaration.parent.parent.kind === 200) {
+ if (declaration.kind === 219 &&
+ declaration.parent.kind === 220 &&
+ declaration.parent.parent.kind === 201) {
var annotation = ts.getJSDocTypeTag(declaration.parent.parent);
if (annotation && annotation.typeExpression) {
return annotation.typeExpression.type;
}
}
- else if (declaration.kind === 142) {
+ else if (declaration.kind === 143) {
var paramTag = ts.getCorrespondingJSDocParameterTag(declaration);
if (paramTag && paramTag.typeExpression) {
return paramTag.typeExpression.type;
@@ -22134,9 +21825,13 @@ var ts;
}
return undefined;
}
- function isAutoVariableInitializer(initializer) {
- var expr = initializer && ts.skipParentheses(initializer);
- return !expr || expr.kind === 93 || expr.kind === 69 && getResolvedSymbol(expr) === undefinedSymbol;
+ function isNullOrUndefined(node) {
+ var expr = ts.skipParentheses(node);
+ return expr.kind === 94 || expr.kind === 70 && getResolvedSymbol(expr) === undefinedSymbol;
+ }
+ function isEmptyArrayLiteral(node) {
+ var expr = ts.skipParentheses(node);
+ return expr.kind === 171 && expr.elements.length === 0;
}
function addOptionality(type, optional) {
return strictNullChecks && optional ? includeFalsyTypes(type, 2048) : type;
@@ -22148,10 +21843,10 @@ var ts;
return type;
}
}
- if (declaration.parent.parent.kind === 207) {
+ if (declaration.parent.parent.kind === 208) {
return stringType;
}
- if (declaration.parent.parent.kind === 208) {
+ if (declaration.parent.parent.kind === 209) {
return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType;
}
if (ts.isBindingPattern(declaration.parent)) {
@@ -22160,15 +21855,19 @@ var ts;
if (declaration.type) {
return addOptionality(getTypeFromTypeNode(declaration.type), declaration.questionToken && includeOptionality);
}
- if (declaration.kind === 218 && !ts.isBindingPattern(declaration.name) &&
- !(ts.getCombinedNodeFlags(declaration) & 2) && !(ts.getCombinedModifierFlags(declaration) & 1) &&
- !ts.isInAmbientContext(declaration) && isAutoVariableInitializer(declaration.initializer)) {
- return autoType;
+ if (declaration.kind === 219 && !ts.isBindingPattern(declaration.name) &&
+ !(ts.getCombinedModifierFlags(declaration) & 1) && !ts.isInAmbientContext(declaration)) {
+ if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) {
+ return autoType;
+ }
+ if (declaration.initializer && isEmptyArrayLiteral(declaration.initializer)) {
+ return autoArrayType;
+ }
}
- if (declaration.kind === 142) {
+ if (declaration.kind === 143) {
var func = declaration.parent;
- if (func.kind === 150 && !ts.hasDynamicName(func)) {
- var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 149);
+ if (func.kind === 151 && !ts.hasDynamicName(func)) {
+ var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 150);
if (getter) {
var getterSignature = getSignatureFromDeclaration(getter);
var thisParameter = getAccessorThisParameter(func);
@@ -22181,8 +21880,7 @@ var ts;
}
var type = void 0;
if (declaration.symbol.name === "this") {
- var thisParameter = getContextualThisParameter(func);
- type = thisParameter ? getTypeOfSymbol(thisParameter) : undefined;
+ type = getContextualThisParameterType(func);
}
else {
type = getContextuallyTypedParameterType(declaration);
@@ -22255,7 +21953,7 @@ var ts;
return result;
}
function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) {
- return pattern.kind === 167
+ return pattern.kind === 168
? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors)
: getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors);
}
@@ -22280,7 +21978,7 @@ var ts;
}
function declarationBelongsToPrivateAmbientMember(declaration) {
var root = ts.getRootDeclaration(declaration);
- var memberDeclaration = root.kind === 142 ? root.parent : root;
+ var memberDeclaration = root.kind === 143 ? root.parent : root;
return isPrivateWithinAmbient(memberDeclaration);
}
function getTypeOfVariableOrParameterOrProperty(symbol) {
@@ -22293,7 +21991,7 @@ var ts;
if (declaration.parent.kind === 252) {
return links.type = anyType;
}
- if (declaration.kind === 235) {
+ if (declaration.kind === 236) {
return links.type = checkExpression(declaration.expression);
}
if (declaration.flags & 1048576 && declaration.kind === 280 && declaration.typeExpression) {
@@ -22303,15 +22001,15 @@ var ts;
return unknownType;
}
var type = void 0;
- if (declaration.kind === 187 ||
- declaration.kind === 172 && declaration.parent.kind === 187) {
+ if (declaration.kind === 188 ||
+ declaration.kind === 173 && declaration.parent.kind === 188) {
if (declaration.flags & 1048576) {
var typeTag = ts.getJSDocTypeTag(declaration.parent);
if (typeTag && typeTag.typeExpression) {
return links.type = getTypeFromTypeNode(typeTag.typeExpression.type);
}
}
- var declaredTypes = ts.map(symbol.declarations, function (decl) { return decl.kind === 187 ?
+ var declaredTypes = ts.map(symbol.declarations, function (decl) { return decl.kind === 188 ?
checkExpressionCached(decl.right) :
checkExpressionCached(decl.parent.right); });
type = getUnionType(declaredTypes, true);
@@ -22337,7 +22035,7 @@ var ts;
}
function getAnnotatedAccessorType(accessor) {
if (accessor) {
- if (accessor.kind === 149) {
+ if (accessor.kind === 150) {
return accessor.type && getTypeFromTypeNode(accessor.type);
}
else {
@@ -22357,8 +22055,8 @@ var ts;
function getTypeOfAccessors(symbol) {
var links = getSymbolLinks(symbol);
if (!links.type) {
- var getter = ts.getDeclarationOfKind(symbol, 149);
- var setter = ts.getDeclarationOfKind(symbol, 150);
+ var getter = ts.getDeclarationOfKind(symbol, 150);
+ var setter = ts.getDeclarationOfKind(symbol, 151);
if (getter && getter.flags & 1048576) {
var jsDocType = getTypeForVariableLikeDeclarationFromJSDocComment(getter);
if (jsDocType) {
@@ -22399,7 +22097,7 @@ var ts;
if (!popTypeResolution()) {
type = anyType;
if (compilerOptions.noImplicitAny) {
- var getter_1 = ts.getDeclarationOfKind(symbol, 149);
+ var getter_1 = ts.getDeclarationOfKind(symbol, 150);
error(getter_1, ts.Diagnostics._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, symbolToString(symbol));
}
}
@@ -22410,7 +22108,7 @@ var ts;
function getTypeOfFuncClassEnumModule(symbol) {
var links = getSymbolLinks(symbol);
if (!links.type) {
- if (symbol.valueDeclaration.kind === 225 && ts.isShorthandAmbientModuleSymbol(symbol)) {
+ if (symbol.valueDeclaration.kind === 226 && ts.isShorthandAmbientModuleSymbol(symbol)) {
links.type = anyType;
}
else {
@@ -22495,9 +22193,9 @@ var ts;
if (!node) {
return typeParameters;
}
- if (node.kind === 221 || node.kind === 192 ||
- node.kind === 220 || node.kind === 179 ||
- node.kind === 147 || node.kind === 180) {
+ if (node.kind === 222 || node.kind === 193 ||
+ node.kind === 221 || node.kind === 180 ||
+ node.kind === 148 || node.kind === 181) {
var declarations = node.typeParameters;
if (declarations) {
return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations);
@@ -22506,15 +22204,15 @@ var ts;
}
}
function getOuterTypeParametersOfClassOrInterface(symbol) {
- var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 222);
+ var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 223);
return appendOuterTypeParameters(undefined, declaration);
}
function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) {
var result;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var node = _a[_i];
- if (node.kind === 222 || node.kind === 221 ||
- node.kind === 192 || node.kind === 223) {
+ if (node.kind === 223 || node.kind === 222 ||
+ node.kind === 193 || node.kind === 224) {
var declaration = node;
if (declaration.typeParameters) {
result = appendTypeParameters(result, declaration.typeParameters);
@@ -22640,7 +22338,7 @@ var ts;
type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray;
for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 222 && ts.getInterfaceBaseTypeNodes(declaration)) {
+ if (declaration.kind === 223 && ts.getInterfaceBaseTypeNodes(declaration)) {
for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) {
var node = _c[_b];
var baseType = getTypeFromTypeNode(node);
@@ -22669,7 +22367,7 @@ var ts;
function isIndependentInterface(symbol) {
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 222) {
+ if (declaration.kind === 223) {
if (declaration.flags & 64) {
return false;
}
@@ -22731,7 +22429,7 @@ var ts;
}
}
else {
- declaration = ts.getDeclarationOfKind(symbol, 223);
+ declaration = ts.getDeclarationOfKind(symbol, 224);
type = getTypeFromTypeNode(declaration.type, symbol, typeParameters);
}
if (popTypeResolution()) {
@@ -22755,14 +22453,14 @@ var ts;
return !ts.isInAmbientContext(member);
}
return expr.kind === 8 ||
- expr.kind === 185 && expr.operator === 36 &&
+ expr.kind === 186 && expr.operator === 37 &&
expr.operand.kind === 8 ||
- expr.kind === 69 && !!symbol.exports[expr.text];
+ expr.kind === 70 && !!symbol.exports[expr.text];
}
function enumHasLiteralMembers(symbol) {
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 224) {
+ if (declaration.kind === 225) {
for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
var member = _c[_b];
if (!isLiteralEnumMember(symbol, member)) {
@@ -22790,7 +22488,7 @@ var ts;
var memberTypes = ts.createMap();
for (var _i = 0, _a = enumType.symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 224) {
+ if (declaration.kind === 225) {
computeEnumMemberValues(declaration);
for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
var member = _c[_b];
@@ -22828,7 +22526,7 @@ var ts;
if (!links.declaredType) {
var type = createType(16384);
type.symbol = symbol;
- if (!ts.getDeclarationOfKind(symbol, 141).constraint) {
+ if (!ts.getDeclarationOfKind(symbol, 142).constraint) {
type.constraint = noConstraintType;
}
links.declaredType = type;
@@ -22877,20 +22575,20 @@ var ts;
}
function isIndependentType(node) {
switch (node.kind) {
- case 117:
- case 132:
- case 130:
- case 120:
+ case 118:
case 133:
- case 103:
- case 135:
- case 93:
- case 127:
- case 166:
+ case 131:
+ case 121:
+ case 134:
+ case 104:
+ case 136:
+ case 94:
+ case 128:
+ case 167:
return true;
- case 160:
+ case 161:
return isIndependentType(node.elementType);
- case 155:
+ case 156:
return isIndependentTypeReference(node);
}
return false;
@@ -22899,7 +22597,7 @@ var ts;
return node.type && isIndependentType(node.type) || !node.type && !node.initializer;
}
function isIndependentFunctionLikeDeclaration(node) {
- if (node.kind !== 148 && (!node.type || !isIndependentType(node.type))) {
+ if (node.kind !== 149 && (!node.type || !isIndependentType(node.type))) {
return false;
}
for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
@@ -22915,12 +22613,12 @@ var ts;
var declaration = symbol.declarations[0];
if (declaration) {
switch (declaration.kind) {
- case 145:
- case 144:
- return isIndependentVariableLikeDeclaration(declaration);
- case 147:
case 146:
+ case 145:
+ return isIndependentVariableLikeDeclaration(declaration);
case 148:
+ case 147:
+ case 149:
return isIndependentFunctionLikeDeclaration(declaration);
}
}
@@ -23486,7 +23184,7 @@ var ts;
return false;
}
function createTypePredicateFromTypePredicateNode(node) {
- if (node.parameterName.kind === 69) {
+ if (node.parameterName.kind === 70) {
var parameterName = node.parameterName;
return {
kind: 1,
@@ -23525,7 +23223,7 @@ var ts;
else {
parameters.push(paramSymbol);
}
- if (param.type && param.type.kind === 166) {
+ if (param.type && param.type.kind === 167) {
hasLiteralTypes = true;
}
if (param.initializer || param.questionToken || param.dotDotDotToken || isJSDocOptionalParameter(param)) {
@@ -23537,10 +23235,10 @@ var ts;
minArgumentCount = -1;
}
}
- if ((declaration.kind === 149 || declaration.kind === 150) &&
+ if ((declaration.kind === 150 || declaration.kind === 151) &&
!ts.hasDynamicName(declaration) &&
(!hasThisParameter || !thisParameter)) {
- var otherKind = declaration.kind === 149 ? 150 : 149;
+ var otherKind = declaration.kind === 150 ? 151 : 150;
var other = ts.getDeclarationOfKind(declaration.symbol, otherKind);
if (other) {
thisParameter = getAnnotatedAccessorThisParameter(other);
@@ -23552,24 +23250,21 @@ var ts;
if (isJSConstructSignature) {
minArgumentCount--;
}
- if (!thisParameter && ts.isObjectLiteralMethod(declaration)) {
- thisParameter = getContextualThisParameter(declaration);
- }
- var classType = declaration.kind === 148 ?
+ var classType = declaration.kind === 149 ?
getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol))
: undefined;
var typeParameters = classType ? classType.localTypeParameters :
declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) :
getTypeParametersFromJSDocTemplate(declaration);
- var returnType = getSignatureReturnTypeFromDeclaration(declaration, minArgumentCount, isJSConstructSignature, classType);
- var typePredicate = declaration.type && declaration.type.kind === 154 ?
+ var returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType);
+ var typePredicate = declaration.type && declaration.type.kind === 155 ?
createTypePredicateFromTypePredicateNode(declaration.type) :
undefined;
links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, ts.hasRestParameter(declaration), hasLiteralTypes);
}
return links.resolvedSignature;
}
- function getSignatureReturnTypeFromDeclaration(declaration, minArgumentCount, isJSConstructSignature, classType) {
+ function getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType) {
if (isJSConstructSignature) {
return getTypeFromTypeNode(declaration.parameters[0].type);
}
@@ -23585,8 +23280,8 @@ var ts;
return type;
}
}
- if (declaration.kind === 149 && !ts.hasDynamicName(declaration)) {
- var setter = ts.getDeclarationOfKind(declaration.symbol, 150);
+ if (declaration.kind === 150 && !ts.hasDynamicName(declaration)) {
+ var setter = ts.getDeclarationOfKind(declaration.symbol, 151);
return getAnnotatedAccessorType(setter);
}
if (ts.nodeIsMissing(declaration.body)) {
@@ -23600,19 +23295,19 @@ var ts;
for (var i = 0, len = symbol.declarations.length; i < len; i++) {
var node = symbol.declarations[i];
switch (node.kind) {
- case 156:
case 157:
- case 220:
- case 147:
- case 146:
+ case 158:
+ case 221:
case 148:
- case 151:
+ case 147:
+ case 149:
case 152:
case 153:
- case 149:
+ case 154:
case 150:
- case 179:
+ case 151:
case 180:
+ case 181:
case 269:
if (i > 0 && node.body) {
var previous = symbol.declarations[i - 1];
@@ -23693,7 +23388,7 @@ var ts;
}
function getOrCreateTypeFromSignature(signature) {
if (!signature.isolatedSignatureType) {
- var isConstructor = signature.declaration.kind === 148 || signature.declaration.kind === 152;
+ var isConstructor = signature.declaration.kind === 149 || signature.declaration.kind === 153;
var type = createObjectType(2097152);
type.members = emptySymbols;
type.properties = emptyArray;
@@ -23707,7 +23402,7 @@ var ts;
return symbol.members["__index"];
}
function getIndexDeclarationOfSymbol(symbol, kind) {
- var syntaxKind = kind === 1 ? 130 : 132;
+ var syntaxKind = kind === 1 ? 131 : 133;
var indexSymbol = getIndexSymbol(symbol);
if (indexSymbol) {
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
@@ -23734,7 +23429,7 @@ var ts;
return undefined;
}
function getConstraintDeclaration(type) {
- return ts.getDeclarationOfKind(type.symbol, 141).constraint;
+ return ts.getDeclarationOfKind(type.symbol, 142).constraint;
}
function hasConstraintReferenceTo(type, target) {
var checked;
@@ -23767,7 +23462,7 @@ var ts;
return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint;
}
function getParentSymbolOfTypeParameter(typeParameter) {
- return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 141).parent);
+ return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 142).parent);
}
function getTypeListId(types) {
var result = "";
@@ -23867,11 +23562,11 @@ var ts;
}
function getTypeReferenceName(node) {
switch (node.kind) {
- case 155:
+ case 156:
return node.typeName;
case 267:
return node.name;
- case 194:
+ case 195:
var expr = node.expression;
if (ts.isEntityNameExpression(expr)) {
return expr;
@@ -23879,7 +23574,7 @@ var ts;
}
return undefined;
}
- function resolveTypeReferenceName(node, typeReferenceName) {
+ function resolveTypeReferenceName(typeReferenceName) {
if (!typeReferenceName) {
return unknownSymbol;
}
@@ -23907,11 +23602,11 @@ var ts;
var type = void 0;
if (node.kind === 267) {
var typeReferenceName = getTypeReferenceName(node);
- symbol = resolveTypeReferenceName(node, typeReferenceName);
+ symbol = resolveTypeReferenceName(typeReferenceName);
type = getTypeReferenceType(node, symbol);
}
else {
- var typeNameOrExpression = node.kind === 155
+ var typeNameOrExpression = node.kind === 156
? node.typeName
: ts.isEntityNameExpression(node.expression)
? node.expression
@@ -23940,9 +23635,9 @@ var ts;
for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) {
var declaration = declarations_3[_i];
switch (declaration.kind) {
- case 221:
case 222:
- case 224:
+ case 223:
+ case 225:
return declaration;
}
}
@@ -24317,9 +24012,9 @@ var ts;
function getThisType(node) {
var container = ts.getThisContainer(node, false);
var parent = container && container.parent;
- if (parent && (ts.isClassLike(parent) || parent.kind === 222)) {
+ if (parent && (ts.isClassLike(parent) || parent.kind === 223)) {
if (!(ts.getModifierFlags(container) & 32) &&
- (container.kind !== 148 || ts.isNodeDescendantOf(node, container.body))) {
+ (container.kind !== 149 || ts.isNodeDescendantOf(node, container.body))) {
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType;
}
}
@@ -24338,25 +24033,25 @@ var ts;
}
function getTypeFromTypeNode(node, aliasSymbol, aliasTypeArguments) {
switch (node.kind) {
- case 117:
+ case 118:
case 258:
case 259:
return anyType;
- case 132:
- return stringType;
- case 130:
- return numberType;
- case 120:
- return booleanType;
case 133:
+ return stringType;
+ case 131:
+ return numberType;
+ case 121:
+ return booleanType;
+ case 134:
return esSymbolType;
- case 103:
+ case 104:
return voidType;
- case 135:
+ case 136:
return undefinedType;
- case 93:
+ case 94:
return nullType;
- case 127:
+ case 128:
return neverType;
case 283:
return nullType;
@@ -24364,33 +24059,33 @@ var ts;
return undefinedType;
case 285:
return neverType;
- case 165:
- case 97:
- return getTypeFromThisTypeNode(node);
case 166:
+ case 98:
+ return getTypeFromThisTypeNode(node);
+ case 167:
return getTypeFromLiteralTypeNode(node);
case 282:
return getTypeFromLiteralTypeNode(node.literal);
- case 155:
+ case 156:
case 267:
return getTypeFromTypeReference(node);
- case 154:
+ case 155:
return booleanType;
- case 194:
+ case 195:
return getTypeFromTypeReference(node);
- case 158:
+ case 159:
return getTypeFromTypeQueryNode(node);
- case 160:
+ case 161:
case 260:
return getTypeFromArrayTypeNode(node);
- case 161:
- return getTypeFromTupleTypeNode(node);
case 162:
+ return getTypeFromTupleTypeNode(node);
+ case 163:
case 261:
return getTypeFromUnionTypeNode(node, aliasSymbol, aliasTypeArguments);
- case 163:
- return getTypeFromIntersectionTypeNode(node, aliasSymbol, aliasTypeArguments);
case 164:
+ return getTypeFromIntersectionTypeNode(node, aliasSymbol, aliasTypeArguments);
+ case 165:
case 263:
case 264:
case 271:
@@ -24399,14 +24094,14 @@ var ts;
return getTypeFromTypeNode(node.type);
case 265:
return getTypeFromTypeNode(node.literal);
- case 156:
case 157:
- case 159:
+ case 158:
+ case 160:
case 281:
case 269:
return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node, aliasSymbol, aliasTypeArguments);
- case 69:
- case 139:
+ case 70:
+ case 140:
var symbol = getSymbolAtLocation(node);
return symbol && getDeclaredTypeOfSymbol(symbol);
case 262:
@@ -24562,23 +24257,23 @@ var ts;
var node = symbol.declarations[0].parent;
while (node) {
switch (node.kind) {
- case 156:
case 157:
- case 220:
- case 147:
- case 146:
+ case 158:
+ case 221:
case 148:
- case 151:
+ case 147:
+ case 149:
case 152:
case 153:
- case 149:
+ case 154:
case 150:
- case 179:
+ case 151:
case 180:
- case 221:
- case 192:
+ case 181:
case 222:
+ case 193:
case 223:
+ case 224:
var declaration = node;
if (declaration.typeParameters) {
for (var _i = 0, _a = declaration.typeParameters; _i < _a.length; _i++) {
@@ -24588,14 +24283,14 @@ var ts;
}
}
}
- if (ts.isClassLike(node) || node.kind === 222) {
+ if (ts.isClassLike(node) || node.kind === 223) {
var thisType = getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
if (thisType && ts.contains(mappedTypes, thisType)) {
return true;
}
}
break;
- case 225:
+ case 226:
case 256:
return false;
}
@@ -24630,35 +24325,43 @@ var ts;
return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration);
}
function isContextSensitive(node) {
- ts.Debug.assert(node.kind !== 147 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 148 || ts.isObjectLiteralMethod(node));
switch (node.kind) {
- case 179:
case 180:
+ case 181:
return isContextSensitiveFunctionLikeDeclaration(node);
- case 171:
+ case 172:
return ts.forEach(node.properties, isContextSensitive);
- case 170:
+ case 171:
return ts.forEach(node.elements, isContextSensitive);
- case 188:
+ case 189:
return isContextSensitive(node.whenTrue) ||
isContextSensitive(node.whenFalse);
- case 187:
- return node.operatorToken.kind === 52 &&
+ case 188:
+ return node.operatorToken.kind === 53 &&
(isContextSensitive(node.left) || isContextSensitive(node.right));
case 253:
return isContextSensitive(node.initializer);
+ case 148:
case 147:
- case 146:
return isContextSensitiveFunctionLikeDeclaration(node);
- case 178:
+ case 179:
return isContextSensitive(node.expression);
}
return false;
}
function isContextSensitiveFunctionLikeDeclaration(node) {
- var areAllParametersUntyped = !ts.forEach(node.parameters, function (p) { return p.type; });
- var isNullaryArrow = node.kind === 180 && !node.parameters.length;
- return !node.typeParameters && areAllParametersUntyped && !isNullaryArrow;
+ if (node.typeParameters) {
+ return false;
+ }
+ if (ts.forEach(node.parameters, function (p) { return !p.type; })) {
+ return true;
+ }
+ if (node.kind === 181) {
+ return false;
+ }
+ var parameter = ts.firstOrUndefined(node.parameters);
+ return !(parameter && ts.parameterIsThisKeyword(parameter));
}
function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
return (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func);
@@ -25078,8 +24781,8 @@ var ts;
}
if (source.flags & 524288 && target.flags & 524288 ||
source.flags & 1048576 && target.flags & 1048576) {
- if (result = eachTypeRelatedToSomeType(source, target, false)) {
- if (result &= eachTypeRelatedToSomeType(target, source, false)) {
+ if (result = eachTypeRelatedToSomeType(source, target)) {
+ if (result &= eachTypeRelatedToSomeType(target, source)) {
return result;
}
}
@@ -25130,7 +24833,7 @@ var ts;
}
return false;
}
- function eachTypeRelatedToSomeType(source, target, reportErrors) {
+ function eachTypeRelatedToSomeType(source, target) {
var result = -1;
var sourceTypes = source.types;
for (var _i = 0, sourceTypes_1 = sourceTypes; _i < sourceTypes_1.length; _i++) {
@@ -25727,7 +25430,7 @@ var ts;
type.flags & 64 ? numberType :
type.flags & 128 ? booleanType :
type.flags & 256 ? type.baseType :
- type.flags & 524288 && !(type.flags & 16) ? getUnionType(ts.map(type.types, getBaseTypeOfLiteralType)) :
+ type.flags & 524288 && !(type.flags & 16) ? getUnionType(ts.sameMap(type.types, getBaseTypeOfLiteralType)) :
type;
}
function getWidenedLiteralType(type) {
@@ -25735,7 +25438,7 @@ var ts;
type.flags & 64 && type.flags & 16777216 ? numberType :
type.flags & 128 ? booleanType :
type.flags & 256 ? type.baseType :
- type.flags & 524288 && !(type.flags & 16) ? getUnionType(ts.map(type.types, getWidenedLiteralType)) :
+ type.flags & 524288 && !(type.flags & 16) ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) :
type;
}
function isTupleType(type) {
@@ -25846,10 +25549,10 @@ var ts;
return getWidenedTypeOfObjectLiteral(type);
}
if (type.flags & 524288) {
- return getUnionType(ts.map(type.types, getWidenedConstituentType));
+ return getUnionType(ts.sameMap(type.types, getWidenedConstituentType));
}
if (isArrayType(type) || isTupleType(type)) {
- return createTypeReference(type.target, ts.map(type.typeArguments, getWidenedType));
+ return createTypeReference(type.target, ts.sameMap(type.typeArguments, getWidenedType));
}
}
return type;
@@ -25890,25 +25593,25 @@ var ts;
var typeAsString = typeToString(getWidenedType(type));
var diagnostic;
switch (declaration.kind) {
+ case 146:
case 145:
- case 144:
diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type;
break;
- case 142:
+ case 143:
diagnostic = declaration.dotDotDotToken ?
ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type :
ts.Diagnostics.Parameter_0_implicitly_has_an_1_type;
break;
- case 169:
+ case 170:
diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type;
break;
- case 220:
+ case 221:
+ case 148:
case 147:
- case 146:
- case 149:
case 150:
- case 179:
+ case 151:
case 180:
+ case 181:
if (!declaration.name) {
error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
return;
@@ -25953,7 +25656,7 @@ var ts;
signature: signature,
inferUnionTypes: inferUnionTypes,
inferences: inferences,
- inferredTypes: new Array(signature.typeParameters.length)
+ inferredTypes: new Array(signature.typeParameters.length),
};
}
function createTypeInferencesObject() {
@@ -25961,7 +25664,7 @@ var ts;
primary: undefined,
secondary: undefined,
topLevel: true,
- isFixed: false
+ isFixed: false,
};
}
function couldContainTypeParameters(type) {
@@ -26202,7 +25905,7 @@ var ts;
var widenLiteralTypes = context.inferences[index].topLevel &&
!hasPrimitiveConstraint(signature.typeParameters[index]) &&
(context.inferences[index].isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), signature.typeParameters[index]));
- var baseInferences = widenLiteralTypes ? ts.map(inferences, getWidenedLiteralType) : inferences;
+ var baseInferences = widenLiteralTypes ? ts.sameMap(inferences, getWidenedLiteralType) : inferences;
var unionOrSuperType = context.inferUnionTypes ? getUnionType(baseInferences, true) : getCommonSupertype(baseInferences);
inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : unknownType;
inferenceSucceeded = !!unionOrSuperType;
@@ -26243,10 +25946,10 @@ var ts;
function isInTypeQuery(node) {
while (node) {
switch (node.kind) {
- case 158:
+ case 159:
return true;
- case 69:
- case 139:
+ case 70:
+ case 140:
node = node.parent;
continue;
default:
@@ -26256,14 +25959,14 @@ var ts;
ts.Debug.fail("should not get here");
}
function getFlowCacheKey(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
var symbol = getResolvedSymbol(node);
return symbol !== unknownSymbol ? "" + getSymbolId(symbol) : undefined;
}
- if (node.kind === 97) {
+ if (node.kind === 98) {
return "0";
}
- if (node.kind === 172) {
+ if (node.kind === 173) {
var key = getFlowCacheKey(node.expression);
return key && key + "." + node.name.text;
}
@@ -26271,31 +25974,31 @@ var ts;
}
function getLeftmostIdentifierOrThis(node) {
switch (node.kind) {
- case 69:
- case 97:
+ case 70:
+ case 98:
return node;
- case 172:
+ case 173:
return getLeftmostIdentifierOrThis(node.expression);
}
return undefined;
}
function isMatchingReference(source, target) {
switch (source.kind) {
- case 69:
- return target.kind === 69 && getResolvedSymbol(source) === getResolvedSymbol(target) ||
- (target.kind === 218 || target.kind === 169) &&
+ case 70:
+ return target.kind === 70 && getResolvedSymbol(source) === getResolvedSymbol(target) ||
+ (target.kind === 219 || target.kind === 170) &&
getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
- case 97:
- return target.kind === 97;
- case 172:
- return target.kind === 172 &&
+ case 98:
+ return target.kind === 98;
+ case 173:
+ return target.kind === 173 &&
source.name.text === target.name.text &&
isMatchingReference(source.expression, target.expression);
}
return false;
}
function containsMatchingReference(source, target) {
- while (source.kind === 172) {
+ while (source.kind === 173) {
source = source.expression;
if (isMatchingReference(source, target)) {
return true;
@@ -26304,15 +26007,15 @@ var ts;
return false;
}
function containsMatchingReferenceDiscriminant(source, target) {
- return target.kind === 172 &&
+ return target.kind === 173 &&
containsMatchingReference(source, target.expression) &&
isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.text);
}
function getDeclaredTypeOfReference(expr) {
- if (expr.kind === 69) {
+ if (expr.kind === 70) {
return getTypeOfSymbol(getResolvedSymbol(expr));
}
- if (expr.kind === 172) {
+ if (expr.kind === 173) {
var type = getDeclaredTypeOfReference(expr.expression);
return type && getTypeOfPropertyOfType(type, expr.name.text);
}
@@ -26342,7 +26045,7 @@ var ts;
}
}
}
- if (callExpression.expression.kind === 172 &&
+ if (callExpression.expression.kind === 173 &&
isOrContainsMatchingReference(reference, callExpression.expression.expression)) {
return true;
}
@@ -26468,7 +26171,7 @@ var ts;
return createArrayType(checkIteratedTypeOrElementType(type, undefined, false) || unknownType);
}
function getAssignedTypeOfBinaryExpression(node) {
- return node.parent.kind === 170 || node.parent.kind === 253 ?
+ return node.parent.kind === 171 || node.parent.kind === 253 ?
getTypeWithDefault(getAssignedType(node), node.right) :
checkExpression(node.right);
}
@@ -26487,17 +26190,17 @@ var ts;
function getAssignedType(node) {
var parent = node.parent;
switch (parent.kind) {
- case 207:
- return stringType;
case 208:
+ return stringType;
+ case 209:
return checkRightHandSideOfForOf(parent.expression) || unknownType;
- case 187:
+ case 188:
return getAssignedTypeOfBinaryExpression(parent);
- case 181:
+ case 182:
return undefinedType;
- case 170:
+ case 171:
return getAssignedTypeOfArrayLiteralElement(parent, node);
- case 191:
+ case 192:
return getAssignedTypeOfSpreadElement(parent);
case 253:
return getAssignedTypeOfPropertyAssignment(parent);
@@ -26509,7 +26212,7 @@ var ts;
function getInitialTypeOfBindingElement(node) {
var pattern = node.parent;
var parentType = getInitialType(pattern.parent);
- var type = pattern.kind === 167 ?
+ var type = pattern.kind === 168 ?
getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) :
!node.dotDotDotToken ?
getTypeOfDestructuredArrayElement(parentType, ts.indexOf(pattern.elements, node)) :
@@ -26524,38 +26227,51 @@ var ts;
if (node.initializer) {
return getTypeOfInitializer(node.initializer);
}
- if (node.parent.parent.kind === 207) {
+ if (node.parent.parent.kind === 208) {
return stringType;
}
- if (node.parent.parent.kind === 208) {
+ if (node.parent.parent.kind === 209) {
return checkRightHandSideOfForOf(node.parent.parent.expression) || unknownType;
}
return unknownType;
}
function getInitialType(node) {
- return node.kind === 218 ?
+ return node.kind === 219 ?
getInitialTypeOfVariableDeclaration(node) :
getInitialTypeOfBindingElement(node);
}
function getInitialOrAssignedType(node) {
- return node.kind === 218 || node.kind === 169 ?
+ return node.kind === 219 || node.kind === 170 ?
getInitialType(node) :
getAssignedType(node);
}
+ function isEmptyArrayAssignment(node) {
+ return node.kind === 219 && node.initializer &&
+ isEmptyArrayLiteral(node.initializer) ||
+ node.kind !== 170 && node.parent.kind === 188 &&
+ isEmptyArrayLiteral(node.parent.right);
+ }
function getReferenceCandidate(node) {
switch (node.kind) {
- case 178:
+ case 179:
return getReferenceCandidate(node.expression);
- case 187:
+ case 188:
switch (node.operatorToken.kind) {
- case 56:
+ case 57:
return getReferenceCandidate(node.left);
- case 24:
+ case 25:
return getReferenceCandidate(node.right);
}
}
return node;
}
+ function getReferenceRoot(node) {
+ var parent = node.parent;
+ return parent.kind === 179 ||
+ parent.kind === 188 && parent.operatorToken.kind === 57 && parent.left === node ||
+ parent.kind === 188 && parent.operatorToken.kind === 25 && parent.right === node ?
+ getReferenceRoot(parent) : node;
+ }
function getTypeOfSwitchClause(clause) {
if (clause.kind === 249) {
var caseType = getRegularTypeOfLiteralType(checkExpression(clause.expression));
@@ -26626,24 +26342,88 @@ var ts;
function createFlowType(type, incomplete) {
return incomplete ? { flags: 0, type: type } : type;
}
+ function createEvolvingArrayType(elementType) {
+ var result = createObjectType(2097152);
+ result.elementType = elementType;
+ return result;
+ }
+ function getEvolvingArrayType(elementType) {
+ return evolvingArrayTypes[elementType.id] || (evolvingArrayTypes[elementType.id] = createEvolvingArrayType(elementType));
+ }
+ function addEvolvingArrayElementType(evolvingArrayType, node) {
+ var elementType = getBaseTypeOfLiteralType(checkExpression(node));
+ return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType]));
+ }
+ function isEvolvingArrayType(type) {
+ return !!(type.flags & 2097152 && type.elementType);
+ }
+ function createFinalArrayType(elementType) {
+ return elementType.flags & 8192 ?
+ autoArrayType :
+ createArrayType(elementType.flags & 524288 ?
+ getUnionType(elementType.types, true) :
+ elementType);
+ }
+ function getFinalArrayType(evolvingArrayType) {
+ return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType));
+ }
+ function finalizeEvolvingArrayType(type) {
+ return isEvolvingArrayType(type) ? getFinalArrayType(type) : type;
+ }
+ function getElementTypeOfEvolvingArrayType(type) {
+ return isEvolvingArrayType(type) ? type.elementType : neverType;
+ }
+ function isEvolvingArrayTypeList(types) {
+ var hasEvolvingArrayType = false;
+ for (var _i = 0, types_12 = types; _i < types_12.length; _i++) {
+ var t = types_12[_i];
+ if (!(t.flags & 8192)) {
+ if (!isEvolvingArrayType(t)) {
+ return false;
+ }
+ hasEvolvingArrayType = true;
+ }
+ }
+ return hasEvolvingArrayType;
+ }
+ function getUnionOrEvolvingArrayType(types, subtypeReduction) {
+ return isEvolvingArrayTypeList(types) ?
+ getEvolvingArrayType(getUnionType(ts.map(types, getElementTypeOfEvolvingArrayType))) :
+ getUnionType(ts.sameMap(types, finalizeEvolvingArrayType), subtypeReduction);
+ }
+ function isEvolvingArrayOperationTarget(node) {
+ var root = getReferenceRoot(node);
+ var parent = root.parent;
+ var isLengthPushOrUnshift = parent.kind === 173 && (parent.name.text === "length" ||
+ parent.parent.kind === 175 && ts.isPushOrUnshiftIdentifier(parent.name));
+ var isElementAssignment = parent.kind === 174 &&
+ parent.expression === root &&
+ parent.parent.kind === 188 &&
+ parent.parent.operatorToken.kind === 57 &&
+ parent.parent.left === parent &&
+ !ts.isAssignmentTarget(parent.parent) &&
+ isTypeAnyOrAllConstituentTypesHaveKind(checkExpression(parent.argumentExpression), 340 | 2048);
+ return isLengthPushOrUnshift || isElementAssignment;
+ }
function getFlowTypeOfReference(reference, declaredType, assumeInitialized, flowContainer) {
var key;
if (!reference.flowNode || assumeInitialized && !(declaredType.flags & 4178943)) {
return declaredType;
}
var initialType = assumeInitialized ? declaredType :
- declaredType === autoType ? undefinedType :
+ declaredType === autoType || declaredType === autoArrayType ? undefinedType :
includeFalsyTypes(declaredType, 2048);
var visitedFlowStart = visitedFlowCount;
- var result = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode));
+ var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode));
visitedFlowCount = visitedFlowStart;
- if (reference.parent.kind === 196 && getTypeWithFacts(result, 524288).flags & 8192) {
+ var resultType = isEvolvingArrayType(evolvedType) && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType);
+ if (reference.parent.kind === 197 && getTypeWithFacts(resultType, 524288).flags & 8192) {
return declaredType;
}
- return result;
+ return resultType;
function getTypeAtFlowNode(flow) {
while (true) {
- if (flow.flags & 512) {
+ if (flow.flags & 1024) {
for (var i = visitedFlowStart; i < visitedFlowCount; i++) {
if (visitedFlowNodes[i] === flow) {
return visitedFlowTypes[i];
@@ -26673,18 +26453,25 @@ var ts;
getTypeAtFlowBranchLabel(flow) :
getTypeAtFlowLoopLabel(flow);
}
+ else if (flow.flags & 256) {
+ type = getTypeAtFlowArrayMutation(flow);
+ if (!type) {
+ flow = flow.antecedent;
+ continue;
+ }
+ }
else if (flow.flags & 2) {
var container = flow.container;
- if (container && container !== flowContainer && reference.kind !== 172) {
+ if (container && container !== flowContainer && reference.kind !== 173) {
flow = container.flowNode;
continue;
}
type = initialType;
}
else {
- type = declaredType;
+ type = convertAutoToAny(declaredType);
}
- if (flow.flags & 512) {
+ if (flow.flags & 1024) {
visitedFlowNodes[visitedFlowCount] = flow;
visitedFlowTypes[visitedFlowCount] = type;
visitedFlowCount++;
@@ -26695,30 +26482,70 @@ var ts;
function getTypeAtFlowAssignment(flow) {
var node = flow.node;
if (isMatchingReference(reference, node)) {
- if (node.parent.kind === 185 || node.parent.kind === 186) {
+ if (node.parent.kind === 186 || node.parent.kind === 187) {
var flowType = getTypeAtFlowNode(flow.antecedent);
return createFlowType(getBaseTypeOfLiteralType(getTypeFromFlowType(flowType)), isIncomplete(flowType));
}
- return declaredType === autoType ? getBaseTypeOfLiteralType(getInitialOrAssignedType(node)) :
- declaredType.flags & 524288 ? getAssignmentReducedType(declaredType, getInitialOrAssignedType(node)) :
- declaredType;
+ if (declaredType === autoType || declaredType === autoArrayType) {
+ if (isEmptyArrayAssignment(node)) {
+ return getEvolvingArrayType(neverType);
+ }
+ var assignedType = getBaseTypeOfLiteralType(getInitialOrAssignedType(node));
+ return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
+ }
+ if (declaredType.flags & 524288) {
+ return getAssignmentReducedType(declaredType, getInitialOrAssignedType(node));
+ }
+ return declaredType;
}
if (containsMatchingReference(reference, node)) {
return declaredType;
}
return undefined;
}
+ function getTypeAtFlowArrayMutation(flow) {
+ var node = flow.node;
+ var expr = node.kind === 175 ?
+ node.expression.expression :
+ node.left.expression;
+ if (isMatchingReference(reference, getReferenceCandidate(expr))) {
+ var flowType = getTypeAtFlowNode(flow.antecedent);
+ var type = getTypeFromFlowType(flowType);
+ if (isEvolvingArrayType(type)) {
+ var evolvedType_1 = type;
+ if (node.kind === 175) {
+ for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) {
+ var arg = _a[_i];
+ evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg);
+ }
+ }
+ else {
+ var indexType = checkExpression(node.left.argumentExpression);
+ if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 340 | 2048)) {
+ evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, node.right);
+ }
+ }
+ return evolvedType_1 === type ? flowType : createFlowType(evolvedType_1, isIncomplete(flowType));
+ }
+ return flowType;
+ }
+ return undefined;
+ }
function getTypeAtFlowCondition(flow) {
var flowType = getTypeAtFlowNode(flow.antecedent);
var type = getTypeFromFlowType(flowType);
- if (!(type.flags & 8192)) {
- var assumeTrue = (flow.flags & 32) !== 0;
- type = narrowType(type, flow.expression, assumeTrue);
- if (type.flags & 8192 && isIncomplete(flowType)) {
- type = silentNeverType;
- }
+ if (type.flags & 8192) {
+ return flowType;
}
- return createFlowType(type, isIncomplete(flowType));
+ var assumeTrue = (flow.flags & 32) !== 0;
+ var nonEvolvingType = finalizeEvolvingArrayType(type);
+ var narrowedType = narrowType(nonEvolvingType, flow.expression, assumeTrue);
+ if (narrowedType === nonEvolvingType) {
+ return flowType;
+ }
+ var incomplete = isIncomplete(flowType);
+ var resultType = incomplete && narrowedType.flags & 8192 ? silentNeverType : narrowedType;
+ return createFlowType(resultType, incomplete);
}
function getTypeAtSwitchClause(flow) {
var flowType = getTypeAtFlowNode(flow.antecedent);
@@ -26753,7 +26580,7 @@ var ts;
seenIncomplete = true;
}
}
- return createFlowType(getUnionType(antecedentTypes, subtypeReduction), seenIncomplete);
+ return createFlowType(getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction), seenIncomplete);
}
function getTypeAtFlowLoopLabel(flow) {
var id = getFlowNodeId(flow);
@@ -26765,8 +26592,8 @@ var ts;
return cache[key];
}
for (var i = flowLoopStart; i < flowLoopCount; i++) {
- if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key) {
- return createFlowType(getUnionType(flowLoopTypes[i]), true);
+ if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key && flowLoopTypes[i].length) {
+ return createFlowType(getUnionOrEvolvingArrayType(flowLoopTypes[i], false), true);
}
}
var antecedentTypes = [];
@@ -26797,14 +26624,14 @@ var ts;
break;
}
}
- var result = getUnionType(antecedentTypes, subtypeReduction);
+ var result = getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction);
if (isIncomplete(firstAntecedentType)) {
return createFlowType(result, true);
}
return cache[key] = result;
}
function isMatchingReferenceDiscriminant(expr) {
- return expr.kind === 172 &&
+ return expr.kind === 173 &&
declaredType.flags & 524288 &&
isMatchingReference(reference, expr.expression) &&
isDiscriminantProperty(declaredType, expr.name.text);
@@ -26829,19 +26656,19 @@ var ts;
}
function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
switch (expr.operatorToken.kind) {
- case 56:
+ case 57:
return narrowTypeByTruthiness(type, expr.left, assumeTrue);
- case 30:
case 31:
case 32:
case 33:
+ case 34:
var operator_1 = expr.operatorToken.kind;
var left_1 = getReferenceCandidate(expr.left);
var right_1 = getReferenceCandidate(expr.right);
- if (left_1.kind === 182 && right_1.kind === 9) {
+ if (left_1.kind === 183 && right_1.kind === 9) {
return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue);
}
- if (right_1.kind === 182 && left_1.kind === 9) {
+ if (right_1.kind === 183 && left_1.kind === 9) {
return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue);
}
if (isMatchingReference(reference, left_1)) {
@@ -26860,9 +26687,9 @@ var ts;
return declaredType;
}
break;
- case 91:
+ case 92:
return narrowTypeByInstanceof(type, expr, assumeTrue);
- case 24:
+ case 25:
return narrowType(type, expr.right, assumeTrue);
}
return type;
@@ -26871,7 +26698,7 @@ var ts;
if (type.flags & 1) {
return type;
}
- if (operator === 31 || operator === 33) {
+ if (operator === 32 || operator === 34) {
assumeTrue = !assumeTrue;
}
var valueType = checkExpression(value);
@@ -26879,10 +26706,10 @@ var ts;
if (!strictNullChecks) {
return type;
}
- var doubleEquals = operator === 30 || operator === 31;
+ var doubleEquals = operator === 31 || operator === 32;
var facts = doubleEquals ?
assumeTrue ? 65536 : 524288 :
- value.kind === 93 ?
+ value.kind === 94 ?
assumeTrue ? 32768 : 262144 :
assumeTrue ? 16384 : 131072;
return getTypeWithFacts(type, facts);
@@ -26908,7 +26735,7 @@ var ts;
}
return type;
}
- if (operator === 31 || operator === 33) {
+ if (operator === 32 || operator === 34) {
assumeTrue = !assumeTrue;
}
if (assumeTrue && !(type.flags & 524288)) {
@@ -27019,7 +26846,7 @@ var ts;
}
else {
var invokedExpression = skipParenthesizedNodes(callExpression.expression);
- if (invokedExpression.kind === 173 || invokedExpression.kind === 172) {
+ if (invokedExpression.kind === 174 || invokedExpression.kind === 173) {
var accessExpression = invokedExpression;
var possibleReference = skipParenthesizedNodes(accessExpression.expression);
if (isMatchingReference(reference, possibleReference)) {
@@ -27034,18 +26861,18 @@ var ts;
}
function narrowType(type, expr, assumeTrue) {
switch (expr.kind) {
- case 69:
- case 97:
- case 172:
+ case 70:
+ case 98:
+ case 173:
return narrowTypeByTruthiness(type, expr, assumeTrue);
- case 174:
+ case 175:
return narrowTypeByTypePredicate(type, expr, assumeTrue);
- case 178:
+ case 179:
return narrowType(type, expr.expression, assumeTrue);
- case 187:
+ case 188:
return narrowTypeByBinaryExpression(type, expr, assumeTrue);
- case 185:
- if (expr.operator === 49) {
+ case 186:
+ if (expr.operator === 50) {
return narrowType(type, expr.operand, !assumeTrue);
}
break;
@@ -27054,7 +26881,7 @@ var ts;
}
}
function getTypeOfSymbolAtLocation(symbol, location) {
- if (location.kind === 69) {
+ if (location.kind === 70) {
if (ts.isRightSideOfQualifiedNameOrPropertyAccess(location)) {
location = location.parent;
}
@@ -27068,7 +26895,7 @@ var ts;
return getTypeOfSymbol(symbol);
}
function skipParenthesizedNodes(expression) {
- while (expression.kind === 178) {
+ while (expression.kind === 179) {
expression = expression.expression;
}
return expression;
@@ -27077,9 +26904,9 @@ var ts;
while (true) {
node = node.parent;
if (ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) ||
- node.kind === 226 ||
+ node.kind === 227 ||
node.kind === 256 ||
- node.kind === 145) {
+ node.kind === 146) {
return node;
}
}
@@ -27107,10 +26934,10 @@ var ts;
}
}
function markParameterAssignments(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
if (ts.isAssignmentTarget(node)) {
var symbol = getResolvedSymbol(node);
- if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 142) {
+ if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 143) {
symbol.isAssigned = true;
}
}
@@ -27119,12 +26946,15 @@ var ts;
ts.forEachChild(node, markParameterAssignments);
}
}
+ function isConstVariable(symbol) {
+ return symbol.flags & 3 && (getDeclarationNodeFlagsFromSymbol(symbol) & 2) !== 0 && getTypeOfSymbol(symbol) !== autoArrayType;
+ }
function checkIdentifier(node) {
var symbol = getResolvedSymbol(node);
if (symbol === argumentsSymbol) {
var container = ts.getContainingFunction(node);
if (languageVersion < 2) {
- if (container.kind === 180) {
+ if (container.kind === 181) {
error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
}
else if (ts.hasModifier(container, 256)) {
@@ -27142,7 +26972,7 @@ var ts;
if (localOrExportSymbol.flags & 32) {
var declaration_1 = localOrExportSymbol.valueDeclaration;
if (languageVersion === 2
- && declaration_1.kind === 221
+ && declaration_1.kind === 222
&& ts.nodeIsDecorated(declaration_1)) {
var container = ts.getContainingClass(node);
while (container !== undefined) {
@@ -27154,11 +26984,11 @@ var ts;
container = ts.getContainingClass(container);
}
}
- else if (declaration_1.kind === 192) {
+ else if (declaration_1.kind === 193) {
var container = ts.getThisContainer(node, false);
while (container !== undefined) {
if (container.parent === declaration_1) {
- if (container.kind === 145 && ts.hasModifier(container, 32)) {
+ if (container.kind === 146 && ts.hasModifier(container, 32)) {
getNodeLinks(declaration_1).flags |= 8388608;
getNodeLinks(node).flags |= 16777216;
}
@@ -27176,28 +27006,26 @@ var ts;
if (!(localOrExportSymbol.flags & 3) || ts.isAssignmentTarget(node) || !declaration) {
return type;
}
- var isParameter = ts.getRootDeclaration(declaration).kind === 142;
+ var isParameter = ts.getRootDeclaration(declaration).kind === 143;
var declarationContainer = getControlFlowContainer(declaration);
var flowContainer = getControlFlowContainer(node);
var isOuterVariable = flowContainer !== declarationContainer;
- while (flowContainer !== declarationContainer &&
- (flowContainer.kind === 179 ||
- flowContainer.kind === 180 ||
- ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) &&
- (isReadonlySymbol(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) {
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 180 ||
+ flowContainer.kind === 181 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) &&
+ (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) {
flowContainer = getControlFlowContainer(flowContainer);
}
var assumeInitialized = isParameter || isOuterVariable ||
- type !== autoType && (!strictNullChecks || (type.flags & 1) !== 0) ||
+ type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1) !== 0) ||
ts.isInAmbientContext(declaration);
var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer);
- if (type === autoType) {
- if (flowType === autoType) {
+ if (type === autoType || type === autoArrayType) {
+ if (flowType === autoType || flowType === autoArrayType) {
if (compilerOptions.noImplicitAny) {
- error(declaration.name, ts.Diagnostics.Variable_0_implicitly_has_type_any_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol));
- error(node, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(anyType));
+ error(declaration.name, ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType));
+ error(node, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType));
}
- return anyType;
+ return convertAutoToAny(flowType);
}
}
else if (!assumeInitialized && !(getFalsyFlags(type) & 2048) && getFalsyFlags(flowType) & 2048) {
@@ -27237,8 +27065,8 @@ var ts;
if (usedInFunction) {
getNodeLinks(current).flags |= 65536;
}
- if (container.kind === 206 &&
- ts.getAncestor(symbol.valueDeclaration, 219).parent === container &&
+ if (container.kind === 207 &&
+ ts.getAncestor(symbol.valueDeclaration, 220).parent === container &&
isAssignedInBodyOfForStatement(node, container)) {
getNodeLinks(symbol.valueDeclaration).flags |= 2097152;
}
@@ -27250,16 +27078,16 @@ var ts;
}
function isAssignedInBodyOfForStatement(node, container) {
var current = node;
- while (current.parent.kind === 178) {
+ while (current.parent.kind === 179) {
current = current.parent;
}
var isAssigned = false;
if (ts.isAssignmentTarget(current)) {
isAssigned = true;
}
- else if ((current.parent.kind === 185 || current.parent.kind === 186)) {
+ else if ((current.parent.kind === 186 || current.parent.kind === 187)) {
var expr = current.parent;
- isAssigned = expr.operator === 41 || expr.operator === 42;
+ isAssigned = expr.operator === 42 || expr.operator === 43;
}
if (!isAssigned) {
return false;
@@ -27276,7 +27104,7 @@ var ts;
}
function captureLexicalThis(node, container) {
getNodeLinks(node).flags |= 2;
- if (container.kind === 145 || container.kind === 148) {
+ if (container.kind === 146 || container.kind === 149) {
var classNode = container.parent;
getNodeLinks(classNode).flags |= 4;
}
@@ -27310,7 +27138,7 @@ var ts;
function checkThisExpression(node) {
var container = ts.getThisContainer(node, true);
var needToCaptureLexicalThis = false;
- if (container.kind === 148) {
+ if (container.kind === 149) {
var containingClassDecl = container.parent;
var baseTypeNode = ts.getClassExtendsHeritageClauseElement(containingClassDecl);
if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) {
@@ -27320,29 +27148,29 @@ var ts;
}
}
}
- if (container.kind === 180) {
+ if (container.kind === 181) {
container = ts.getThisContainer(container, false);
needToCaptureLexicalThis = (languageVersion < 2);
}
switch (container.kind) {
- case 225:
+ case 226:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);
break;
- case 224:
+ case 225:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location);
break;
- case 148:
+ case 149:
if (isInConstructorArgumentInitializer(node, container)) {
error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments);
}
break;
+ case 146:
case 145:
- case 144:
if (ts.getModifierFlags(container) & 32) {
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer);
}
break;
- case 140:
+ case 141:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name);
break;
}
@@ -27351,7 +27179,7 @@ var ts;
}
if (ts.isFunctionLike(container) &&
(!isInParameterInitializerBeforeContainingFunction(node) || ts.getThisParameter(container))) {
- if (container.kind === 179 &&
+ if (container.kind === 180 &&
ts.isInJavaScriptFile(container.parent) &&
ts.getSpecialPropertyAssignmentKind(container.parent) === 3) {
var className = container.parent
@@ -27363,7 +27191,7 @@ var ts;
return getInferredClassType(classSymbol);
}
}
- var thisType = getThisTypeOfDeclaration(container);
+ var thisType = getThisTypeOfDeclaration(container) || getContextualThisParameterType(container);
if (thisType) {
return thisType;
}
@@ -27395,18 +27223,18 @@ var ts;
}
function isInConstructorArgumentInitializer(node, constructorDecl) {
for (var n = node; n && n !== constructorDecl; n = n.parent) {
- if (n.kind === 142) {
+ if (n.kind === 143) {
return true;
}
}
return false;
}
function checkSuperExpression(node) {
- var isCallExpression = node.parent.kind === 174 && node.parent.expression === node;
+ var isCallExpression = node.parent.kind === 175 && node.parent.expression === node;
var container = ts.getSuperContainer(node, true);
var needToCaptureLexicalThis = false;
if (!isCallExpression) {
- while (container && container.kind === 180) {
+ while (container && container.kind === 181) {
container = ts.getSuperContainer(container, true);
needToCaptureLexicalThis = languageVersion < 2;
}
@@ -27415,16 +27243,16 @@ var ts;
var nodeCheckFlag = 0;
if (!canUseSuperExpression) {
var current = node;
- while (current && current !== container && current.kind !== 140) {
+ while (current && current !== container && current.kind !== 141) {
current = current.parent;
}
- if (current && current.kind === 140) {
+ if (current && current.kind === 141) {
error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name);
}
else if (isCallExpression) {
error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors);
}
- else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 171)) {
+ else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 172)) {
error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions);
}
else {
@@ -27439,7 +27267,7 @@ var ts;
nodeCheckFlag = 256;
}
getNodeLinks(node).flags |= nodeCheckFlag;
- if (container.kind === 147 && ts.getModifierFlags(container) & 256) {
+ if (container.kind === 148 && ts.getModifierFlags(container) & 256) {
if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) {
getNodeLinks(container).flags |= 4096;
}
@@ -27450,7 +27278,7 @@ var ts;
if (needToCaptureLexicalThis) {
captureLexicalThis(node.parent, container);
}
- if (container.parent.kind === 171) {
+ if (container.parent.kind === 172) {
if (languageVersion < 2) {
error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher);
return unknownType;
@@ -27468,7 +27296,7 @@ var ts;
}
return unknownType;
}
- if (container.kind === 148 && isInConstructorArgumentInitializer(node, container)) {
+ if (container.kind === 149 && isInConstructorArgumentInitializer(node, container)) {
error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
return unknownType;
}
@@ -27480,35 +27308,38 @@ var ts;
return false;
}
if (isCallExpression) {
- return container.kind === 148;
+ return container.kind === 149;
}
else {
- if (ts.isClassLike(container.parent) || container.parent.kind === 171) {
+ if (ts.isClassLike(container.parent) || container.parent.kind === 172) {
if (ts.getModifierFlags(container) & 32) {
- return container.kind === 147 ||
- container.kind === 146 ||
- container.kind === 149 ||
- container.kind === 150;
+ return container.kind === 148 ||
+ container.kind === 147 ||
+ container.kind === 150 ||
+ container.kind === 151;
}
else {
- return container.kind === 147 ||
- container.kind === 146 ||
- container.kind === 149 ||
+ return container.kind === 148 ||
+ container.kind === 147 ||
container.kind === 150 ||
+ container.kind === 151 ||
+ container.kind === 146 ||
container.kind === 145 ||
- container.kind === 144 ||
- container.kind === 148;
+ container.kind === 149;
}
}
}
return false;
}
}
- function getContextualThisParameter(func) {
- if (isContextSensitiveFunctionOrObjectLiteralMethod(func) && func.kind !== 180) {
+ function getContextualThisParameterType(func) {
+ if (isContextSensitiveFunctionOrObjectLiteralMethod(func) && func.kind !== 181) {
var contextualSignature = getContextualSignature(func);
if (contextualSignature) {
- return contextualSignature.thisParameter;
+ var thisParameter = contextualSignature.thisParameter;
+ if (thisParameter) {
+ return getTypeOfSymbol(thisParameter);
+ }
}
}
return undefined;
@@ -27558,7 +27389,7 @@ var ts;
if (declaration.type) {
return getTypeFromTypeNode(declaration.type);
}
- if (declaration.kind === 142) {
+ if (declaration.kind === 143) {
var type = getContextuallyTypedParameterType(declaration);
if (type) {
return type;
@@ -27569,11 +27400,11 @@ var ts;
}
if (ts.isBindingPattern(declaration.parent)) {
var parentDeclaration = declaration.parent.parent;
- var name_18 = declaration.propertyName || declaration.name;
+ var name_15 = declaration.propertyName || declaration.name;
if (ts.isVariableLike(parentDeclaration) &&
parentDeclaration.type &&
- !ts.isBindingPattern(name_18)) {
- var text = getTextOfPropertyName(name_18);
+ !ts.isBindingPattern(name_15)) {
+ var text = getTextOfPropertyName(name_15);
if (text) {
return getTypeOfPropertyOfType(getTypeFromTypeNode(parentDeclaration.type), text);
}
@@ -27610,7 +27441,7 @@ var ts;
}
function isInParameterInitializerBeforeContainingFunction(node) {
while (node.parent && !ts.isFunctionLike(node.parent)) {
- if (node.parent.kind === 142 && node.parent.initializer === node) {
+ if (node.parent.kind === 143 && node.parent.initializer === node) {
return true;
}
node = node.parent;
@@ -27619,8 +27450,8 @@ var ts;
}
function getContextualReturnType(functionDecl) {
if (functionDecl.type ||
- functionDecl.kind === 148 ||
- functionDecl.kind === 149 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 150))) {
+ functionDecl.kind === 149 ||
+ functionDecl.kind === 150 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 151))) {
return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl));
}
var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl);
@@ -27639,7 +27470,7 @@ var ts;
return undefined;
}
function getContextualTypeForSubstitutionExpression(template, substitutionExpression) {
- if (template.parent.kind === 176) {
+ if (template.parent.kind === 177) {
return getContextualTypeForArgument(template.parent, substitutionExpression);
}
return undefined;
@@ -27647,7 +27478,7 @@ var ts;
function getContextualTypeForBinaryOperand(node) {
var binaryExpression = node.parent;
var operator = binaryExpression.operatorToken.kind;
- if (operator >= 56 && operator <= 68) {
+ if (operator >= 57 && operator <= 69) {
if (ts.getSpecialPropertyAssignmentKind(binaryExpression) !== 0) {
return undefined;
}
@@ -27655,14 +27486,14 @@ var ts;
return checkExpression(binaryExpression.left);
}
}
- else if (operator === 52) {
+ else if (operator === 53) {
var type = getContextualType(binaryExpression);
if (!type && node === binaryExpression.right) {
type = checkExpression(binaryExpression.left);
}
return type;
}
- else if (operator === 51 || operator === 24) {
+ else if (operator === 52 || operator === 25) {
if (node === binaryExpression.right) {
return getContextualType(binaryExpression);
}
@@ -27676,8 +27507,8 @@ var ts;
var types = type.types;
var mappedType;
var mappedTypes;
- for (var _i = 0, types_12 = types; _i < types_12.length; _i++) {
- var current = types_12[_i];
+ for (var _i = 0, types_13 = types; _i < types_13.length; _i++) {
+ var current = types_13[_i];
var t = mapper(current);
if (t) {
if (!mappedType) {
@@ -27771,36 +27602,36 @@ var ts;
}
var parent = node.parent;
switch (parent.kind) {
- case 218:
- case 142:
+ case 219:
+ case 143:
+ case 146:
case 145:
- case 144:
- case 169:
+ case 170:
return getContextualTypeForInitializerExpression(node);
- case 180:
- case 211:
+ case 181:
+ case 212:
return getContextualTypeForReturnExpression(node);
- case 190:
+ case 191:
return getContextualTypeForYieldOperand(parent);
- case 174:
case 175:
+ case 176:
return getContextualTypeForArgument(parent, node);
- case 177:
- case 195:
+ case 178:
+ case 196:
return getTypeFromTypeNode(parent.type);
- case 187:
+ case 188:
return getContextualTypeForBinaryOperand(node);
case 253:
case 254:
return getContextualTypeForObjectLiteralElement(parent);
- case 170:
+ case 171:
return getContextualTypeForElementExpression(node);
- case 188:
+ case 189:
return getContextualTypeForConditionalOperand(node);
- case 197:
- ts.Debug.assert(parent.parent.kind === 189);
+ case 198:
+ ts.Debug.assert(parent.parent.kind === 190);
return getContextualTypeForSubstitutionExpression(parent.parent, node);
- case 178:
+ case 179:
return getContextualType(parent);
case 248:
return getContextualType(parent);
@@ -27820,7 +27651,7 @@ var ts;
}
}
function isFunctionExpressionOrArrowFunction(node) {
- return node.kind === 179 || node.kind === 180;
+ return node.kind === 180 || node.kind === 181;
}
function getContextualSignatureForFunctionLikeDeclaration(node) {
return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node)
@@ -27833,7 +27664,7 @@ var ts;
getApparentTypeOfContextualType(node);
}
function getContextualSignature(node) {
- ts.Debug.assert(node.kind !== 147 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 148 || ts.isObjectLiteralMethod(node));
var type = getContextualTypeForFunctionLikeDeclaration(node);
if (!type) {
return undefined;
@@ -27843,8 +27674,8 @@ var ts;
}
var signatureList;
var types = type.types;
- for (var _i = 0, types_13 = types; _i < types_13.length; _i++) {
- var current = types_13[_i];
+ for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
+ var current = types_14[_i];
var signature = getNonGenericSignature(current);
if (signature) {
if (!signatureList) {
@@ -27874,8 +27705,8 @@ var ts;
return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false);
}
function hasDefaultValue(node) {
- return (node.kind === 169 && !!node.initializer) ||
- (node.kind === 187 && node.operatorToken.kind === 56);
+ return (node.kind === 170 && !!node.initializer) ||
+ (node.kind === 188 && node.operatorToken.kind === 57);
}
function checkArrayLiteral(node, contextualMapper) {
var elements = node.elements;
@@ -27884,7 +27715,7 @@ var ts;
var inDestructuringPattern = ts.isAssignmentTarget(node);
for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {
var e = elements_1[_i];
- if (inDestructuringPattern && e.kind === 191) {
+ if (inDestructuringPattern && e.kind === 192) {
var restArrayType = checkExpression(e.expression, contextualMapper);
var restElementType = getIndexTypeOfType(restArrayType, 1) ||
(languageVersion >= 2 ? getElementTypeOfIterable(restArrayType, undefined) : undefined);
@@ -27896,7 +27727,7 @@ var ts;
var type = checkExpressionForMutableLocation(e, contextualMapper);
elementTypes.push(type);
}
- hasSpreadElement = hasSpreadElement || e.kind === 191;
+ hasSpreadElement = hasSpreadElement || e.kind === 192;
}
if (!hasSpreadElement) {
if (inDestructuringPattern && elementTypes.length) {
@@ -27907,7 +27738,7 @@ var ts;
var contextualType = getApparentTypeOfContextualType(node);
if (contextualType && contextualTypeIsTupleLikeType(contextualType)) {
var pattern = contextualType.pattern;
- if (pattern && (pattern.kind === 168 || pattern.kind === 170)) {
+ if (pattern && (pattern.kind === 169 || pattern.kind === 171)) {
var patternElements = pattern.elements;
for (var i = elementTypes.length; i < patternElements.length; i++) {
var patternElement = patternElements[i];
@@ -27915,7 +27746,7 @@ var ts;
elementTypes.push(contextualType.typeArguments[i]);
}
else {
- if (patternElement.kind !== 193) {
+ if (patternElement.kind !== 194) {
error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value);
}
elementTypes.push(unknownType);
@@ -27932,7 +27763,7 @@ var ts;
strictNullChecks ? neverType : undefinedWideningType);
}
function isNumericName(name) {
- return name.kind === 140 ? isNumericComputedName(name) : isNumericLiteralName(name.text);
+ return name.kind === 141 ? isNumericComputedName(name) : isNumericLiteralName(name.text);
}
function isNumericComputedName(name) {
return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), 340);
@@ -27976,7 +27807,7 @@ var ts;
var propertiesArray = [];
var contextualType = getApparentTypeOfContextualType(node);
var contextualTypeHasPattern = contextualType && contextualType.pattern &&
- (contextualType.pattern.kind === 167 || contextualType.pattern.kind === 171);
+ (contextualType.pattern.kind === 168 || contextualType.pattern.kind === 172);
var typeFlags = 0;
var patternWithComputedProperties = false;
var hasComputedStringProperty = false;
@@ -27991,7 +27822,7 @@ var ts;
if (memberDecl.kind === 253) {
type = checkPropertyAssignment(memberDecl, contextualMapper);
}
- else if (memberDecl.kind === 147) {
+ else if (memberDecl.kind === 148) {
type = checkObjectLiteralMethod(memberDecl, contextualMapper);
}
else {
@@ -28030,7 +27861,7 @@ var ts;
member = prop;
}
else {
- ts.Debug.assert(memberDecl.kind === 149 || memberDecl.kind === 150);
+ ts.Debug.assert(memberDecl.kind === 150 || memberDecl.kind === 151);
checkAccessorDeclaration(memberDecl);
}
if (ts.hasDynamicName(memberDecl)) {
@@ -28089,10 +27920,10 @@ var ts;
case 248:
checkJsxExpression(child);
break;
- case 241:
+ case 242:
checkJsxElement(child);
break;
- case 242:
+ case 243:
checkJsxSelfClosingElement(child);
break;
}
@@ -28103,7 +27934,7 @@ var ts;
return name.indexOf("-") < 0;
}
function isJsxIntrinsicIdentifier(tagName) {
- if (tagName.kind === 172 || tagName.kind === 97) {
+ if (tagName.kind === 173 || tagName.kind === 98) {
return false;
}
else {
@@ -28206,7 +28037,7 @@ var ts;
return unknownType;
}
}
- return getUnionType(signatures.map(getReturnTypeOfSignature), true);
+ return getUnionType(ts.map(signatures, getReturnTypeOfSignature), true);
}
function getJsxElementPropertiesName() {
var jsxNamespace = getGlobalSymbol(JsxNames.JSX, 1920, undefined);
@@ -28235,7 +28066,7 @@ var ts;
}
if (elemType.flags & 524288) {
var types = elemType.types;
- return getUnionType(types.map(function (type) {
+ return getUnionType(ts.map(types, function (type) {
return getResolvedJsxType(node, type, elemClassType);
}), true);
}
@@ -28411,7 +28242,7 @@ var ts;
}
}
function getDeclarationKindFromSymbol(s) {
- return s.valueDeclaration ? s.valueDeclaration.kind : 145;
+ return s.valueDeclaration ? s.valueDeclaration.kind : 146;
}
function getDeclarationModifierFlagsFromSymbol(s) {
return s.valueDeclaration ? ts.getCombinedModifierFlags(s.valueDeclaration) : s.flags & 134217728 ? 4 | 32 : 0;
@@ -28422,11 +28253,11 @@ var ts;
function checkClassPropertyAccess(node, left, type, prop) {
var flags = getDeclarationModifierFlagsFromSymbol(prop);
var declaringClass = getDeclaredTypeOfSymbol(getParentOfSymbol(prop));
- var errorNode = node.kind === 172 || node.kind === 218 ?
+ var errorNode = node.kind === 173 || node.kind === 219 ?
node.name :
node.right;
- if (left.kind === 95) {
- if (languageVersion < 2 && getDeclarationKindFromSymbol(prop) !== 147) {
+ if (left.kind === 96) {
+ if (languageVersion < 2 && getDeclarationKindFromSymbol(prop) !== 148) {
error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword);
return false;
}
@@ -28446,7 +28277,7 @@ var ts;
}
return true;
}
- if (left.kind === 95) {
+ if (left.kind === 96) {
return true;
}
var enclosingClass = forEachEnclosingClass(node, function (enclosingDeclaration) {
@@ -28520,7 +28351,7 @@ var ts;
checkClassPropertyAccess(node, left, apparentType, prop);
}
var propType = getTypeOfSymbol(prop);
- if (node.kind !== 172 || ts.isAssignmentTarget(node) ||
+ if (node.kind !== 173 || ts.isAssignmentTarget(node) ||
!(prop.flags & (3 | 4 | 98304)) &&
!(prop.flags & 8192 && propType.flags & 524288)) {
return propType;
@@ -28542,7 +28373,7 @@ var ts;
}
}
function isValidPropertyAccess(node, propertyName) {
- var left = node.kind === 172
+ var left = node.kind === 173
? node.expression
: node.left;
var type = checkExpression(left);
@@ -28556,13 +28387,13 @@ var ts;
}
function getForInVariableSymbol(node) {
var initializer = node.initializer;
- if (initializer.kind === 219) {
+ if (initializer.kind === 220) {
var variable = initializer.declarations[0];
if (variable && !ts.isBindingPattern(variable.name)) {
return getSymbolOfNode(variable);
}
}
- else if (initializer.kind === 69) {
+ else if (initializer.kind === 70) {
return getResolvedSymbol(initializer);
}
return undefined;
@@ -28572,13 +28403,13 @@ var ts;
}
function isForInVariableForNumericPropertyNames(expr) {
var e = skipParenthesizedNodes(expr);
- if (e.kind === 69) {
+ if (e.kind === 70) {
var symbol = getResolvedSymbol(e);
if (symbol.flags & 3) {
var child = expr;
var node = expr.parent;
while (node) {
- if (node.kind === 207 &&
+ if (node.kind === 208 &&
child === node.statement &&
getForInVariableSymbol(node) === symbol &&
hasNumericPropertyNames(checkExpression(node.expression))) {
@@ -28594,7 +28425,7 @@ var ts;
function checkIndexedAccess(node) {
if (!node.argumentExpression) {
var sourceFile = ts.getSourceFileOfNode(node);
- if (node.parent.kind === 175 && node.parent.expression === node) {
+ if (node.parent.kind === 176 && node.parent.expression === node) {
var start = ts.skipTrivia(sourceFile.text, node.expression.end);
var end = node.end;
grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead);
@@ -28617,15 +28448,15 @@ var ts;
return unknownType;
}
if (node.argumentExpression) {
- var name_19 = getPropertyNameForIndexedAccess(node.argumentExpression, indexType);
- if (name_19 !== undefined) {
- var prop = getPropertyOfType(objectType, name_19);
+ var name_16 = getPropertyNameForIndexedAccess(node.argumentExpression, indexType);
+ if (name_16 !== undefined) {
+ var prop = getPropertyOfType(objectType, name_16);
if (prop) {
getNodeLinks(node).resolvedSymbol = prop;
return getTypeOfSymbol(prop);
}
else if (isConstEnum) {
- error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, name_19, symbolToString(objectType.symbol));
+ error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, name_16, symbolToString(objectType.symbol));
return unknownType;
}
}
@@ -28658,7 +28489,7 @@ var ts;
if (indexArgumentExpression.kind === 9 || indexArgumentExpression.kind === 8) {
return indexArgumentExpression.text;
}
- if (indexArgumentExpression.kind === 173 || indexArgumentExpression.kind === 172) {
+ if (indexArgumentExpression.kind === 174 || indexArgumentExpression.kind === 173) {
var value = getConstantValue(indexArgumentExpression);
if (value !== undefined) {
return value.toString();
@@ -28701,10 +28532,10 @@ var ts;
return true;
}
function resolveUntypedCall(node) {
- if (node.kind === 176) {
+ if (node.kind === 177) {
checkExpression(node.template);
}
- else if (node.kind !== 143) {
+ else if (node.kind !== 144) {
ts.forEach(node.arguments, function (argument) {
checkExpression(argument);
});
@@ -28755,7 +28586,7 @@ var ts;
function getSpreadArgumentIndex(args) {
for (var i = 0; i < args.length; i++) {
var arg = args[i];
- if (arg && arg.kind === 191) {
+ if (arg && arg.kind === 192) {
return i;
}
}
@@ -28768,11 +28599,11 @@ var ts;
var callIsIncomplete;
var isDecorator;
var spreadArgIndex = -1;
- if (node.kind === 176) {
+ if (node.kind === 177) {
var tagExpression = node;
argCount = args.length;
typeArguments = undefined;
- if (tagExpression.template.kind === 189) {
+ if (tagExpression.template.kind === 190) {
var templateExpression = tagExpression.template;
var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans);
ts.Debug.assert(lastSpan !== undefined);
@@ -28780,11 +28611,11 @@ var ts;
}
else {
var templateLiteral = tagExpression.template;
- ts.Debug.assert(templateLiteral.kind === 11);
+ ts.Debug.assert(templateLiteral.kind === 12);
callIsIncomplete = !!templateLiteral.isUnterminated;
}
}
- else if (node.kind === 143) {
+ else if (node.kind === 144) {
isDecorator = true;
typeArguments = undefined;
argCount = getEffectiveArgumentCount(node, undefined, signature);
@@ -28792,7 +28623,7 @@ var ts;
else {
var callExpression = node;
if (!callExpression.arguments) {
- ts.Debug.assert(callExpression.kind === 175);
+ ts.Debug.assert(callExpression.kind === 176);
return signature.minArgumentCount === 0;
}
argCount = signatureHelpTrailingComma ? args.length + 1 : args.length;
@@ -28851,9 +28682,9 @@ var ts;
var argCount = getEffectiveArgumentCount(node, args, signature);
for (var i = 0; i < argCount; i++) {
var arg = getEffectiveArgument(node, args, i);
- if (arg === undefined || arg.kind !== 193) {
+ if (arg === undefined || arg.kind !== 194) {
var paramType = getTypeAtPosition(signature, i);
- var argType = getEffectiveArgumentType(node, i, arg);
+ var argType = getEffectiveArgumentType(node, i);
if (argType === undefined) {
var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper;
argType = checkExpressionWithContextualType(arg, paramType, mapper);
@@ -28898,7 +28729,7 @@ var ts;
}
function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) {
var thisType = getThisTypeOfSignature(signature);
- if (thisType && thisType !== voidType && node.kind !== 175) {
+ if (thisType && thisType !== voidType && node.kind !== 176) {
var thisArgumentNode = getThisArgumentOfCall(node);
var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType;
var errorNode = reportErrors ? (thisArgumentNode || node) : undefined;
@@ -28911,9 +28742,9 @@ var ts;
var argCount = getEffectiveArgumentCount(node, args, signature);
for (var i = 0; i < argCount; i++) {
var arg = getEffectiveArgument(node, args, i);
- if (arg === undefined || arg.kind !== 193) {
+ if (arg === undefined || arg.kind !== 194) {
var paramType = getTypeAtPosition(signature, i);
- var argType = getEffectiveArgumentType(node, i, arg);
+ var argType = getEffectiveArgumentType(node, i);
if (argType === undefined) {
argType = checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined);
}
@@ -28926,28 +28757,28 @@ var ts;
return true;
}
function getThisArgumentOfCall(node) {
- if (node.kind === 174) {
+ if (node.kind === 175) {
var callee = node.expression;
- if (callee.kind === 172) {
+ if (callee.kind === 173) {
return callee.expression;
}
- else if (callee.kind === 173) {
+ else if (callee.kind === 174) {
return callee.expression;
}
}
}
function getEffectiveCallArguments(node) {
var args;
- if (node.kind === 176) {
+ if (node.kind === 177) {
var template = node.template;
args = [undefined];
- if (template.kind === 189) {
+ if (template.kind === 190) {
ts.forEach(template.templateSpans, function (span) {
args.push(span.expression);
});
}
}
- else if (node.kind === 143) {
+ else if (node.kind === 144) {
return undefined;
}
else {
@@ -28956,21 +28787,21 @@ var ts;
return args;
}
function getEffectiveArgumentCount(node, args, signature) {
- if (node.kind === 143) {
+ if (node.kind === 144) {
switch (node.parent.kind) {
- case 221:
- case 192:
+ case 222:
+ case 193:
return 1;
- case 145:
+ case 146:
return 2;
- case 147:
- case 149:
+ case 148:
case 150:
+ case 151:
if (languageVersion === 0) {
return 2;
}
return signature.parameters.length >= 3 ? 3 : 2;
- case 142:
+ case 143:
return 3;
}
}
@@ -28979,48 +28810,48 @@ var ts;
}
}
function getEffectiveDecoratorFirstArgumentType(node) {
- if (node.kind === 221) {
+ if (node.kind === 222) {
var classSymbol = getSymbolOfNode(node);
return getTypeOfSymbol(classSymbol);
}
- if (node.kind === 142) {
+ if (node.kind === 143) {
node = node.parent;
- if (node.kind === 148) {
+ if (node.kind === 149) {
var classSymbol = getSymbolOfNode(node);
return getTypeOfSymbol(classSymbol);
}
}
- if (node.kind === 145 ||
- node.kind === 147 ||
- node.kind === 149 ||
- node.kind === 150) {
+ if (node.kind === 146 ||
+ node.kind === 148 ||
+ node.kind === 150 ||
+ node.kind === 151) {
return getParentTypeOfClassElement(node);
}
ts.Debug.fail("Unsupported decorator target.");
return unknownType;
}
function getEffectiveDecoratorSecondArgumentType(node) {
- if (node.kind === 221) {
+ if (node.kind === 222) {
ts.Debug.fail("Class decorators should not have a second synthetic argument.");
return unknownType;
}
- if (node.kind === 142) {
+ if (node.kind === 143) {
node = node.parent;
- if (node.kind === 148) {
+ if (node.kind === 149) {
return anyType;
}
}
- if (node.kind === 145 ||
- node.kind === 147 ||
- node.kind === 149 ||
- node.kind === 150) {
+ if (node.kind === 146 ||
+ node.kind === 148 ||
+ node.kind === 150 ||
+ node.kind === 151) {
var element = node;
switch (element.name.kind) {
- case 69:
+ case 70:
case 8:
case 9:
return getLiteralTypeForText(32, element.name.text);
- case 140:
+ case 141:
var nameType = checkComputedPropertyName(element.name);
if (isTypeOfKind(nameType, 512)) {
return nameType;
@@ -29037,20 +28868,20 @@ var ts;
return unknownType;
}
function getEffectiveDecoratorThirdArgumentType(node) {
- if (node.kind === 221) {
+ if (node.kind === 222) {
ts.Debug.fail("Class decorators should not have a third synthetic argument.");
return unknownType;
}
- if (node.kind === 142) {
+ if (node.kind === 143) {
return numberType;
}
- if (node.kind === 145) {
+ if (node.kind === 146) {
ts.Debug.fail("Property decorators should not have a third synthetic argument.");
return unknownType;
}
- if (node.kind === 147 ||
- node.kind === 149 ||
- node.kind === 150) {
+ if (node.kind === 148 ||
+ node.kind === 150 ||
+ node.kind === 151) {
var propertyType = getTypeOfNode(node);
return createTypedPropertyDescriptorType(propertyType);
}
@@ -29070,27 +28901,27 @@ var ts;
ts.Debug.fail("Decorators should not have a fourth synthetic argument.");
return unknownType;
}
- function getEffectiveArgumentType(node, argIndex, arg) {
- if (node.kind === 143) {
+ function getEffectiveArgumentType(node, argIndex) {
+ if (node.kind === 144) {
return getEffectiveDecoratorArgumentType(node, argIndex);
}
- else if (argIndex === 0 && node.kind === 176) {
+ else if (argIndex === 0 && node.kind === 177) {
return getGlobalTemplateStringsArrayType();
}
return undefined;
}
function getEffectiveArgument(node, args, argIndex) {
- if (node.kind === 143 ||
- (argIndex === 0 && node.kind === 176)) {
+ if (node.kind === 144 ||
+ (argIndex === 0 && node.kind === 177)) {
return undefined;
}
return args[argIndex];
}
function getEffectiveArgumentErrorNode(node, argIndex, arg) {
- if (node.kind === 143) {
+ if (node.kind === 144) {
return node.expression;
}
- else if (argIndex === 0 && node.kind === 176) {
+ else if (argIndex === 0 && node.kind === 177) {
return node.template;
}
else {
@@ -29098,12 +28929,12 @@ var ts;
}
}
function resolveCall(node, signatures, candidatesOutArray, headMessage) {
- var isTaggedTemplate = node.kind === 176;
- var isDecorator = node.kind === 143;
+ var isTaggedTemplate = node.kind === 177;
+ var isDecorator = node.kind === 144;
var typeArguments;
if (!isTaggedTemplate && !isDecorator) {
typeArguments = node.typeArguments;
- if (node.expression.kind !== 95) {
+ if (node.expression.kind !== 96) {
ts.forEach(typeArguments, checkSourceElement);
}
}
@@ -29129,7 +28960,7 @@ var ts;
var candidateForTypeArgumentError;
var resultOfFailedInference;
var result;
- var signatureHelpTrailingComma = candidatesOutArray && node.kind === 174 && node.arguments.hasTrailingComma;
+ var signatureHelpTrailingComma = candidatesOutArray && node.kind === 175 && node.arguments.hasTrailingComma;
if (candidates.length > 1) {
result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma);
}
@@ -29244,7 +29075,7 @@ var ts;
}
}
function resolveCallExpression(node, candidatesOutArray) {
- if (node.expression.kind === 95) {
+ if (node.expression.kind === 96) {
var superType = checkSuperExpression(node.expression);
if (superType !== unknownType) {
var baseTypeNode = ts.getClassExtendsHeritageClauseElement(ts.getContainingClass(node));
@@ -29397,16 +29228,16 @@ var ts;
}
function getDiagnosticHeadMessageForDecoratorResolution(node) {
switch (node.parent.kind) {
- case 221:
- case 192:
+ case 222:
+ case 193:
return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;
- case 142:
+ case 143:
return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;
- case 145:
+ case 146:
return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;
- case 147:
- case 149:
+ case 148:
case 150:
+ case 151:
return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;
}
}
@@ -29433,13 +29264,13 @@ var ts;
}
function resolveSignature(node, candidatesOutArray) {
switch (node.kind) {
- case 174:
- return resolveCallExpression(node, candidatesOutArray);
case 175:
- return resolveNewExpression(node, candidatesOutArray);
+ return resolveCallExpression(node, candidatesOutArray);
case 176:
+ return resolveNewExpression(node, candidatesOutArray);
+ case 177:
return resolveTaggedTemplateExpression(node, candidatesOutArray);
- case 143:
+ case 144:
return resolveDecorator(node, candidatesOutArray);
}
ts.Debug.fail("Branch in 'resolveSignature' should be unreachable.");
@@ -29468,17 +29299,17 @@ var ts;
function checkCallExpression(node) {
checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments);
var signature = getResolvedSignature(node);
- if (node.expression.kind === 95) {
+ if (node.expression.kind === 96) {
return voidType;
}
- if (node.kind === 175) {
+ if (node.kind === 176) {
var declaration = signature.declaration;
if (declaration &&
- declaration.kind !== 148 &&
- declaration.kind !== 152 &&
- declaration.kind !== 157 &&
+ declaration.kind !== 149 &&
+ declaration.kind !== 153 &&
+ declaration.kind !== 158 &&
!ts.isJSDocConstructSignature(declaration)) {
- var funcSymbol = node.expression.kind === 69 ?
+ var funcSymbol = node.expression.kind === 70 ?
getResolvedSymbol(node.expression) :
checkExpression(node.expression).symbol;
if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16 || ts.isDeclarationOfFunctionExpression(funcSymbol))) {
@@ -29490,7 +29321,9 @@ var ts;
return anyType;
}
}
- if (ts.isInJavaScriptFile(node) && ts.isRequireCall(node, true)) {
+ if (ts.isInJavaScriptFile(node) &&
+ ts.isRequireCall(node, true) &&
+ !resolveName(node.expression, node.expression.text, 107455, undefined, undefined)) {
return resolveExternalModuleTypeByLiteral(node.arguments[0]);
}
return getReturnTypeOfSignature(signature);
@@ -29530,21 +29363,36 @@ var ts;
}
function assignContextualParameterTypes(signature, context, mapper) {
var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0);
+ if (isInferentialContext(mapper)) {
+ for (var i = 0; i < len; i++) {
+ var declaration = signature.parameters[i].valueDeclaration;
+ if (declaration.type) {
+ inferTypes(mapper.context, getTypeFromTypeNode(declaration.type), getTypeAtPosition(context, i));
+ }
+ }
+ }
if (context.thisParameter) {
- if (!signature.thisParameter) {
- signature.thisParameter = createTransientSymbol(context.thisParameter, undefined);
+ var parameter = signature.thisParameter;
+ if (!parameter || parameter.valueDeclaration && !parameter.valueDeclaration.type) {
+ if (!parameter) {
+ signature.thisParameter = createTransientSymbol(context.thisParameter, undefined);
+ }
+ assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper);
}
- assignTypeToParameterAndFixTypeParameters(signature.thisParameter, getTypeOfSymbol(context.thisParameter), mapper);
}
for (var i = 0; i < len; i++) {
var parameter = signature.parameters[i];
- var contextualParameterType = getTypeAtPosition(context, i);
- assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper);
+ if (!parameter.valueDeclaration.type) {
+ var contextualParameterType = getTypeAtPosition(context, i);
+ assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper);
+ }
}
if (signature.hasRestParameter && isRestParameterIndex(context, signature.parameters.length - 1)) {
var parameter = ts.lastOrUndefined(signature.parameters);
- var contextualParameterType = getTypeOfSymbol(ts.lastOrUndefined(context.parameters));
- assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper);
+ if (!parameter.valueDeclaration.type) {
+ var contextualParameterType = getTypeOfSymbol(ts.lastOrUndefined(context.parameters));
+ assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType, mapper);
+ }
}
}
function assignBindingElementTypes(node) {
@@ -29552,7 +29400,7 @@ var ts;
for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) {
var element = _a[_i];
if (!ts.isOmittedExpression(element)) {
- if (element.name.kind === 69) {
+ if (element.name.kind === 70) {
getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
}
assignBindingElementTypes(element);
@@ -29565,8 +29413,8 @@ var ts;
if (!links.type) {
links.type = instantiateType(contextualType, mapper);
if (links.type === emptyObjectType &&
- (parameter.valueDeclaration.name.kind === 167 ||
- parameter.valueDeclaration.name.kind === 168)) {
+ (parameter.valueDeclaration.name.kind === 168 ||
+ parameter.valueDeclaration.name.kind === 169)) {
links.type = getTypeFromBindingPattern(parameter.valueDeclaration.name);
}
assignBindingElementTypes(parameter.valueDeclaration);
@@ -29605,7 +29453,7 @@ var ts;
}
var isAsync = ts.isAsyncFunctionLike(func);
var type;
- if (func.body.kind !== 199) {
+ if (func.body.kind !== 200) {
type = checkExpressionCached(func.body, contextualMapper);
if (isAsync) {
type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member);
@@ -29684,7 +29532,7 @@ var ts;
return false;
}
var lastStatement = ts.lastOrUndefined(func.body.statements);
- if (lastStatement && lastStatement.kind === 213 && isExhaustiveSwitchStatement(lastStatement)) {
+ if (lastStatement && lastStatement.kind === 214 && isExhaustiveSwitchStatement(lastStatement)) {
return false;
}
return true;
@@ -29713,7 +29561,7 @@ var ts;
}
});
if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever ||
- func.kind === 179 || func.kind === 180)) {
+ func.kind === 180 || func.kind === 181)) {
return undefined;
}
if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) {
@@ -29730,7 +29578,7 @@ var ts;
if (returnType && maybeTypeOfKind(returnType, 1 | 1024)) {
return;
}
- if (ts.nodeIsMissing(func.body) || func.body.kind !== 199 || !functionHasImplicitReturn(func)) {
+ if (ts.nodeIsMissing(func.body) || func.body.kind !== 200 || !functionHasImplicitReturn(func)) {
return;
}
var hasExplicitReturn = func.flags & 256;
@@ -29757,9 +29605,9 @@ var ts;
}
}
function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) {
- ts.Debug.assert(node.kind !== 147 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 148 || ts.isObjectLiteralMethod(node));
var hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
- if (!hasGrammarError && node.kind === 179) {
+ if (!hasGrammarError && node.kind === 180) {
checkGrammarForGenerator(node);
}
if (contextualMapper === identityMapper && isContextSensitive(node)) {
@@ -29793,14 +29641,14 @@ var ts;
}
}
}
- if (produceDiagnostics && node.kind !== 147) {
+ if (produceDiagnostics && node.kind !== 148) {
checkCollisionWithCapturedSuperVariable(node, node.name);
checkCollisionWithCapturedThisVariable(node, node.name);
}
return type;
}
function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) {
- ts.Debug.assert(node.kind !== 147 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 148 || ts.isObjectLiteralMethod(node));
var isAsync = ts.isAsyncFunctionLike(node);
var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type));
if (!node.asteriskToken) {
@@ -29810,7 +29658,7 @@ var ts;
if (!node.type) {
getReturnTypeOfSignature(getSignatureFromDeclaration(node));
}
- if (node.body.kind === 199) {
+ if (node.body.kind === 200) {
checkSourceElement(node.body);
}
else {
@@ -29845,10 +29693,10 @@ var ts;
function isReferenceToReadonlyEntity(expr, symbol) {
if (isReadonlySymbol(symbol)) {
if (symbol.flags & 4 &&
- (expr.kind === 172 || expr.kind === 173) &&
- expr.expression.kind === 97) {
+ (expr.kind === 173 || expr.kind === 174) &&
+ expr.expression.kind === 98) {
var func = ts.getContainingFunction(expr);
- if (!(func && func.kind === 148))
+ if (!(func && func.kind === 149))
return true;
return !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent);
}
@@ -29857,13 +29705,13 @@ var ts;
return false;
}
function isReferenceThroughNamespaceImport(expr) {
- if (expr.kind === 172 || expr.kind === 173) {
+ if (expr.kind === 173 || expr.kind === 174) {
var node = skipParenthesizedNodes(expr.expression);
- if (node.kind === 69) {
+ if (node.kind === 70) {
var symbol = getNodeLinks(node).resolvedSymbol;
if (symbol.flags & 8388608) {
var declaration = getDeclarationOfAliasSymbol(symbol);
- return declaration && declaration.kind === 232;
+ return declaration && declaration.kind === 233;
}
}
}
@@ -29871,7 +29719,7 @@ var ts;
}
function checkReferenceExpression(expr, invalidReferenceMessage, constantVariableMessage) {
var node = skipParenthesizedNodes(expr);
- if (node.kind !== 69 && node.kind !== 172 && node.kind !== 173) {
+ if (node.kind !== 70 && node.kind !== 173 && node.kind !== 174) {
error(expr, invalidReferenceMessage);
return false;
}
@@ -29879,7 +29727,7 @@ var ts;
var symbol = getExportSymbolOfValueSymbolIfExported(links.resolvedSymbol);
if (symbol) {
if (symbol !== unknownSymbol && symbol !== argumentsSymbol) {
- if (node.kind === 69 && !(symbol.flags & 3)) {
+ if (node.kind === 70 && !(symbol.flags & 3)) {
error(expr, invalidReferenceMessage);
return false;
}
@@ -29889,7 +29737,7 @@ var ts;
}
}
}
- else if (node.kind === 173) {
+ else if (node.kind === 174) {
if (links.resolvedIndexInfo && links.resolvedIndexInfo.isReadonly) {
error(expr, constantVariableMessage);
return false;
@@ -29926,24 +29774,24 @@ var ts;
if (operandType === silentNeverType) {
return silentNeverType;
}
- if (node.operator === 36 && node.operand.kind === 8) {
+ if (node.operator === 37 && node.operand.kind === 8) {
return getFreshTypeOfLiteralType(getLiteralTypeForText(64, "" + -node.operand.text));
}
switch (node.operator) {
- case 35:
case 36:
- case 50:
+ case 37:
+ case 51:
if (maybeTypeOfKind(operandType, 512)) {
error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator));
}
return numberType;
- case 49:
+ case 50:
var facts = getTypeFacts(operandType) & (1048576 | 2097152);
return facts === 1048576 ? falseType :
facts === 2097152 ? trueType :
booleanType;
- case 41:
case 42:
+ case 43:
var ok = checkArithmeticOperandType(node.operand, getNonNullableType(operandType), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type);
if (ok) {
checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant_or_a_read_only_property);
@@ -29969,8 +29817,8 @@ var ts;
}
if (type.flags & 1572864) {
var types = type.types;
- for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
- var t = types_14[_i];
+ for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
+ var t = types_15[_i];
if (maybeTypeOfKind(t, kind)) {
return true;
}
@@ -29984,8 +29832,8 @@ var ts;
}
if (type.flags & 524288) {
var types = type.types;
- for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
- var t = types_15[_i];
+ for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
+ var t = types_16[_i];
if (!isTypeOfKind(t, kind)) {
return false;
}
@@ -29994,8 +29842,8 @@ var ts;
}
if (type.flags & 1048576) {
var types = type.types;
- for (var _a = 0, types_16 = types; _a < types_16.length; _a++) {
- var t = types_16[_a];
+ for (var _a = 0, types_17 = types; _a < types_17.length; _a++) {
+ var t = types_17[_a];
if (isTypeOfKind(t, kind)) {
return true;
}
@@ -30033,24 +29881,24 @@ var ts;
}
return booleanType;
}
- function checkObjectLiteralAssignment(node, sourceType, contextualMapper) {
+ function checkObjectLiteralAssignment(node, sourceType) {
var properties = node.properties;
for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) {
var p = properties_4[_i];
- checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, contextualMapper);
+ checkObjectLiteralDestructuringPropertyAssignment(sourceType, p);
}
return sourceType;
}
- function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, contextualMapper) {
+ function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property) {
if (property.kind === 253 || property.kind === 254) {
- var name_20 = property.name;
- if (name_20.kind === 140) {
- checkComputedPropertyName(name_20);
+ var name_17 = property.name;
+ if (name_17.kind === 141) {
+ checkComputedPropertyName(name_17);
}
- if (isComputedNonLiteralName(name_20)) {
+ if (isComputedNonLiteralName(name_17)) {
return undefined;
}
- var text = getTextOfPropertyName(name_20);
+ var text = getTextOfPropertyName(name_17);
var type = isTypeAny(objectLiteralType)
? objectLiteralType
: getTypeOfPropertyOfType(objectLiteralType, text) ||
@@ -30065,7 +29913,7 @@ var ts;
}
}
else {
- error(name_20, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name_20));
+ error(name_17, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name_17));
}
}
else {
@@ -30083,8 +29931,8 @@ var ts;
function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, contextualMapper) {
var elements = node.elements;
var element = elements[elementIndex];
- if (element.kind !== 193) {
- if (element.kind !== 191) {
+ if (element.kind !== 194) {
+ if (element.kind !== 192) {
var propName = "" + elementIndex;
var type = isTypeAny(sourceType)
? sourceType
@@ -30110,7 +29958,7 @@ var ts;
}
else {
var restExpression = element.expression;
- if (restExpression.kind === 187 && restExpression.operatorToken.kind === 56) {
+ if (restExpression.kind === 188 && restExpression.operatorToken.kind === 57) {
error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer);
}
else {
@@ -30137,14 +29985,14 @@ var ts;
else {
target = exprOrAssignment;
}
- if (target.kind === 187 && target.operatorToken.kind === 56) {
+ if (target.kind === 188 && target.operatorToken.kind === 57) {
checkBinaryExpression(target, contextualMapper);
target = target.left;
}
- if (target.kind === 171) {
- return checkObjectLiteralAssignment(target, sourceType, contextualMapper);
+ if (target.kind === 172) {
+ return checkObjectLiteralAssignment(target, sourceType);
}
- if (target.kind === 170) {
+ if (target.kind === 171) {
return checkArrayLiteralAssignment(target, sourceType, contextualMapper);
}
return checkReferenceAssignment(target, sourceType, contextualMapper);
@@ -30159,49 +30007,49 @@ var ts;
function isSideEffectFree(node) {
node = ts.skipParentheses(node);
switch (node.kind) {
- case 69:
+ case 70:
case 9:
- case 10:
- case 176:
- case 189:
case 11:
+ case 177:
+ case 190:
+ case 12:
case 8:
- case 99:
- case 84:
- case 93:
- case 135:
- case 179:
- case 192:
+ case 100:
+ case 85:
+ case 94:
+ case 136:
case 180:
- case 170:
+ case 193:
+ case 181:
case 171:
- case 182:
- case 196:
+ case 172:
+ case 183:
+ case 197:
+ case 243:
case 242:
- case 241:
return true;
- case 188:
+ case 189:
return isSideEffectFree(node.whenTrue) &&
isSideEffectFree(node.whenFalse);
- case 187:
+ case 188:
if (ts.isAssignmentOperator(node.operatorToken.kind)) {
return false;
}
return isSideEffectFree(node.left) &&
isSideEffectFree(node.right);
- case 185:
case 186:
+ case 187:
switch (node.operator) {
- case 49:
- case 35:
- case 36:
case 50:
+ case 36:
+ case 37:
+ case 51:
return true;
}
return false;
- case 183:
- case 177:
- case 195:
+ case 184:
+ case 178:
+ case 196:
default:
return false;
}
@@ -30221,34 +30069,34 @@ var ts;
}
function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) {
var operator = operatorToken.kind;
- if (operator === 56 && (left.kind === 171 || left.kind === 170)) {
+ if (operator === 57 && (left.kind === 172 || left.kind === 171)) {
return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper);
}
var leftType = checkExpression(left, contextualMapper);
var rightType = checkExpression(right, contextualMapper);
switch (operator) {
- case 37:
case 38:
- case 59:
- case 60:
case 39:
+ case 60:
case 61:
case 40:
case 62:
- case 36:
- case 58:
- case 43:
+ case 41:
case 63:
+ case 37:
+ case 59:
case 44:
case 64:
case 45:
case 65:
- case 47:
- case 67:
- case 48:
- case 68:
case 46:
case 66:
+ case 48:
+ case 68:
+ case 49:
+ case 69:
+ case 47:
+ case 67:
if (leftType === silentNeverType || rightType === silentNeverType) {
return silentNeverType;
}
@@ -30272,8 +30120,8 @@ var ts;
}
}
return numberType;
- case 35:
- case 57:
+ case 36:
+ case 58:
if (leftType === silentNeverType || rightType === silentNeverType) {
return silentNeverType;
}
@@ -30302,24 +30150,24 @@ var ts;
reportOperatorError();
return anyType;
}
- if (operator === 57) {
+ if (operator === 58) {
checkAssignmentOperator(resultType);
}
return resultType;
- case 25:
- case 27:
+ case 26:
case 28:
case 29:
+ case 30:
if (checkForDisallowedESSymbolOperand(operator)) {
if (!isTypeComparableTo(leftType, rightType) && !isTypeComparableTo(rightType, leftType)) {
reportOperatorError();
}
}
return booleanType;
- case 30:
case 31:
case 32:
case 33:
+ case 34:
var leftIsLiteral = isLiteralType(leftType);
var rightIsLiteral = isLiteralType(rightType);
if (!leftIsLiteral || !rightIsLiteral) {
@@ -30330,22 +30178,22 @@ var ts;
reportOperatorError();
}
return booleanType;
- case 91:
+ case 92:
return checkInstanceOfExpression(left, right, leftType, rightType);
- case 90:
+ case 91:
return checkInExpression(left, right, leftType, rightType);
- case 51:
+ case 52:
return getTypeFacts(leftType) & 1048576 ?
includeFalsyTypes(rightType, getFalsyFlags(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType))) :
leftType;
- case 52:
+ case 53:
return getTypeFacts(leftType) & 2097152 ?
getBestChoiceType(removeDefinitelyFalsyTypes(leftType), rightType) :
leftType;
- case 56:
+ case 57:
checkAssignmentOperator(rightType);
return getRegularTypeOfObjectLiteral(rightType);
- case 24:
+ case 25:
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left)) {
error(left, ts.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);
}
@@ -30363,21 +30211,21 @@ var ts;
}
function getSuggestedBooleanOperator(operator) {
switch (operator) {
+ case 48:
+ case 68:
+ return 53;
+ case 49:
+ case 69:
+ return 34;
case 47:
case 67:
return 52;
- case 48:
- case 68:
- return 33;
- case 46:
- case 66:
- return 51;
default:
return undefined;
}
}
function checkAssignmentOperator(valueType) {
- if (produceDiagnostics && operator >= 56 && operator <= 68) {
+ if (produceDiagnostics && operator >= 57 && operator <= 69) {
var ok = checkReferenceExpression(left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant_or_a_read_only_property);
if (ok) {
checkTypeAssignableTo(valueType, leftType, left, undefined);
@@ -30449,9 +30297,9 @@ var ts;
return getFreshTypeOfLiteralType(getLiteralTypeForText(32, node.text));
case 8:
return getFreshTypeOfLiteralType(getLiteralTypeForText(64, node.text));
- case 99:
+ case 100:
return trueType;
- case 84:
+ case 85:
return falseType;
}
}
@@ -30480,7 +30328,7 @@ var ts;
}
function isTypeAssertion(node) {
node = skipParenthesizedNodes(node);
- return node.kind === 177 || node.kind === 195;
+ return node.kind === 178 || node.kind === 196;
}
function checkDeclarationInitializer(declaration) {
var type = checkExpressionCached(declaration.initializer);
@@ -30506,14 +30354,14 @@ var ts;
return isTypeAssertion(node) || isLiteralContextualType(getContextualType(node)) ? type : getWidenedLiteralType(type);
}
function checkPropertyAssignment(node, contextualMapper) {
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
checkComputedPropertyName(node.name);
}
return checkExpressionForMutableLocation(node.initializer, contextualMapper);
}
function checkObjectLiteralMethod(node, contextualMapper) {
checkGrammarMethod(node);
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
checkComputedPropertyName(node.name);
}
var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper);
@@ -30536,7 +30384,7 @@ var ts;
}
function checkExpression(node, contextualMapper) {
var type;
- if (node.kind === 139) {
+ if (node.kind === 140) {
type = checkQualifiedName(node);
}
else {
@@ -30544,9 +30392,9 @@ var ts;
type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper);
}
if (isConstEnumObjectType(type)) {
- var ok = (node.parent.kind === 172 && node.parent.expression === node) ||
- (node.parent.kind === 173 && node.parent.expression === node) ||
- ((node.kind === 69 || node.kind === 139) && isInRightSideOfImportOrExportAssignment(node));
+ var ok = (node.parent.kind === 173 && node.parent.expression === node) ||
+ (node.parent.kind === 174 && node.parent.expression === node) ||
+ ((node.kind === 70 || node.kind === 140) && isInRightSideOfImportOrExportAssignment(node));
if (!ok) {
error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment);
}
@@ -30555,79 +30403,79 @@ var ts;
}
function checkExpressionWorker(node, contextualMapper) {
switch (node.kind) {
- case 69:
+ case 70:
return checkIdentifier(node);
- case 97:
+ case 98:
return checkThisExpression(node);
- case 95:
+ case 96:
return checkSuperExpression(node);
- case 93:
+ case 94:
return nullWideningType;
case 9:
case 8:
- case 99:
- case 84:
+ case 100:
+ case 85:
return checkLiteralExpression(node);
- case 189:
- return checkTemplateExpression(node);
- case 11:
- return stringType;
- case 10:
- return globalRegExpType;
- case 170:
- return checkArrayLiteral(node, contextualMapper);
- case 171:
- return checkObjectLiteral(node, contextualMapper);
- case 172:
- return checkPropertyAccessExpression(node);
- case 173:
- return checkIndexedAccess(node);
- case 174:
- case 175:
- return checkCallExpression(node);
- case 176:
- return checkTaggedTemplateExpression(node);
- case 178:
- return checkExpression(node.expression, contextualMapper);
- case 192:
- return checkClassExpression(node);
- case 179:
- case 180:
- return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper);
- case 182:
- return checkTypeOfExpression(node);
- case 177:
- case 195:
- return checkAssertion(node);
- case 196:
- return checkNonNullAssertion(node);
- case 181:
- return checkDeleteExpression(node);
- case 183:
- return checkVoidExpression(node);
- case 184:
- return checkAwaitExpression(node);
- case 185:
- return checkPrefixUnaryExpression(node);
- case 186:
- return checkPostfixUnaryExpression(node);
- case 187:
- return checkBinaryExpression(node, contextualMapper);
- case 188:
- return checkConditionalExpression(node, contextualMapper);
- case 191:
- return checkSpreadElementExpression(node, contextualMapper);
- case 193:
- return undefinedWideningType;
case 190:
+ return checkTemplateExpression(node);
+ case 12:
+ return stringType;
+ case 11:
+ return globalRegExpType;
+ case 171:
+ return checkArrayLiteral(node, contextualMapper);
+ case 172:
+ return checkObjectLiteral(node, contextualMapper);
+ case 173:
+ return checkPropertyAccessExpression(node);
+ case 174:
+ return checkIndexedAccess(node);
+ case 175:
+ case 176:
+ return checkCallExpression(node);
+ case 177:
+ return checkTaggedTemplateExpression(node);
+ case 179:
+ return checkExpression(node.expression, contextualMapper);
+ case 193:
+ return checkClassExpression(node);
+ case 180:
+ case 181:
+ return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper);
+ case 183:
+ return checkTypeOfExpression(node);
+ case 178:
+ case 196:
+ return checkAssertion(node);
+ case 197:
+ return checkNonNullAssertion(node);
+ case 182:
+ return checkDeleteExpression(node);
+ case 184:
+ return checkVoidExpression(node);
+ case 185:
+ return checkAwaitExpression(node);
+ case 186:
+ return checkPrefixUnaryExpression(node);
+ case 187:
+ return checkPostfixUnaryExpression(node);
+ case 188:
+ return checkBinaryExpression(node, contextualMapper);
+ case 189:
+ return checkConditionalExpression(node, contextualMapper);
+ case 192:
+ return checkSpreadElementExpression(node, contextualMapper);
+ case 194:
+ return undefinedWideningType;
+ case 191:
return checkYieldExpression(node);
case 248:
return checkJsxExpression(node);
- case 241:
- return checkJsxElement(node);
case 242:
- return checkJsxSelfClosingElement(node);
+ return checkJsxElement(node);
case 243:
+ return checkJsxSelfClosingElement(node);
+ case 244:
ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement");
}
return unknownType;
@@ -30648,7 +30496,7 @@ var ts;
var func = ts.getContainingFunction(node);
if (ts.getModifierFlags(node) & 92) {
func = ts.getContainingFunction(node);
- if (!(func.kind === 148 && ts.nodeIsPresent(func.body))) {
+ if (!(func.kind === 149 && ts.nodeIsPresent(func.body))) {
error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
}
}
@@ -30659,7 +30507,7 @@ var ts;
if (ts.indexOf(func.parameters, node) !== 0) {
error(node, ts.Diagnostics.A_this_parameter_must_be_the_first_parameter);
}
- if (func.kind === 148 || func.kind === 152 || func.kind === 157) {
+ if (func.kind === 149 || func.kind === 153 || func.kind === 158) {
error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter);
}
}
@@ -30671,15 +30519,15 @@ var ts;
if (!node.asteriskToken || !node.body) {
return false;
}
- return node.kind === 147 ||
- node.kind === 220 ||
- node.kind === 179;
+ return node.kind === 148 ||
+ node.kind === 221 ||
+ node.kind === 180;
}
function getTypePredicateParameterIndex(parameterList, parameter) {
if (parameterList) {
for (var i = 0; i < parameterList.length; i++) {
var param = parameterList[i];
- if (param.name.kind === 69 &&
+ if (param.name.kind === 70 &&
param.name.text === parameter.text) {
return i;
}
@@ -30714,9 +30562,9 @@ var ts;
else if (parameterName) {
var hasReportedError = false;
for (var _i = 0, _a = parent.parameters; _i < _a.length; _i++) {
- var name_21 = _a[_i].name;
- if (ts.isBindingPattern(name_21) &&
- checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_21, parameterName, typePredicate.parameterName)) {
+ var name_18 = _a[_i].name;
+ if (ts.isBindingPattern(name_18) &&
+ checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_18, parameterName, typePredicate.parameterName)) {
hasReportedError = true;
break;
}
@@ -30729,13 +30577,13 @@ var ts;
}
function getTypePredicateParent(node) {
switch (node.parent.kind) {
+ case 181:
+ case 152:
+ case 221:
case 180:
- case 151:
- case 220:
- case 179:
- case 156:
+ case 157:
+ case 148:
case 147:
- case 146:
var parent_12 = node.parent;
if (node === parent_12.type) {
return parent_12;
@@ -30748,27 +30596,27 @@ var ts;
if (ts.isOmittedExpression(element)) {
continue;
}
- var name_22 = element.name;
- if (name_22.kind === 69 &&
- name_22.text === predicateVariableName) {
+ var name_19 = element.name;
+ if (name_19.kind === 70 &&
+ name_19.text === predicateVariableName) {
error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName);
return true;
}
- else if (name_22.kind === 168 ||
- name_22.kind === 167) {
- if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_22, predicateVariableNode, predicateVariableName)) {
+ else if (name_19.kind === 169 ||
+ name_19.kind === 168) {
+ if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_19, predicateVariableNode, predicateVariableName)) {
return true;
}
}
}
}
function checkSignatureDeclaration(node) {
- if (node.kind === 153) {
+ if (node.kind === 154) {
checkGrammarIndexSignature(node);
}
- else if (node.kind === 156 || node.kind === 220 || node.kind === 157 ||
- node.kind === 151 || node.kind === 148 ||
- node.kind === 152) {
+ else if (node.kind === 157 || node.kind === 221 || node.kind === 158 ||
+ node.kind === 152 || node.kind === 149 ||
+ node.kind === 153) {
checkGrammarFunctionLikeDeclaration(node);
}
checkTypeParameters(node.typeParameters);
@@ -30780,10 +30628,10 @@ var ts;
checkCollisionWithArgumentsInGeneratedCode(node);
if (compilerOptions.noImplicitAny && !node.type) {
switch (node.kind) {
- case 152:
+ case 153:
error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
- case 151:
+ case 152:
error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
}
@@ -30810,11 +30658,17 @@ var ts;
}
}
function checkClassForDuplicateDeclarations(node) {
+ var Accessor;
+ (function (Accessor) {
+ Accessor[Accessor["Getter"] = 1] = "Getter";
+ Accessor[Accessor["Setter"] = 2] = "Setter";
+ Accessor[Accessor["Property"] = 3] = "Property";
+ })(Accessor || (Accessor = {}));
var instanceNames = ts.createMap();
var staticNames = ts.createMap();
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind === 148) {
+ if (member.kind === 149) {
for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
var param = _c[_b];
if (ts.isParameterPropertyDeclaration(param)) {
@@ -30823,18 +30677,18 @@ var ts;
}
}
else {
- var isStatic = ts.forEach(member.modifiers, function (m) { return m.kind === 113; });
+ var isStatic = ts.forEach(member.modifiers, function (m) { return m.kind === 114; });
var names = isStatic ? staticNames : instanceNames;
var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name);
if (memberName) {
switch (member.kind) {
- case 149:
+ case 150:
addName(names, member.name, memberName, 1);
break;
- case 150:
+ case 151:
addName(names, member.name, memberName, 2);
break;
- case 145:
+ case 146:
addName(names, member.name, memberName, 3);
break;
}
@@ -30860,12 +30714,12 @@ var ts;
var names = ts.createMap();
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind == 144) {
+ if (member.kind == 145) {
var memberName = void 0;
switch (member.name.kind) {
case 9:
case 8:
- case 69:
+ case 70:
memberName = member.name.text;
break;
default:
@@ -30882,7 +30736,7 @@ var ts;
}
}
function checkTypeForDuplicateIndexSignatures(node) {
- if (node.kind === 222) {
+ if (node.kind === 223) {
var nodeSymbol = getSymbolOfNode(node);
if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) {
return;
@@ -30897,7 +30751,7 @@ var ts;
var declaration = decl;
if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
switch (declaration.parameters[0].type.kind) {
- case 132:
+ case 133:
if (!seenStringIndexer) {
seenStringIndexer = true;
}
@@ -30905,7 +30759,7 @@ var ts;
error(declaration, ts.Diagnostics.Duplicate_string_index_signature);
}
break;
- case 130:
+ case 131:
if (!seenNumericIndexer) {
seenNumericIndexer = true;
}
@@ -30961,15 +30815,15 @@ var ts;
return ts.forEachChild(n, containsSuperCall);
}
function markThisReferencesAsErrors(n) {
- if (n.kind === 97) {
+ if (n.kind === 98) {
error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location);
}
- else if (n.kind !== 179 && n.kind !== 220) {
+ else if (n.kind !== 180 && n.kind !== 221) {
ts.forEachChild(n, markThisReferencesAsErrors);
}
}
function isInstancePropertyWithInitializer(n) {
- return n.kind === 145 &&
+ return n.kind === 146 &&
!(ts.getModifierFlags(n) & 32) &&
!!n.initializer;
}
@@ -30989,7 +30843,7 @@ var ts;
var superCallStatement = void 0;
for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) {
var statement = statements_2[_i];
- if (statement.kind === 202 && ts.isSuperCall(statement.expression)) {
+ if (statement.kind === 203 && ts.isSuperCall(statement.expression)) {
superCallStatement = statement;
break;
}
@@ -31012,18 +30866,18 @@ var ts;
checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name);
checkDecorators(node);
checkSignatureDeclaration(node);
- if (node.kind === 149) {
+ if (node.kind === 150) {
if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 128)) {
if (!(node.flags & 256)) {
error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value);
}
}
}
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
checkComputedPropertyName(node.name);
}
if (!ts.hasDynamicName(node)) {
- var otherKind = node.kind === 149 ? 150 : 149;
+ var otherKind = node.kind === 150 ? 151 : 150;
var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind);
if (otherAccessor) {
if ((ts.getModifierFlags(node) & 28) !== (ts.getModifierFlags(otherAccessor) & 28)) {
@@ -31037,11 +30891,11 @@ var ts;
}
}
var returnType = getTypeOfAccessors(getSymbolOfNode(node));
- if (node.kind === 149) {
+ if (node.kind === 150) {
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
}
}
- if (node.parent.kind !== 171) {
+ if (node.parent.kind !== 172) {
checkSourceElement(node.body);
registerForUnusedIdentifiersCheck(node);
}
@@ -31127,9 +30981,9 @@ var ts;
}
function getEffectiveDeclarationFlags(n, flagsToCheck) {
var flags = ts.getCombinedModifierFlags(n);
- if (n.parent.kind !== 222 &&
- n.parent.kind !== 221 &&
- n.parent.kind !== 192 &&
+ if (n.parent.kind !== 223 &&
+ n.parent.kind !== 222 &&
+ n.parent.kind !== 193 &&
ts.isInAmbientContext(n)) {
if (!(flags & 2)) {
flags |= 1;
@@ -31206,7 +31060,7 @@ var ts;
if (subsequentNode.kind === node.kind) {
var errorNode_1 = subsequentNode.name || subsequentNode;
if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) {
- var reportError = (node.kind === 147 || node.kind === 146) &&
+ var reportError = (node.kind === 148 || node.kind === 147) &&
(ts.getModifierFlags(node) & 32) !== (ts.getModifierFlags(subsequentNode) & 32);
if (reportError) {
var diagnostic = ts.getModifierFlags(node) & 32 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
@@ -31239,11 +31093,11 @@ var ts;
var current = declarations_4[_i];
var node = current;
var inAmbientContext = ts.isInAmbientContext(node);
- var inAmbientContextOrInterface = node.parent.kind === 222 || node.parent.kind === 159 || inAmbientContext;
+ var inAmbientContextOrInterface = node.parent.kind === 223 || node.parent.kind === 160 || inAmbientContext;
if (inAmbientContextOrInterface) {
previousDeclaration = undefined;
}
- if (node.kind === 220 || node.kind === 147 || node.kind === 146 || node.kind === 148) {
+ if (node.kind === 221 || node.kind === 148 || node.kind === 147 || node.kind === 149) {
var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck);
someNodeFlags |= currentNodeFlags;
allNodeFlags &= currentNodeFlags;
@@ -31354,16 +31208,16 @@ var ts;
}
function getDeclarationSpaces(d) {
switch (d.kind) {
- case 222:
+ case 223:
return 2097152;
- case 225:
+ case 226:
return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0
? 4194304 | 1048576
: 4194304;
- case 221:
- case 224:
+ case 222:
+ case 225:
return 2097152 | 1048576;
- case 229:
+ case 230:
var result_2 = 0;
var target = resolveAlias(getSymbolOfNode(d));
ts.forEach(target.declarations, function (d) { result_2 |= getDeclarationSpaces(d); });
@@ -31511,22 +31365,22 @@ var ts;
var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
var errorInfo;
switch (node.parent.kind) {
- case 221:
+ case 222:
var classSymbol = getSymbolOfNode(node.parent);
var classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 142:
+ case 143:
expectedReturnType = voidType;
errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
break;
- case 145:
+ case 146:
expectedReturnType = voidType;
errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
break;
- case 147:
- case 149:
+ case 148:
case 150:
+ case 151:
var methodType = getTypeOfNode(node.parent);
var descriptorType = createTypedPropertyDescriptorType(methodType);
expectedReturnType = getUnionType([descriptorType, voidType]);
@@ -31535,9 +31389,9 @@ var ts;
checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, errorInfo);
}
function checkTypeNodeAsExpression(node) {
- if (node && node.kind === 155) {
+ if (node && node.kind === 156) {
var root = getFirstIdentifier(node.typeName);
- var meaning = root.parent.kind === 155 ? 793064 : 1920;
+ var meaning = root.parent.kind === 156 ? 793064 : 1920;
var rootSymbol = resolveName(root, root.text, meaning | 8388608, undefined, undefined);
if (rootSymbol && rootSymbol.flags & 8388608) {
var aliasTarget = resolveAlias(rootSymbol);
@@ -31571,20 +31425,20 @@ var ts;
}
if (compilerOptions.emitDecoratorMetadata) {
switch (node.kind) {
- case 221:
+ case 222:
var constructor = ts.getFirstConstructorWithBody(node);
if (constructor) {
checkParameterTypeAnnotationsAsExpressions(constructor);
}
break;
- case 147:
- case 149:
+ case 148:
case 150:
+ case 151:
checkParameterTypeAnnotationsAsExpressions(node);
checkReturnTypeAnnotationAsExpression(node);
break;
- case 145:
- case 142:
+ case 146:
+ case 143:
checkTypeAnnotationAsExpression(node);
break;
}
@@ -31604,7 +31458,7 @@ var ts;
checkDecorators(node);
checkSignatureDeclaration(node);
var isAsync = ts.isAsyncFunctionLike(node);
- if (node.name && node.name.kind === 140) {
+ if (node.name && node.name.kind === 141) {
checkComputedPropertyName(node.name);
}
if (!ts.hasDynamicName(node)) {
@@ -31647,42 +31501,42 @@ var ts;
var node = deferredUnusedIdentifierNodes_1[_i];
switch (node.kind) {
case 256:
- case 225:
+ case 226:
checkUnusedModuleMembers(node);
break;
- case 221:
- case 192:
+ case 222:
+ case 193:
checkUnusedClassMembers(node);
checkUnusedTypeParameters(node);
break;
- case 222:
+ case 223:
checkUnusedTypeParameters(node);
break;
- case 199:
- case 227:
- case 206:
+ case 200:
+ case 228:
case 207:
case 208:
+ case 209:
checkUnusedLocalsAndParameters(node);
break;
- case 148:
- case 179:
- case 220:
- case 180:
- case 147:
case 149:
+ case 180:
+ case 221:
+ case 181:
+ case 148:
case 150:
+ case 151:
if (node.body) {
checkUnusedLocalsAndParameters(node);
}
checkUnusedTypeParameters(node);
break;
- case 146:
- case 151:
+ case 147:
case 152:
case 153:
- case 156:
+ case 154:
case 157:
+ case 158:
checkUnusedTypeParameters(node);
break;
}
@@ -31691,11 +31545,11 @@ var ts;
}
}
function checkUnusedLocalsAndParameters(node) {
- if (node.parent.kind !== 222 && noUnusedIdentifiers && !ts.isInAmbientContext(node)) {
+ if (node.parent.kind !== 223 && noUnusedIdentifiers && !ts.isInAmbientContext(node)) {
var _loop_1 = function (key) {
var local = node.locals[key];
if (!local.isReferenced) {
- if (local.valueDeclaration && local.valueDeclaration.kind === 142) {
+ if (local.valueDeclaration && local.valueDeclaration.kind === 143) {
var parameter = local.valueDeclaration;
if (compilerOptions.noUnusedParameters &&
!ts.isParameterPropertyDeclaration(parameter) &&
@@ -31715,19 +31569,19 @@ var ts;
}
}
function parameterNameStartsWithUnderscore(parameter) {
- return parameter.name && parameter.name.kind === 69 && parameter.name.text.charCodeAt(0) === 95;
+ return parameter.name && parameter.name.kind === 70 && parameter.name.text.charCodeAt(0) === 95;
}
function checkUnusedClassMembers(node) {
if (compilerOptions.noUnusedLocals && !ts.isInAmbientContext(node)) {
if (node.members) {
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind === 147 || member.kind === 145) {
+ if (member.kind === 148 || member.kind === 146) {
if (!member.symbol.isReferenced && ts.getModifierFlags(member) & 8) {
error(member.name, ts.Diagnostics._0_is_declared_but_never_used, member.symbol.name);
}
}
- else if (member.kind === 148) {
+ else if (member.kind === 149) {
for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
var parameter = _c[_b];
if (!parameter.symbol.isReferenced && ts.getModifierFlags(parameter) & 8) {
@@ -31772,7 +31626,7 @@ var ts;
}
}
function checkBlock(node) {
- if (node.kind === 199) {
+ if (node.kind === 200) {
checkGrammarStatementInAmbientContext(node);
}
ts.forEach(node.statements, checkSourceElement);
@@ -31794,19 +31648,19 @@ var ts;
if (!(identifier && identifier.text === name)) {
return false;
}
- if (node.kind === 145 ||
- node.kind === 144 ||
+ if (node.kind === 146 ||
+ node.kind === 145 ||
+ node.kind === 148 ||
node.kind === 147 ||
- node.kind === 146 ||
- node.kind === 149 ||
- node.kind === 150) {
+ node.kind === 150 ||
+ node.kind === 151) {
return false;
}
if (ts.isInAmbientContext(node)) {
return false;
}
var root = ts.getRootDeclaration(node);
- if (root.kind === 142 && ts.nodeIsMissing(root.parent.body)) {
+ if (root.kind === 143 && ts.nodeIsMissing(root.parent.body)) {
return false;
}
return true;
@@ -31820,7 +31674,7 @@ var ts;
var current = node;
while (current) {
if (getNodeCheckFlags(current) & 4) {
- var isDeclaration_1 = node.kind !== 69;
+ var isDeclaration_1 = node.kind !== 70;
if (isDeclaration_1) {
error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference);
}
@@ -31841,7 +31695,7 @@ var ts;
return;
}
if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) {
- var isDeclaration_2 = node.kind !== 69;
+ var isDeclaration_2 = node.kind !== 70;
if (isDeclaration_2) {
error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference);
}
@@ -31851,13 +31705,13 @@ var ts;
}
}
function checkCollisionWithRequireExportsInGeneratedCode(node, name) {
- if (modulekind >= ts.ModuleKind.ES6) {
+ if (modulekind >= ts.ModuleKind.ES2015) {
return;
}
if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) {
return;
}
- if (node.kind === 225 && ts.getModuleInstanceState(node) !== 1) {
+ if (node.kind === 226 && ts.getModuleInstanceState(node) !== 1) {
return;
}
var parent = getDeclarationContainer(node);
@@ -31869,7 +31723,7 @@ var ts;
if (!needCollisionCheckForIdentifier(node, name, "Promise")) {
return;
}
- if (node.kind === 225 && ts.getModuleInstanceState(node) !== 1) {
+ if (node.kind === 226 && ts.getModuleInstanceState(node) !== 1) {
return;
}
var parent = getDeclarationContainer(node);
@@ -31881,7 +31735,7 @@ var ts;
if ((ts.getCombinedNodeFlags(node) & 3) !== 0 || ts.isParameterDeclaration(node)) {
return;
}
- if (node.kind === 218 && !node.initializer) {
+ if (node.kind === 219 && !node.initializer) {
return;
}
var symbol = getSymbolOfNode(node);
@@ -31891,25 +31745,25 @@ var ts;
localDeclarationSymbol !== symbol &&
localDeclarationSymbol.flags & 2) {
if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3) {
- var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 219);
- var container = varDeclList.parent.kind === 200 && varDeclList.parent.parent
+ var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 220);
+ var container = varDeclList.parent.kind === 201 && varDeclList.parent.parent
? varDeclList.parent.parent
: undefined;
var namesShareScope = container &&
- (container.kind === 199 && ts.isFunctionLike(container.parent) ||
+ (container.kind === 200 && ts.isFunctionLike(container.parent) ||
+ container.kind === 227 ||
container.kind === 226 ||
- container.kind === 225 ||
container.kind === 256);
if (!namesShareScope) {
- var name_23 = symbolToString(localDeclarationSymbol);
- error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_23, name_23);
+ var name_20 = symbolToString(localDeclarationSymbol);
+ error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_20, name_20);
}
}
}
}
}
function checkParameterInitializer(node) {
- if (ts.getRootDeclaration(node).kind !== 142) {
+ if (ts.getRootDeclaration(node).kind !== 143) {
return;
}
var func = ts.getContainingFunction(node);
@@ -31918,10 +31772,10 @@ var ts;
if (ts.isTypeNode(n) || ts.isDeclarationName(n)) {
return;
}
- if (n.kind === 172) {
+ if (n.kind === 173) {
return visit(n.expression);
}
- else if (n.kind === 69) {
+ else if (n.kind === 70) {
var symbol = resolveName(n, n.text, 107455 | 8388608, undefined, undefined);
if (!symbol || symbol === unknownSymbol || !symbol.valueDeclaration) {
return;
@@ -31932,7 +31786,7 @@ var ts;
}
var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);
if (enclosingContainer === func) {
- if (symbol.valueDeclaration.kind === 142) {
+ if (symbol.valueDeclaration.kind === 143) {
if (symbol.valueDeclaration.pos < node.pos) {
return;
}
@@ -31941,7 +31795,7 @@ var ts;
if (ts.isFunctionLike(current.parent)) {
return;
}
- if (current.parent.kind === 145 &&
+ if (current.parent.kind === 146 &&
!(ts.hasModifier(current.parent, 32)) &&
ts.isClassLike(current.parent.parent)) {
return;
@@ -31958,25 +31812,25 @@ var ts;
}
}
function convertAutoToAny(type) {
- return type === autoType ? anyType : type;
+ return type === autoType ? anyType : type === autoArrayType ? anyArrayType : type;
}
function checkVariableLikeDeclaration(node) {
checkDecorators(node);
checkSourceElement(node.type);
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
checkComputedPropertyName(node.name);
if (node.initializer) {
checkExpressionCached(node.initializer);
}
}
- if (node.kind === 169) {
- if (node.propertyName && node.propertyName.kind === 140) {
+ if (node.kind === 170) {
+ if (node.propertyName && node.propertyName.kind === 141) {
checkComputedPropertyName(node.propertyName);
}
var parent_13 = node.parent.parent;
var parentType = getTypeForBindingElementParent(parent_13);
- var name_24 = node.propertyName || node.name;
- var property = getPropertyOfType(parentType, getTextOfPropertyName(name_24));
+ var name_21 = node.propertyName || node.name;
+ var property = getPropertyOfType(parentType, getTextOfPropertyName(name_21));
if (parent_13.initializer && property && getParentOfSymbol(property)) {
checkClassPropertyAccess(parent_13, parent_13.initializer, parentType, property);
}
@@ -31984,12 +31838,12 @@ var ts;
if (ts.isBindingPattern(node.name)) {
ts.forEach(node.name.elements, checkSourceElement);
}
- if (node.initializer && ts.getRootDeclaration(node).kind === 142 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) {
+ if (node.initializer && ts.getRootDeclaration(node).kind === 143 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) {
error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation);
return;
}
if (ts.isBindingPattern(node.name)) {
- if (node.initializer && node.parent.parent.kind !== 207) {
+ if (node.initializer && node.parent.parent.kind !== 208) {
checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, undefined);
checkParameterInitializer(node);
}
@@ -31998,7 +31852,7 @@ var ts;
var symbol = getSymbolOfNode(node);
var type = convertAutoToAny(getTypeOfVariableOrParameterOrProperty(symbol));
if (node === symbol.valueDeclaration) {
- if (node.initializer && node.parent.parent.kind !== 207) {
+ if (node.initializer && node.parent.parent.kind !== 208) {
checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, undefined);
checkParameterInitializer(node);
}
@@ -32016,9 +31870,9 @@ var ts;
error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
}
}
- if (node.kind !== 145 && node.kind !== 144) {
+ if (node.kind !== 146 && node.kind !== 145) {
checkExportsOnMergedDeclarations(node);
- if (node.kind === 218 || node.kind === 169) {
+ if (node.kind === 219 || node.kind === 170) {
checkVarDeclaredNamesNotShadowed(node);
}
checkCollisionWithCapturedSuperVariable(node, node.name);
@@ -32028,8 +31882,8 @@ var ts;
}
}
function areDeclarationFlagsIdentical(left, right) {
- if ((left.kind === 142 && right.kind === 218) ||
- (left.kind === 218 && right.kind === 142)) {
+ if ((left.kind === 143 && right.kind === 219) ||
+ (left.kind === 219 && right.kind === 143)) {
return true;
}
if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) {
@@ -32056,7 +31910,7 @@ var ts;
ts.forEach(node.declarationList.declarations, checkSourceElement);
}
function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) {
- if (node.modifiers && node.parent.kind === 171) {
+ if (node.modifiers && node.parent.kind === 172) {
if (ts.isAsyncFunctionLike(node)) {
if (node.modifiers.length > 1) {
return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here);
@@ -32075,7 +31929,7 @@ var ts;
checkGrammarStatementInAmbientContext(node);
checkExpression(node.expression);
checkSourceElement(node.thenStatement);
- if (node.thenStatement.kind === 201) {
+ if (node.thenStatement.kind === 202) {
error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
}
checkSourceElement(node.elseStatement);
@@ -32092,12 +31946,12 @@ var ts;
}
function checkForStatement(node) {
if (!checkGrammarStatementInAmbientContext(node)) {
- if (node.initializer && node.initializer.kind === 219) {
+ if (node.initializer && node.initializer.kind === 220) {
checkGrammarVariableDeclarationList(node.initializer);
}
}
if (node.initializer) {
- if (node.initializer.kind === 219) {
+ if (node.initializer.kind === 220) {
ts.forEach(node.initializer.declarations, checkVariableDeclaration);
}
else {
@@ -32115,13 +31969,13 @@ var ts;
}
function checkForOfStatement(node) {
checkGrammarForInOrForOfStatement(node);
- if (node.initializer.kind === 219) {
+ if (node.initializer.kind === 220) {
checkForInOrForOfVariableDeclaration(node);
}
else {
var varExpr = node.initializer;
var iteratedType = checkRightHandSideOfForOf(node.expression);
- if (varExpr.kind === 170 || varExpr.kind === 171) {
+ if (varExpr.kind === 171 || varExpr.kind === 172) {
checkDestructuringAssignment(varExpr, iteratedType || unknownType);
}
else {
@@ -32139,7 +31993,7 @@ var ts;
}
function checkForInStatement(node) {
checkGrammarForInOrForOfStatement(node);
- if (node.initializer.kind === 219) {
+ if (node.initializer.kind === 220) {
var variable = node.initializer.declarations[0];
if (variable && ts.isBindingPattern(variable.name)) {
error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
@@ -32149,7 +32003,7 @@ var ts;
else {
var varExpr = node.initializer;
var leftType = checkExpression(varExpr);
- if (varExpr.kind === 170 || varExpr.kind === 171) {
+ if (varExpr.kind === 171 || varExpr.kind === 172) {
error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
}
else if (!isTypeAnyOrAllConstituentTypesHaveKind(leftType, 34)) {
@@ -32322,7 +32176,7 @@ var ts;
checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node);
}
function isGetAccessorWithAnnotatedSetAccessor(node) {
- return !!(node.kind === 149 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 150)));
+ return !!(node.kind === 150 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 151)));
}
function isUnwrappedReturnTypeVoidOrAny(func, returnType) {
var unwrappedReturnType = ts.isAsyncFunctionLike(func) ? getPromisedType(returnType) : returnType;
@@ -32344,12 +32198,12 @@ var ts;
if (func.asteriskToken) {
return;
}
- if (func.kind === 150) {
+ if (func.kind === 151) {
if (node.expression) {
error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value);
}
}
- else if (func.kind === 148) {
+ else if (func.kind === 149) {
if (node.expression && !checkTypeAssignableTo(exprType, returnType, node.expression)) {
error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
}
@@ -32367,7 +32221,7 @@ var ts;
}
}
}
- else if (func.kind !== 148 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) {
+ else if (func.kind !== 149 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) {
error(node, ts.Diagnostics.Not_all_code_paths_return_a_value);
}
}
@@ -32424,7 +32278,7 @@ var ts;
if (ts.isFunctionLike(current)) {
break;
}
- if (current.kind === 214 && current.label.text === node.label.text) {
+ if (current.kind === 215 && current.label.text === node.label.text) {
var sourceFile = ts.getSourceFileOfNode(node);
grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label));
break;
@@ -32450,7 +32304,7 @@ var ts;
var catchClause = node.catchClause;
if (catchClause) {
if (catchClause.variableDeclaration) {
- if (catchClause.variableDeclaration.name.kind !== 69) {
+ if (catchClause.variableDeclaration.name.kind !== 70) {
grammarErrorOnFirstToken(catchClause.variableDeclaration.name, ts.Diagnostics.Catch_clause_variable_name_must_be_an_identifier);
}
else if (catchClause.variableDeclaration.type) {
@@ -32518,7 +32372,7 @@ var ts;
return;
}
var errorNode;
- if (prop.valueDeclaration.name.kind === 140 || prop.parent === containingType.symbol) {
+ if (prop.valueDeclaration.name.kind === 141 || prop.parent === containingType.symbol) {
errorNode = prop.valueDeclaration;
}
else if (indexDeclaration) {
@@ -32569,7 +32423,7 @@ var ts;
var firstDecl;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 221 || declaration.kind === 222) {
+ if (declaration.kind === 222 || declaration.kind === 223) {
if (!firstDecl) {
firstDecl = declaration;
}
@@ -32706,7 +32560,7 @@ var ts;
if (derived === base) {
var derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol);
if (baseDeclarationFlags & 128 && (!derivedClassDecl || !(ts.getModifierFlags(derivedClassDecl) & 128))) {
- if (derivedClassDecl.kind === 192) {
+ if (derivedClassDecl.kind === 193) {
error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType));
}
else {
@@ -32750,7 +32604,7 @@ var ts;
}
}
function isAccessor(kind) {
- return kind === 149 || kind === 150;
+ return kind === 150 || kind === 151;
}
function areTypeParametersIdentical(list1, list2) {
if (!list1 && !list2) {
@@ -32817,7 +32671,7 @@ var ts;
checkExportsOnMergedDeclarations(node);
var symbol = getSymbolOfNode(node);
checkTypeParameterListsIdentical(node, symbol);
- var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 222);
+ var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 223);
if (node === firstInterfaceDecl) {
var type = getDeclaredTypeOfSymbol(symbol);
var typeWithThis = getTypeWithThisArgument(type);
@@ -32912,18 +32766,18 @@ var ts;
return value;
function evalConstant(e) {
switch (e.kind) {
- case 185:
+ case 186:
var value_1 = evalConstant(e.operand);
if (value_1 === undefined) {
return undefined;
}
switch (e.operator) {
- case 35: return value_1;
- case 36: return -value_1;
- case 50: return ~value_1;
+ case 36: return value_1;
+ case 37: return -value_1;
+ case 51: return ~value_1;
}
return undefined;
- case 187:
+ case 188:
var left = evalConstant(e.left);
if (left === undefined) {
return undefined;
@@ -32933,37 +32787,37 @@ var ts;
return undefined;
}
switch (e.operatorToken.kind) {
- case 47: return left | right;
- case 46: return left & right;
- case 44: return left >> right;
- case 45: return left >>> right;
- case 43: return left << right;
- case 48: return left ^ right;
- case 37: return left * right;
- case 39: return left / right;
- case 35: return left + right;
- case 36: return left - right;
- case 40: return left % right;
+ case 48: return left | right;
+ case 47: return left & right;
+ case 45: return left >> right;
+ case 46: return left >>> right;
+ case 44: return left << right;
+ case 49: return left ^ right;
+ case 38: return left * right;
+ case 40: return left / right;
+ case 36: return left + right;
+ case 37: return left - right;
+ case 41: return left % right;
}
return undefined;
case 8:
return +e.text;
- case 178:
+ case 179:
return evalConstant(e.expression);
- case 69:
+ case 70:
+ case 174:
case 173:
- case 172:
var member = initializer.parent;
var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent));
var enumType_1;
var propertyName = void 0;
- if (e.kind === 69) {
+ if (e.kind === 70) {
enumType_1 = currentType;
propertyName = e.text;
}
else {
var expression = void 0;
- if (e.kind === 173) {
+ if (e.kind === 174) {
if (e.argumentExpression === undefined ||
e.argumentExpression.kind !== 9) {
return undefined;
@@ -32977,10 +32831,10 @@ var ts;
}
var current = expression;
while (current) {
- if (current.kind === 69) {
+ if (current.kind === 70) {
break;
}
- else if (current.kind === 172) {
+ else if (current.kind === 173) {
current = current.expression;
}
else {
@@ -33040,7 +32894,7 @@ var ts;
}
var seenEnumMissingInitialInitializer_1 = false;
ts.forEach(enumSymbol.declarations, function (declaration) {
- if (declaration.kind !== 224) {
+ if (declaration.kind !== 225) {
return false;
}
var enumDeclaration = declaration;
@@ -33063,8 +32917,8 @@ var ts;
var declarations = symbol.declarations;
for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
var declaration = declarations_5[_i];
- if ((declaration.kind === 221 ||
- (declaration.kind === 220 && ts.nodeIsPresent(declaration.body))) &&
+ if ((declaration.kind === 222 ||
+ (declaration.kind === 221 && ts.nodeIsPresent(declaration.body))) &&
!ts.isInAmbientContext(declaration)) {
return declaration;
}
@@ -33123,7 +32977,7 @@ var ts;
error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged);
}
}
- var mergedClass = ts.getDeclarationOfKind(symbol, 221);
+ var mergedClass = ts.getDeclarationOfKind(symbol, 222);
if (mergedClass &&
inSameLexicalScope(node, mergedClass)) {
getNodeLinks(node).flags |= 32768;
@@ -33166,36 +33020,36 @@ var ts;
}
function checkModuleAugmentationElement(node, isGlobalAugmentation) {
switch (node.kind) {
- case 200:
+ case 201:
for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
var decl = _a[_i];
checkModuleAugmentationElement(decl, isGlobalAugmentation);
}
break;
- case 235:
case 236:
+ case 237:
grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);
break;
- case 229:
case 230:
+ case 231:
grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
break;
- case 169:
- case 218:
- var name_25 = node.name;
- if (ts.isBindingPattern(name_25)) {
- for (var _b = 0, _c = name_25.elements; _b < _c.length; _b++) {
+ case 170:
+ case 219:
+ var name_22 = node.name;
+ if (ts.isBindingPattern(name_22)) {
+ for (var _b = 0, _c = name_22.elements; _b < _c.length; _b++) {
var el = _c[_b];
checkModuleAugmentationElement(el, isGlobalAugmentation);
}
break;
}
- case 221:
- case 224:
- case 220:
case 222:
case 225:
+ case 221:
case 223:
+ case 226:
+ case 224:
if (isGlobalAugmentation) {
return;
}
@@ -33211,17 +33065,17 @@ var ts;
}
function getFirstIdentifier(node) {
switch (node.kind) {
- case 69:
+ case 70:
return node;
- case 139:
+ case 140:
do {
node = node.left;
- } while (node.kind !== 69);
+ } while (node.kind !== 70);
return node;
- case 172:
+ case 173:
do {
node = node.expression;
- } while (node.kind !== 69);
+ } while (node.kind !== 70);
return node;
}
}
@@ -33231,9 +33085,9 @@ var ts;
error(moduleName, ts.Diagnostics.String_literal_expected);
return false;
}
- var inAmbientExternalModule = node.parent.kind === 226 && ts.isAmbientModule(node.parent.parent);
+ var inAmbientExternalModule = node.parent.kind === 227 && ts.isAmbientModule(node.parent.parent);
if (node.parent.kind !== 256 && !inAmbientExternalModule) {
- error(moduleName, node.kind === 236 ?
+ error(moduleName, node.kind === 237 ?
ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace :
ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
return false;
@@ -33254,7 +33108,7 @@ var ts;
(symbol.flags & 793064 ? 793064 : 0) |
(symbol.flags & 1920 ? 1920 : 0);
if (target.flags & excludedMeanings) {
- var message = node.kind === 238 ?
+ var message = node.kind === 239 ?
ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 :
ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
error(node, message, symbolToString(symbol));
@@ -33281,7 +33135,7 @@ var ts;
checkImportBinding(importClause);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 232) {
+ if (importClause.namedBindings.kind === 233) {
checkImportBinding(importClause.namedBindings);
}
else {
@@ -33316,7 +33170,7 @@ var ts;
}
}
else {
- if (modulekind === ts.ModuleKind.ES6 && !ts.isInAmbientContext(node)) {
+ if (modulekind === ts.ModuleKind.ES2015 && !ts.isInAmbientContext(node)) {
grammarErrorOnNode(node, ts.Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_2015_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
}
}
@@ -33332,7 +33186,7 @@ var ts;
if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
if (node.exportClause) {
ts.forEach(node.exportClause.elements, checkExportSpecifier);
- var inAmbientExternalModule = node.parent.kind === 226 && ts.isAmbientModule(node.parent.parent);
+ var inAmbientExternalModule = node.parent.kind === 227 && ts.isAmbientModule(node.parent.parent);
if (node.parent.kind !== 256 && !inAmbientExternalModule) {
error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
}
@@ -33346,7 +33200,7 @@ var ts;
}
}
function checkGrammarModuleElementContext(node, errorMessage) {
- var isInAppropriateContext = node.parent.kind === 256 || node.parent.kind === 226 || node.parent.kind === 225;
+ var isInAppropriateContext = node.parent.kind === 256 || node.parent.kind === 227 || node.parent.kind === 226;
if (!isInAppropriateContext) {
grammarErrorOnFirstToken(node, errorMessage);
}
@@ -33370,14 +33224,14 @@ var ts;
return;
}
var container = node.parent.kind === 256 ? node.parent : node.parent.parent;
- if (container.kind === 225 && !ts.isAmbientModule(container)) {
+ if (container.kind === 226 && !ts.isAmbientModule(container)) {
error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);
return;
}
if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) {
grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers);
}
- if (node.expression.kind === 69) {
+ if (node.expression.kind === 70) {
markExportAsReferenced(node);
}
else {
@@ -33385,7 +33239,7 @@ var ts;
}
checkExternalModuleExports(container);
if (node.isExportEquals && !ts.isInAmbientContext(node)) {
- if (modulekind === ts.ModuleKind.ES6) {
+ if (modulekind === ts.ModuleKind.ES2015) {
grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_2015_modules_Consider_using_export_default_or_another_module_format_instead);
}
else if (modulekind === ts.ModuleKind.System) {
@@ -33437,7 +33291,7 @@ var ts;
links.exportsChecked = true;
}
function isNotOverload(declaration) {
- return (declaration.kind !== 220 && declaration.kind !== 147) ||
+ return (declaration.kind !== 221 && declaration.kind !== 148) ||
!!declaration.body;
}
}
@@ -33448,118 +33302,118 @@ var ts;
var kind = node.kind;
if (cancellationToken) {
switch (kind) {
- case 225:
- case 221:
+ case 226:
case 222:
- case 220:
+ case 223:
+ case 221:
cancellationToken.throwIfCancellationRequested();
}
}
switch (kind) {
- case 141:
- return checkTypeParameter(node);
case 142:
+ return checkTypeParameter(node);
+ case 143:
return checkParameter(node);
+ case 146:
case 145:
- case 144:
return checkPropertyDeclaration(node);
- case 156:
case 157:
- case 151:
+ case 158:
case 152:
- return checkSignatureDeclaration(node);
case 153:
return checkSignatureDeclaration(node);
- case 147:
- case 146:
- return checkMethodDeclaration(node);
- case 148:
- return checkConstructorDeclaration(node);
- case 149:
- case 150:
- return checkAccessorDeclaration(node);
- case 155:
- return checkTypeReferenceNode(node);
case 154:
+ return checkSignatureDeclaration(node);
+ case 148:
+ case 147:
+ return checkMethodDeclaration(node);
+ case 149:
+ return checkConstructorDeclaration(node);
+ case 150:
+ case 151:
+ return checkAccessorDeclaration(node);
+ case 156:
+ return checkTypeReferenceNode(node);
+ case 155:
return checkTypePredicate(node);
- case 158:
- return checkTypeQuery(node);
case 159:
- return checkTypeLiteral(node);
+ return checkTypeQuery(node);
case 160:
- return checkArrayType(node);
+ return checkTypeLiteral(node);
case 161:
- return checkTupleType(node);
+ return checkArrayType(node);
case 162:
+ return checkTupleType(node);
case 163:
- return checkUnionOrIntersectionType(node);
case 164:
+ return checkUnionOrIntersectionType(node);
+ case 165:
return checkSourceElement(node.type);
- case 220:
- return checkFunctionDeclaration(node);
- case 199:
- case 226:
- return checkBlock(node);
- case 200:
- return checkVariableStatement(node);
- case 202:
- return checkExpressionStatement(node);
- case 203:
- return checkIfStatement(node);
- case 204:
- return checkDoStatement(node);
- case 205:
- return checkWhileStatement(node);
- case 206:
- return checkForStatement(node);
- case 207:
- return checkForInStatement(node);
- case 208:
- return checkForOfStatement(node);
- case 209:
- case 210:
- return checkBreakOrContinueStatement(node);
- case 211:
- return checkReturnStatement(node);
- case 212:
- return checkWithStatement(node);
- case 213:
- return checkSwitchStatement(node);
- case 214:
- return checkLabeledStatement(node);
- case 215:
- return checkThrowStatement(node);
- case 216:
- return checkTryStatement(node);
- case 218:
- return checkVariableDeclaration(node);
- case 169:
- return checkBindingElement(node);
case 221:
- return checkClassDeclaration(node);
- case 222:
- return checkInterfaceDeclaration(node);
- case 223:
- return checkTypeAliasDeclaration(node);
- case 224:
- return checkEnumDeclaration(node);
- case 225:
- return checkModuleDeclaration(node);
- case 230:
- return checkImportDeclaration(node);
- case 229:
- return checkImportEqualsDeclaration(node);
- case 236:
- return checkExportDeclaration(node);
- case 235:
- return checkExportAssignment(node);
+ return checkFunctionDeclaration(node);
+ case 200:
+ case 227:
+ return checkBlock(node);
case 201:
- checkGrammarStatementInAmbientContext(node);
- return;
+ return checkVariableStatement(node);
+ case 203:
+ return checkExpressionStatement(node);
+ case 204:
+ return checkIfStatement(node);
+ case 205:
+ return checkDoStatement(node);
+ case 206:
+ return checkWhileStatement(node);
+ case 207:
+ return checkForStatement(node);
+ case 208:
+ return checkForInStatement(node);
+ case 209:
+ return checkForOfStatement(node);
+ case 210:
+ case 211:
+ return checkBreakOrContinueStatement(node);
+ case 212:
+ return checkReturnStatement(node);
+ case 213:
+ return checkWithStatement(node);
+ case 214:
+ return checkSwitchStatement(node);
+ case 215:
+ return checkLabeledStatement(node);
+ case 216:
+ return checkThrowStatement(node);
case 217:
+ return checkTryStatement(node);
+ case 219:
+ return checkVariableDeclaration(node);
+ case 170:
+ return checkBindingElement(node);
+ case 222:
+ return checkClassDeclaration(node);
+ case 223:
+ return checkInterfaceDeclaration(node);
+ case 224:
+ return checkTypeAliasDeclaration(node);
+ case 225:
+ return checkEnumDeclaration(node);
+ case 226:
+ return checkModuleDeclaration(node);
+ case 231:
+ return checkImportDeclaration(node);
+ case 230:
+ return checkImportEqualsDeclaration(node);
+ case 237:
+ return checkExportDeclaration(node);
+ case 236:
+ return checkExportAssignment(node);
+ case 202:
checkGrammarStatementInAmbientContext(node);
return;
- case 239:
+ case 218:
+ checkGrammarStatementInAmbientContext(node);
+ return;
+ case 240:
return checkMissingDeclaration(node);
}
}
@@ -33572,17 +33426,17 @@ var ts;
for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) {
var node = deferredNodes_1[_i];
switch (node.kind) {
- case 179:
case 180:
+ case 181:
+ case 148:
case 147:
- case 146:
checkFunctionExpressionOrObjectLiteralMethodDeferred(node);
break;
- case 149:
case 150:
+ case 151:
checkAccessorDeferred(node);
break;
- case 192:
+ case 193:
checkClassExpressionDeferred(node);
break;
}
@@ -33654,7 +33508,7 @@ var ts;
function isInsideWithStatementBody(node) {
if (node) {
while (node.parent) {
- if (node.parent.kind === 212 && node.parent.statement === node) {
+ if (node.parent.kind === 213 && node.parent.statement === node) {
return true;
}
node = node.parent;
@@ -33680,24 +33534,24 @@ var ts;
if (!ts.isExternalOrCommonJsModule(location)) {
break;
}
- case 225:
+ case 226:
copySymbols(getSymbolOfNode(location).exports, meaning & 8914931);
break;
- case 224:
+ case 225:
copySymbols(getSymbolOfNode(location).exports, meaning & 8);
break;
- case 192:
+ case 193:
var className = location.name;
if (className) {
copySymbol(location.symbol, meaning);
}
- case 221:
case 222:
+ case 223:
if (!(memberFlags & 32)) {
copySymbols(getSymbolOfNode(location).members, meaning & 793064);
}
break;
- case 179:
+ case 180:
var funcName = location.name;
if (funcName) {
copySymbol(location.symbol, meaning);
@@ -33730,33 +33584,33 @@ var ts;
}
}
function isTypeDeclarationName(name) {
- return name.kind === 69 &&
+ return name.kind === 70 &&
isTypeDeclaration(name.parent) &&
name.parent.name === name;
}
function isTypeDeclaration(node) {
switch (node.kind) {
- case 141:
- case 221:
+ case 142:
case 222:
case 223:
case 224:
+ case 225:
return true;
}
}
function isTypeReferenceIdentifier(entityName) {
var node = entityName;
- while (node.parent && node.parent.kind === 139) {
+ while (node.parent && node.parent.kind === 140) {
node = node.parent;
}
- return node.parent && (node.parent.kind === 155 || node.parent.kind === 267);
+ return node.parent && (node.parent.kind === 156 || node.parent.kind === 267);
}
function isHeritageClauseElementIdentifier(entityName) {
var node = entityName;
- while (node.parent && node.parent.kind === 172) {
+ while (node.parent && node.parent.kind === 173) {
node = node.parent;
}
- return node.parent && node.parent.kind === 194;
+ return node.parent && node.parent.kind === 195;
}
function forEachEnclosingClass(node, callback) {
var result;
@@ -33773,13 +33627,13 @@ var ts;
return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; });
}
function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) {
- while (nodeOnRightSide.parent.kind === 139) {
+ while (nodeOnRightSide.parent.kind === 140) {
nodeOnRightSide = nodeOnRightSide.parent;
}
- if (nodeOnRightSide.parent.kind === 229) {
+ if (nodeOnRightSide.parent.kind === 230) {
return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent;
}
- if (nodeOnRightSide.parent.kind === 235) {
+ if (nodeOnRightSide.parent.kind === 236) {
return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent;
}
return undefined;
@@ -33791,7 +33645,7 @@ var ts;
if (ts.isDeclarationName(entityName)) {
return getSymbolOfNode(entityName.parent);
}
- if (ts.isInJavaScriptFile(entityName) && entityName.parent.kind === 172) {
+ if (ts.isInJavaScriptFile(entityName) && entityName.parent.kind === 173) {
var specialPropertyAssignmentKind = ts.getSpecialPropertyAssignmentKind(entityName.parent.parent);
switch (specialPropertyAssignmentKind) {
case 1:
@@ -33803,20 +33657,20 @@ var ts;
default:
}
}
- if (entityName.parent.kind === 235 && ts.isEntityNameExpression(entityName)) {
+ if (entityName.parent.kind === 236 && ts.isEntityNameExpression(entityName)) {
return resolveEntityName(entityName, 107455 | 793064 | 1920 | 8388608);
}
- if (entityName.kind !== 172 && isInRightSideOfImportOrExportAssignment(entityName)) {
- var importEqualsDeclaration = ts.getAncestor(entityName, 229);
+ if (entityName.kind !== 173 && isInRightSideOfImportOrExportAssignment(entityName)) {
+ var importEqualsDeclaration = ts.getAncestor(entityName, 230);
ts.Debug.assert(importEqualsDeclaration !== undefined);
- return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importEqualsDeclaration, true);
+ return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, true);
}
if (ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
entityName = entityName.parent;
}
if (isHeritageClauseElementIdentifier(entityName)) {
var meaning = 0;
- if (entityName.parent.kind === 194) {
+ if (entityName.parent.kind === 195) {
meaning = 793064;
if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) {
meaning |= 107455;
@@ -33832,20 +33686,20 @@ var ts;
if (ts.nodeIsMissing(entityName)) {
return undefined;
}
- if (entityName.kind === 69) {
+ if (entityName.kind === 70) {
if (ts.isJSXTagName(entityName) && isJsxIntrinsicIdentifier(entityName)) {
return getIntrinsicTagSymbol(entityName.parent);
}
return resolveEntityName(entityName, 107455, false, true);
}
- else if (entityName.kind === 172) {
+ else if (entityName.kind === 173) {
var symbol = getNodeLinks(entityName).resolvedSymbol;
if (!symbol) {
checkPropertyAccessExpression(entityName);
}
return getNodeLinks(entityName).resolvedSymbol;
}
- else if (entityName.kind === 139) {
+ else if (entityName.kind === 140) {
var symbol = getNodeLinks(entityName).resolvedSymbol;
if (!symbol) {
checkQualifiedName(entityName);
@@ -33854,13 +33708,13 @@ var ts;
}
}
else if (isTypeReferenceIdentifier(entityName)) {
- var meaning = (entityName.parent.kind === 155 || entityName.parent.kind === 267) ? 793064 : 1920;
+ var meaning = (entityName.parent.kind === 156 || entityName.parent.kind === 267) ? 793064 : 1920;
return resolveEntityName(entityName, meaning, false, true);
}
else if (entityName.parent.kind === 246) {
return getJsxAttributePropertySymbol(entityName.parent);
}
- if (entityName.parent.kind === 154) {
+ if (entityName.parent.kind === 155) {
return resolveEntityName(entityName, 1);
}
return undefined;
@@ -33878,12 +33732,12 @@ var ts;
else if (ts.isLiteralComputedPropertyDeclarationName(node)) {
return getSymbolOfNode(node.parent.parent);
}
- if (node.kind === 69) {
+ if (node.kind === 70) {
if (isInRightSideOfImportOrExportAssignment(node)) {
return getSymbolOfEntityNameOrPropertyAccessExpression(node);
}
- else if (node.parent.kind === 169 &&
- node.parent.parent.kind === 167 &&
+ else if (node.parent.kind === 170 &&
+ node.parent.parent.kind === 168 &&
node === node.parent.propertyName) {
var typeOfPattern = getTypeOfNode(node.parent.parent);
var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text);
@@ -33893,11 +33747,11 @@ var ts;
}
}
switch (node.kind) {
- case 69:
- case 172:
- case 139:
+ case 70:
+ case 173:
+ case 140:
return getSymbolOfEntityNameOrPropertyAccessExpression(node);
- case 97:
+ case 98:
var container = ts.getThisContainer(node, false);
if (ts.isFunctionLike(container)) {
var sig = getSignatureFromDeclaration(container);
@@ -33905,21 +33759,21 @@ var ts;
return sig.thisParameter;
}
}
- case 95:
+ case 96:
var type = ts.isPartOfExpression(node) ? checkExpression(node) : getTypeFromTypeNode(node);
return type.symbol;
- case 165:
+ case 166:
return getTypeFromTypeNode(node).symbol;
- case 121:
+ case 122:
var constructorDeclaration = node.parent;
- if (constructorDeclaration && constructorDeclaration.kind === 148) {
+ if (constructorDeclaration && constructorDeclaration.kind === 149) {
return constructorDeclaration.parent.symbol;
}
return undefined;
case 9:
if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) &&
ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||
- ((node.parent.kind === 230 || node.parent.kind === 236) &&
+ ((node.parent.kind === 231 || node.parent.kind === 237) &&
node.parent.moduleSpecifier === node)) {
return resolveExternalModuleName(node, node);
}
@@ -33927,7 +33781,7 @@ var ts;
return resolveExternalModuleName(node, node);
}
case 8:
- if (node.parent.kind === 173 && node.parent.argumentExpression === node) {
+ if (node.parent.kind === 174 && node.parent.argumentExpression === node) {
var objectType = checkExpression(node.parent.expression);
if (objectType === unknownType)
return undefined;
@@ -33991,12 +33845,12 @@ var ts;
return unknownType;
}
function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) {
- ts.Debug.assert(expr.kind === 171 || expr.kind === 170);
- if (expr.parent.kind === 208) {
+ ts.Debug.assert(expr.kind === 172 || expr.kind === 171);
+ if (expr.parent.kind === 209) {
var iteratedType = checkRightHandSideOfForOf(expr.parent.expression);
return checkDestructuringAssignment(expr, iteratedType || unknownType);
}
- if (expr.parent.kind === 187) {
+ if (expr.parent.kind === 188) {
var iteratedType = checkExpression(expr.parent.right);
return checkDestructuringAssignment(expr, iteratedType || unknownType);
}
@@ -34004,7 +33858,7 @@ var ts;
var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent);
return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent);
}
- ts.Debug.assert(expr.parent.kind === 170);
+ ts.Debug.assert(expr.parent.kind === 171);
var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent);
var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, false) || unknownType;
return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, ts.indexOf(expr.parent.elements, expr), elementType || unknownType);
@@ -34040,9 +33894,9 @@ var ts;
function getRootSymbols(symbol) {
if (symbol.flags & 268435456) {
var symbols_3 = [];
- var name_26 = symbol.name;
+ var name_23 = symbol.name;
ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) {
- var symbol = getPropertyOfType(t, name_26);
+ var symbol = getPropertyOfType(t, name_23);
if (symbol) {
symbols_3.push(symbol);
}
@@ -34145,7 +33999,7 @@ var ts;
else if (nodeLinks_1.flags & 131072) {
var isDeclaredInLoop = nodeLinks_1.flags & 262144;
var inLoopInitializer = ts.isIterationStatement(container, false);
- var inLoopBodyBlock = container.kind === 199 && ts.isIterationStatement(container.parent, false);
+ var inLoopBodyBlock = container.kind === 200 && ts.isIterationStatement(container.parent, false);
links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock));
}
else {
@@ -34185,18 +34039,18 @@ var ts;
return true;
}
switch (node.kind) {
- case 229:
- case 231:
+ case 230:
case 232:
- case 234:
- case 238:
+ case 233:
+ case 235:
+ case 239:
return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol);
- case 236:
+ case 237:
var exportClause = node.exportClause;
return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration);
- case 235:
+ case 236:
return node.expression
- && node.expression.kind === 69
+ && node.expression.kind === 70
? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol)
: true;
}
@@ -34428,7 +34282,7 @@ var ts;
if (!fileToDirective) {
return undefined;
}
- var meaning = (node.kind === 172) || (node.kind === 69 && isInTypeQuery(node))
+ var meaning = (node.kind === 173) || (node.kind === 70 && isInTypeQuery(node))
? 107455 | 1048576
: 793064 | 1920;
var symbol = resolveEntityName(node, meaning, true);
@@ -34575,6 +34429,7 @@ var ts;
getGlobalIterableIteratorType = ts.memoize(function () { return emptyGenericType; });
}
anyArrayType = createArrayType(anyType);
+ autoArrayType = createArrayType(autoType);
var symbol = getGlobalSymbol("ReadonlyArray", 793064, undefined);
globalReadonlyArrayType = symbol && getTypeOfGlobalSymbol(symbol, 1);
anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType;
@@ -34634,14 +34489,14 @@ var ts;
return false;
}
if (!ts.nodeCanBeDecorated(node)) {
- if (node.kind === 147 && !ts.nodeIsPresent(node.body)) {
+ if (node.kind === 148 && !ts.nodeIsPresent(node.body)) {
return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload);
}
else {
return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here);
}
}
- else if (node.kind === 149 || node.kind === 150) {
+ else if (node.kind === 150 || node.kind === 151) {
var accessors = ts.getAllAccessorDeclarations(node.parent.members, node);
if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) {
return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
@@ -34658,28 +34513,28 @@ var ts;
var flags = 0;
for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) {
var modifier = _a[_i];
- if (modifier.kind !== 128) {
- if (node.kind === 144 || node.kind === 146) {
+ if (modifier.kind !== 129) {
+ if (node.kind === 145 || node.kind === 147) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind));
}
- if (node.kind === 153) {
+ if (node.kind === 154) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind));
}
}
switch (modifier.kind) {
- case 74:
- if (node.kind !== 224 && node.parent.kind === 221) {
- return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(74));
+ case 75:
+ if (node.kind !== 225 && node.parent.kind === 222) {
+ return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(75));
}
break;
+ case 113:
case 112:
case 111:
- case 110:
var text = visibilityToString(ts.modifierToFlag(modifier.kind));
- if (modifier.kind === 111) {
+ if (modifier.kind === 112) {
lastProtected = modifier;
}
- else if (modifier.kind === 110) {
+ else if (modifier.kind === 111) {
lastPrivate = modifier;
}
if (flags & 28) {
@@ -34694,11 +34549,11 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async");
}
- else if (node.parent.kind === 226 || node.parent.kind === 256) {
+ else if (node.parent.kind === 227 || node.parent.kind === 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
}
else if (flags & 128) {
- if (modifier.kind === 110) {
+ if (modifier.kind === 111) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract");
}
else {
@@ -34707,7 +34562,7 @@ var ts;
}
flags |= ts.modifierToFlag(modifier.kind);
break;
- case 113:
+ case 114:
if (flags & 32) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static");
}
@@ -34717,10 +34572,10 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async");
}
- else if (node.parent.kind === 226 || node.parent.kind === 256) {
+ else if (node.parent.kind === 227 || node.parent.kind === 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
}
- else if (node.kind === 142) {
+ else if (node.kind === 143) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static");
}
else if (flags & 128) {
@@ -34729,17 +34584,17 @@ var ts;
flags |= 32;
lastStatic = modifier;
break;
- case 128:
+ case 129:
if (flags & 64) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly");
}
- else if (node.kind !== 145 && node.kind !== 144 && node.kind !== 153 && node.kind !== 142) {
+ else if (node.kind !== 146 && node.kind !== 145 && node.kind !== 154 && node.kind !== 143) {
return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
}
flags |= 64;
lastReadonly = modifier;
break;
- case 82:
+ case 83:
if (flags & 1) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export");
}
@@ -34752,45 +34607,45 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async");
}
- else if (node.parent.kind === 221) {
+ else if (node.parent.kind === 222) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export");
}
- else if (node.kind === 142) {
+ else if (node.kind === 143) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export");
}
flags |= 1;
break;
- case 122:
+ case 123:
if (flags & 2) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare");
}
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
}
- else if (node.parent.kind === 221) {
+ else if (node.parent.kind === 222) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare");
}
- else if (node.kind === 142) {
+ else if (node.kind === 143) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare");
}
- else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 226) {
+ else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 227) {
return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
}
flags |= 2;
lastDeclare = modifier;
break;
- case 115:
+ case 116:
if (flags & 128) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract");
}
- if (node.kind !== 221) {
- if (node.kind !== 147 &&
- node.kind !== 145 &&
- node.kind !== 149 &&
- node.kind !== 150) {
+ if (node.kind !== 222) {
+ if (node.kind !== 148 &&
+ node.kind !== 146 &&
+ node.kind !== 150 &&
+ node.kind !== 151) {
return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
}
- if (!(node.parent.kind === 221 && ts.getModifierFlags(node.parent) & 128)) {
+ if (!(node.parent.kind === 222 && ts.getModifierFlags(node.parent) & 128)) {
return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);
}
if (flags & 32) {
@@ -34802,14 +34657,14 @@ var ts;
}
flags |= 128;
break;
- case 118:
+ case 119:
if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "async");
}
else if (flags & 2 || ts.isInAmbientContext(node.parent)) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
}
- else if (node.kind === 142) {
+ else if (node.kind === 143) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async");
}
flags |= 256;
@@ -34817,7 +34672,7 @@ var ts;
break;
}
}
- if (node.kind === 148) {
+ if (node.kind === 149) {
if (flags & 32) {
return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
}
@@ -34832,13 +34687,13 @@ var ts;
}
return;
}
- else if ((node.kind === 230 || node.kind === 229) && flags & 2) {
+ else if ((node.kind === 231 || node.kind === 230) && flags & 2) {
return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
}
- else if (node.kind === 142 && (flags & 92) && ts.isBindingPattern(node.name)) {
+ else if (node.kind === 143 && (flags & 92) && ts.isBindingPattern(node.name)) {
return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern);
}
- else if (node.kind === 142 && (flags & 92) && node.dotDotDotToken) {
+ else if (node.kind === 143 && (flags & 92) && node.dotDotDotToken) {
return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
}
if (flags & 256) {
@@ -34854,38 +34709,38 @@ var ts;
}
function shouldReportBadModifier(node) {
switch (node.kind) {
- case 149:
case 150:
- case 148:
- case 145:
- case 144:
- case 147:
+ case 151:
+ case 149:
case 146:
- case 153:
- case 225:
+ case 145:
+ case 148:
+ case 147:
+ case 154:
+ case 226:
+ case 231:
case 230:
- case 229:
+ case 237:
case 236:
- case 235:
- case 179:
case 180:
- case 142:
+ case 181:
+ case 143:
return false;
default:
- if (node.parent.kind === 226 || node.parent.kind === 256) {
+ if (node.parent.kind === 227 || node.parent.kind === 256) {
return false;
}
switch (node.kind) {
- case 220:
- return nodeHasAnyModifiersExcept(node, 118);
case 221:
- return nodeHasAnyModifiersExcept(node, 115);
+ return nodeHasAnyModifiersExcept(node, 119);
case 222:
- case 200:
+ return nodeHasAnyModifiersExcept(node, 116);
case 223:
- return true;
+ case 201:
case 224:
- return nodeHasAnyModifiersExcept(node, 74);
+ return true;
+ case 225:
+ return nodeHasAnyModifiersExcept(node, 75);
default:
ts.Debug.fail();
return false;
@@ -34897,10 +34752,10 @@ var ts;
}
function checkGrammarAsyncModifier(node, asyncModifier) {
switch (node.kind) {
- case 147:
- case 220:
- case 179:
+ case 148:
+ case 221:
case 180:
+ case 181:
if (!node.asteriskToken) {
return false;
}
@@ -34916,7 +34771,7 @@ var ts;
return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Trailing_comma_not_allowed);
}
}
- function checkGrammarTypeParameterList(node, typeParameters, file) {
+ function checkGrammarTypeParameterList(typeParameters, file) {
if (checkGrammarForDisallowedTrailingComma(typeParameters)) {
return true;
}
@@ -34958,11 +34813,11 @@ var ts;
}
function checkGrammarFunctionLikeDeclaration(node) {
var file = ts.getSourceFileOfNode(node);
- return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node.typeParameters, file) ||
+ return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) ||
checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file);
}
function checkGrammarArrowFunction(node, file) {
- if (node.kind === 180) {
+ if (node.kind === 181) {
var arrowFunction = node;
var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line;
var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line;
@@ -34997,7 +34852,7 @@ var ts;
if (!parameter.type) {
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation);
}
- if (parameter.type.kind !== 132 && parameter.type.kind !== 130) {
+ if (parameter.type.kind !== 133 && parameter.type.kind !== 131) {
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number);
}
if (!node.type) {
@@ -35024,7 +34879,7 @@ var ts;
var sourceFile = ts.getSourceFileOfNode(node);
for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
var arg = args_4[_i];
- if (arg.kind === 193) {
+ if (arg.kind === 194) {
return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
}
}
@@ -35050,7 +34905,7 @@ var ts;
if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && node.heritageClauses) {
for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) {
var heritageClause = _a[_i];
- if (heritageClause.token === 83) {
+ if (heritageClause.token === 84) {
if (seenExtendsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen);
}
@@ -35063,7 +34918,7 @@ var ts;
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 106);
+ ts.Debug.assert(heritageClause.token === 107);
if (seenImplementsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen);
}
@@ -35078,14 +34933,14 @@ var ts;
if (node.heritageClauses) {
for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) {
var heritageClause = _a[_i];
- if (heritageClause.token === 83) {
+ if (heritageClause.token === 84) {
if (seenExtendsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen);
}
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 106);
+ ts.Debug.assert(heritageClause.token === 107);
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause);
}
checkGrammarHeritageClause(heritageClause);
@@ -35094,19 +34949,19 @@ var ts;
return false;
}
function checkGrammarComputedPropertyName(node) {
- if (node.kind !== 140) {
+ if (node.kind !== 141) {
return false;
}
var computedPropertyName = node;
- if (computedPropertyName.expression.kind === 187 && computedPropertyName.expression.operatorToken.kind === 24) {
+ if (computedPropertyName.expression.kind === 188 && computedPropertyName.expression.operatorToken.kind === 25) {
return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name);
}
}
function checkGrammarForGenerator(node) {
if (node.asteriskToken) {
- ts.Debug.assert(node.kind === 220 ||
- node.kind === 179 ||
- node.kind === 147);
+ ts.Debug.assert(node.kind === 221 ||
+ node.kind === 180 ||
+ node.kind === 148);
if (ts.isInAmbientContext(node)) {
return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);
}
@@ -35118,7 +34973,7 @@ var ts;
}
}
}
- function checkGrammarForInvalidQuestionMark(node, questionToken, message) {
+ function checkGrammarForInvalidQuestionMark(questionToken, message) {
if (questionToken) {
return grammarErrorOnNode(questionToken, message);
}
@@ -35131,9 +34986,9 @@ var ts;
var GetOrSetAccessor = GetAccessor | SetAccessor;
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var prop = _a[_i];
- var name_27 = prop.name;
- if (name_27.kind === 140) {
- checkGrammarComputedPropertyName(name_27);
+ var name_24 = prop.name;
+ if (name_24.kind === 141) {
+ checkGrammarComputedPropertyName(name_24);
}
if (prop.kind === 254 && !inDestructuring && prop.objectAssignmentInitializer) {
return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment);
@@ -35141,32 +34996,32 @@ var ts;
if (prop.modifiers) {
for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) {
var mod = _c[_b];
- if (mod.kind !== 118 || prop.kind !== 147) {
+ if (mod.kind !== 119 || prop.kind !== 148) {
grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod));
}
}
}
var currentKind = void 0;
if (prop.kind === 253 || prop.kind === 254) {
- checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
- if (name_27.kind === 8) {
- checkGrammarNumericLiteral(name_27);
+ checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
+ if (name_24.kind === 8) {
+ checkGrammarNumericLiteral(name_24);
}
currentKind = Property;
}
- else if (prop.kind === 147) {
+ else if (prop.kind === 148) {
currentKind = Property;
}
- else if (prop.kind === 149) {
+ else if (prop.kind === 150) {
currentKind = GetAccessor;
}
- else if (prop.kind === 150) {
+ else if (prop.kind === 151) {
currentKind = SetAccessor;
}
else {
ts.Debug.fail("Unexpected syntax kind:" + prop.kind);
}
- var effectiveName = ts.getPropertyNameForPropertyNameNode(name_27);
+ var effectiveName = ts.getPropertyNameForPropertyNameNode(name_24);
if (effectiveName === undefined) {
continue;
}
@@ -35176,18 +35031,18 @@ var ts;
else {
var existingKind = seen[effectiveName];
if (currentKind === Property && existingKind === Property) {
- grammarErrorOnNode(name_27, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name_27));
+ grammarErrorOnNode(name_24, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name_24));
}
else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) {
if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) {
seen[effectiveName] = currentKind | existingKind;
}
else {
- return grammarErrorOnNode(name_27, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);
+ return grammarErrorOnNode(name_24, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);
}
}
else {
- return grammarErrorOnNode(name_27, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);
+ return grammarErrorOnNode(name_24, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);
}
}
}
@@ -35200,12 +35055,12 @@ var ts;
continue;
}
var jsxAttr = attr;
- var name_28 = jsxAttr.name;
- if (!seen[name_28.text]) {
- seen[name_28.text] = true;
+ var name_25 = jsxAttr.name;
+ if (!seen[name_25.text]) {
+ seen[name_25.text] = true;
}
else {
- return grammarErrorOnNode(name_28, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);
+ return grammarErrorOnNode(name_25, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);
}
var initializer = jsxAttr.initializer;
if (initializer && initializer.kind === 248 && !initializer.expression) {
@@ -35217,7 +35072,7 @@ var ts;
if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) {
return true;
}
- if (forInOrOfStatement.initializer.kind === 219) {
+ if (forInOrOfStatement.initializer.kind === 220) {
var variableList = forInOrOfStatement.initializer;
if (!checkGrammarVariableDeclarationList(variableList)) {
var declarations = variableList.declarations;
@@ -35225,20 +35080,20 @@ var ts;
return false;
}
if (declarations.length > 1) {
- var diagnostic = forInOrOfStatement.kind === 207
+ var diagnostic = forInOrOfStatement.kind === 208
? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement
: ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;
return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic);
}
var firstDeclaration = declarations[0];
if (firstDeclaration.initializer) {
- var diagnostic = forInOrOfStatement.kind === 207
+ var diagnostic = forInOrOfStatement.kind === 208
? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer
: ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;
return grammarErrorOnNode(firstDeclaration.name, diagnostic);
}
if (firstDeclaration.type) {
- var diagnostic = forInOrOfStatement.kind === 207
+ var diagnostic = forInOrOfStatement.kind === 208
? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation
: ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;
return grammarErrorOnNode(firstDeclaration, diagnostic);
@@ -35262,11 +35117,11 @@ var ts;
return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters);
}
else if (!doesAccessorHaveCorrectParameterCount(accessor)) {
- return grammarErrorOnNode(accessor.name, kind === 149 ?
+ return grammarErrorOnNode(accessor.name, kind === 150 ?
ts.Diagnostics.A_get_accessor_cannot_have_parameters :
ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter);
}
- else if (kind === 150) {
+ else if (kind === 151) {
if (accessor.type) {
return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);
}
@@ -35285,10 +35140,10 @@ var ts;
}
}
function doesAccessorHaveCorrectParameterCount(accessor) {
- return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 149 ? 0 : 1);
+ return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 150 ? 0 : 1);
}
function getAccessorThisParameter(accessor) {
- if (accessor.parameters.length === (accessor.kind === 149 ? 1 : 2)) {
+ if (accessor.parameters.length === (accessor.kind === 150 ? 1 : 2)) {
return ts.getThisParameter(accessor);
}
}
@@ -35303,8 +35158,8 @@ var ts;
checkGrammarForGenerator(node)) {
return true;
}
- if (node.parent.kind === 171) {
- if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) {
+ if (node.parent.kind === 172) {
+ if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) {
return true;
}
else if (node.body === undefined) {
@@ -35319,10 +35174,10 @@ var ts;
return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol);
}
}
- else if (node.parent.kind === 222) {
+ else if (node.parent.kind === 223) {
return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol);
}
- else if (node.parent.kind === 159) {
+ else if (node.parent.kind === 160) {
return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol);
}
}
@@ -35333,9 +35188,9 @@ var ts;
return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary);
}
switch (current.kind) {
- case 214:
+ case 215:
if (node.label && current.label.text === node.label.text) {
- var isMisplacedContinueLabel = node.kind === 209
+ var isMisplacedContinueLabel = node.kind === 210
&& !ts.isIterationStatement(current.statement, true);
if (isMisplacedContinueLabel) {
return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement);
@@ -35343,8 +35198,8 @@ var ts;
return false;
}
break;
- case 213:
- if (node.kind === 210 && !node.label) {
+ case 214:
+ if (node.kind === 211 && !node.label) {
return false;
}
break;
@@ -35357,13 +35212,13 @@ var ts;
current = current.parent;
}
if (node.label) {
- var message = node.kind === 210
+ var message = node.kind === 211
? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement
: ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
}
else {
- var message = node.kind === 210
+ var message = node.kind === 211
? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement
: ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
@@ -35375,7 +35230,7 @@ var ts;
if (node !== ts.lastOrUndefined(elements)) {
return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern);
}
- if (node.name.kind === 168 || node.name.kind === 167) {
+ if (node.name.kind === 169 || node.name.kind === 168) {
return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern);
}
if (node.initializer) {
@@ -35385,11 +35240,11 @@ var ts;
}
function isStringOrNumberLiteralExpression(expr) {
return expr.kind === 9 || expr.kind === 8 ||
- expr.kind === 185 && expr.operator === 36 &&
+ expr.kind === 186 && expr.operator === 37 &&
expr.operand.kind === 8;
}
function checkGrammarVariableDeclaration(node) {
- if (node.parent.parent.kind !== 207 && node.parent.parent.kind !== 208) {
+ if (node.parent.parent.kind !== 208 && node.parent.parent.kind !== 209) {
if (ts.isInAmbientContext(node)) {
if (node.initializer) {
if (ts.isConst(node) && !node.type) {
@@ -35420,8 +35275,8 @@ var ts;
return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name);
}
function checkGrammarNameInLetOrConstDeclarations(name) {
- if (name.kind === 69) {
- if (name.originalKeywordKind === 108) {
+ if (name.kind === 70) {
+ if (name.originalKeywordKind === 109) {
return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations);
}
}
@@ -35446,15 +35301,15 @@ var ts;
}
function allowLetAndConstDeclarations(parent) {
switch (parent.kind) {
- case 203:
case 204:
case 205:
- case 212:
case 206:
+ case 213:
case 207:
case 208:
+ case 209:
return false;
- case 214:
+ case 215:
return allowLetAndConstDeclarations(parent.parent);
}
return true;
@@ -35509,7 +35364,7 @@ var ts;
return true;
}
}
- else if (node.parent.kind === 222) {
+ else if (node.parent.kind === 223) {
if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) {
return true;
}
@@ -35517,7 +35372,7 @@ var ts;
return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer);
}
}
- else if (node.parent.kind === 159) {
+ else if (node.parent.kind === 160) {
if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) {
return true;
}
@@ -35530,13 +35385,13 @@ var ts;
}
}
function checkGrammarTopLevelElementForRequiredDeclareModifier(node) {
- if (node.kind === 222 ||
- node.kind === 223 ||
+ if (node.kind === 223 ||
+ node.kind === 224 ||
+ node.kind === 231 ||
node.kind === 230 ||
- node.kind === 229 ||
+ node.kind === 237 ||
node.kind === 236 ||
- node.kind === 235 ||
- node.kind === 228 ||
+ node.kind === 229 ||
ts.getModifierFlags(node) & (2 | 1 | 512)) {
return false;
}
@@ -35545,7 +35400,7 @@ var ts;
function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) {
for (var _i = 0, _a = file.statements; _i < _a.length; _i++) {
var decl = _a[_i];
- if (ts.isDeclaration(decl) || decl.kind === 200) {
+ if (ts.isDeclaration(decl) || decl.kind === 201) {
if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) {
return true;
}
@@ -35564,7 +35419,7 @@ var ts;
if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) {
return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
}
- if (node.parent.kind === 199 || node.parent.kind === 226 || node.parent.kind === 256) {
+ if (node.parent.kind === 200 || node.parent.kind === 227 || node.parent.kind === 256) {
var links_1 = getNodeLinks(node.parent);
if (!links_1.hasReportedStatementInAmbientContext) {
return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts);
@@ -35603,46 +35458,46 @@ var ts;
(function (ts) {
;
var nodeEdgeTraversalMap = ts.createMap((_a = {},
- _a[139] = [
+ _a[140] = [
{ name: "left", test: ts.isEntityName },
{ name: "right", test: ts.isIdentifier }
],
- _a[143] = [
+ _a[144] = [
{ name: "expression", test: ts.isLeftHandSideExpression }
],
- _a[177] = [
+ _a[178] = [
{ name: "type", test: ts.isTypeNode },
{ name: "expression", test: ts.isUnaryExpression }
],
- _a[195] = [
+ _a[196] = [
{ name: "expression", test: ts.isExpression },
{ name: "type", test: ts.isTypeNode }
],
- _a[196] = [
+ _a[197] = [
{ name: "expression", test: ts.isLeftHandSideExpression }
],
- _a[224] = [
+ _a[225] = [
{ name: "decorators", test: ts.isDecorator },
{ name: "modifiers", test: ts.isModifier },
{ name: "name", test: ts.isIdentifier },
{ name: "members", test: ts.isEnumMember }
],
- _a[225] = [
+ _a[226] = [
{ name: "decorators", test: ts.isDecorator },
{ name: "modifiers", test: ts.isModifier },
{ name: "name", test: ts.isModuleName },
{ name: "body", test: ts.isModuleBody }
],
- _a[226] = [
+ _a[227] = [
{ name: "statements", test: ts.isStatement }
],
- _a[229] = [
+ _a[230] = [
{ name: "decorators", test: ts.isDecorator },
{ name: "modifiers", test: ts.isModifier },
{ name: "name", test: ts.isIdentifier },
{ name: "moduleReference", test: ts.isModuleReference }
],
- _a[240] = [
+ _a[241] = [
{ name: "expression", test: ts.isExpression, optional: true }
],
_a[255] = [
@@ -35658,41 +35513,41 @@ var ts;
return initial;
}
var kind = node.kind;
- if ((kind > 0 && kind <= 138)) {
+ if ((kind > 0 && kind <= 139)) {
return initial;
}
- if ((kind >= 154 && kind <= 166)) {
+ if ((kind >= 155 && kind <= 167)) {
return initial;
}
var result = initial;
switch (node.kind) {
- case 198:
- case 201:
- case 193:
- case 217:
+ case 199:
+ case 202:
+ case 194:
+ case 218:
case 287:
break;
- case 140:
+ case 141:
result = reduceNode(node.expression, f, result);
break;
- case 142:
- result = ts.reduceLeft(node.decorators, f, result);
- result = ts.reduceLeft(node.modifiers, f, result);
- result = reduceNode(node.name, f, result);
- result = reduceNode(node.type, f, result);
- result = reduceNode(node.initializer, f, result);
- break;
case 143:
- result = reduceNode(node.expression, f, result);
- break;
- case 145:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
result = reduceNode(node.type, f, result);
result = reduceNode(node.initializer, f, result);
break;
- case 147:
+ case 144:
+ result = reduceNode(node.expression, f, result);
+ break;
+ case 146:
+ result = ts.reduceLeft(node.decorators, f, result);
+ result = ts.reduceLeft(node.modifiers, f, result);
+ result = reduceNode(node.name, f, result);
+ result = reduceNode(node.type, f, result);
+ result = reduceNode(node.initializer, f, result);
+ break;
+ case 148:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
@@ -35701,53 +35556,48 @@ var ts;
result = reduceNode(node.type, f, result);
result = reduceNode(node.body, f, result);
break;
- case 148:
- result = ts.reduceLeft(node.modifiers, f, result);
- result = ts.reduceLeft(node.parameters, f, result);
- result = reduceNode(node.body, f, result);
- break;
case 149:
- result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
- result = reduceNode(node.name, f, result);
result = ts.reduceLeft(node.parameters, f, result);
- result = reduceNode(node.type, f, result);
result = reduceNode(node.body, f, result);
break;
case 150:
+ result = ts.reduceLeft(node.decorators, f, result);
+ result = ts.reduceLeft(node.modifiers, f, result);
+ result = reduceNode(node.name, f, result);
+ result = ts.reduceLeft(node.parameters, f, result);
+ result = reduceNode(node.type, f, result);
+ result = reduceNode(node.body, f, result);
+ break;
+ case 151:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
result = ts.reduceLeft(node.parameters, f, result);
result = reduceNode(node.body, f, result);
break;
- case 167:
case 168:
+ case 169:
result = ts.reduceLeft(node.elements, f, result);
break;
- case 169:
+ case 170:
result = reduceNode(node.propertyName, f, result);
result = reduceNode(node.name, f, result);
result = reduceNode(node.initializer, f, result);
break;
- case 170:
+ case 171:
result = ts.reduceLeft(node.elements, f, result);
break;
- case 171:
- result = ts.reduceLeft(node.properties, f, result);
- break;
case 172:
- result = reduceNode(node.expression, f, result);
- result = reduceNode(node.name, f, result);
+ result = ts.reduceLeft(node.properties, f, result);
break;
case 173:
result = reduceNode(node.expression, f, result);
- result = reduceNode(node.argumentExpression, f, result);
+ result = reduceNode(node.name, f, result);
break;
case 174:
result = reduceNode(node.expression, f, result);
- result = ts.reduceLeft(node.typeArguments, f, result);
- result = ts.reduceLeft(node.arguments, f, result);
+ result = reduceNode(node.argumentExpression, f, result);
break;
case 175:
result = reduceNode(node.expression, f, result);
@@ -35755,10 +35605,15 @@ var ts;
result = ts.reduceLeft(node.arguments, f, result);
break;
case 176:
+ result = reduceNode(node.expression, f, result);
+ result = ts.reduceLeft(node.typeArguments, f, result);
+ result = ts.reduceLeft(node.arguments, f, result);
+ break;
+ case 177:
result = reduceNode(node.tag, f, result);
result = reduceNode(node.template, f, result);
break;
- case 179:
+ case 180:
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
result = ts.reduceLeft(node.typeParameters, f, result);
@@ -35766,126 +35621,126 @@ var ts;
result = reduceNode(node.type, f, result);
result = reduceNode(node.body, f, result);
break;
- case 180:
+ case 181:
result = ts.reduceLeft(node.modifiers, f, result);
result = ts.reduceLeft(node.typeParameters, f, result);
result = ts.reduceLeft(node.parameters, f, result);
result = reduceNode(node.type, f, result);
result = reduceNode(node.body, f, result);
break;
- case 178:
- case 181:
+ case 179:
case 182:
case 183:
case 184:
- case 190:
+ case 185:
case 191:
- case 196:
+ case 192:
+ case 197:
result = reduceNode(node.expression, f, result);
break;
- case 185:
case 186:
+ case 187:
result = reduceNode(node.operand, f, result);
break;
- case 187:
+ case 188:
result = reduceNode(node.left, f, result);
result = reduceNode(node.right, f, result);
break;
- case 188:
+ case 189:
result = reduceNode(node.condition, f, result);
result = reduceNode(node.whenTrue, f, result);
result = reduceNode(node.whenFalse, f, result);
break;
- case 189:
+ case 190:
result = reduceNode(node.head, f, result);
result = ts.reduceLeft(node.templateSpans, f, result);
break;
- case 192:
+ case 193:
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
result = ts.reduceLeft(node.typeParameters, f, result);
result = ts.reduceLeft(node.heritageClauses, f, result);
result = ts.reduceLeft(node.members, f, result);
break;
- case 194:
+ case 195:
result = reduceNode(node.expression, f, result);
result = ts.reduceLeft(node.typeArguments, f, result);
break;
- case 197:
+ case 198:
result = reduceNode(node.expression, f, result);
result = reduceNode(node.literal, f, result);
break;
- case 199:
+ case 200:
result = ts.reduceLeft(node.statements, f, result);
break;
- case 200:
+ case 201:
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.declarationList, f, result);
break;
- case 202:
+ case 203:
result = reduceNode(node.expression, f, result);
break;
- case 203:
+ case 204:
result = reduceNode(node.expression, f, result);
result = reduceNode(node.thenStatement, f, result);
result = reduceNode(node.elseStatement, f, result);
break;
- case 204:
- result = reduceNode(node.statement, f, result);
- result = reduceNode(node.expression, f, result);
- break;
case 205:
- case 212:
- result = reduceNode(node.expression, f, result);
result = reduceNode(node.statement, f, result);
+ result = reduceNode(node.expression, f, result);
break;
case 206:
+ case 213:
+ result = reduceNode(node.expression, f, result);
+ result = reduceNode(node.statement, f, result);
+ break;
+ case 207:
result = reduceNode(node.initializer, f, result);
result = reduceNode(node.condition, f, result);
result = reduceNode(node.incrementor, f, result);
result = reduceNode(node.statement, f, result);
break;
- case 207:
case 208:
+ case 209:
result = reduceNode(node.initializer, f, result);
result = reduceNode(node.expression, f, result);
result = reduceNode(node.statement, f, result);
break;
- case 211:
- case 215:
+ case 212:
+ case 216:
result = reduceNode(node.expression, f, result);
break;
- case 213:
+ case 214:
result = reduceNode(node.expression, f, result);
result = reduceNode(node.caseBlock, f, result);
break;
- case 214:
+ case 215:
result = reduceNode(node.label, f, result);
result = reduceNode(node.statement, f, result);
break;
- case 216:
+ case 217:
result = reduceNode(node.tryBlock, f, result);
result = reduceNode(node.catchClause, f, result);
result = reduceNode(node.finallyBlock, f, result);
break;
- case 218:
+ case 219:
result = reduceNode(node.name, f, result);
result = reduceNode(node.type, f, result);
result = reduceNode(node.initializer, f, result);
break;
- case 219:
- result = ts.reduceLeft(node.declarations, f, result);
- break;
case 220:
- result = ts.reduceLeft(node.decorators, f, result);
- result = ts.reduceLeft(node.modifiers, f, result);
- result = reduceNode(node.name, f, result);
- result = ts.reduceLeft(node.typeParameters, f, result);
- result = ts.reduceLeft(node.parameters, f, result);
- result = reduceNode(node.type, f, result);
- result = reduceNode(node.body, f, result);
+ result = ts.reduceLeft(node.declarations, f, result);
break;
case 221:
+ result = ts.reduceLeft(node.decorators, f, result);
+ result = ts.reduceLeft(node.modifiers, f, result);
+ result = reduceNode(node.name, f, result);
+ result = ts.reduceLeft(node.typeParameters, f, result);
+ result = ts.reduceLeft(node.parameters, f, result);
+ result = reduceNode(node.type, f, result);
+ result = reduceNode(node.body, f, result);
+ break;
+ case 222:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.name, f, result);
@@ -35893,49 +35748,49 @@ var ts;
result = ts.reduceLeft(node.heritageClauses, f, result);
result = ts.reduceLeft(node.members, f, result);
break;
- case 227:
+ case 228:
result = ts.reduceLeft(node.clauses, f, result);
break;
- case 230:
+ case 231:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.importClause, f, result);
result = reduceNode(node.moduleSpecifier, f, result);
break;
- case 231:
+ case 232:
result = reduceNode(node.name, f, result);
result = reduceNode(node.namedBindings, f, result);
break;
- case 232:
- result = reduceNode(node.name, f, result);
- break;
case 233:
- case 237:
- result = ts.reduceLeft(node.elements, f, result);
+ result = reduceNode(node.name, f, result);
break;
case 234:
case 238:
+ result = ts.reduceLeft(node.elements, f, result);
+ break;
+ case 235:
+ case 239:
result = reduceNode(node.propertyName, f, result);
result = reduceNode(node.name, f, result);
break;
- case 235:
+ case 236:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.expression, f, result);
break;
- case 236:
+ case 237:
result = ts.reduceLeft(node.decorators, f, result);
result = ts.reduceLeft(node.modifiers, f, result);
result = reduceNode(node.exportClause, f, result);
result = reduceNode(node.moduleSpecifier, f, result);
break;
- case 241:
+ case 242:
result = reduceNode(node.openingElement, f, result);
result = ts.reduceLeft(node.children, f, result);
result = reduceNode(node.closingElement, f, result);
break;
- case 242:
case 243:
+ case 244:
result = reduceNode(node.tagName, f, result);
result = ts.reduceLeft(node.attributes, f, result);
break;
@@ -36078,153 +35933,153 @@ var ts;
return undefined;
}
var kind = node.kind;
- if ((kind > 0 && kind <= 138)) {
+ if ((kind > 0 && kind <= 139)) {
return node;
}
- if ((kind >= 154 && kind <= 166)) {
+ if ((kind >= 155 && kind <= 167)) {
return node;
}
switch (node.kind) {
- case 198:
- case 201:
- case 193:
- case 217:
- return node;
- case 140:
- return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression));
- case 142:
- return ts.updateParameterDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
- case 145:
- return ts.updateProperty(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
- case 147:
- return ts.updateMethod(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
- case 148:
- return ts.updateConstructor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
- case 149:
- return ts.updateGetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
- case 150:
- return ts.updateSetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
- case 167:
- return ts.updateObjectBindingPattern(node, visitNodes(node.elements, visitor, ts.isBindingElement));
- case 168:
- return ts.updateArrayBindingPattern(node, visitNodes(node.elements, visitor, ts.isArrayBindingElement));
- case 169:
- return ts.updateBindingElement(node, visitNode(node.propertyName, visitor, ts.isPropertyName, true), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression, true));
- case 170:
- return ts.updateArrayLiteral(node, visitNodes(node.elements, visitor, ts.isExpression));
- case 171:
- return ts.updateObjectLiteral(node, visitNodes(node.properties, visitor, ts.isObjectLiteralElementLike));
- case 172:
- return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier));
- case 173:
- return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression));
- case 174:
- return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression));
- case 175:
- return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression));
- case 176:
- return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral));
- case 178:
- return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression));
- case 179:
- return ts.updateFunctionExpression(node, visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
- case 180:
- return ts.updateArrowFunction(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isConciseBody, true), context.endLexicalEnvironment()));
- case 181:
- return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression));
- case 182:
- return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression));
- case 183:
- return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression));
- case 184:
- return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression));
- case 187:
- return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression));
- case 185:
- return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression));
- case 186:
- return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression));
- case 188:
- return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.whenFalse, visitor, ts.isExpression));
- case 189:
- return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), visitNodes(node.templateSpans, visitor, ts.isTemplateSpan));
- case 190:
- return ts.updateYield(node, visitNode(node.expression, visitor, ts.isExpression));
- case 191:
- return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression));
- case 192:
- return ts.updateClassExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement));
- case 194:
- return ts.updateExpressionWithTypeArguments(node, visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression));
- case 197:
- return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail));
case 199:
- return ts.updateBlock(node, visitNodes(node.statements, visitor, ts.isStatement));
- case 200:
- return ts.updateVariableStatement(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList));
case 202:
- return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression));
- case 203:
- return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, true, liftToBlock));
- case 204:
- return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.expression, visitor, ts.isExpression));
- case 205:
- return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 206:
- return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 207:
- return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 208:
- return ts.updateForOf(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 209:
- return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier, true));
- case 210:
- return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier, true));
- case 211:
- return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression, true));
- case 212:
- return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 213:
- return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock));
- case 214:
- return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
- case 215:
- return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression));
- case 216:
- return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause, true), visitNode(node.finallyBlock, visitor, ts.isBlock, true));
+ case 194:
case 218:
- return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
+ return node;
+ case 141:
+ return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 143:
+ return ts.updateParameterDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
+ case 146:
+ return ts.updateProperty(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
+ case 148:
+ return ts.updateMethod(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 149:
+ return ts.updateConstructor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 150:
+ return ts.updateGetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 151:
+ return ts.updateSetAccessor(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 168:
+ return ts.updateObjectBindingPattern(node, visitNodes(node.elements, visitor, ts.isBindingElement));
+ case 169:
+ return ts.updateArrayBindingPattern(node, visitNodes(node.elements, visitor, ts.isArrayBindingElement));
+ case 170:
+ return ts.updateBindingElement(node, visitNode(node.propertyName, visitor, ts.isPropertyName, true), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression, true));
+ case 171:
+ return ts.updateArrayLiteral(node, visitNodes(node.elements, visitor, ts.isExpression));
+ case 172:
+ return ts.updateObjectLiteral(node, visitNodes(node.properties, visitor, ts.isObjectLiteralElementLike));
+ case 173:
+ return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier));
+ case 174:
+ return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression));
+ case 175:
+ return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression));
+ case 176:
+ return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNodes(node.arguments, visitor, ts.isExpression));
+ case 177:
+ return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral));
+ case 179:
+ return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 180:
+ return ts.updateFunctionExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 181:
+ return ts.updateArrowFunction(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isConciseBody, true), context.endLexicalEnvironment()));
+ case 182:
+ return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 183:
+ return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 184:
+ return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 185:
+ return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 188:
+ return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression));
+ case 186:
+ return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression));
+ case 187:
+ return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression));
+ case 189:
+ return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.whenFalse, visitor, ts.isExpression));
+ case 190:
+ return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), visitNodes(node.templateSpans, visitor, ts.isTemplateSpan));
+ case 191:
+ return ts.updateYield(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 192:
+ return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 193:
+ return ts.updateClassExpression(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement));
+ case 195:
+ return ts.updateExpressionWithTypeArguments(node, visitNodes(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression));
+ case 198:
+ return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail));
+ case 200:
+ return ts.updateBlock(node, visitNodes(node.statements, visitor, ts.isStatement));
+ case 201:
+ return ts.updateVariableStatement(node, visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList));
+ case 203:
+ return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 204:
+ return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, true, liftToBlock));
+ case 205:
+ return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock), visitNode(node.expression, visitor, ts.isExpression));
+ case 206:
+ return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 207:
+ return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 208:
+ return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 209:
+ return ts.updateForOf(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 210:
+ return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier, true));
+ case 211:
+ return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier, true));
+ case 212:
+ return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression, true));
+ case 213:
+ return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 214:
+ return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock));
+ case 215:
+ return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, false, liftToBlock));
+ case 216:
+ return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 217:
+ return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause, true), visitNode(node.finallyBlock, visitor, ts.isBlock, true));
case 219:
- return ts.updateVariableDeclarationList(node, visitNodes(node.declarations, visitor, ts.isVariableDeclaration));
+ return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode, true), visitNode(node.initializer, visitor, ts.isExpression, true));
case 220:
- return ts.updateFunctionDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ return ts.updateVariableDeclarationList(node, visitNodes(node.declarations, visitor, ts.isVariableDeclaration));
case 221:
+ return ts.updateFunctionDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), (context.startLexicalEnvironment(), visitNodes(node.parameters, visitor, ts.isParameter)), visitNode(node.type, visitor, ts.isTypeNode, true), mergeFunctionBodyLexicalEnvironment(visitNode(node.body, visitor, ts.isFunctionBody, true), context.endLexicalEnvironment()));
+ case 222:
return ts.updateClassDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier, true), visitNodes(node.typeParameters, visitor, ts.isTypeParameter), visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), visitNodes(node.members, visitor, ts.isClassElement));
- case 227:
+ case 228:
return ts.updateCaseBlock(node, visitNodes(node.clauses, visitor, ts.isCaseOrDefaultClause));
- case 230:
- return ts.updateImportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression));
case 231:
- return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier, true), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings, true));
+ return ts.updateImportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression));
case 232:
- return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier, true), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings, true));
case 233:
- return ts.updateNamedImports(node, visitNodes(node.elements, visitor, ts.isImportSpecifier));
+ return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier));
case 234:
- return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, true), visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateNamedImports(node, visitNodes(node.elements, visitor, ts.isImportSpecifier));
case 235:
- return ts.updateExportAssignment(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, true), visitNode(node.name, visitor, ts.isIdentifier));
case 236:
- return ts.updateExportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression, true));
+ return ts.updateExportAssignment(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression));
case 237:
- return ts.updateNamedExports(node, visitNodes(node.elements, visitor, ts.isExportSpecifier));
+ return ts.updateExportDeclaration(node, visitNodes(node.decorators, visitor, ts.isDecorator), visitNodes(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports, true), visitNode(node.moduleSpecifier, visitor, ts.isExpression, true));
case 238:
+ return ts.updateNamedExports(node, visitNodes(node.elements, visitor, ts.isExportSpecifier));
+ case 239:
return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier, true), visitNode(node.name, visitor, ts.isIdentifier));
- case 241:
- return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), visitNodes(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement));
case 242:
- return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike));
+ return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), visitNodes(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement));
case 243:
+ return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike));
+ case 244:
return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNodes(node.attributes, visitor, ts.isJsxAttributeLike));
case 245:
return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression));
@@ -36325,67 +36180,67 @@ var ts;
return transformFlags | aggregateTransformFlagsForNode(child);
}
function getTransformFlagsSubtreeExclusions(kind) {
- if (kind >= 154 && kind <= 166) {
+ if (kind >= 155 && kind <= 167) {
return -3;
}
switch (kind) {
- case 174:
case 175:
- case 170:
- return 537133909;
- case 225:
- return 546335573;
- case 142:
- return 538968917;
+ case 176:
+ case 171:
+ return 537922901;
+ case 226:
+ return 574729557;
+ case 143:
+ return 545262933;
+ case 181:
+ return 592227669;
case 180:
- return 550710101;
- case 179:
- case 220:
- return 550726485;
- case 219:
- return 538968917;
case 221:
- case 192:
- return 537590613;
- case 148:
- return 550593365;
- case 147:
+ return 592293205;
+ case 220:
+ return 545262933;
+ case 222:
+ case 193:
+ return 539749717;
case 149:
+ return 591760725;
+ case 148:
case 150:
- return 550593365;
- case 117:
- case 130:
- case 127:
- case 132:
- case 120:
- case 133:
- case 103:
- case 141:
- case 144:
- case 146:
case 151:
+ return 591760725;
+ case 118:
+ case 131:
+ case 128:
+ case 133:
+ case 121:
+ case 134:
+ case 104:
+ case 142:
+ case 145:
+ case 147:
case 152:
case 153:
- case 222:
+ case 154:
case 223:
+ case 224:
return -3;
- case 171:
- return 537430869;
+ case 172:
+ return 539110741;
default:
- return 536871765;
+ return 536874325;
}
}
var Debug;
(function (Debug) {
Debug.failNotOptional = Debug.shouldAssert(1)
? function (message) { return Debug.assert(false, message || "Node not optional."); }
- : function (message) { };
+ : function () { };
Debug.failBadSyntaxKind = Debug.shouldAssert(1)
? function (node, message) { return Debug.assert(false, message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " was unexpected."; }); }
- : function (node, message) { };
+ : function () { };
Debug.assertNode = Debug.shouldAssert(1)
? function (node, test, message) { return Debug.assert(test === undefined || test(node), message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }); }
- : function (node, test, message) { };
+ : function () { };
function getFunctionName(func) {
if (typeof func !== "function") {
return "";
@@ -36423,7 +36278,7 @@ var ts;
else if (ts.nodeIsSynthesized(node)) {
location = value;
}
- flattenDestructuring(context, node, value, location, emitAssignment, emitTempVariableAssignment, visitor);
+ flattenDestructuring(node, value, location, emitAssignment, emitTempVariableAssignment, visitor);
if (needsValue) {
expressions.push(value);
}
@@ -36443,9 +36298,9 @@ var ts;
}
}
ts.flattenDestructuringAssignment = flattenDestructuringAssignment;
- function flattenParameterDestructuring(context, node, value, visitor) {
+ function flattenParameterDestructuring(node, value, visitor) {
var declarations = [];
- flattenDestructuring(context, node, value, node, emitAssignment, emitTempVariableAssignment, visitor);
+ flattenDestructuring(node, value, node, emitAssignment, emitTempVariableAssignment, visitor);
return declarations;
function emitAssignment(name, value, location) {
var declaration = ts.createVariableDeclaration(name, undefined, value, location);
@@ -36460,10 +36315,10 @@ var ts;
}
}
ts.flattenParameterDestructuring = flattenParameterDestructuring;
- function flattenVariableDestructuring(context, node, value, visitor, recordTempVariable) {
+ function flattenVariableDestructuring(node, value, visitor, recordTempVariable) {
var declarations = [];
var pendingAssignments;
- flattenDestructuring(context, node, value, node, emitAssignment, emitTempVariableAssignment, visitor);
+ flattenDestructuring(node, value, node, emitAssignment, emitTempVariableAssignment, visitor);
return declarations;
function emitAssignment(name, value, location, original) {
if (pendingAssignments) {
@@ -36495,9 +36350,9 @@ var ts;
}
}
ts.flattenVariableDestructuring = flattenVariableDestructuring;
- function flattenVariableDestructuringToExpression(context, node, recordTempVariable, nameSubstitution, visitor) {
+ function flattenVariableDestructuringToExpression(node, recordTempVariable, nameSubstitution, visitor) {
var pendingAssignments = [];
- flattenDestructuring(context, node, undefined, node, emitAssignment, emitTempVariableAssignment, visitor);
+ flattenDestructuring(node, undefined, node, emitAssignment, emitTempVariableAssignment, visitor);
var expression = ts.inlineExpressions(pendingAssignments);
ts.aggregateTransformFlags(expression);
return expression;
@@ -36519,7 +36374,7 @@ var ts;
}
}
ts.flattenVariableDestructuringToExpression = flattenVariableDestructuringToExpression;
- function flattenDestructuring(context, root, value, location, emitAssignment, emitTempVariableAssignment, visitor) {
+ function flattenDestructuring(root, value, location, emitAssignment, emitTempVariableAssignment, visitor) {
if (value && visitor) {
value = ts.visitNode(value, visitor, ts.isExpression);
}
@@ -36540,7 +36395,7 @@ var ts;
}
target = bindingTarget.name;
}
- else if (ts.isBinaryExpression(bindingTarget) && bindingTarget.operatorToken.kind === 56) {
+ else if (ts.isBinaryExpression(bindingTarget) && bindingTarget.operatorToken.kind === 57) {
var initializer = visitor
? ts.visitNode(bindingTarget.right, visitor, ts.isExpression)
: bindingTarget.right;
@@ -36550,17 +36405,17 @@ var ts;
else {
target = bindingTarget;
}
- if (target.kind === 171) {
+ if (target.kind === 172) {
emitObjectLiteralAssignment(target, value, location);
}
- else if (target.kind === 170) {
+ else if (target.kind === 171) {
emitArrayLiteralAssignment(target, value, location);
}
else {
- var name_29 = ts.getMutableClone(target);
- ts.setSourceMapRange(name_29, target);
- ts.setCommentRange(name_29, target);
- emitAssignment(name_29, value, location, undefined);
+ var name_26 = ts.getMutableClone(target);
+ ts.setSourceMapRange(name_26, target);
+ ts.setCommentRange(name_26, target);
+ emitAssignment(name_26, value, location, undefined);
}
}
function emitObjectLiteralAssignment(target, value, location) {
@@ -36585,8 +36440,8 @@ var ts;
}
for (var i = 0; i < numElements; i++) {
var e = elements[i];
- if (e.kind !== 193) {
- if (e.kind !== 191) {
+ if (e.kind !== 194) {
+ if (e.kind !== 192) {
emitDestructuringAssignment(e, ts.createElementAccess(value, ts.createLiteral(i)), e);
}
else if (i === numElements - 1) {
@@ -36615,7 +36470,7 @@ var ts;
if (ts.isOmittedExpression(element)) {
continue;
}
- else if (name.kind === 167) {
+ else if (name.kind === 168) {
var propName = element.propertyName || element.name;
emitBindingElement(element, createDestructuringPropertyAccess(value, propName));
}
@@ -36635,7 +36490,7 @@ var ts;
}
function createDefaultValueCheck(value, defaultValue, location) {
value = ensureIdentifier(value, true, location, emitTempVariableAssignment);
- return ts.createConditional(ts.createStrictEquality(value, ts.createVoidZero()), ts.createToken(53), defaultValue, ts.createToken(54), value);
+ return ts.createConditional(ts.createStrictEquality(value, ts.createVoidZero()), ts.createToken(54), defaultValue, ts.createToken(55), value);
}
function createDestructuringPropertyAccess(expression, propertyName) {
if (ts.isComputedPropertyName(propertyName)) {
@@ -36673,6 +36528,12 @@ var ts;
var ts;
(function (ts) {
var USE_NEW_TYPE_METADATA_FORMAT = false;
+ var TypeScriptSubstitutionFlags;
+ (function (TypeScriptSubstitutionFlags) {
+ TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["ClassAliases"] = 1] = "ClassAliases";
+ TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["NamespaceExports"] = 2] = "NamespaceExports";
+ TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["NonQualifiedEnumMembers"] = 8] = "NonQualifiedEnumMembers";
+ })(TypeScriptSubstitutionFlags || (TypeScriptSubstitutionFlags = {}));
function transformTypeScript(context) {
var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration;
var resolver = context.getEmitResolver();
@@ -36683,8 +36544,8 @@ var ts;
var previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(172);
context.enableSubstitution(173);
+ context.enableSubstitution(174);
var currentSourceFile;
var currentNamespace;
var currentNamespaceContainerName;
@@ -36694,7 +36555,6 @@ var ts;
var enabledSubstitutions;
var classAliases;
var applicableSubstitutions;
- var currentSuperContainer;
return transformSourceFile;
function transformSourceFile(node) {
if (ts.isDeclarationFile(node)) {
@@ -36728,15 +36588,32 @@ var ts;
}
return node;
}
+ function sourceElementVisitor(node) {
+ return saveStateAndInvoke(node, sourceElementVisitorWorker);
+ }
+ function sourceElementVisitorWorker(node) {
+ switch (node.kind) {
+ case 231:
+ return visitImportDeclaration(node);
+ case 230:
+ return visitImportEqualsDeclaration(node);
+ case 236:
+ return visitExportAssignment(node);
+ case 237:
+ return visitExportDeclaration(node);
+ default:
+ return visitorWorker(node);
+ }
+ }
function namespaceElementVisitor(node) {
return saveStateAndInvoke(node, namespaceElementVisitorWorker);
}
function namespaceElementVisitorWorker(node) {
- if (node.kind === 236 ||
- node.kind === 230 ||
+ if (node.kind === 237 ||
node.kind === 231 ||
- (node.kind === 229 &&
- node.moduleReference.kind === 240)) {
+ node.kind === 232 ||
+ (node.kind === 230 &&
+ node.moduleReference.kind === 241)) {
return undefined;
}
else if (node.transformFlags & 1 || ts.hasModifier(node, 1)) {
@@ -36752,15 +36629,15 @@ var ts;
}
function classElementVisitorWorker(node) {
switch (node.kind) {
- case 148:
- return undefined;
- case 145:
- case 153:
case 149:
+ return undefined;
+ case 146:
+ case 154:
case 150:
- case 147:
+ case 151:
+ case 148:
return visitorWorker(node);
- case 198:
+ case 199:
return node;
default:
ts.Debug.failBadSyntaxKind(node);
@@ -36772,84 +36649,87 @@ var ts;
return ts.createNotEmittedStatement(node);
}
switch (node.kind) {
- case 82:
- case 77:
+ case 83:
+ case 78:
return currentNamespace ? undefined : node;
- case 112:
- case 110:
+ case 113:
case 111:
- case 115:
- case 118:
- case 74:
- case 122:
- case 128:
- case 160:
+ case 112:
+ case 116:
+ case 75:
+ case 123:
+ case 129:
case 161:
- case 159:
- case 154:
- case 141:
- case 117:
- case 120:
- case 132:
- case 130:
- case 127:
- case 103:
- case 133:
- case 157:
- case 156:
- case 158:
- case 155:
case 162:
+ case 160:
+ case 155:
+ case 142:
+ case 118:
+ case 121:
+ case 133:
+ case 131:
+ case 128:
+ case 104:
+ case 134:
+ case 158:
+ case 157:
+ case 159:
+ case 156:
case 163:
case 164:
case 165:
case 166:
- case 153:
- case 143:
+ case 167:
+ case 154:
+ case 144:
+ case 224:
+ case 146:
+ case 149:
+ return visitConstructor(node);
case 223:
- case 145:
- case 148:
- return undefined;
- case 222:
return ts.createNotEmittedStatement(node);
- case 221:
+ case 222:
return visitClassDeclaration(node);
- case 192:
+ case 193:
return visitClassExpression(node);
case 251:
return visitHeritageClause(node);
- case 194:
- return visitExpressionWithTypeArguments(node);
- case 147:
- return visitMethodDeclaration(node);
- case 149:
- return visitGetAccessor(node);
- case 150:
- return visitSetAccessor(node);
- case 220:
- return visitFunctionDeclaration(node);
- case 179:
- return visitFunctionExpression(node);
- case 180:
- return visitArrowFunction(node);
- case 142:
- return visitParameter(node);
- case 178:
- return visitParenthesizedExpression(node);
- case 177:
case 195:
- return visitAssertionExpression(node);
+ return visitExpressionWithTypeArguments(node);
+ case 148:
+ return visitMethodDeclaration(node);
+ case 150:
+ return visitGetAccessor(node);
+ case 151:
+ return visitSetAccessor(node);
+ case 221:
+ return visitFunctionDeclaration(node);
+ case 180:
+ return visitFunctionExpression(node);
+ case 181:
+ return visitArrowFunction(node);
+ case 143:
+ return visitParameter(node);
+ case 179:
+ return visitParenthesizedExpression(node);
+ case 178:
case 196:
+ return visitAssertionExpression(node);
+ case 175:
+ return visitCallExpression(node);
+ case 176:
+ return visitNewExpression(node);
+ case 197:
return visitNonNullExpression(node);
- case 224:
- return visitEnumDeclaration(node);
- case 184:
- return visitAwaitExpression(node);
- case 200:
- return visitVariableStatement(node);
case 225:
+ return visitEnumDeclaration(node);
+ case 201:
+ return visitVariableStatement(node);
+ case 219:
+ return visitVariableDeclaration(node);
+ case 226:
return visitModuleDeclaration(node);
- case 229:
+ case 230:
return visitImportEqualsDeclaration(node);
default:
ts.Debug.failBadSyntaxKind(node);
@@ -36859,14 +36739,14 @@ var ts;
function onBeforeVisitNode(node) {
switch (node.kind) {
case 256:
+ case 228:
case 227:
- case 226:
- case 199:
+ case 200:
currentScope = node;
currentScopeFirstDeclarationsOfName = undefined;
break;
+ case 222:
case 221:
- case 220:
if (ts.hasModifier(node, 2)) {
break;
}
@@ -36891,14 +36771,14 @@ var ts;
externalHelpersModuleImport.flags &= ~8;
statements.push(externalHelpersModuleImport);
currentSourceFileExternalHelpersModuleName = externalHelpersModuleName;
- ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset));
+ ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset));
ts.addRange(statements, endLexicalEnvironment());
currentSourceFileExternalHelpersModuleName = undefined;
node = ts.updateSourceFileNode(node, ts.createNodeArray(statements, node.statements));
node.externalHelpersModuleName = externalHelpersModuleName;
}
else {
- node = ts.visitEachChild(node, visitor, context);
+ node = ts.visitEachChild(node, sourceElementVisitor, context);
}
ts.setEmitFlags(node, 1 | ts.getEmitFlags(node));
return node;
@@ -36938,7 +36818,7 @@ var ts;
classAlias = addClassDeclarationHeadWithDecorators(statements, node, name, hasExtendsClause);
}
if (staticProperties.length) {
- addInitializedPropertyStatements(statements, node, staticProperties, getLocalName(node, true));
+ addInitializedPropertyStatements(statements, staticProperties, getLocalName(node, true));
}
addClassElementDecorationStatements(statements, node, false);
addClassElementDecorationStatements(statements, node, true);
@@ -36984,7 +36864,7 @@ var ts;
function visitClassExpression(node) {
var staticProperties = getInitializedProperties(node, true);
var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause);
- var members = transformClassMembers(node, heritageClauses !== undefined);
+ var members = transformClassMembers(node, ts.some(heritageClauses, function (c) { return c.token === 84; }));
var classExpression = ts.setOriginalNode(ts.createClassExpression(undefined, node.name, undefined, heritageClauses, members, node), node);
if (staticProperties.length > 0) {
var expressions = [];
@@ -36995,7 +36875,7 @@ var ts;
}
ts.setEmitFlags(classExpression, 524288 | ts.getEmitFlags(classExpression));
expressions.push(ts.startOnNewLine(ts.createAssignment(temp, classExpression)));
- ts.addRange(expressions, generateInitializedPropertyExpressions(node, staticProperties, temp));
+ ts.addRange(expressions, generateInitializedPropertyExpressions(staticProperties, temp));
expressions.push(ts.startOnNewLine(temp));
return ts.inlineExpressions(expressions);
}
@@ -37012,13 +36892,13 @@ var ts;
}
function transformConstructor(node, hasExtendsClause) {
var hasInstancePropertyWithInitializer = ts.forEach(node.members, isInstanceInitializedProperty);
- var hasParameterPropertyAssignments = node.transformFlags & 131072;
+ var hasParameterPropertyAssignments = node.transformFlags & 524288;
var constructor = ts.getFirstConstructorWithBody(node);
if (!hasInstancePropertyWithInitializer && !hasParameterPropertyAssignments) {
return ts.visitEachChild(constructor, visitor, context);
}
var parameters = transformConstructorParameters(constructor);
- var body = transformConstructorBody(node, constructor, hasExtendsClause, parameters);
+ var body = transformConstructorBody(node, constructor, hasExtendsClause);
return ts.startOnNewLine(ts.setOriginalNode(ts.createConstructor(undefined, undefined, parameters, body, constructor || node), constructor));
}
function transformConstructorParameters(constructor) {
@@ -37026,7 +36906,7 @@ var ts;
? ts.visitNodes(constructor.parameters, visitor, ts.isParameter)
: [];
}
- function transformConstructorBody(node, constructor, hasExtendsClause, parameters) {
+ function transformConstructorBody(node, constructor, hasExtendsClause) {
var statements = [];
var indexOfFirstStatement = 0;
startLexicalEnvironment();
@@ -37039,7 +36919,7 @@ var ts;
statements.push(ts.createStatement(ts.createCall(ts.createSuper(), undefined, [ts.createSpread(ts.createIdentifier("arguments"))])));
}
var properties = getInitializedProperties(node, false);
- addInitializedPropertyStatements(statements, node, properties, ts.createThis());
+ addInitializedPropertyStatements(statements, properties, ts.createThis());
if (constructor) {
ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement));
}
@@ -37054,7 +36934,7 @@ var ts;
return index;
}
var statement = statements[index];
- if (statement.kind === 202 && ts.isSuperCall(statement.expression)) {
+ if (statement.kind === 203 && ts.isSuperCall(statement.expression)) {
result.push(ts.visitNode(statement, visitor, ts.isStatement));
return index + 1;
}
@@ -37088,24 +36968,24 @@ var ts;
return isInitializedProperty(member, false);
}
function isInitializedProperty(member, isStatic) {
- return member.kind === 145
+ return member.kind === 146
&& isStatic === ts.hasModifier(member, 32)
&& member.initializer !== undefined;
}
- function addInitializedPropertyStatements(statements, node, properties, receiver) {
+ function addInitializedPropertyStatements(statements, properties, receiver) {
for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) {
var property = properties_7[_i];
- var statement = ts.createStatement(transformInitializedProperty(node, property, receiver));
+ var statement = ts.createStatement(transformInitializedProperty(property, receiver));
ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));
ts.setCommentRange(statement, property);
statements.push(statement);
}
}
- function generateInitializedPropertyExpressions(node, properties, receiver) {
+ function generateInitializedPropertyExpressions(properties, receiver) {
var expressions = [];
for (var _i = 0, properties_8 = properties; _i < properties_8.length; _i++) {
var property = properties_8[_i];
- var expression = transformInitializedProperty(node, property, receiver);
+ var expression = transformInitializedProperty(property, receiver);
expression.startsOnNewLine = true;
ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property));
ts.setCommentRange(expression, property);
@@ -37113,7 +36993,7 @@ var ts;
}
return expressions;
}
- function transformInitializedProperty(node, property, receiver) {
+ function transformInitializedProperty(property, receiver) {
var propertyName = visitPropertyNameOfClassElement(property);
var initializer = ts.visitNode(property.initializer, visitor, ts.isExpression);
var memberAccess = ts.createMemberAccessForPropertyName(receiver, propertyName, propertyName);
@@ -37161,12 +37041,12 @@ var ts;
}
function getAllDecoratorsOfClassElement(node, member) {
switch (member.kind) {
- case 149:
case 150:
+ case 151:
return getAllDecoratorsOfAccessors(node, member);
- case 147:
+ case 148:
return getAllDecoratorsOfMethod(member);
- case 145:
+ case 146:
return getAllDecoratorsOfProperty(member);
default:
return undefined;
@@ -37244,7 +37124,7 @@ var ts;
var prefix = getClassMemberPrefix(node, member);
var memberName = getExpressionForPropertyName(member, true);
var descriptor = languageVersion > 0
- ? member.kind === 145
+ ? member.kind === 146
? ts.createVoidZero()
: ts.createNull()
: undefined;
@@ -37332,43 +37212,43 @@ var ts;
}
function shouldAddTypeMetadata(node) {
var kind = node.kind;
- return kind === 147
- || kind === 149
+ return kind === 148
|| kind === 150
- || kind === 145;
+ || kind === 151
+ || kind === 146;
}
function shouldAddReturnTypeMetadata(node) {
- return node.kind === 147;
+ return node.kind === 148;
}
function shouldAddParamTypesMetadata(node) {
var kind = node.kind;
- return kind === 221
- || kind === 192
- || kind === 147
- || kind === 149
- || kind === 150;
+ return kind === 222
+ || kind === 193
+ || kind === 148
+ || kind === 150
+ || kind === 151;
}
function serializeTypeOfNode(node) {
switch (node.kind) {
- case 145:
- case 142:
- case 149:
- return serializeTypeNode(node.type);
+ case 146:
+ case 143:
case 150:
+ return serializeTypeNode(node.type);
+ case 151:
return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node));
- case 221:
- case 192:
- case 147:
+ case 222:
+ case 193:
+ case 148:
return ts.createIdentifier("Function");
default:
return ts.createVoidZero();
}
}
function getRestParameterElementType(node) {
- if (node && node.kind === 160) {
+ if (node && node.kind === 161) {
return node.elementType;
}
- else if (node && node.kind === 155) {
+ else if (node && node.kind === 156) {
return ts.singleOrUndefined(node.typeArguments);
}
else {
@@ -37414,52 +37294,52 @@ var ts;
return ts.createIdentifier("Object");
}
switch (node.kind) {
- case 103:
+ case 104:
return ts.createVoidZero();
- case 164:
+ case 165:
return serializeTypeNode(node.type);
- case 156:
case 157:
+ case 158:
return ts.createIdentifier("Function");
- case 160:
case 161:
+ case 162:
return ts.createIdentifier("Array");
- case 154:
- case 120:
+ case 155:
+ case 121:
return ts.createIdentifier("Boolean");
- case 132:
+ case 133:
return ts.createIdentifier("String");
- case 166:
+ case 167:
switch (node.literal.kind) {
case 9:
return ts.createIdentifier("String");
case 8:
return ts.createIdentifier("Number");
- case 99:
- case 84:
+ case 100:
+ case 85:
return ts.createIdentifier("Boolean");
default:
ts.Debug.failBadSyntaxKind(node.literal);
break;
}
break;
- case 130:
+ case 131:
return ts.createIdentifier("Number");
- case 133:
+ case 134:
return languageVersion < 2
? getGlobalSymbolNameWithFallback()
: ts.createIdentifier("Symbol");
- case 155:
+ case 156:
return serializeTypeReferenceNode(node);
+ case 164:
case 163:
- case 162:
{
var unionOrIntersection = node;
var serializedUnion = void 0;
for (var _i = 0, _a = unionOrIntersection.types; _i < _a.length; _i++) {
var typeNode = _a[_i];
var serializedIndividual = serializeTypeNode(typeNode);
- if (serializedIndividual.kind !== 69) {
+ if (serializedIndividual.kind !== 70) {
serializedUnion = undefined;
break;
}
@@ -37476,10 +37356,10 @@ var ts;
return serializedUnion;
}
}
- case 158:
case 159:
- case 117:
- case 165:
+ case 160:
+ case 118:
+ case 166:
break;
default:
ts.Debug.failBadSyntaxKind(node);
@@ -37520,22 +37400,22 @@ var ts;
}
function serializeEntityNameAsExpression(node, useFallback) {
switch (node.kind) {
- case 69:
- var name_30 = ts.getMutableClone(node);
- name_30.flags &= ~8;
- name_30.original = undefined;
- name_30.parent = currentScope;
+ case 70:
+ var name_27 = ts.getMutableClone(node);
+ name_27.flags &= ~8;
+ name_27.original = undefined;
+ name_27.parent = currentScope;
if (useFallback) {
- return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name_30), ts.createLiteral("undefined")), name_30);
+ return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name_27), ts.createLiteral("undefined")), name_27);
}
- return name_30;
- case 139:
+ return name_27;
+ case 140:
return serializeQualifiedNameAsExpression(node, useFallback);
}
}
function serializeQualifiedNameAsExpression(node, useFallback) {
var left;
- if (node.left.kind === 69) {
+ if (node.left.kind === 70) {
left = serializeEntityNameAsExpression(node.left, useFallback);
}
else if (useFallback) {
@@ -37548,7 +37428,7 @@ var ts;
return ts.createPropertyAccess(left, node.right);
}
function getGlobalSymbolNameWithFallback() {
- return ts.createConditional(ts.createStrictEquality(ts.createTypeOf(ts.createIdentifier("Symbol")), ts.createLiteral("function")), ts.createToken(53), ts.createIdentifier("Symbol"), ts.createToken(54), ts.createIdentifier("Object"));
+ return ts.createConditional(ts.createStrictEquality(ts.createTypeOf(ts.createIdentifier("Symbol")), ts.createLiteral("function")), ts.createToken(54), ts.createIdentifier("Symbol"), ts.createToken(55), ts.createIdentifier("Object"));
}
function getExpressionForPropertyName(member, generateNameForComputedPropertyName) {
var name = member.name;
@@ -37580,9 +37460,9 @@ var ts;
}
}
function visitHeritageClause(node) {
- if (node.token === 83) {
+ if (node.token === 84) {
var types = ts.visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments, 0, 1);
- return ts.createHeritageClause(83, types, node);
+ return ts.createHeritageClause(84, types, node);
}
return undefined;
}
@@ -37593,6 +37473,12 @@ var ts;
function shouldEmitFunctionLikeDeclaration(node) {
return !ts.nodeIsMissing(node.body);
}
+ function visitConstructor(node) {
+ if (!shouldEmitFunctionLikeDeclaration(node)) {
+ return undefined;
+ }
+ return ts.visitEachChild(node, visitor, context);
+ }
function visitMethodDeclaration(node) {
if (!shouldEmitFunctionLikeDeclaration(node)) {
return undefined;
@@ -37643,36 +37529,33 @@ var ts;
if (ts.nodeIsMissing(node.body)) {
return ts.createOmittedExpression();
}
- var func = ts.createFunctionExpression(node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node);
+ var func = ts.createFunctionExpression(ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node);
ts.setOriginalNode(func, node);
return func;
}
function visitArrowFunction(node) {
- var func = ts.createArrowFunction(undefined, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, node.equalsGreaterThanToken, transformConciseBody(node), node);
+ var func = ts.createArrowFunction(ts.visitNodes(node.modifiers, visitor, ts.isModifier), undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, node.equalsGreaterThanToken, transformConciseBody(node), node);
ts.setOriginalNode(func, node);
return func;
}
function transformFunctionBody(node) {
- if (ts.isAsyncFunctionLike(node)) {
- return transformAsyncFunctionBody(node);
- }
return transformFunctionBodyWorker(node.body);
}
function transformFunctionBodyWorker(body, start) {
if (start === void 0) { start = 0; }
var savedCurrentScope = currentScope;
+ var savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName;
currentScope = body;
+ currentScopeFirstDeclarationsOfName = ts.createMap();
startLexicalEnvironment();
var statements = ts.visitNodes(body.statements, visitor, ts.isStatement, start);
var visited = ts.updateBlock(body, statements);
var declarations = endLexicalEnvironment();
currentScope = savedCurrentScope;
+ currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName;
return ts.mergeFunctionBodyLexicalEnvironment(visited, declarations);
}
function transformConciseBody(node) {
- if (ts.isAsyncFunctionLike(node)) {
- return transformAsyncFunctionBody(node);
- }
return transformConciseBodyWorker(node.body, false);
}
function transformConciseBodyWorker(body, forceBlockFunctionBody) {
@@ -37694,42 +37577,6 @@ var ts;
}
}
}
- function getPromiseConstructor(type) {
- var typeName = ts.getEntityNameFromTypeNode(type);
- if (typeName && ts.isEntityName(typeName)) {
- var serializationKind = resolver.getTypeReferenceSerializationKind(typeName);
- if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue
- || serializationKind === ts.TypeReferenceSerializationKind.Unknown) {
- return typeName;
- }
- }
- return undefined;
- }
- function transformAsyncFunctionBody(node) {
- var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(node.type) : undefined;
- var isArrowFunction = node.kind === 180;
- var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0;
- if (!isArrowFunction) {
- var statements = [];
- var statementOffset = ts.addPrologueDirectives(statements, node.body.statements, false, visitor);
- statements.push(ts.createReturn(ts.createAwaiterHelper(currentSourceFileExternalHelpersModuleName, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset))));
- var block = ts.createBlock(statements, node.body, true);
- if (languageVersion >= 2) {
- if (resolver.getNodeCheckFlags(node) & 4096) {
- enableSubstitutionForAsyncMethodsWithSuper();
- ts.setEmitFlags(block, 8);
- }
- else if (resolver.getNodeCheckFlags(node) & 2048) {
- enableSubstitutionForAsyncMethodsWithSuper();
- ts.setEmitFlags(block, 4);
- }
- }
- return block;
- }
- else {
- return ts.createAwaiterHelper(currentSourceFileExternalHelpersModuleName, hasLexicalArguments, promiseConstructor, transformConciseBodyWorker(node.body, true));
- }
- }
function visitParameter(node) {
if (ts.parameterIsThisKeyword(node)) {
return undefined;
@@ -37756,14 +37603,14 @@ var ts;
function transformInitializedVariable(node) {
var name = node.name;
if (ts.isBindingPattern(name)) {
- return ts.flattenVariableDestructuringToExpression(context, node, hoistVariableDeclaration, getNamespaceMemberNameWithSourceMapsAndWithoutComments, visitor);
+ return ts.flattenVariableDestructuringToExpression(node, hoistVariableDeclaration, getNamespaceMemberNameWithSourceMapsAndWithoutComments, visitor);
}
else {
return ts.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression), node);
}
}
- function visitAwaitExpression(node) {
- return ts.setOriginalNode(ts.createYield(undefined, ts.visitNode(node.expression, visitor, ts.isExpression), node), node);
+ function visitVariableDeclaration(node) {
+ return ts.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName), undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
}
function visitParenthesizedExpression(node) {
var innerExpression = ts.skipOuterExpressions(node.expression, ~2);
@@ -37781,6 +37628,12 @@ var ts;
var expression = ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression);
return ts.createPartiallyEmittedExpression(expression, node);
}
+ function visitCallExpression(node) {
+ return ts.updateCall(node, ts.visitNode(node.expression, visitor, ts.isExpression), undefined, ts.visitNodes(node.arguments, visitor, ts.isExpression));
+ }
+ function visitNewExpression(node) {
+ return ts.updateNew(node, ts.visitNode(node.expression, visitor, ts.isExpression), undefined, ts.visitNodes(node.arguments, visitor, ts.isExpression));
+ }
function shouldEmitEnumDeclaration(node) {
return !ts.isConst(node)
|| compilerOptions.preserveConstEnums
@@ -37812,7 +37665,7 @@ var ts;
var parameterName = getNamespaceParameterName(node);
var containerName = getNamespaceContainerName(node);
var exportName = getExportName(node);
- var enumStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, transformEnumBody(node, containerName)), undefined, [ts.createLogicalOr(exportName, ts.createAssignment(exportName, ts.createObjectLiteral()))]), node);
+ var enumStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, transformEnumBody(node, containerName)), undefined, [ts.createLogicalOr(exportName, ts.createAssignment(exportName, ts.createObjectLiteral()))]), node);
ts.setOriginalNode(enumStatement, node);
ts.setEmitFlags(enumStatement, emitFlags);
statements.push(enumStatement);
@@ -37855,7 +37708,7 @@ var ts;
}
function isES6ExportedDeclaration(node) {
return isExternalModuleExport(node)
- && moduleKind === ts.ModuleKind.ES6;
+ && moduleKind === ts.ModuleKind.ES2015;
}
function recordEmittedDeclarationInScope(node) {
var name = node.symbol && node.symbol.name;
@@ -37870,9 +37723,9 @@ var ts;
}
function isFirstEmittedDeclarationInScope(node) {
if (currentScopeFirstDeclarationsOfName) {
- var name_31 = node.symbol && node.symbol.name;
- if (name_31) {
- return currentScopeFirstDeclarationsOfName[name_31] === node;
+ var name_28 = node.symbol && node.symbol.name;
+ if (name_28) {
+ return currentScopeFirstDeclarationsOfName[name_28] === node;
}
}
return false;
@@ -37887,7 +37740,7 @@ var ts;
ts.createVariableDeclaration(getDeclarationName(node, false, true))
]);
ts.setOriginalNode(statement, node);
- if (node.kind === 224) {
+ if (node.kind === 225) {
ts.setSourceMapRange(statement.declarationList, node);
}
else {
@@ -37920,7 +37773,7 @@ var ts;
var localName = getLocalName(node);
moduleArg = ts.createAssignment(localName, moduleArg);
}
- var moduleStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, transformModuleBody(node, containerName)), undefined, [moduleArg]), node);
+ var moduleStatement = ts.createStatement(ts.createCall(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, transformModuleBody(node, containerName)), undefined, [moduleArg]), node);
ts.setOriginalNode(moduleStatement, node);
ts.setEmitFlags(moduleStatement, emitFlags);
statements.push(moduleStatement);
@@ -37938,7 +37791,7 @@ var ts;
var statementsLocation;
var blockLocation;
var body = node.body;
- if (body.kind === 226) {
+ if (body.kind === 227) {
ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement));
statementsLocation = body.statements;
blockLocation = body;
@@ -37961,17 +37814,67 @@ var ts;
currentNamespace = savedCurrentNamespace;
currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName;
var block = ts.createBlock(ts.createNodeArray(statements, statementsLocation), blockLocation, true);
- if (body.kind !== 226) {
+ if (body.kind !== 227) {
ts.setEmitFlags(block, ts.getEmitFlags(block) | 49152);
}
return block;
}
function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) {
- if (moduleDeclaration.body.kind === 225) {
+ if (moduleDeclaration.body.kind === 226) {
var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body);
return recursiveInnerModule || moduleDeclaration.body;
}
}
+ function visitImportDeclaration(node) {
+ if (!node.importClause) {
+ return node;
+ }
+ var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause, true);
+ return importClause
+ ? ts.updateImportDeclaration(node, undefined, undefined, importClause, node.moduleSpecifier)
+ : undefined;
+ }
+ function visitImportClause(node) {
+ var name = resolver.isReferencedAliasDeclaration(node) ? node.name : undefined;
+ var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings, true);
+ return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings) : undefined;
+ }
+ function visitNamedImportBindings(node) {
+ if (node.kind === 233) {
+ return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
+ }
+ else {
+ var elements = ts.visitNodes(node.elements, visitImportSpecifier, ts.isImportSpecifier);
+ return ts.some(elements) ? ts.updateNamedImports(node, elements) : undefined;
+ }
+ }
+ function visitImportSpecifier(node) {
+ return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
+ }
+ function visitExportAssignment(node) {
+ return resolver.isValueAliasDeclaration(node)
+ ? ts.visitEachChild(node, visitor, context)
+ : undefined;
+ }
+ function visitExportDeclaration(node) {
+ if (!node.exportClause) {
+ return resolver.moduleExportsSomeValue(node.moduleSpecifier) ? node : undefined;
+ }
+ if (!resolver.isValueAliasDeclaration(node)) {
+ return undefined;
+ }
+ var exportClause = ts.visitNode(node.exportClause, visitNamedExports, ts.isNamedExports, true);
+ return exportClause
+ ? ts.updateExportDeclaration(node, undefined, undefined, exportClause, node.moduleSpecifier)
+ : undefined;
+ }
+ function visitNamedExports(node) {
+ var elements = ts.visitNodes(node.elements, visitExportSpecifier, ts.isExportSpecifier);
+ return ts.some(elements) ? ts.updateNamedExports(node, elements) : undefined;
+ }
+ function visitExportSpecifier(node) {
+ return resolver.isValueAliasDeclaration(node) ? node : undefined;
+ }
function shouldEmitImportEqualsDeclaration(node) {
return resolver.isReferencedAliasDeclaration(node)
|| (!ts.isExternalModule(currentSourceFile)
@@ -37979,7 +37882,9 @@ var ts;
}
function visitImportEqualsDeclaration(node) {
if (ts.isExternalModuleImportEqualsDeclaration(node)) {
- return ts.visitEachChild(node, visitor, context);
+ return resolver.isReferencedAliasDeclaration(node)
+ ? ts.visitEachChild(node, visitor, context)
+ : undefined;
}
if (!shouldEmitImportEqualsDeclaration(node)) {
return undefined;
@@ -38063,7 +37968,7 @@ var ts;
}
function getDeclarationName(node, allowComments, allowSourceMaps, emitFlags) {
if (node.name) {
- var name_32 = ts.getMutableClone(node.name);
+ var name_29 = ts.getMutableClone(node.name);
emitFlags |= ts.getEmitFlags(node.name);
if (!allowSourceMaps) {
emitFlags |= 1536;
@@ -38072,9 +37977,9 @@ var ts;
emitFlags |= 49152;
}
if (emitFlags) {
- ts.setEmitFlags(name_32, emitFlags);
+ ts.setEmitFlags(name_29, emitFlags);
}
- return name_32;
+ return name_29;
}
else {
return ts.getGeneratedNameForNode(node);
@@ -38091,57 +37996,32 @@ var ts;
function enableSubstitutionForNonQualifiedEnumMembers() {
if ((enabledSubstitutions & 8) === 0) {
enabledSubstitutions |= 8;
- context.enableSubstitution(69);
- }
- }
- function enableSubstitutionForAsyncMethodsWithSuper() {
- if ((enabledSubstitutions & 4) === 0) {
- enabledSubstitutions |= 4;
- context.enableSubstitution(174);
- context.enableSubstitution(172);
- context.enableSubstitution(173);
- context.enableEmitNotification(221);
- context.enableEmitNotification(147);
- context.enableEmitNotification(149);
- context.enableEmitNotification(150);
- context.enableEmitNotification(148);
+ context.enableSubstitution(70);
}
}
function enableSubstitutionForClassAliases() {
if ((enabledSubstitutions & 1) === 0) {
enabledSubstitutions |= 1;
- context.enableSubstitution(69);
+ context.enableSubstitution(70);
classAliases = ts.createMap();
}
}
function enableSubstitutionForNamespaceExports() {
if ((enabledSubstitutions & 2) === 0) {
enabledSubstitutions |= 2;
- context.enableSubstitution(69);
+ context.enableSubstitution(70);
context.enableSubstitution(254);
- context.enableEmitNotification(225);
+ context.enableEmitNotification(226);
}
}
- function isSuperContainer(node) {
- var kind = node.kind;
- return kind === 221
- || kind === 148
- || kind === 147
- || kind === 149
- || kind === 150;
- }
function isTransformedModuleDeclaration(node) {
- return ts.getOriginalNode(node).kind === 225;
+ return ts.getOriginalNode(node).kind === 226;
}
function isTransformedEnumDeclaration(node) {
- return ts.getOriginalNode(node).kind === 224;
+ return ts.getOriginalNode(node).kind === 225;
}
function onEmitNode(emitContext, node, emitCallback) {
var savedApplicableSubstitutions = applicableSubstitutions;
- var savedCurrentSuperContainer = currentSuperContainer;
- if (enabledSubstitutions & 4 && isSuperContainer(node)) {
- currentSuperContainer = node;
- }
if (enabledSubstitutions & 2 && isTransformedModuleDeclaration(node)) {
applicableSubstitutions |= 2;
}
@@ -38150,7 +38030,6 @@ var ts;
}
previousOnEmitNode(emitContext, node, emitCallback);
applicableSubstitutions = savedApplicableSubstitutions;
- currentSuperContainer = savedCurrentSuperContainer;
}
function onSubstituteNode(emitContext, node) {
node = previousOnSubstituteNode(emitContext, node);
@@ -38164,31 +38043,26 @@ var ts;
}
function substituteShorthandPropertyAssignment(node) {
if (enabledSubstitutions & 2) {
- var name_33 = node.name;
- var exportedName = trySubstituteNamespaceExportedName(name_33);
+ var name_30 = node.name;
+ var exportedName = trySubstituteNamespaceExportedName(name_30);
if (exportedName) {
if (node.objectAssignmentInitializer) {
var initializer = ts.createAssignment(exportedName, node.objectAssignmentInitializer);
- return ts.createPropertyAssignment(name_33, initializer, node);
+ return ts.createPropertyAssignment(name_30, initializer, node);
}
- return ts.createPropertyAssignment(name_33, exportedName, node);
+ return ts.createPropertyAssignment(name_30, exportedName, node);
}
}
return node;
}
function substituteExpression(node) {
switch (node.kind) {
- case 69:
+ case 70:
return substituteExpressionIdentifier(node);
- case 172:
- return substitutePropertyAccessExpression(node);
case 173:
- return substituteElementAccessExpression(node);
+ return substitutePropertyAccessExpression(node);
case 174:
- if (enabledSubstitutions & 4) {
- return substituteCallExpression(node);
- }
- break;
+ return substituteElementAccessExpression(node);
}
return node;
}
@@ -38218,8 +38092,8 @@ var ts;
if (enabledSubstitutions & applicableSubstitutions && (ts.getEmitFlags(node) & 262144) === 0) {
var container = resolver.getReferencedExportContainer(node, false);
if (container) {
- var substitute = (applicableSubstitutions & 2 && container.kind === 225) ||
- (applicableSubstitutions & 8 && container.kind === 224);
+ var substitute = (applicableSubstitutions & 2 && container.kind === 226) ||
+ (applicableSubstitutions & 8 && container.kind === 225);
if (substitute) {
return ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node, node);
}
@@ -38227,37 +38101,10 @@ var ts;
}
return undefined;
}
- function substituteCallExpression(node) {
- var expression = node.expression;
- if (ts.isSuperProperty(expression)) {
- var flags = getSuperContainerAsyncMethodFlags();
- if (flags) {
- var argumentExpression = ts.isPropertyAccessExpression(expression)
- ? substitutePropertyAccessExpression(expression)
- : substituteElementAccessExpression(expression);
- return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [
- ts.createThis()
- ].concat(node.arguments));
- }
- }
- return node;
- }
function substitutePropertyAccessExpression(node) {
- if (enabledSubstitutions & 4 && node.expression.kind === 95) {
- var flags = getSuperContainerAsyncMethodFlags();
- if (flags) {
- return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), flags, node);
- }
- }
return substituteConstantValue(node);
}
function substituteElementAccessExpression(node) {
- if (enabledSubstitutions & 4 && node.expression.kind === 95) {
- var flags = getSuperContainerAsyncMethodFlags();
- if (flags) {
- return createSuperAccessInAsyncMethod(node.argumentExpression, flags, node);
- }
- }
return substituteConstantValue(node);
}
function substituteConstantValue(node) {
@@ -38285,18 +38132,6 @@ var ts;
? resolver.getConstantValue(node)
: undefined;
}
- function createSuperAccessInAsyncMethod(argumentExpression, flags, location) {
- if (flags & 4096) {
- return ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), "value", location);
- }
- else {
- return ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression], location);
- }
- }
- function getSuperContainerAsyncMethodFlags() {
- return currentSuperContainer !== undefined
- && resolver.getNodeCheckFlags(currentSuperContainer) & (2048 | 4096);
- }
}
ts.transformTypeScript = transformTypeScript;
})(ts || (ts = {}));
@@ -38329,9 +38164,9 @@ var ts;
}
function visitorWorker(node) {
switch (node.kind) {
- case 241:
- return visitJsxElement(node, false);
case 242:
+ return visitJsxElement(node, false);
+ case 243:
return visitJsxSelfClosingElement(node, false);
case 248:
return visitJsxExpression(node);
@@ -38342,13 +38177,13 @@ var ts;
}
function transformJsxChildToExpression(node) {
switch (node.kind) {
- case 244:
+ case 10:
return visitJsxText(node);
case 248:
return visitJsxExpression(node);
- case 241:
- return visitJsxElement(node, true);
case 242:
+ return visitJsxElement(node, true);
+ case 243:
return visitJsxSelfClosingElement(node, true);
default:
ts.Debug.failBadSyntaxKind(node);
@@ -38465,16 +38300,16 @@ var ts;
return decoded === text ? undefined : decoded;
}
function getTagName(node) {
- if (node.kind === 241) {
+ if (node.kind === 242) {
return getTagName(node.openingElement);
}
else {
- var name_34 = node.tagName;
- if (ts.isIdentifier(name_34) && ts.isIntrinsicJsxName(name_34.text)) {
- return ts.createLiteral(name_34.text);
+ var name_31 = node.tagName;
+ if (ts.isIdentifier(name_31) && ts.isIntrinsicJsxName(name_31.text)) {
+ return ts.createLiteral(name_31.text);
}
else {
- return ts.createExpressionFromEntityName(name_34);
+ return ts.createExpressionFromEntityName(name_31);
}
}
}
@@ -38752,13 +38587,30 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
- function transformES7(context) {
- var hoistVariableDeclaration = context.hoistVariableDeclaration;
+ function transformES2017(context) {
+ var ES2017SubstitutionFlags;
+ (function (ES2017SubstitutionFlags) {
+ ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper";
+ })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {}));
+ var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment;
+ var resolver = context.getEmitResolver();
+ var compilerOptions = context.getCompilerOptions();
+ var languageVersion = ts.getEmitScriptTarget(compilerOptions);
+ var currentSourceFileExternalHelpersModuleName;
+ var enabledSubstitutions;
+ var applicableSubstitutions;
+ var currentSuperContainer;
+ var previousOnEmitNode = context.onEmitNode;
+ var previousOnSubstituteNode = context.onSubstituteNode;
+ context.onEmitNode = onEmitNode;
+ context.onSubstituteNode = onSubstituteNode;
+ var currentScope;
return transformSourceFile;
function transformSourceFile(node) {
if (ts.isDeclarationFile(node)) {
return node;
}
+ currentSourceFileExternalHelpersModuleName = node.externalHelpersModuleName;
return ts.visitEachChild(node, visitor, context);
}
function visitor(node) {
@@ -38768,13 +38620,265 @@ var ts;
else if (node.transformFlags & 32) {
return ts.visitEachChild(node, visitor, context);
}
+ return node;
+ }
+ function visitorWorker(node) {
+ switch (node.kind) {
+ case 119:
+ return undefined;
+ case 185:
+ return visitAwaitExpression(node);
+ case 148:
+ return visitMethodDeclaration(node);
+ case 221:
+ return visitFunctionDeclaration(node);
+ case 180:
+ return visitFunctionExpression(node);
+ case 181:
+ return visitArrowFunction(node);
+ default:
+ ts.Debug.failBadSyntaxKind(node);
+ return node;
+ }
+ }
+ function visitAwaitExpression(node) {
+ return ts.setOriginalNode(ts.createYield(undefined, ts.visitNode(node.expression, visitor, ts.isExpression), node), node);
+ }
+ function visitMethodDeclaration(node) {
+ if (!ts.isAsyncFunctionLike(node)) {
+ return node;
+ }
+ var method = ts.createMethod(undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node);
+ ts.setCommentRange(method, node);
+ ts.setSourceMapRange(method, ts.moveRangePastDecorators(node));
+ ts.setOriginalNode(method, node);
+ return method;
+ }
+ function visitFunctionDeclaration(node) {
+ if (!ts.isAsyncFunctionLike(node)) {
+ return node;
+ }
+ var func = ts.createFunctionDeclaration(undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node);
+ ts.setOriginalNode(func, node);
+ return func;
+ }
+ function visitFunctionExpression(node) {
+ if (!ts.isAsyncFunctionLike(node)) {
+ return node;
+ }
+ if (ts.nodeIsMissing(node.body)) {
+ return ts.createOmittedExpression();
+ }
+ var func = ts.createFunctionExpression(undefined, node.asteriskToken, node.name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, transformFunctionBody(node), node);
+ ts.setOriginalNode(func, node);
+ return func;
+ }
+ function visitArrowFunction(node) {
+ if (!ts.isAsyncFunctionLike(node)) {
+ return node;
+ }
+ var func = ts.createArrowFunction(ts.visitNodes(node.modifiers, visitor, ts.isModifier), undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, node.equalsGreaterThanToken, transformConciseBody(node), node);
+ ts.setOriginalNode(func, node);
+ return func;
+ }
+ function transformFunctionBody(node) {
+ return transformAsyncFunctionBody(node);
+ }
+ function transformConciseBody(node) {
+ return transformAsyncFunctionBody(node);
+ }
+ function transformFunctionBodyWorker(body, start) {
+ if (start === void 0) { start = 0; }
+ var savedCurrentScope = currentScope;
+ currentScope = body;
+ startLexicalEnvironment();
+ var statements = ts.visitNodes(body.statements, visitor, ts.isStatement, start);
+ var visited = ts.updateBlock(body, statements);
+ var declarations = endLexicalEnvironment();
+ currentScope = savedCurrentScope;
+ return ts.mergeFunctionBodyLexicalEnvironment(visited, declarations);
+ }
+ function transformAsyncFunctionBody(node) {
+ var nodeType = node.original ? node.original.type : node.type;
+ var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : undefined;
+ var isArrowFunction = node.kind === 181;
+ var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0;
+ if (!isArrowFunction) {
+ var statements = [];
+ var statementOffset = ts.addPrologueDirectives(statements, node.body.statements, false, visitor);
+ statements.push(ts.createReturn(ts.createAwaiterHelper(currentSourceFileExternalHelpersModuleName, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset))));
+ var block = ts.createBlock(statements, node.body, true);
+ if (languageVersion >= 2) {
+ if (resolver.getNodeCheckFlags(node) & 4096) {
+ enableSubstitutionForAsyncMethodsWithSuper();
+ ts.setEmitFlags(block, 8);
+ }
+ else if (resolver.getNodeCheckFlags(node) & 2048) {
+ enableSubstitutionForAsyncMethodsWithSuper();
+ ts.setEmitFlags(block, 4);
+ }
+ }
+ return block;
+ }
+ else {
+ return ts.createAwaiterHelper(currentSourceFileExternalHelpersModuleName, hasLexicalArguments, promiseConstructor, transformConciseBodyWorker(node.body, true));
+ }
+ }
+ function transformConciseBodyWorker(body, forceBlockFunctionBody) {
+ if (ts.isBlock(body)) {
+ return transformFunctionBodyWorker(body);
+ }
+ else {
+ startLexicalEnvironment();
+ var visited = ts.visitNode(body, visitor, ts.isConciseBody);
+ var declarations = endLexicalEnvironment();
+ var merged = ts.mergeFunctionBodyLexicalEnvironment(visited, declarations);
+ if (forceBlockFunctionBody && !ts.isBlock(merged)) {
+ return ts.createBlock([
+ ts.createReturn(merged)
+ ]);
+ }
+ else {
+ return merged;
+ }
+ }
+ }
+ function getPromiseConstructor(type) {
+ var typeName = ts.getEntityNameFromTypeNode(type);
+ if (typeName && ts.isEntityName(typeName)) {
+ var serializationKind = resolver.getTypeReferenceSerializationKind(typeName);
+ if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue
+ || serializationKind === ts.TypeReferenceSerializationKind.Unknown) {
+ return typeName;
+ }
+ }
+ return undefined;
+ }
+ function enableSubstitutionForAsyncMethodsWithSuper() {
+ if ((enabledSubstitutions & 1) === 0) {
+ enabledSubstitutions |= 1;
+ context.enableSubstitution(175);
+ context.enableSubstitution(173);
+ context.enableSubstitution(174);
+ context.enableEmitNotification(222);
+ context.enableEmitNotification(148);
+ context.enableEmitNotification(150);
+ context.enableEmitNotification(151);
+ context.enableEmitNotification(149);
+ }
+ }
+ function substituteExpression(node) {
+ switch (node.kind) {
+ case 173:
+ return substitutePropertyAccessExpression(node);
+ case 174:
+ return substituteElementAccessExpression(node);
+ case 175:
+ if (enabledSubstitutions & 1) {
+ return substituteCallExpression(node);
+ }
+ break;
+ }
+ return node;
+ }
+ function substitutePropertyAccessExpression(node) {
+ if (enabledSubstitutions & 1 && node.expression.kind === 96) {
+ var flags = getSuperContainerAsyncMethodFlags();
+ if (flags) {
+ return createSuperAccessInAsyncMethod(ts.createLiteral(node.name.text), flags, node);
+ }
+ }
+ return node;
+ }
+ function substituteElementAccessExpression(node) {
+ if (enabledSubstitutions & 1 && node.expression.kind === 96) {
+ var flags = getSuperContainerAsyncMethodFlags();
+ if (flags) {
+ return createSuperAccessInAsyncMethod(node.argumentExpression, flags, node);
+ }
+ }
+ return node;
+ }
+ function substituteCallExpression(node) {
+ var expression = node.expression;
+ if (ts.isSuperProperty(expression)) {
+ var flags = getSuperContainerAsyncMethodFlags();
+ if (flags) {
+ var argumentExpression = ts.isPropertyAccessExpression(expression)
+ ? substitutePropertyAccessExpression(expression)
+ : substituteElementAccessExpression(expression);
+ return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [
+ ts.createThis()
+ ].concat(node.arguments));
+ }
+ }
+ return node;
+ }
+ function isSuperContainer(node) {
+ var kind = node.kind;
+ return kind === 222
+ || kind === 149
+ || kind === 148
+ || kind === 150
+ || kind === 151;
+ }
+ function onEmitNode(emitContext, node, emitCallback) {
+ var savedApplicableSubstitutions = applicableSubstitutions;
+ var savedCurrentSuperContainer = currentSuperContainer;
+ if (enabledSubstitutions & 1 && isSuperContainer(node)) {
+ currentSuperContainer = node;
+ }
+ previousOnEmitNode(emitContext, node, emitCallback);
+ applicableSubstitutions = savedApplicableSubstitutions;
+ currentSuperContainer = savedCurrentSuperContainer;
+ }
+ function onSubstituteNode(emitContext, node) {
+ node = previousOnSubstituteNode(emitContext, node);
+ if (emitContext === 1) {
+ return substituteExpression(node);
+ }
+ return node;
+ }
+ function createSuperAccessInAsyncMethod(argumentExpression, flags, location) {
+ if (flags & 4096) {
+ return ts.createPropertyAccess(ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression]), "value", location);
+ }
+ else {
+ return ts.createCall(ts.createIdentifier("_super"), undefined, [argumentExpression], location);
+ }
+ }
+ function getSuperContainerAsyncMethodFlags() {
+ return currentSuperContainer !== undefined
+ && resolver.getNodeCheckFlags(currentSuperContainer) & (2048 | 4096);
+ }
+ }
+ ts.transformES2017 = transformES2017;
+})(ts || (ts = {}));
+var ts;
+(function (ts) {
+ function transformES2016(context) {
+ var hoistVariableDeclaration = context.hoistVariableDeclaration;
+ return transformSourceFile;
+ function transformSourceFile(node) {
+ if (ts.isDeclarationFile(node)) {
+ return node;
+ }
+ return ts.visitEachChild(node, visitor, context);
+ }
+ function visitor(node) {
+ if (node.transformFlags & 64) {
+ return visitorWorker(node);
+ }
+ else if (node.transformFlags & 128) {
+ return ts.visitEachChild(node, visitor, context);
+ }
else {
return node;
}
}
function visitorWorker(node) {
switch (node.kind) {
- case 187:
+ case 188:
return visitBinaryExpression(node);
default:
ts.Debug.failBadSyntaxKind(node);
@@ -38784,7 +38888,7 @@ var ts;
function visitBinaryExpression(node) {
var left = ts.visitNode(node.left, visitor, ts.isExpression);
var right = ts.visitNode(node.right, visitor, ts.isExpression);
- if (node.operatorToken.kind === 60) {
+ if (node.operatorToken.kind === 61) {
var target = void 0;
var value = void 0;
if (ts.isElementAccessExpression(left)) {
@@ -38804,7 +38908,7 @@ var ts;
}
return ts.createAssignment(target, ts.createMathPow(value, right, node), node);
}
- else if (node.operatorToken.kind === 38) {
+ else if (node.operatorToken.kind === 39) {
return ts.createMathPow(left, right, node);
}
else {
@@ -38813,11 +38917,33 @@ var ts;
}
}
}
- ts.transformES7 = transformES7;
+ ts.transformES2016 = transformES2016;
})(ts || (ts = {}));
var ts;
(function (ts) {
- function transformES6(context) {
+ var ES2015SubstitutionFlags;
+ (function (ES2015SubstitutionFlags) {
+ ES2015SubstitutionFlags[ES2015SubstitutionFlags["CapturedThis"] = 1] = "CapturedThis";
+ ES2015SubstitutionFlags[ES2015SubstitutionFlags["BlockScopedBindings"] = 2] = "BlockScopedBindings";
+ })(ES2015SubstitutionFlags || (ES2015SubstitutionFlags = {}));
+ var CopyDirection;
+ (function (CopyDirection) {
+ CopyDirection[CopyDirection["ToOriginal"] = 0] = "ToOriginal";
+ CopyDirection[CopyDirection["ToOutParameter"] = 1] = "ToOutParameter";
+ })(CopyDirection || (CopyDirection = {}));
+ var Jump;
+ (function (Jump) {
+ Jump[Jump["Break"] = 2] = "Break";
+ Jump[Jump["Continue"] = 4] = "Continue";
+ Jump[Jump["Return"] = 8] = "Return";
+ })(Jump || (Jump = {}));
+ var SuperCaptureResult;
+ (function (SuperCaptureResult) {
+ SuperCaptureResult[SuperCaptureResult["NoReplacement"] = 0] = "NoReplacement";
+ SuperCaptureResult[SuperCaptureResult["ReplaceSuperCapture"] = 1] = "ReplaceSuperCapture";
+ SuperCaptureResult[SuperCaptureResult["ReplaceWithReturn"] = 2] = "ReplaceWithReturn";
+ })(SuperCaptureResult || (SuperCaptureResult = {}));
+ function transformES2015(context) {
var startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration;
var resolver = context.getEmitResolver();
var previousOnSubstituteNode = context.onSubstituteNode;
@@ -38880,15 +39006,15 @@ var ts;
return visited;
}
function shouldCheckNode(node) {
- return (node.transformFlags & 64) !== 0 ||
- node.kind === 214 ||
+ return (node.transformFlags & 256) !== 0 ||
+ node.kind === 215 ||
(ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node));
}
function visitorWorker(node) {
if (shouldCheckNode(node)) {
return visitJavaScript(node);
}
- else if (node.transformFlags & 128) {
+ else if (node.transformFlags & 512) {
return ts.visitEachChild(node, visitor, context);
}
else {
@@ -38907,18 +39033,18 @@ var ts;
}
function visitNodesInConvertedLoop(node) {
switch (node.kind) {
- case 211:
+ case 212:
return visitReturnStatement(node);
- case 200:
+ case 201:
return visitVariableStatement(node);
- case 213:
+ case 214:
return visitSwitchStatement(node);
+ case 211:
case 210:
- case 209:
return visitBreakOrContinueStatement(node);
- case 97:
+ case 98:
return visitThisKeyword(node);
- case 69:
+ case 70:
return visitIdentifier(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -38926,74 +39052,74 @@ var ts;
}
function visitJavaScript(node) {
switch (node.kind) {
- case 82:
+ case 83:
return node;
- case 221:
+ case 222:
return visitClassDeclaration(node);
- case 192:
+ case 193:
return visitClassExpression(node);
- case 142:
+ case 143:
return visitParameter(node);
- case 220:
+ case 221:
return visitFunctionDeclaration(node);
- case 180:
+ case 181:
return visitArrowFunction(node);
- case 179:
+ case 180:
return visitFunctionExpression(node);
- case 218:
- return visitVariableDeclaration(node);
- case 69:
- return visitIdentifier(node);
case 219:
+ return visitVariableDeclaration(node);
+ case 70:
+ return visitIdentifier(node);
+ case 220:
return visitVariableDeclarationList(node);
- case 214:
+ case 215:
return visitLabeledStatement(node);
- case 204:
- return visitDoStatement(node);
case 205:
- return visitWhileStatement(node);
+ return visitDoStatement(node);
case 206:
- return visitForStatement(node);
+ return visitWhileStatement(node);
case 207:
- return visitForInStatement(node);
+ return visitForStatement(node);
case 208:
+ return visitForInStatement(node);
+ case 209:
return visitForOfStatement(node);
- case 202:
+ case 203:
return visitExpressionStatement(node);
- case 171:
+ case 172:
return visitObjectLiteralExpression(node);
case 254:
return visitShorthandPropertyAssignment(node);
- case 170:
+ case 171:
return visitArrayLiteralExpression(node);
- case 174:
- return visitCallExpression(node);
case 175:
+ return visitCallExpression(node);
+ case 176:
return visitNewExpression(node);
- case 178:
+ case 179:
return visitParenthesizedExpression(node, true);
- case 187:
+ case 188:
return visitBinaryExpression(node, true);
- case 11:
case 12:
case 13:
case 14:
+ case 15:
return visitTemplateLiteral(node);
- case 176:
+ case 177:
return visitTaggedTemplateExpression(node);
- case 189:
+ case 190:
return visitTemplateExpression(node);
- case 190:
+ case 191:
return visitYieldExpression(node);
- case 95:
- return visitSuperKeyword(node);
- case 190:
+ case 96:
+ return visitSuperKeyword();
+ case 191:
return ts.visitEachChild(node, visitor, context);
- case 147:
+ case 148:
return visitMethodDeclaration(node);
case 256:
return visitSourceFileNode(node);
- case 200:
+ case 201:
return visitVariableStatement(node);
default:
ts.Debug.failBadSyntaxKind(node);
@@ -39008,7 +39134,7 @@ var ts;
}
if (ts.isFunctionLike(currentNode)) {
enclosingFunction = currentNode;
- if (currentNode.kind !== 180) {
+ if (currentNode.kind !== 181) {
enclosingNonArrowFunction = currentNode;
if (!(ts.getEmitFlags(currentNode) & 2097152)) {
enclosingNonAsyncFunctionBody = currentNode;
@@ -39016,14 +39142,14 @@ var ts;
}
}
switch (currentNode.kind) {
- case 200:
+ case 201:
enclosingVariableStatement = currentNode;
break;
+ case 220:
case 219:
- case 218:
- case 169:
- case 167:
+ case 170:
case 168:
+ case 169:
break;
default:
enclosingVariableStatement = undefined;
@@ -39051,7 +39177,7 @@ var ts;
}
function visitThisKeyword(node) {
ts.Debug.assert(convertedLoopState !== undefined);
- if (enclosingFunction && enclosingFunction.kind === 180) {
+ if (enclosingFunction && enclosingFunction.kind === 181) {
convertedLoopState.containsLexicalThis = true;
return node;
}
@@ -39071,13 +39197,13 @@ var ts;
}
function visitBreakOrContinueStatement(node) {
if (convertedLoopState) {
- var jump = node.kind === 210 ? 2 : 4;
+ var jump = node.kind === 211 ? 2 : 4;
var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) ||
(!node.label && (convertedLoopState.allowedNonLabeledJumps & jump));
if (!canUseBreakOrContinue) {
var labelMarker = void 0;
if (!node.label) {
- if (node.kind === 210) {
+ if (node.kind === 211) {
convertedLoopState.nonLocalJumps |= 2;
labelMarker = "break";
}
@@ -39087,7 +39213,7 @@ var ts;
}
}
else {
- if (node.kind === 210) {
+ if (node.kind === 211) {
labelMarker = "break-" + node.label.text;
setLabeledJump(convertedLoopState, true, node.label.text, labelMarker);
}
@@ -39106,10 +39232,10 @@ var ts;
expr = copyExpr;
}
else {
- expr = ts.createBinary(expr, 24, copyExpr);
+ expr = ts.createBinary(expr, 25, copyExpr);
}
}
- returnExpression = ts.createBinary(expr, 24, returnExpression);
+ returnExpression = ts.createBinary(expr, 25, returnExpression);
}
return ts.createReturn(returnExpression);
}
@@ -39136,7 +39262,7 @@ var ts;
return statement;
}
function isExportModifier(node) {
- return node.kind === 82;
+ return node.kind === 83;
}
function visitClassExpression(node) {
return transformClassLikeDeclarationToExpression(node);
@@ -39146,7 +39272,7 @@ var ts;
enableSubstitutionsForBlockScopedBindings();
}
var extendsClauseElement = ts.getClassExtendsHeritageClauseElement(node);
- var classFunction = ts.createFunctionExpression(undefined, undefined, undefined, extendsClauseElement ? [ts.createParameter("_super")] : [], undefined, transformClassBody(node, extendsClauseElement));
+ var classFunction = ts.createFunctionExpression(undefined, undefined, undefined, undefined, extendsClauseElement ? [ts.createParameter("_super")] : [], undefined, transformClassBody(node, extendsClauseElement));
if (ts.getEmitFlags(node) & 524288) {
ts.setEmitFlags(classFunction, 524288);
}
@@ -39166,7 +39292,7 @@ var ts;
addExtendsHelperIfNeeded(statements, node, extendsClauseElement);
addConstructor(statements, node, extendsClauseElement);
addClassMembers(statements, node);
- var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 16);
+ var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 17);
var localName = getLocalName(node);
var outer = ts.createPartiallyEmittedExpression(localName);
outer.end = closingBraceLocation.end;
@@ -39236,17 +39362,17 @@ var ts;
return block;
}
function isSufficientlyCoveredByReturnStatements(statement) {
- if (statement.kind === 211) {
+ if (statement.kind === 212) {
return true;
}
- else if (statement.kind === 203) {
+ else if (statement.kind === 204) {
var ifStatement = statement;
if (ifStatement.elseStatement) {
return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) &&
isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement);
}
}
- else if (statement.kind === 199) {
+ else if (statement.kind === 200) {
var lastStatement = ts.lastOrUndefined(statement.statements);
if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) {
return true;
@@ -39275,7 +39401,7 @@ var ts;
var ctorStatements = ctor.body.statements;
if (statementOffset < ctorStatements.length) {
firstStatement = ctorStatements[statementOffset];
- if (firstStatement.kind === 202 && ts.isSuperCall(firstStatement.expression)) {
+ if (firstStatement.kind === 203 && ts.isSuperCall(firstStatement.expression)) {
var superCall = firstStatement.expression;
superCallExpression = ts.setOriginalNode(saveStateAndInvoke(superCall, visitImmediateSuperCallInBody), superCall);
}
@@ -39311,7 +39437,7 @@ var ts;
}
}
function shouldAddDefaultValueAssignments(node) {
- return (node.transformFlags & 65536) !== 0;
+ return (node.transformFlags & 262144) !== 0;
}
function addDefaultValueAssignmentsIfNeeded(statements, node) {
if (!shouldAddDefaultValueAssignments(node)) {
@@ -39319,22 +39445,22 @@ var ts;
}
for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
var parameter = _a[_i];
- var name_35 = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken;
+ var name_32 = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken;
if (dotDotDotToken) {
continue;
}
- if (ts.isBindingPattern(name_35)) {
- addDefaultValueAssignmentForBindingPattern(statements, parameter, name_35, initializer);
+ if (ts.isBindingPattern(name_32)) {
+ addDefaultValueAssignmentForBindingPattern(statements, parameter, name_32, initializer);
}
else if (initializer) {
- addDefaultValueAssignmentForInitializer(statements, parameter, name_35, initializer);
+ addDefaultValueAssignmentForInitializer(statements, parameter, name_32, initializer);
}
}
}
function addDefaultValueAssignmentForBindingPattern(statements, parameter, name, initializer) {
var temp = ts.getGeneratedNameForNode(parameter);
if (name.elements.length > 0) {
- statements.push(ts.setEmitFlags(ts.createVariableStatement(undefined, ts.createVariableDeclarationList(ts.flattenParameterDestructuring(context, parameter, temp, visitor))), 8388608));
+ statements.push(ts.setEmitFlags(ts.createVariableStatement(undefined, ts.createVariableDeclarationList(ts.flattenParameterDestructuring(parameter, temp, visitor))), 8388608));
}
else if (initializer) {
statements.push(ts.setEmitFlags(ts.createStatement(ts.createAssignment(temp, ts.visitNode(initializer, visitor, ts.isExpression))), 8388608));
@@ -39350,7 +39476,7 @@ var ts;
statements.push(statement);
}
function shouldAddRestParameter(node, inConstructorWithSynthesizedSuper) {
- return node && node.dotDotDotToken && node.name.kind === 69 && !inConstructorWithSynthesizedSuper;
+ return node && node.dotDotDotToken && node.name.kind === 70 && !inConstructorWithSynthesizedSuper;
}
function addRestParameterIfNeeded(statements, node, inConstructorWithSynthesizedSuper) {
var parameter = ts.lastOrUndefined(node.parameters);
@@ -39375,7 +39501,7 @@ var ts;
statements.push(forStatement);
}
function addCaptureThisForNodeIfNeeded(statements, node) {
- if (node.transformFlags & 16384 && node.kind !== 180) {
+ if (node.transformFlags & 65536 && node.kind !== 181) {
captureThisForNode(statements, node, ts.createThis());
}
}
@@ -39392,20 +39518,20 @@ var ts;
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
switch (member.kind) {
- case 198:
+ case 199:
statements.push(transformSemicolonClassElementToStatement(member));
break;
- case 147:
+ case 148:
statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member));
break;
- case 149:
case 150:
+ case 151:
var accessors = ts.getAllAccessorDeclarations(node.members, member);
if (member === accessors.firstAccessor) {
statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors));
}
break;
- case 148:
+ case 149:
break;
default:
ts.Debug.failBadSyntaxKind(node);
@@ -39445,6 +39571,7 @@ var ts;
if (getAccessor) {
var getterFunction = transformFunctionLikeToExpression(getAccessor, undefined, undefined);
ts.setSourceMapRange(getterFunction, ts.getSourceMapRange(getAccessor));
+ ts.setEmitFlags(getterFunction, 16384);
var getter = ts.createPropertyAssignment("get", getterFunction);
ts.setCommentRange(getter, ts.getCommentRange(getAccessor));
properties.push(getter);
@@ -39452,6 +39579,7 @@ var ts;
if (setAccessor) {
var setterFunction = transformFunctionLikeToExpression(setAccessor, undefined, undefined);
ts.setSourceMapRange(setterFunction, ts.getSourceMapRange(setAccessor));
+ ts.setEmitFlags(setterFunction, 16384);
var setter = ts.createPropertyAssignment("set", setterFunction);
ts.setCommentRange(setter, ts.getCommentRange(setAccessor));
properties.push(setter);
@@ -39468,7 +39596,7 @@ var ts;
return call;
}
function visitArrowFunction(node) {
- if (node.transformFlags & 8192) {
+ if (node.transformFlags & 32768) {
enableSubstitutionsForCapturedThis();
}
var func = transformFunctionLikeToExpression(node, node, undefined);
@@ -39483,10 +39611,10 @@ var ts;
}
function transformFunctionLikeToExpression(node, location, name) {
var savedContainingNonArrowFunction = enclosingNonArrowFunction;
- if (node.kind !== 180) {
+ if (node.kind !== 181) {
enclosingNonArrowFunction = node;
}
- var expression = ts.setOriginalNode(ts.createFunctionExpression(node.asteriskToken, name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, saveStateAndInvoke(node, transformFunctionBody), location), node);
+ var expression = ts.setOriginalNode(ts.createFunctionExpression(undefined, node.asteriskToken, name, undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter), undefined, saveStateAndInvoke(node, transformFunctionBody), location), node);
enclosingNonArrowFunction = savedContainingNonArrowFunction;
return expression;
}
@@ -39516,7 +39644,7 @@ var ts;
}
}
else {
- ts.Debug.assert(node.kind === 180);
+ ts.Debug.assert(node.kind === 181);
statementsLocation = ts.moveRangeEnd(body, -1);
var equalsGreaterThanToken = node.equalsGreaterThanToken;
if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) {
@@ -39543,16 +39671,16 @@ var ts;
ts.setEmitFlags(block, 32);
}
if (closeBraceLocation) {
- ts.setTokenSourceMapRange(block, 16, closeBraceLocation);
+ ts.setTokenSourceMapRange(block, 17, closeBraceLocation);
}
ts.setOriginalNode(block, node.body);
return block;
}
function visitExpressionStatement(node) {
switch (node.expression.kind) {
- case 178:
+ case 179:
return ts.updateStatement(node, visitParenthesizedExpression(node.expression, false));
- case 187:
+ case 188:
return ts.updateStatement(node, visitBinaryExpression(node.expression, false));
}
return ts.visitEachChild(node, visitor, context);
@@ -39560,9 +39688,9 @@ var ts;
function visitParenthesizedExpression(node, needsDestructuringValue) {
if (needsDestructuringValue) {
switch (node.expression.kind) {
- case 178:
+ case 179:
return ts.createParen(visitParenthesizedExpression(node.expression, true), node);
- case 187:
+ case 188:
return ts.createParen(visitBinaryExpression(node.expression, true), node);
}
}
@@ -39581,16 +39709,16 @@ var ts;
if (decl.initializer) {
var assignment = void 0;
if (ts.isBindingPattern(decl.name)) {
- assignment = ts.flattenVariableDestructuringToExpression(context, decl, hoistVariableDeclaration, undefined, visitor);
+ assignment = ts.flattenVariableDestructuringToExpression(decl, hoistVariableDeclaration, undefined, visitor);
}
else {
- assignment = ts.createBinary(decl.name, 56, ts.visitNode(decl.initializer, visitor, ts.isExpression));
+ assignment = ts.createBinary(decl.name, 57, ts.visitNode(decl.initializer, visitor, ts.isExpression));
}
(assignments || (assignments = [])).push(assignment);
}
}
if (assignments) {
- return ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 24, acc); }), node);
+ return ts.createStatement(ts.reduceLeft(assignments, function (acc, v) { return ts.createBinary(v, 25, acc); }), node);
}
else {
return undefined;
@@ -39608,7 +39736,7 @@ var ts;
var declarationList = ts.createVariableDeclarationList(declarations, node);
ts.setOriginalNode(declarationList, node);
ts.setCommentRange(declarationList, node);
- if (node.transformFlags & 2097152
+ if (node.transformFlags & 8388608
&& (ts.isBindingPattern(node.declarations[0].name)
|| ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) {
var firstDeclaration = ts.firstOrUndefined(declarations);
@@ -39627,8 +39755,8 @@ var ts;
&& ts.isBlock(enclosingBlockScopeContainer)
&& ts.isIterationStatement(enclosingBlockScopeContainerParent, false));
var emitExplicitInitializer = !emittedAsTopLevel
- && enclosingBlockScopeContainer.kind !== 207
&& enclosingBlockScopeContainer.kind !== 208
+ && enclosingBlockScopeContainer.kind !== 209
&& (!resolver.isDeclarationWithCollidingName(node)
|| (isDeclaredInLoop
&& !isCapturedInFunction
@@ -39651,7 +39779,7 @@ var ts;
if (ts.isBindingPattern(node.name)) {
var recordTempVariablesInLine = !enclosingVariableStatement
|| !ts.hasModifier(enclosingVariableStatement, 1);
- return ts.flattenVariableDestructuring(context, node, undefined, visitor, recordTempVariablesInLine ? undefined : hoistVariableDeclaration);
+ return ts.flattenVariableDestructuring(node, undefined, visitor, recordTempVariablesInLine ? undefined : hoistVariableDeclaration);
}
return ts.visitEachChild(node, visitor, context);
}
@@ -39694,7 +39822,7 @@ var ts;
var initializer = node.initializer;
var statements = [];
var counter = ts.createLoopVariable();
- var rhsReference = expression.kind === 69
+ var rhsReference = expression.kind === 70
? ts.createUniqueName(expression.text)
: ts.createTempVariable(undefined);
if (ts.isVariableDeclarationList(initializer)) {
@@ -39703,7 +39831,7 @@ var ts;
}
var firstOriginalDeclaration = ts.firstOrUndefined(initializer.declarations);
if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) {
- var declarations = ts.flattenVariableDestructuring(context, firstOriginalDeclaration, ts.createElementAccess(rhsReference, counter), visitor);
+ var declarations = ts.flattenVariableDestructuring(firstOriginalDeclaration, ts.createElementAccess(rhsReference, counter), visitor);
var declarationList = ts.createVariableDeclarationList(declarations, initializer);
ts.setOriginalNode(declarationList, initializer);
var firstDeclaration = declarations[0];
@@ -39759,8 +39887,8 @@ var ts;
var numInitialProperties = numProperties;
for (var i = 0; i < numProperties; i++) {
var property = properties[i];
- if (property.transformFlags & 4194304
- || property.name.kind === 140) {
+ if (property.transformFlags & 16777216
+ || property.name.kind === 141) {
numInitialProperties = i;
break;
}
@@ -39786,7 +39914,7 @@ var ts;
}
visit(node.name);
function visit(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
state.hoistedLocalVariables.push(node);
}
else {
@@ -39815,11 +39943,11 @@ var ts;
var functionName = ts.createUniqueName("_loop");
var loopInitializer;
switch (node.kind) {
- case 206:
case 207:
case 208:
+ case 209:
var initializer = node.initializer;
- if (initializer && initializer.kind === 219) {
+ if (initializer && initializer.kind === 220) {
loopInitializer = initializer;
}
break;
@@ -39858,7 +39986,7 @@ var ts;
}
var isAsyncBlockContainingAwait = enclosingNonArrowFunction
&& (ts.getEmitFlags(enclosingNonArrowFunction) & 2097152) !== 0
- && (node.statement.transformFlags & 4194304) !== 0;
+ && (node.statement.transformFlags & 16777216) !== 0;
var loopBodyFlags = 0;
if (currentState.containsLexicalThis) {
loopBodyFlags |= 256;
@@ -39867,7 +39995,7 @@ var ts;
loopBodyFlags |= 2097152;
}
var convertedLoopVariable = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
- ts.createVariableDeclaration(functionName, undefined, ts.setEmitFlags(ts.createFunctionExpression(isAsyncBlockContainingAwait ? ts.createToken(37) : undefined, undefined, undefined, loopParameters, undefined, loopBody), loopBodyFlags))
+ ts.createVariableDeclaration(functionName, undefined, ts.setEmitFlags(ts.createFunctionExpression(undefined, isAsyncBlockContainingAwait ? ts.createToken(38) : undefined, undefined, undefined, loopParameters, undefined, loopBody), loopBodyFlags))
]));
var statements = [convertedLoopVariable];
var extraVariableDeclarations;
@@ -39926,7 +40054,7 @@ var ts;
loop.transformFlags = 0;
ts.aggregateTransformFlags(loop);
}
- statements.push(currentParent.kind === 214
+ statements.push(currentParent.kind === 215
? ts.createLabel(currentParent.label, loop)
: loop);
return statements;
@@ -39934,7 +40062,7 @@ var ts;
function copyOutParameter(outParam, copyDirection) {
var source = copyDirection === 0 ? outParam.outParamName : outParam.originalName;
var target = copyDirection === 0 ? outParam.originalName : outParam.outParamName;
- return ts.createBinary(target, 56, source);
+ return ts.createBinary(target, 57, source);
}
function copyOutParameters(outParams, copyDirection, statements) {
for (var _i = 0, outParams_1 = outParams; _i < outParams_1.length; _i++) {
@@ -39949,7 +40077,7 @@ var ts;
!state.labeledNonLocalBreaks &&
!state.labeledNonLocalContinues;
var call = ts.createCall(loopFunctionExpressionName, undefined, ts.map(parameters, function (p) { return p.name; }));
- var callResult = isAsyncBlockContainingAwait ? ts.createYield(ts.createToken(37), call) : call;
+ var callResult = isAsyncBlockContainingAwait ? ts.createYield(ts.createToken(38), call) : call;
if (isSimpleLoop) {
statements.push(ts.createStatement(callResult));
copyOutParameters(state.loopOutParameters, 0, statements);
@@ -39968,10 +40096,10 @@ var ts;
else {
returnStatement = ts.createReturn(ts.createPropertyAccess(loopResultName, "value"));
}
- statements.push(ts.createIf(ts.createBinary(ts.createTypeOf(loopResultName), 32, ts.createLiteral("object")), returnStatement));
+ statements.push(ts.createIf(ts.createBinary(ts.createTypeOf(loopResultName), 33, ts.createLiteral("object")), returnStatement));
}
if (state.nonLocalJumps & 2) {
- statements.push(ts.createIf(ts.createBinary(loopResultName, 32, ts.createLiteral("break")), ts.createBreak()));
+ statements.push(ts.createIf(ts.createBinary(loopResultName, 33, ts.createLiteral("break")), ts.createBreak()));
}
if (state.labeledNonLocalBreaks || state.labeledNonLocalContinues) {
var caseClauses = [];
@@ -40038,21 +40166,21 @@ var ts;
for (var i = start; i < numProperties; i++) {
var property = properties[i];
switch (property.kind) {
- case 149:
case 150:
+ case 151:
var accessors = ts.getAllAccessorDeclarations(node.properties, property);
if (property === accessors.firstAccessor) {
expressions.push(transformAccessorsToExpression(receiver, accessors, node.multiLine));
}
break;
case 253:
- expressions.push(transformPropertyAssignmentToExpression(node, property, receiver, node.multiLine));
+ expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
case 254:
- expressions.push(transformShorthandPropertyAssignmentToExpression(node, property, receiver, node.multiLine));
+ expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
- case 147:
- expressions.push(transformObjectLiteralMethodDeclarationToExpression(node, property, receiver, node.multiLine));
+ case 148:
+ expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node.multiLine));
break;
default:
ts.Debug.failBadSyntaxKind(node);
@@ -40060,21 +40188,21 @@ var ts;
}
}
}
- function transformPropertyAssignmentToExpression(node, property, receiver, startsOnNewLine) {
+ function transformPropertyAssignmentToExpression(property, receiver, startsOnNewLine) {
var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression), property);
if (startsOnNewLine) {
expression.startsOnNewLine = true;
}
return expression;
}
- function transformShorthandPropertyAssignmentToExpression(node, property, receiver, startsOnNewLine) {
+ function transformShorthandPropertyAssignmentToExpression(property, receiver, startsOnNewLine) {
var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.getSynthesizedClone(property.name), property);
if (startsOnNewLine) {
expression.startsOnNewLine = true;
}
return expression;
}
- function transformObjectLiteralMethodDeclarationToExpression(node, method, receiver, startsOnNewLine) {
+ function transformObjectLiteralMethodDeclarationToExpression(method, receiver, startsOnNewLine) {
var expression = ts.createAssignment(ts.createMemberAccessForPropertyName(receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, method, undefined), method);
if (startsOnNewLine) {
expression.startsOnNewLine = true;
@@ -40104,17 +40232,17 @@ var ts;
}
function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) {
var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
- if (node.expression.kind === 95) {
+ if (node.expression.kind === 96) {
ts.setEmitFlags(thisArg, 128);
}
var resultingCall;
- if (node.transformFlags & 262144) {
+ if (node.transformFlags & 1048576) {
resultingCall = ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, false, false, false));
}
else {
resultingCall = ts.createFunctionCall(ts.visitNode(target, visitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), node);
}
- if (node.expression.kind === 95) {
+ if (node.expression.kind === 96) {
var actualThis = ts.createThis();
ts.setEmitFlags(actualThis, 128);
var initializer = ts.createLogicalOr(resultingCall, actualThis);
@@ -40125,18 +40253,18 @@ var ts;
return resultingCall;
}
function visitNewExpression(node) {
- ts.Debug.assert((node.transformFlags & 262144) !== 0);
+ ts.Debug.assert((node.transformFlags & 1048576) !== 0);
var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), false, false, false)), undefined, []);
}
function transformAndSpreadElements(elements, needsUniqueCopy, multiLine, hasTrailingComma) {
var numElements = elements.length;
- var segments = ts.flatten(ts.spanMap(elements, partitionSpreadElement, function (partition, visitPartition, start, end) {
+ var segments = ts.flatten(ts.spanMap(elements, partitionSpreadElement, function (partition, visitPartition, _start, end) {
return visitPartition(partition, multiLine, hasTrailingComma && end === numElements);
}));
if (segments.length === 1) {
var firstElement = elements[0];
- return needsUniqueCopy && ts.isSpreadElementExpression(firstElement) && firstElement.expression.kind !== 170
+ return needsUniqueCopy && ts.isSpreadElementExpression(firstElement) && firstElement.expression.kind !== 171
? ts.createArraySlice(segments[0])
: segments[0];
}
@@ -40147,7 +40275,7 @@ var ts;
? visitSpanOfSpreadElements
: visitSpanOfNonSpreadElements;
}
- function visitSpanOfSpreadElements(chunk, multiLine, hasTrailingComma) {
+ function visitSpanOfSpreadElements(chunk) {
return ts.map(chunk, visitExpressionOfSpreadElement);
}
function visitSpanOfNonSpreadElements(chunk, multiLine, hasTrailingComma) {
@@ -40188,7 +40316,7 @@ var ts;
}
function getRawLiteral(node) {
var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node);
- var isLast = node.kind === 11 || node.kind === 14;
+ var isLast = node.kind === 12 || node.kind === 15;
text = text.substring(1, text.length - (isLast ? 1 : 2));
text = text.replace(/\r\n?/g, "\n");
return ts.createLiteral(text, node);
@@ -40222,11 +40350,11 @@ var ts;
}
}
}
- function visitSuperKeyword(node) {
+ function visitSuperKeyword() {
return enclosingNonAsyncFunctionBody
&& ts.isClassElement(enclosingNonAsyncFunctionBody)
&& !ts.hasModifier(enclosingNonAsyncFunctionBody, 32)
- && currentParent.kind !== 174
+ && currentParent.kind !== 175
? ts.createPropertyAccess(ts.createIdentifier("_super"), "prototype")
: ts.createIdentifier("_super");
}
@@ -40253,20 +40381,20 @@ var ts;
function enableSubstitutionsForBlockScopedBindings() {
if ((enabledSubstitutions & 2) === 0) {
enabledSubstitutions |= 2;
- context.enableSubstitution(69);
+ context.enableSubstitution(70);
}
}
function enableSubstitutionsForCapturedThis() {
if ((enabledSubstitutions & 1) === 0) {
enabledSubstitutions |= 1;
- context.enableSubstitution(97);
- context.enableEmitNotification(148);
- context.enableEmitNotification(147);
+ context.enableSubstitution(98);
context.enableEmitNotification(149);
+ context.enableEmitNotification(148);
context.enableEmitNotification(150);
+ context.enableEmitNotification(151);
+ context.enableEmitNotification(181);
context.enableEmitNotification(180);
- context.enableEmitNotification(179);
- context.enableEmitNotification(220);
+ context.enableEmitNotification(221);
}
}
function onSubstituteNode(emitContext, node) {
@@ -40291,10 +40419,10 @@ var ts;
function isNameOfDeclarationWithCollidingName(node) {
var parent = node.parent;
switch (parent.kind) {
- case 169:
- case 221:
- case 224:
- case 218:
+ case 170:
+ case 222:
+ case 225:
+ case 219:
return parent.name === node
&& resolver.isDeclarationWithCollidingName(parent);
}
@@ -40302,9 +40430,9 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 69:
+ case 70:
return substituteExpressionIdentifier(node);
- case 97:
+ case 98:
return substituteThisKeyword(node);
}
return node;
@@ -40331,7 +40459,7 @@ var ts;
}
function getDeclarationName(node, allowComments, allowSourceMaps, emitFlags) {
if (node.name && !ts.isGeneratedIdentifier(node.name)) {
- var name_36 = ts.getMutableClone(node.name);
+ var name_33 = ts.getMutableClone(node.name);
emitFlags |= ts.getEmitFlags(node.name);
if (!allowSourceMaps) {
emitFlags |= 1536;
@@ -40340,9 +40468,9 @@ var ts;
emitFlags |= 49152;
}
if (emitFlags) {
- ts.setEmitFlags(name_36, emitFlags);
+ ts.setEmitFlags(name_33, emitFlags);
}
- return name_36;
+ return name_33;
}
return ts.getGeneratedNameForNode(node);
}
@@ -40359,29 +40487,74 @@ var ts;
return false;
}
var statement = ts.firstOrUndefined(constructor.body.statements);
- if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 202) {
+ if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 203) {
return false;
}
var statementExpression = statement.expression;
- if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 174) {
+ if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 175) {
return false;
}
var callTarget = statementExpression.expression;
- if (!ts.nodeIsSynthesized(callTarget) || callTarget.kind !== 95) {
+ if (!ts.nodeIsSynthesized(callTarget) || callTarget.kind !== 96) {
return false;
}
var callArgument = ts.singleOrUndefined(statementExpression.arguments);
- if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 191) {
+ if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 192) {
return false;
}
var expression = callArgument.expression;
return ts.isIdentifier(expression) && expression === parameter.name;
}
}
- ts.transformES6 = transformES6;
+ ts.transformES2015 = transformES2015;
})(ts || (ts = {}));
var ts;
(function (ts) {
+ var OpCode;
+ (function (OpCode) {
+ OpCode[OpCode["Nop"] = 0] = "Nop";
+ OpCode[OpCode["Statement"] = 1] = "Statement";
+ OpCode[OpCode["Assign"] = 2] = "Assign";
+ OpCode[OpCode["Break"] = 3] = "Break";
+ OpCode[OpCode["BreakWhenTrue"] = 4] = "BreakWhenTrue";
+ OpCode[OpCode["BreakWhenFalse"] = 5] = "BreakWhenFalse";
+ OpCode[OpCode["Yield"] = 6] = "Yield";
+ OpCode[OpCode["YieldStar"] = 7] = "YieldStar";
+ OpCode[OpCode["Return"] = 8] = "Return";
+ OpCode[OpCode["Throw"] = 9] = "Throw";
+ OpCode[OpCode["Endfinally"] = 10] = "Endfinally";
+ })(OpCode || (OpCode = {}));
+ var BlockAction;
+ (function (BlockAction) {
+ BlockAction[BlockAction["Open"] = 0] = "Open";
+ BlockAction[BlockAction["Close"] = 1] = "Close";
+ })(BlockAction || (BlockAction = {}));
+ var CodeBlockKind;
+ (function (CodeBlockKind) {
+ CodeBlockKind[CodeBlockKind["Exception"] = 0] = "Exception";
+ CodeBlockKind[CodeBlockKind["With"] = 1] = "With";
+ CodeBlockKind[CodeBlockKind["Switch"] = 2] = "Switch";
+ CodeBlockKind[CodeBlockKind["Loop"] = 3] = "Loop";
+ CodeBlockKind[CodeBlockKind["Labeled"] = 4] = "Labeled";
+ })(CodeBlockKind || (CodeBlockKind = {}));
+ var ExceptionBlockState;
+ (function (ExceptionBlockState) {
+ ExceptionBlockState[ExceptionBlockState["Try"] = 0] = "Try";
+ ExceptionBlockState[ExceptionBlockState["Catch"] = 1] = "Catch";
+ ExceptionBlockState[ExceptionBlockState["Finally"] = 2] = "Finally";
+ ExceptionBlockState[ExceptionBlockState["Done"] = 3] = "Done";
+ })(ExceptionBlockState || (ExceptionBlockState = {}));
+ var Instruction;
+ (function (Instruction) {
+ Instruction[Instruction["Next"] = 0] = "Next";
+ Instruction[Instruction["Throw"] = 1] = "Throw";
+ Instruction[Instruction["Return"] = 2] = "Return";
+ Instruction[Instruction["Break"] = 3] = "Break";
+ Instruction[Instruction["Yield"] = 4] = "Yield";
+ Instruction[Instruction["YieldStar"] = 5] = "YieldStar";
+ Instruction[Instruction["Catch"] = 6] = "Catch";
+ Instruction[Instruction["Endfinally"] = 7] = "Endfinally";
+ })(Instruction || (Instruction = {}));
var instructionNames = ts.createMap((_a = {},
_a[2] = "return",
_a[3] = "break",
@@ -40427,7 +40600,7 @@ var ts;
if (ts.isDeclarationFile(node)) {
return node;
}
- if (node.transformFlags & 1024) {
+ if (node.transformFlags & 4096) {
currentSourceFile = node;
node = ts.visitEachChild(node, visitor, context);
currentSourceFile = undefined;
@@ -40442,10 +40615,10 @@ var ts;
else if (inGeneratorFunctionBody) {
return visitJavaScriptInGeneratorFunctionBody(node);
}
- else if (transformFlags & 512) {
+ else if (transformFlags & 2048) {
return visitGenerator(node);
}
- else if (transformFlags & 1024) {
+ else if (transformFlags & 4096) {
return ts.visitEachChild(node, visitor, context);
}
else {
@@ -40454,13 +40627,13 @@ var ts;
}
function visitJavaScriptInStatementContainingYield(node) {
switch (node.kind) {
- case 204:
- return visitDoStatement(node);
case 205:
+ return visitDoStatement(node);
+ case 206:
return visitWhileStatement(node);
- case 213:
- return visitSwitchStatement(node);
case 214:
+ return visitSwitchStatement(node);
+ case 215:
return visitLabeledStatement(node);
default:
return visitJavaScriptInGeneratorFunctionBody(node);
@@ -40468,30 +40641,30 @@ var ts;
}
function visitJavaScriptInGeneratorFunctionBody(node) {
switch (node.kind) {
- case 220:
+ case 221:
return visitFunctionDeclaration(node);
- case 179:
+ case 180:
return visitFunctionExpression(node);
- case 149:
case 150:
+ case 151:
return visitAccessorDeclaration(node);
- case 200:
+ case 201:
return visitVariableStatement(node);
- case 206:
- return visitForStatement(node);
case 207:
+ return visitForStatement(node);
+ case 208:
return visitForInStatement(node);
- case 210:
- return visitBreakStatement(node);
- case 209:
- return visitContinueStatement(node);
case 211:
+ return visitBreakStatement(node);
+ case 210:
+ return visitContinueStatement(node);
+ case 212:
return visitReturnStatement(node);
default:
- if (node.transformFlags & 4194304) {
+ if (node.transformFlags & 16777216) {
return visitJavaScriptContainingYield(node);
}
- else if (node.transformFlags & (1024 | 8388608)) {
+ else if (node.transformFlags & (4096 | 33554432)) {
return ts.visitEachChild(node, visitor, context);
}
else {
@@ -40501,21 +40674,21 @@ var ts;
}
function visitJavaScriptContainingYield(node) {
switch (node.kind) {
- case 187:
- return visitBinaryExpression(node);
case 188:
+ return visitBinaryExpression(node);
+ case 189:
return visitConditionalExpression(node);
- case 190:
+ case 191:
return visitYieldExpression(node);
- case 170:
- return visitArrayLiteralExpression(node);
case 171:
+ return visitArrayLiteralExpression(node);
+ case 172:
return visitObjectLiteralExpression(node);
- case 173:
- return visitElementAccessExpression(node);
case 174:
- return visitCallExpression(node);
+ return visitElementAccessExpression(node);
case 175:
+ return visitCallExpression(node);
+ case 176:
return visitNewExpression(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -40523,9 +40696,9 @@ var ts;
}
function visitGenerator(node) {
switch (node.kind) {
- case 220:
+ case 221:
return visitFunctionDeclaration(node);
- case 179:
+ case 180:
return visitFunctionExpression(node);
default:
ts.Debug.failBadSyntaxKind(node);
@@ -40555,7 +40728,7 @@ var ts;
}
function visitFunctionExpression(node) {
if (node.asteriskToken && ts.getEmitFlags(node) & 2097152) {
- node = ts.setOriginalNode(ts.createFunctionExpression(undefined, node.name, undefined, node.parameters, undefined, transformGeneratorFunctionBody(node.body), node), node);
+ node = ts.setOriginalNode(ts.createFunctionExpression(undefined, undefined, node.name, undefined, node.parameters, undefined, transformGeneratorFunctionBody(node.body), node), node);
}
else {
var savedInGeneratorFunctionBody = inGeneratorFunctionBody;
@@ -40628,7 +40801,7 @@ var ts;
return ts.createBlock(statements, body, body.multiLine);
}
function visitVariableStatement(node) {
- if (node.transformFlags & 4194304) {
+ if (node.transformFlags & 16777216) {
transformAndEmitVariableDeclarationList(node.declarationList);
return undefined;
}
@@ -40658,23 +40831,23 @@ var ts;
}
}
function isCompoundAssignment(kind) {
- return kind >= 57
- && kind <= 68;
+ return kind >= 58
+ && kind <= 69;
}
function getOperatorForCompoundAssignment(kind) {
switch (kind) {
- case 57: return 35;
case 58: return 36;
case 59: return 37;
case 60: return 38;
case 61: return 39;
case 62: return 40;
- case 63: return 43;
+ case 63: return 41;
case 64: return 44;
case 65: return 45;
case 66: return 46;
case 67: return 47;
case 68: return 48;
+ case 69: return 49;
}
}
function visitRightAssociativeBinaryExpression(node) {
@@ -40682,10 +40855,10 @@ var ts;
if (containsYield(right)) {
var target = void 0;
switch (left.kind) {
- case 172:
+ case 173:
target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name);
break;
- case 173:
+ case 174:
target = ts.updateElementAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression)));
break;
default:
@@ -40694,7 +40867,7 @@ var ts;
}
var operator = node.operatorToken.kind;
if (isCompoundAssignment(operator)) {
- return ts.createBinary(target, 56, ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression), node), node);
+ return ts.createBinary(target, 57, ts.createBinary(cacheExpression(target), getOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression), node), node);
}
else {
return ts.updateBinary(node, target, ts.visitNode(right, visitor, ts.isExpression));
@@ -40707,7 +40880,7 @@ var ts;
if (ts.isLogicalOperator(node.operatorToken.kind)) {
return visitLogicalBinaryExpression(node);
}
- else if (node.operatorToken.kind === 24) {
+ else if (node.operatorToken.kind === 25) {
return visitCommaExpression(node);
}
var clone_6 = ts.getMutableClone(node);
@@ -40721,7 +40894,7 @@ var ts;
var resultLabel = defineLabel();
var resultLocal = declareLocal();
emitAssignment(resultLocal, ts.visitNode(node.left, visitor, ts.isExpression), node.left);
- if (node.operatorToken.kind === 51) {
+ if (node.operatorToken.kind === 52) {
emitBreakWhenFalse(resultLabel, resultLocal, node.left);
}
else {
@@ -40737,7 +40910,7 @@ var ts;
visit(node.right);
return ts.inlineExpressions(pendingExpressions);
function visit(node) {
- if (ts.isBinaryExpression(node) && node.operatorToken.kind === 24) {
+ if (ts.isBinaryExpression(node) && node.operatorToken.kind === 25) {
visit(node.left);
visit(node.right);
}
@@ -40780,7 +40953,7 @@ var ts;
function visitArrayLiteralExpression(node) {
return visitElements(node.elements, node.multiLine);
}
- function visitElements(elements, multiLine) {
+ function visitElements(elements, _multiLine) {
var numInitialElements = countInitialNodesWithoutYield(elements);
var temp = declareLocal();
var hasAssignedTemp = false;
@@ -40841,14 +41014,14 @@ var ts;
function visitCallExpression(node) {
if (ts.forEach(node.arguments, containsYield)) {
var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion, true), target = _a.target, thisArg = _a.thisArg;
- return ts.setOriginalNode(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isLeftHandSideExpression)), thisArg, visitElements(node.arguments, false), node), node);
+ return ts.setOriginalNode(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isLeftHandSideExpression)), thisArg, visitElements(node.arguments), node), node);
}
return ts.visitEachChild(node, visitor, context);
}
function visitNewExpression(node) {
if (ts.forEach(node.arguments, containsYield)) {
var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
- return ts.setOriginalNode(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, false)), undefined, [], node), node);
+ return ts.setOriginalNode(ts.createNew(ts.createFunctionApply(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments)), undefined, [], node), node);
}
return ts.visitEachChild(node, visitor, context);
}
@@ -40877,35 +41050,35 @@ var ts;
}
function transformAndEmitStatementWorker(node) {
switch (node.kind) {
- case 199:
+ case 200:
return transformAndEmitBlock(node);
- case 202:
- return transformAndEmitExpressionStatement(node);
case 203:
- return transformAndEmitIfStatement(node);
+ return transformAndEmitExpressionStatement(node);
case 204:
- return transformAndEmitDoStatement(node);
+ return transformAndEmitIfStatement(node);
case 205:
- return transformAndEmitWhileStatement(node);
+ return transformAndEmitDoStatement(node);
case 206:
- return transformAndEmitForStatement(node);
+ return transformAndEmitWhileStatement(node);
case 207:
+ return transformAndEmitForStatement(node);
+ case 208:
return transformAndEmitForInStatement(node);
- case 209:
- return transformAndEmitContinueStatement(node);
case 210:
- return transformAndEmitBreakStatement(node);
+ return transformAndEmitContinueStatement(node);
case 211:
- return transformAndEmitReturnStatement(node);
+ return transformAndEmitBreakStatement(node);
case 212:
- return transformAndEmitWithStatement(node);
+ return transformAndEmitReturnStatement(node);
case 213:
- return transformAndEmitSwitchStatement(node);
+ return transformAndEmitWithStatement(node);
case 214:
- return transformAndEmitLabeledStatement(node);
+ return transformAndEmitSwitchStatement(node);
case 215:
- return transformAndEmitThrowStatement(node);
+ return transformAndEmitLabeledStatement(node);
case 216:
+ return transformAndEmitThrowStatement(node);
+ case 217:
return transformAndEmitTryStatement(node);
default:
return emitStatement(ts.visitNode(node, visitor, ts.isStatement, true));
@@ -41290,7 +41463,7 @@ var ts;
}
}
function containsYield(node) {
- return node && (node.transformFlags & 4194304) !== 0;
+ return node && (node.transformFlags & 16777216) !== 0;
}
function countInitialNodesWithoutYield(nodes) {
var numNodes = nodes.length;
@@ -41320,9 +41493,9 @@ var ts;
if (ts.isIdentifier(original) && original.parent) {
var declaration = resolver.getReferencedValueDeclaration(original);
if (declaration) {
- var name_37 = ts.getProperty(renamedCatchVariableDeclarations, String(ts.getOriginalNodeId(declaration)));
- if (name_37) {
- var clone_8 = ts.getMutableClone(name_37);
+ var name_34 = ts.getProperty(renamedCatchVariableDeclarations, String(ts.getOriginalNodeId(declaration)));
+ if (name_34) {
+ var clone_8 = ts.getMutableClone(name_34);
ts.setSourceMapRange(clone_8, node);
ts.setCommentRange(clone_8, node);
return clone_8;
@@ -41431,7 +41604,7 @@ var ts;
if (!renamedCatchVariables) {
renamedCatchVariables = ts.createMap();
renamedCatchVariableDeclarations = ts.createMap();
- context.enableSubstitution(69);
+ context.enableSubstitution(70);
}
renamedCatchVariables[text] = true;
renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name;
@@ -41630,7 +41803,7 @@ var ts;
}
return expression;
}
- return ts.createNode(193);
+ return ts.createNode(194);
}
function createInstruction(instruction) {
var literal = ts.createLiteral(instruction);
@@ -41718,7 +41891,7 @@ var ts;
var buildResult = buildStatements();
return ts.createCall(ts.createHelperName(currentSourceFile.externalHelpersModuleName, "__generator"), undefined, [
ts.createThis(),
- ts.setEmitFlags(ts.createFunctionExpression(undefined, undefined, undefined, [ts.createParameter(state)], undefined, ts.createBlock(buildResult, undefined, buildResult.length > 0)), 4194304)
+ ts.setEmitFlags(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(state)], undefined, ts.createBlock(buildResult, undefined, buildResult.length > 0)), 4194304)
]);
}
function buildStatements() {
@@ -41985,6 +42158,51 @@ var ts;
var _a;
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ function transformES5(context) {
+ var previousOnSubstituteNode = context.onSubstituteNode;
+ context.onSubstituteNode = onSubstituteNode;
+ context.enableSubstitution(173);
+ context.enableSubstitution(253);
+ return transformSourceFile;
+ function transformSourceFile(node) {
+ return node;
+ }
+ function onSubstituteNode(emitContext, node) {
+ node = previousOnSubstituteNode(emitContext, node);
+ if (ts.isPropertyAccessExpression(node)) {
+ return substitutePropertyAccessExpression(node);
+ }
+ else if (ts.isPropertyAssignment(node)) {
+ return substitutePropertyAssignment(node);
+ }
+ return node;
+ }
+ function substitutePropertyAccessExpression(node) {
+ var literalName = trySubstituteReservedName(node.name);
+ if (literalName) {
+ return ts.createElementAccess(node.expression, literalName, node);
+ }
+ return node;
+ }
+ function substitutePropertyAssignment(node) {
+ var literalName = ts.isIdentifier(node.name) && trySubstituteReservedName(node.name);
+ if (literalName) {
+ return ts.updatePropertyAssignment(node, literalName, node.initializer);
+ }
+ return node;
+ }
+ function trySubstituteReservedName(name) {
+ var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(name.text) : undefined);
+ if (token >= 71 && token <= 106) {
+ return ts.createLiteral(name, name);
+ }
+ return undefined;
+ }
+ }
+ ts.transformES5 = transformES5;
+})(ts || (ts = {}));
+var ts;
(function (ts) {
function transformModule(context) {
var transformModuleDelegates = ts.createMap((_a = {},
@@ -42003,10 +42221,10 @@ var ts;
var previousOnEmitNode = context.onEmitNode;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
- context.enableSubstitution(69);
- context.enableSubstitution(187);
- context.enableSubstitution(185);
+ context.enableSubstitution(70);
+ context.enableSubstitution(188);
context.enableSubstitution(186);
+ context.enableSubstitution(187);
context.enableSubstitution(254);
context.enableEmitNotification(256);
var currentSourceFile;
@@ -42023,7 +42241,7 @@ var ts;
}
if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
currentSourceFile = node;
- (_a = ts.collectExternalModuleInfo(node, resolver), externalImports = _a.externalImports, exportSpecifiers = _a.exportSpecifiers, exportEquals = _a.exportEquals, hasExportStarsToExportValues = _a.hasExportStarsToExportValues, _a);
+ (_a = ts.collectExternalModuleInfo(node), externalImports = _a.externalImports, exportSpecifiers = _a.exportSpecifiers, exportEquals = _a.exportEquals, hasExportStarsToExportValues = _a.hasExportStarsToExportValues, _a);
var transformModule_1 = transformModuleDelegates[moduleKind] || transformModuleDelegates[ts.ModuleKind.None];
var updated = transformModule_1(node);
ts.aggregateTransformFlags(updated);
@@ -42068,7 +42286,7 @@ var ts;
ts.createLiteral("require"),
ts.createLiteral("exports")
].concat(aliasedModuleNames, unaliasedModuleNames)),
- ts.createFunctionExpression(undefined, undefined, undefined, [
+ ts.createFunctionExpression(undefined, undefined, undefined, undefined, [
ts.createParameter("require"),
ts.createParameter("exports")
].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node))
@@ -42089,7 +42307,7 @@ var ts;
return body;
}
function addExportEqualsIfNeeded(statements, emitAsReturn) {
- if (exportEquals && resolver.isValueAliasDeclaration(exportEquals)) {
+ if (exportEquals) {
if (emitAsReturn) {
var statement = ts.createReturn(exportEquals.expression, exportEquals);
ts.setEmitFlags(statement, 12288 | 49152);
@@ -42104,21 +42322,21 @@ var ts;
}
function visitor(node) {
switch (node.kind) {
- case 230:
+ case 231:
return visitImportDeclaration(node);
- case 229:
+ case 230:
return visitImportEqualsDeclaration(node);
- case 236:
+ case 237:
return visitExportDeclaration(node);
- case 235:
+ case 236:
return visitExportAssignment(node);
- case 200:
+ case 201:
return visitVariableStatement(node);
- case 220:
- return visitFunctionDeclaration(node);
case 221:
+ return visitFunctionDeclaration(node);
+ case 222:
return visitClassDeclaration(node);
- case 202:
+ case 203:
return visitExpressionStatement(node);
default:
return node;
@@ -42194,14 +42412,12 @@ var ts;
}
for (var _i = 0, _a = node.exportClause.elements; _i < _a.length; _i++) {
var specifier = _a[_i];
- if (resolver.isValueAliasDeclaration(specifier)) {
- var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name);
- statements.push(ts.createStatement(createExportAssignment(specifier.name, exportedValue), specifier));
- }
+ var exportedValue = ts.createPropertyAccess(generatedName, specifier.propertyName || specifier.name);
+ statements.push(ts.createStatement(createExportAssignment(specifier.name, exportedValue), specifier));
}
return ts.singleOrMany(statements);
}
- else if (resolver.moduleExportsSomeValue(node.moduleSpecifier)) {
+ else {
return ts.createStatement(ts.createCall(ts.createIdentifier("__export"), undefined, [
moduleKind !== ts.ModuleKind.AMD
? createRequireCall(node)
@@ -42210,14 +42426,12 @@ var ts;
}
}
function visitExportAssignment(node) {
- if (!node.isExportEquals) {
- if (ts.nodeIsSynthesized(node) || resolver.isValueAliasDeclaration(node)) {
- var statements = [];
- addExportDefault(statements, node.expression, node);
- return statements;
- }
+ if (node.isExportEquals) {
+ return undefined;
}
- return undefined;
+ var statements = [];
+ addExportDefault(statements, node.expression, node);
+ return statements;
}
function addExportDefault(statements, expression, location) {
tryAddExportDefaultCompat(statements);
@@ -42248,16 +42462,16 @@ var ts;
else {
var names = ts.reduceEachChild(node, collectExportMembers, []);
for (var _i = 0, names_1 = names; _i < names_1.length; _i++) {
- var name_38 = names_1[_i];
- addExportMemberAssignments(statements, name_38);
+ var name_35 = names_1[_i];
+ addExportMemberAssignments(statements, name_35);
}
}
}
function collectExportMembers(names, node) {
- if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node) && ts.isDeclaration(node)) {
- var name_39 = node.name;
- if (ts.isIdentifier(name_39)) {
- names.push(name_39);
+ if (ts.isAliasSymbolDeclaration(node) && ts.isDeclaration(node)) {
+ var name_36 = node.name;
+ if (ts.isIdentifier(name_36)) {
+ names.push(name_36);
}
}
return ts.reduceEachChild(node, collectExportMembers, names);
@@ -42280,9 +42494,9 @@ var ts;
}
function visitVariableStatement(node) {
var originalKind = ts.getOriginalNode(node).kind;
- if (originalKind === 225 ||
- originalKind === 224 ||
- originalKind === 221) {
+ if (originalKind === 226 ||
+ originalKind === 225 ||
+ originalKind === 222) {
if (!ts.hasModifier(node, 1)) {
return node;
}
@@ -42328,7 +42542,7 @@ var ts;
function transformInitializedVariable(node) {
var name = node.name;
if (ts.isBindingPattern(name)) {
- return ts.flattenVariableDestructuringToExpression(context, node, hoistVariableDeclaration, getModuleMemberName, visitor);
+ return ts.flattenVariableDestructuringToExpression(node, hoistVariableDeclaration, getModuleMemberName, visitor);
}
else {
return ts.createAssignment(getModuleMemberName(name), ts.visitNode(node.initializer, visitor, ts.isExpression));
@@ -42338,7 +42552,8 @@ var ts;
var statements = [];
var name = node.name || ts.getGeneratedNameForNode(node);
if (ts.hasModifier(node, 1)) {
- statements.push(ts.setOriginalNode(ts.createFunctionDeclaration(undefined, undefined, node.asteriskToken, name, undefined, node.parameters, undefined, node.body, node), node));
+ var isAsync = ts.hasModifier(node, 256);
+ statements.push(ts.setOriginalNode(ts.createFunctionDeclaration(undefined, isAsync ? [ts.createNode(119)] : undefined, node.asteriskToken, name, undefined, node.parameters, undefined, node.body, node), node));
addExportMemberAssignment(statements, node);
}
else {
@@ -42367,10 +42582,10 @@ var ts;
function visitExpressionStatement(node) {
var original = ts.getOriginalNode(node);
var origKind = original.kind;
- if (origKind === 224 || origKind === 225) {
+ if (origKind === 225 || origKind === 226) {
return visitExpressionStatementForEnumOrNamespaceDeclaration(node, original);
}
- else if (origKind === 221) {
+ else if (origKind === 222) {
var classDecl = original;
if (classDecl.name) {
var statements = [node];
@@ -42383,8 +42598,8 @@ var ts;
function visitExpressionStatementForEnumOrNamespaceDeclaration(node, original) {
var statements = [node];
if (ts.hasModifier(original, 1) &&
- original.kind === 224 &&
- ts.isFirstDeclarationOfKind(original, 224)) {
+ original.kind === 225 &&
+ ts.isFirstDeclarationOfKind(original, 225)) {
addVarForExportedEnumOrNamespaceDeclaration(statements, original);
}
addExportMemberAssignments(statements, original.name);
@@ -42432,12 +42647,12 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 69:
+ case 70:
return substituteExpressionIdentifier(node);
- case 187:
+ case 188:
return substituteBinaryExpression(node);
+ case 187:
case 186:
- case 185:
return substituteUnaryExpression(node);
}
return node;
@@ -42471,8 +42686,8 @@ var ts;
if (bindingNameExportSpecifiersMap && ts.hasProperty(bindingNameExportSpecifiersMap, operand.text)) {
ts.setEmitFlags(node, 128);
var transformedUnaryExpression = void 0;
- if (node.kind === 186) {
- transformedUnaryExpression = ts.createBinary(operand, ts.createToken(operator === 41 ? 57 : 58), ts.createLiteral(1), node);
+ if (node.kind === 187) {
+ transformedUnaryExpression = ts.createBinary(operand, ts.createToken(operator === 42 ? 58 : 59), ts.createLiteral(1), node);
ts.setEmitFlags(transformedUnaryExpression, 128);
}
var nestedExportAssignment = void 0;
@@ -42504,21 +42719,11 @@ var ts;
var declaration = resolver.getReferencedImportDeclaration(node);
if (declaration) {
if (ts.isImportClause(declaration)) {
- if (languageVersion >= 1) {
- return ts.createPropertyAccess(ts.getGeneratedNameForNode(declaration.parent), ts.createIdentifier("default"), node);
- }
- else {
- return ts.createElementAccess(ts.getGeneratedNameForNode(declaration.parent), ts.createLiteral("default"), node);
- }
+ return ts.createPropertyAccess(ts.getGeneratedNameForNode(declaration.parent), ts.createIdentifier("default"), node);
}
else if (ts.isImportSpecifier(declaration)) {
- var name_40 = declaration.propertyName || declaration.name;
- if (name_40.originalKeywordKind === 77 && languageVersion <= 0) {
- return ts.createElementAccess(ts.getGeneratedNameForNode(declaration.parent.parent.parent), ts.createLiteral(name_40.text), node);
- }
- else {
- return ts.createPropertyAccess(ts.getGeneratedNameForNode(declaration.parent.parent.parent), ts.getSynthesizedClone(name_40), node);
- }
+ var name_37 = declaration.propertyName || declaration.name;
+ return ts.createPropertyAccess(ts.getGeneratedNameForNode(declaration.parent.parent.parent), ts.getSynthesizedClone(name_37), node);
}
}
}
@@ -42544,9 +42749,7 @@ var ts;
return statement;
}
function createExportAssignment(name, value) {
- return ts.createAssignment(name.originalKeywordKind === 77 && languageVersion === 0
- ? ts.createElementAccess(ts.createIdentifier("exports"), ts.createLiteral(name.text))
- : ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value);
+ return ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(name)), value);
}
function collectAsynchronousDependencies(node, includeNonAmdDependencies) {
var aliasedModuleNames = [];
@@ -42593,15 +42796,14 @@ var ts;
var compilerOptions = context.getCompilerOptions();
var resolver = context.getEmitResolver();
var host = context.getEmitHost();
- var languageVersion = ts.getEmitScriptTarget(compilerOptions);
var previousOnSubstituteNode = context.onSubstituteNode;
var previousOnEmitNode = context.onEmitNode;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
- context.enableSubstitution(69);
- context.enableSubstitution(187);
- context.enableSubstitution(185);
+ context.enableSubstitution(70);
+ context.enableSubstitution(188);
context.enableSubstitution(186);
+ context.enableSubstitution(187);
context.enableEmitNotification(256);
var exportFunctionForFileMap = [];
var currentSourceFile;
@@ -42641,7 +42843,7 @@ var ts;
}
function transformSystemModuleWorker(node) {
ts.Debug.assert(!exportFunctionForFile);
- (_a = ts.collectExternalModuleInfo(node, resolver), externalImports = _a.externalImports, exportSpecifiers = _a.exportSpecifiers, exportEquals = _a.exportEquals, hasExportStarsToExportValues = _a.hasExportStarsToExportValues, _a);
+ (_a = ts.collectExternalModuleInfo(node), externalImports = _a.externalImports, exportSpecifiers = _a.exportSpecifiers, exportEquals = _a.exportEquals, hasExportStarsToExportValues = _a.hasExportStarsToExportValues, _a);
exportFunctionForFile = ts.createUniqueName("exports");
contextObjectForFile = ts.createUniqueName("context");
exportFunctionForFileMap[ts.getOriginalNodeId(node)] = exportFunctionForFile;
@@ -42650,7 +42852,7 @@ var ts;
addSystemModuleBody(statements, node, dependencyGroups);
var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions);
var dependencies = ts.createArrayLiteral(ts.map(dependencyGroups, getNameOfDependencyGroup));
- var body = ts.createFunctionExpression(undefined, undefined, undefined, [
+ var body = ts.createFunctionExpression(undefined, undefined, undefined, undefined, [
ts.createParameter(exportFunctionForFile),
ts.createParameter(contextObjectForFile)
], undefined, ts.setEmitFlags(ts.createBlock(statements, undefined, true), 1));
@@ -42673,7 +42875,7 @@ var ts;
var exportStarFunction = addExportStarIfNeeded(statements);
statements.push(ts.createReturn(ts.setMultiLine(ts.createObjectLiteral([
ts.createPropertyAssignment("setters", generateSetters(exportStarFunction, dependencyGroups)),
- ts.createPropertyAssignment("execute", ts.createFunctionExpression(undefined, undefined, undefined, [], undefined, ts.createBlock(executeStatements, undefined, true)))
+ ts.createPropertyAssignment("execute", ts.createFunctionExpression(undefined, undefined, undefined, undefined, [], undefined, ts.createBlock(executeStatements, undefined, true)))
]), true)));
}
function addExportStarIfNeeded(statements) {
@@ -42684,7 +42886,7 @@ var ts;
var hasExportDeclarationWithExportClause = false;
for (var _i = 0, externalImports_2 = externalImports; _i < externalImports_2.length; _i++) {
var externalImport = externalImports_2[_i];
- if (externalImport.kind === 236 && externalImport.exportClause) {
+ if (externalImport.kind === 237 && externalImport.exportClause) {
hasExportDeclarationWithExportClause = true;
break;
}
@@ -42702,7 +42904,7 @@ var ts;
}
for (var _b = 0, externalImports_3 = externalImports; _b < externalImports_3.length; _b++) {
var externalImport = externalImports_3[_b];
- if (externalImport.kind !== 236) {
+ if (externalImport.kind !== 237) {
continue;
}
var exportDecl = externalImport;
@@ -42731,15 +42933,15 @@ var ts;
var entry = _b[_a];
var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile);
switch (entry.kind) {
- case 230:
+ case 231:
if (!entry.importClause) {
break;
}
- case 229:
+ case 230:
ts.Debug.assert(importVariableName !== undefined);
statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName)));
break;
- case 236:
+ case 237:
ts.Debug.assert(importVariableName !== undefined);
if (entry.exportClause) {
var properties = [];
@@ -42755,19 +42957,19 @@ var ts;
break;
}
}
- setters.push(ts.createFunctionExpression(undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, ts.createBlock(statements, undefined, true)));
+ setters.push(ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ts.createParameter(parameterName)], undefined, ts.createBlock(statements, undefined, true)));
}
return ts.createArrayLiteral(setters, undefined, true);
}
function visitSourceElement(node) {
switch (node.kind) {
- case 230:
+ case 231:
return visitImportDeclaration(node);
- case 229:
+ case 230:
return visitImportEqualsDeclaration(node);
- case 236:
+ case 237:
return visitExportDeclaration(node);
- case 235:
+ case 236:
return visitExportAssignment(node);
default:
return visitNestedNode(node);
@@ -42791,41 +42993,41 @@ var ts;
}
function visitNestedNodeWorker(node) {
switch (node.kind) {
- case 200:
+ case 201:
return visitVariableStatement(node);
- case 220:
- return visitFunctionDeclaration(node);
case 221:
+ return visitFunctionDeclaration(node);
+ case 222:
return visitClassDeclaration(node);
- case 206:
- return visitForStatement(node);
case 207:
- return visitForInStatement(node);
+ return visitForStatement(node);
case 208:
+ return visitForInStatement(node);
+ case 209:
return visitForOfStatement(node);
- case 204:
- return visitDoStatement(node);
case 205:
+ return visitDoStatement(node);
+ case 206:
return visitWhileStatement(node);
- case 214:
+ case 215:
return visitLabeledStatement(node);
- case 212:
- return visitWithStatement(node);
case 213:
+ return visitWithStatement(node);
+ case 214:
return visitSwitchStatement(node);
- case 227:
+ case 228:
return visitCaseBlock(node);
case 249:
return visitCaseClause(node);
case 250:
return visitDefaultClause(node);
- case 216:
+ case 217:
return visitTryStatement(node);
case 252:
return visitCatchClause(node);
- case 199:
+ case 200:
return visitBlock(node);
- case 202:
+ case 203:
return visitExpressionStatement(node);
default:
return node;
@@ -42852,20 +43054,14 @@ var ts;
return undefined;
}
function visitExportSpecifier(specifier) {
- if (resolver.getReferencedValueDeclaration(specifier.propertyName || specifier.name)
- || resolver.isValueAliasDeclaration(specifier)) {
- recordExportName(specifier.name);
- return createExportStatement(specifier.name, specifier.propertyName || specifier.name);
- }
- return undefined;
+ recordExportName(specifier.name);
+ return createExportStatement(specifier.name, specifier.propertyName || specifier.name);
}
function visitExportAssignment(node) {
- if (!node.isExportEquals) {
- if (ts.nodeIsSynthesized(node) || resolver.isValueAliasDeclaration(node)) {
- return createExportStatement(ts.createLiteral("default"), node.expression);
- }
+ if (node.isExportEquals) {
+ return undefined;
}
- return undefined;
+ return createExportStatement(ts.createLiteral("default"), node.expression);
}
function visitVariableStatement(node) {
var shouldHoist = ((ts.getCombinedNodeFlags(ts.getOriginalNode(node.declarationList)) & 3) == 0) ||
@@ -42897,16 +43093,17 @@ var ts;
return ts.createAssignment(name, node.initializer);
}
else {
- return ts.flattenVariableDestructuringToExpression(context, node, hoistVariableDeclaration);
+ return ts.flattenVariableDestructuringToExpression(node, hoistVariableDeclaration);
}
}
function visitFunctionDeclaration(node) {
if (ts.hasModifier(node, 1)) {
- var name_41 = node.name || ts.getGeneratedNameForNode(node);
- var newNode = ts.createFunctionDeclaration(undefined, undefined, node.asteriskToken, name_41, undefined, node.parameters, undefined, node.body, node);
+ var name_38 = node.name || ts.getGeneratedNameForNode(node);
+ var isAsync = ts.hasModifier(node, 256);
+ var newNode = ts.createFunctionDeclaration(undefined, isAsync ? [ts.createNode(119)] : undefined, node.asteriskToken, name_38, undefined, node.parameters, undefined, node.body, node);
recordExportedFunctionDeclaration(node);
if (!ts.hasModifier(node, 512)) {
- recordExportName(name_41);
+ recordExportName(name_38);
}
ts.setOriginalNode(newNode, node);
node = newNode;
@@ -42916,14 +43113,14 @@ var ts;
}
function visitExpressionStatement(node) {
var originalNode = ts.getOriginalNode(node);
- if ((originalNode.kind === 225 || originalNode.kind === 224) && ts.hasModifier(originalNode, 1)) {
- var name_42 = getDeclarationName(originalNode);
- if (originalNode.kind === 224) {
- hoistVariableDeclaration(name_42);
+ if ((originalNode.kind === 226 || originalNode.kind === 225) && ts.hasModifier(originalNode, 1)) {
+ var name_39 = getDeclarationName(originalNode);
+ if (originalNode.kind === 225) {
+ hoistVariableDeclaration(name_39);
}
return [
node,
- createExportStatement(name_42, name_42)
+ createExportStatement(name_39, name_39)
];
}
return node;
@@ -42958,7 +43155,7 @@ var ts;
;
return ts.createFor(expressions.length
? ts.inlineExpressions(expressions)
- : ts.createSynthesizedNode(193), node.condition, node.incrementor, ts.visitNode(node.statement, visitNestedNode, ts.isStatement), node);
+ : ts.createSynthesizedNode(194), node.condition, node.incrementor, ts.visitNode(node.statement, visitNestedNode, ts.isStatement), node);
}
else {
return ts.visitEachChild(node, visitNestedNode, context);
@@ -42970,7 +43167,7 @@ var ts;
var name = firstDeclaration.name;
return ts.isIdentifier(name)
? name
- : ts.flattenVariableDestructuringToExpression(context, firstDeclaration, hoistVariableDeclaration);
+ : ts.flattenVariableDestructuringToExpression(firstDeclaration, hoistVariableDeclaration);
}
function visitForInStatement(node) {
var initializer = node.initializer;
@@ -43096,12 +43293,12 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 69:
+ case 70:
return substituteExpressionIdentifier(node);
- case 187:
+ case 188:
return substituteBinaryExpression(node);
- case 185:
case 186:
+ case 187:
return substituteUnaryExpression(node);
}
return node;
@@ -43126,14 +43323,14 @@ var ts;
ts.setEmitFlags(node, 128);
var left = node.left;
switch (left.kind) {
- case 69:
+ case 70:
var exportDeclaration = resolver.getReferencedExportContainer(left);
if (exportDeclaration) {
return createExportExpression(left, node);
}
break;
+ case 172:
case 171:
- case 170:
if (hasExportedReferenceInDestructuringPattern(left)) {
return substituteDestructuring(node);
}
@@ -43147,9 +43344,9 @@ var ts;
}
function hasExportedReferenceInDestructuringPattern(node) {
switch (node.kind) {
- case 69:
+ case 70:
return isExportedBinding(node);
- case 171:
+ case 172:
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var property = _a[_i];
if (hasExportedReferenceInObjectDestructuringElement(property)) {
@@ -43157,7 +43354,7 @@ var ts;
}
}
break;
- case 170:
+ case 171:
for (var _b = 0, _c = node.elements; _b < _c.length; _b++) {
var element = _c[_b];
if (hasExportedReferenceInArrayDestructuringElement(element)) {
@@ -43191,7 +43388,7 @@ var ts;
function hasExportedReferenceInDestructuringElement(node) {
if (ts.isBinaryExpression(node)) {
var left = node.left;
- return node.operatorToken.kind === 56
+ return node.operatorToken.kind === 57
&& isDestructuringPattern(left)
&& hasExportedReferenceInDestructuringPattern(left);
}
@@ -43211,9 +43408,9 @@ var ts;
}
function isDestructuringPattern(node) {
var kind = node.kind;
- return kind === 69
- || kind === 171
- || kind === 170;
+ return kind === 70
+ || kind === 172
+ || kind === 171;
}
function substituteDestructuring(node) {
return ts.flattenDestructuringAssignment(context, node, true, hoistVariableDeclaration);
@@ -43222,19 +43419,19 @@ var ts;
var operand = node.operand;
var operator = node.operator;
var substitute = ts.isIdentifier(operand) &&
- (node.kind === 186 ||
- (node.kind === 185 && (operator === 41 || operator === 42)));
+ (node.kind === 187 ||
+ (node.kind === 186 && (operator === 42 || operator === 43)));
if (substitute) {
var exportDeclaration = resolver.getReferencedExportContainer(operand);
if (exportDeclaration) {
var expr = ts.createPrefix(node.operator, operand, node);
ts.setEmitFlags(expr, 128);
var call = createExportExpression(operand, expr);
- if (node.kind === 185) {
+ if (node.kind === 186) {
return call;
}
else {
- return operator === 41
+ return operator === 42
? ts.createSubtract(call, ts.createLiteral(1))
: ts.createAdd(call, ts.createLiteral(1));
}
@@ -43293,12 +43490,7 @@ var ts;
else {
return undefined;
}
- if (name.originalKeywordKind && languageVersion === 0) {
- return ts.createElementAccess(importAlias, ts.createLiteral(name.text));
- }
- else {
- return ts.createPropertyAccess(importAlias, ts.getSynthesizedClone(name));
- }
+ return ts.createPropertyAccess(importAlias, ts.getSynthesizedClone(name));
}
function collectDependencyGroups(externalImports) {
var groupIndices = ts.createMap();
@@ -43369,17 +43561,14 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
- function transformES6Module(context) {
+ function transformES2015Module(context) {
var compilerOptions = context.getCompilerOptions();
- var resolver = context.getEmitResolver();
- var currentSourceFile;
return transformSourceFile;
function transformSourceFile(node) {
if (ts.isDeclarationFile(node)) {
return node;
}
if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
- currentSourceFile = node;
return ts.visitEachChild(node, visitor, context);
}
return node;
@@ -43387,115 +43576,33 @@ var ts;
function visitor(node) {
switch (node.kind) {
case 230:
- return visitImportDeclaration(node);
- case 229:
- return visitImportEqualsDeclaration(node);
- case 231:
- return visitImportClause(node);
- case 233:
- case 232:
- return visitNamedBindings(node);
- case 234:
- return visitImportSpecifier(node);
- case 235:
- return visitExportAssignment(node);
+ return undefined;
case 236:
- return visitExportDeclaration(node);
- case 237:
- return visitNamedExports(node);
- case 238:
- return visitExportSpecifier(node);
+ return visitExportAssignment(node);
}
return node;
}
function visitExportAssignment(node) {
- if (node.isExportEquals) {
- return undefined;
- }
- var original = ts.getOriginalNode(node);
- return ts.nodeIsSynthesized(original) || resolver.isValueAliasDeclaration(original) ? node : undefined;
- }
- function visitExportDeclaration(node) {
- if (!node.exportClause) {
- return resolver.moduleExportsSomeValue(node.moduleSpecifier) ? node : undefined;
- }
- if (!resolver.isValueAliasDeclaration(node)) {
- return undefined;
- }
- var newExportClause = ts.visitNode(node.exportClause, visitor, ts.isNamedExports, true);
- if (node.exportClause === newExportClause) {
- return node;
- }
- return newExportClause
- ? ts.createExportDeclaration(undefined, undefined, newExportClause, node.moduleSpecifier)
- : undefined;
- }
- function visitNamedExports(node) {
- var newExports = ts.visitNodes(node.elements, visitor, ts.isExportSpecifier);
- if (node.elements === newExports) {
- return node;
- }
- return newExports.length ? ts.createNamedExports(newExports) : undefined;
- }
- function visitExportSpecifier(node) {
- return resolver.isValueAliasDeclaration(node) ? node : undefined;
- }
- function visitImportEqualsDeclaration(node) {
- return !ts.isExternalModuleImportEqualsDeclaration(node) || resolver.isReferencedAliasDeclaration(node) ? node : undefined;
- }
- function visitImportDeclaration(node) {
- if (node.importClause) {
- var newImportClause = ts.visitNode(node.importClause, visitor, ts.isImportClause);
- if (!newImportClause.name && !newImportClause.namedBindings) {
- return undefined;
- }
- else if (newImportClause !== node.importClause) {
- return ts.createImportDeclaration(undefined, undefined, newImportClause, node.moduleSpecifier);
- }
- }
- return node;
- }
- function visitImportClause(node) {
- var newDefaultImport = node.name;
- if (!resolver.isReferencedAliasDeclaration(node)) {
- newDefaultImport = undefined;
- }
- var newNamedBindings = ts.visitNode(node.namedBindings, visitor, ts.isNamedImportBindings, true);
- return newDefaultImport !== node.name || newNamedBindings !== node.namedBindings
- ? ts.createImportClause(newDefaultImport, newNamedBindings)
- : node;
- }
- function visitNamedBindings(node) {
- if (node.kind === 232) {
- return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
- }
- else {
- var newNamedImportElements = ts.visitNodes(node.elements, visitor, ts.isImportSpecifier);
- if (!newNamedImportElements || newNamedImportElements.length == 0) {
- return undefined;
- }
- if (newNamedImportElements === node.elements) {
- return node;
- }
- return ts.createNamedImports(newNamedImportElements);
- }
- }
- function visitImportSpecifier(node) {
- return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
+ return node.isExportEquals ? undefined : node;
}
}
- ts.transformES6Module = transformES6Module;
+ ts.transformES2015Module = transformES2015Module;
})(ts || (ts = {}));
var ts;
(function (ts) {
var moduleTransformerMap = ts.createMap((_a = {},
- _a[ts.ModuleKind.ES6] = ts.transformES6Module,
+ _a[ts.ModuleKind.ES2015] = ts.transformES2015Module,
_a[ts.ModuleKind.System] = ts.transformSystemModule,
_a[ts.ModuleKind.AMD] = ts.transformModule,
_a[ts.ModuleKind.CommonJS] = ts.transformModule,
_a[ts.ModuleKind.UMD] = ts.transformModule,
_a[ts.ModuleKind.None] = ts.transformModule,
_a));
+ var SyntaxKindFeatureFlags;
+ (function (SyntaxKindFeatureFlags) {
+ SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["Substitution"] = 1] = "Substitution";
+ SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["EmitNotifications"] = 2] = "EmitNotifications";
+ })(SyntaxKindFeatureFlags || (SyntaxKindFeatureFlags = {}));
function getTransformers(compilerOptions) {
var jsx = compilerOptions.jsx;
var languageVersion = ts.getEmitScriptTarget(compilerOptions);
@@ -43506,11 +43613,19 @@ var ts;
if (jsx === 2) {
transformers.push(ts.transformJsx);
}
- transformers.push(ts.transformES7);
+ if (languageVersion < 4) {
+ transformers.push(ts.transformES2017);
+ }
+ if (languageVersion < 3) {
+ transformers.push(ts.transformES2016);
+ }
if (languageVersion < 2) {
- transformers.push(ts.transformES6);
+ transformers.push(ts.transformES2015);
transformers.push(ts.transformGenerators);
}
+ if (languageVersion < 1) {
+ transformers.push(ts.transformES5);
+ }
return transformers;
}
ts.getTransformers = getTransformers;
@@ -43530,7 +43645,7 @@ var ts;
hoistFunctionDeclaration: hoistFunctionDeclaration,
startLexicalEnvironment: startLexicalEnvironment,
endLexicalEnvironment: endLexicalEnvironment,
- onSubstituteNode: function (emitContext, node) { return node; },
+ onSubstituteNode: function (_emitContext, node) { return node; },
enableSubstitution: enableSubstitution,
isSubstitutionEnabled: isSubstitutionEnabled,
onEmitNode: function (node, emitContext, emitCallback) { return emitCallback(node, emitContext); },
@@ -43670,7 +43785,7 @@ var ts;
var isCurrentFileExternalModule;
var reportedDeclarationError = false;
var errorNameNode;
- var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments;
+ var emitJsDocComments = compilerOptions.removeComments ? function () { } : writeJsDocComments;
var emit = compilerOptions.stripInternal ? stripInternal : emitNode;
var noDeclare;
var moduleElementDeclarationEmitInfo = [];
@@ -43714,7 +43829,7 @@ var ts;
var oldWriter = writer;
ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) {
if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) {
- ts.Debug.assert(aliasEmitInfo.node.kind === 230);
+ ts.Debug.assert(aliasEmitInfo.node.kind === 231);
createAndSetNewTextWriterWithSymbolWriter();
ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit));
for (var i = 0; i < aliasEmitInfo.indent; i++) {
@@ -43745,7 +43860,7 @@ var ts;
reportedDeclarationError: reportedDeclarationError,
moduleElementDeclarationEmitInfo: allSourcesModuleElementDeclarationEmitInfo,
synchronousDeclarationOutput: writer.getText(),
- referencesOutput: referencesOutput
+ referencesOutput: referencesOutput,
};
function hasInternalAnnotation(range) {
var comment = currentText.substring(range.pos, range.end);
@@ -43785,10 +43900,10 @@ var ts;
var oldWriter = writer;
ts.forEach(nodes, function (declaration) {
var nodeToCheck;
- if (declaration.kind === 218) {
+ if (declaration.kind === 219) {
nodeToCheck = declaration.parent.parent;
}
- else if (declaration.kind === 233 || declaration.kind === 234 || declaration.kind === 231) {
+ else if (declaration.kind === 234 || declaration.kind === 235 || declaration.kind === 232) {
ts.Debug.fail("We should be getting ImportDeclaration instead to write");
}
else {
@@ -43799,7 +43914,7 @@ var ts;
moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; });
}
if (moduleElementEmitInfo) {
- if (moduleElementEmitInfo.node.kind === 230) {
+ if (moduleElementEmitInfo.node.kind === 231) {
moduleElementEmitInfo.isVisible = true;
}
else {
@@ -43807,12 +43922,12 @@ var ts;
for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) {
increaseIndent();
}
- if (nodeToCheck.kind === 225) {
+ if (nodeToCheck.kind === 226) {
ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined);
asynchronousSubModuleDeclarationEmitInfo = [];
}
writeModuleElement(nodeToCheck);
- if (nodeToCheck.kind === 225) {
+ if (nodeToCheck.kind === 226) {
moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo;
asynchronousSubModuleDeclarationEmitInfo = undefined;
}
@@ -43924,67 +44039,67 @@ var ts;
}
function emitType(type) {
switch (type.kind) {
- case 117:
- case 132:
- case 130:
- case 120:
+ case 118:
case 133:
- case 103:
- case 135:
- case 93:
- case 127:
- case 165:
+ case 131:
+ case 121:
+ case 134:
+ case 104:
+ case 136:
+ case 94:
+ case 128:
case 166:
+ case 167:
return writeTextOfNode(currentText, type);
- case 194:
+ case 195:
return emitExpressionWithTypeArguments(type);
- case 155:
- return emitTypeReference(type);
- case 158:
- return emitTypeQuery(type);
- case 160:
- return emitArrayType(type);
- case 161:
- return emitTupleType(type);
- case 162:
- return emitUnionType(type);
- case 163:
- return emitIntersectionType(type);
- case 164:
- return emitParenType(type);
case 156:
- case 157:
- return emitSignatureDeclarationWithJsDocComments(type);
+ return emitTypeReference(type);
case 159:
+ return emitTypeQuery(type);
+ case 161:
+ return emitArrayType(type);
+ case 162:
+ return emitTupleType(type);
+ case 163:
+ return emitUnionType(type);
+ case 164:
+ return emitIntersectionType(type);
+ case 165:
+ return emitParenType(type);
+ case 157:
+ case 158:
+ return emitSignatureDeclarationWithJsDocComments(type);
+ case 160:
return emitTypeLiteral(type);
- case 69:
+ case 70:
return emitEntityName(type);
- case 139:
+ case 140:
return emitEntityName(type);
- case 154:
+ case 155:
return emitTypePredicate(type);
}
function writeEntityName(entityName) {
- if (entityName.kind === 69) {
+ if (entityName.kind === 70) {
writeTextOfNode(currentText, entityName);
}
else {
- var left = entityName.kind === 139 ? entityName.left : entityName.expression;
- var right = entityName.kind === 139 ? entityName.right : entityName.name;
+ var left = entityName.kind === 140 ? entityName.left : entityName.expression;
+ var right = entityName.kind === 140 ? entityName.right : entityName.name;
writeEntityName(left);
write(".");
writeTextOfNode(currentText, right);
}
}
function emitEntityName(entityName) {
- var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 229 ? entityName.parent : enclosingDeclaration);
+ var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 230 ? entityName.parent : enclosingDeclaration);
handleSymbolAccessibilityError(visibilityResult);
recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName));
writeEntityName(entityName);
}
function emitExpressionWithTypeArguments(node) {
if (ts.isEntityNameExpression(node.expression)) {
- ts.Debug.assert(node.expression.kind === 69 || node.expression.kind === 172);
+ ts.Debug.assert(node.expression.kind === 70 || node.expression.kind === 173);
emitEntityName(node.expression);
if (node.typeArguments) {
write("<");
@@ -44058,14 +44173,14 @@ var ts;
var count = 0;
while (true) {
count++;
- var name_43 = baseName + "_" + count;
- if (!(name_43 in currentIdentifiers)) {
- return name_43;
+ var name_40 = baseName + "_" + count;
+ if (!(name_40 in currentIdentifiers)) {
+ return name_40;
}
}
}
function emitExportAssignment(node) {
- if (node.expression.kind === 69) {
+ if (node.expression.kind === 70) {
write(node.isExportEquals ? "export = " : "export default ");
writeTextOfNode(currentText, node.expression);
}
@@ -44086,11 +44201,11 @@ var ts;
}
write(";");
writeLine();
- if (node.expression.kind === 69) {
+ if (node.expression.kind === 70) {
var nodes = resolver.collectLinkedAliases(node.expression);
writeAsynchronousModuleElements(nodes);
}
- function getDefaultExportAccessibilityDiagnostic(diagnostic) {
+ function getDefaultExportAccessibilityDiagnostic() {
return {
diagnosticMessage: ts.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0,
errorNode: node
@@ -44104,7 +44219,7 @@ var ts;
if (isModuleElementVisible) {
writeModuleElement(node);
}
- else if (node.kind === 229 ||
+ else if (node.kind === 230 ||
(node.parent.kind === 256 && isCurrentFileExternalModule)) {
var isVisible = void 0;
if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 256) {
@@ -44116,7 +44231,7 @@ var ts;
});
}
else {
- if (node.kind === 230) {
+ if (node.kind === 231) {
var importDeclaration = node;
if (importDeclaration.importClause) {
isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) ||
@@ -44134,23 +44249,23 @@ var ts;
}
function writeModuleElement(node) {
switch (node.kind) {
- case 220:
- return writeFunctionDeclaration(node);
- case 200:
- return writeVariableStatement(node);
- case 222:
- return writeInterfaceDeclaration(node);
case 221:
- return writeClassDeclaration(node);
+ return writeFunctionDeclaration(node);
+ case 201:
+ return writeVariableStatement(node);
case 223:
- return writeTypeAliasDeclaration(node);
+ return writeInterfaceDeclaration(node);
+ case 222:
+ return writeClassDeclaration(node);
case 224:
- return writeEnumDeclaration(node);
+ return writeTypeAliasDeclaration(node);
case 225:
+ return writeEnumDeclaration(node);
+ case 226:
return writeModuleDeclaration(node);
- case 229:
- return writeImportEqualsDeclaration(node);
case 230:
+ return writeImportEqualsDeclaration(node);
+ case 231:
return writeImportDeclaration(node);
default:
ts.Debug.fail("Unknown symbol kind");
@@ -44165,7 +44280,7 @@ var ts;
if (modifiers & 512) {
write("default ");
}
- else if (node.kind !== 222 && !noDeclare) {
+ else if (node.kind !== 223 && !noDeclare) {
write("declare ");
}
}
@@ -44205,7 +44320,7 @@ var ts;
write(");");
}
writer.writeLine();
- function getImportEntityNameVisibilityError(symbolAccessibilityResult) {
+ function getImportEntityNameVisibilityError() {
return {
diagnosticMessage: ts.Diagnostics.Import_declaration_0_is_using_private_name_1,
errorNode: node,
@@ -44215,7 +44330,7 @@ var ts;
}
function isVisibleNamedBinding(namedBindings) {
if (namedBindings) {
- if (namedBindings.kind === 232) {
+ if (namedBindings.kind === 233) {
return resolver.isDeclarationVisible(namedBindings);
}
else {
@@ -44238,7 +44353,7 @@ var ts;
if (currentWriterPos !== writer.getTextPos()) {
write(", ");
}
- if (node.importClause.namedBindings.kind === 232) {
+ if (node.importClause.namedBindings.kind === 233) {
write("* as ");
writeTextOfNode(currentText, node.importClause.namedBindings.name);
}
@@ -44255,13 +44370,13 @@ var ts;
writer.writeLine();
}
function emitExternalModuleSpecifier(parent) {
- resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 225;
+ resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 226;
var moduleSpecifier;
- if (parent.kind === 229) {
+ if (parent.kind === 230) {
var node = parent;
moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node);
}
- else if (parent.kind === 225) {
+ else if (parent.kind === 226) {
moduleSpecifier = parent.name;
}
else {
@@ -44329,7 +44444,7 @@ var ts;
writeTextOfNode(currentText, node.name);
}
}
- while (node.body && node.body.kind !== 226) {
+ while (node.body && node.body.kind !== 227) {
node = node.body;
write(".");
writeTextOfNode(currentText, node.name);
@@ -44363,7 +44478,7 @@ var ts;
write(";");
writeLine();
enclosingDeclaration = prevEnclosingDeclaration;
- function getTypeAliasDeclarationVisibilityError(symbolAccessibilityResult) {
+ function getTypeAliasDeclarationVisibilityError() {
return {
diagnosticMessage: ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1,
errorNode: node.type,
@@ -44399,7 +44514,7 @@ var ts;
writeLine();
}
function isPrivateMethodTypeParameter(node) {
- return node.parent.kind === 147 && ts.hasModifier(node.parent, 8);
+ return node.parent.kind === 148 && ts.hasModifier(node.parent, 8);
}
function emitTypeParameters(typeParameters) {
function emitTypeParameter(node) {
@@ -44409,49 +44524,49 @@ var ts;
writeTextOfNode(currentText, node.name);
if (node.constraint && !isPrivateMethodTypeParameter(node)) {
write(" extends ");
- if (node.parent.kind === 156 ||
- node.parent.kind === 157 ||
- (node.parent.parent && node.parent.parent.kind === 159)) {
- ts.Debug.assert(node.parent.kind === 147 ||
- node.parent.kind === 146 ||
- node.parent.kind === 156 ||
+ if (node.parent.kind === 157 ||
+ node.parent.kind === 158 ||
+ (node.parent.parent && node.parent.parent.kind === 160)) {
+ ts.Debug.assert(node.parent.kind === 148 ||
+ node.parent.kind === 147 ||
node.parent.kind === 157 ||
- node.parent.kind === 151 ||
- node.parent.kind === 152);
+ node.parent.kind === 158 ||
+ node.parent.kind === 152 ||
+ node.parent.kind === 153);
emitType(node.constraint);
}
else {
emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.constraint, getTypeParameterConstraintVisibilityError);
}
}
- function getTypeParameterConstraintVisibilityError(symbolAccessibilityResult) {
+ function getTypeParameterConstraintVisibilityError() {
var diagnosticMessage;
switch (node.parent.kind) {
- case 221:
+ case 222:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;
break;
- case 222:
+ case 223:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;
break;
- case 152:
+ case 153:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
- case 151:
+ case 152:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
+ case 148:
case 147:
- case 146:
if (ts.hasModifier(node.parent, 32)) {
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
}
- else if (node.parent.parent.kind === 221) {
+ else if (node.parent.parent.kind === 222) {
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1;
}
else {
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
break;
- case 220:
+ case 221:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
break;
default:
@@ -44479,16 +44594,16 @@ var ts;
if (ts.isEntityNameExpression(node.expression)) {
emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError);
}
- else if (!isImplementsList && node.expression.kind === 93) {
+ else if (!isImplementsList && node.expression.kind === 94) {
write("null");
}
else {
writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError;
resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 | 1024, writer);
}
- function getHeritageClauseVisibilityError(symbolAccessibilityResult) {
+ function getHeritageClauseVisibilityError() {
var diagnosticMessage;
- if (node.parent.parent.kind === 221) {
+ if (node.parent.parent.kind === 222) {
diagnosticMessage = isImplementsList ?
ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 :
ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1;
@@ -44568,17 +44683,17 @@ var ts;
writeLine();
}
function emitVariableDeclaration(node) {
- if (node.kind !== 218 || resolver.isDeclarationVisible(node)) {
+ if (node.kind !== 219 || resolver.isDeclarationVisible(node)) {
if (ts.isBindingPattern(node.name)) {
emitBindingPattern(node.name);
}
else {
writeTextOfNode(currentText, node.name);
- if ((node.kind === 145 || node.kind === 144 ||
- (node.kind === 142 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) {
+ if ((node.kind === 146 || node.kind === 145 ||
+ (node.kind === 143 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) {
write("?");
}
- if ((node.kind === 145 || node.kind === 144) && node.parent.kind === 159) {
+ if ((node.kind === 146 || node.kind === 145) && node.parent.kind === 160) {
emitTypeOfVariableDeclarationFromTypeLiteral(node);
}
else if (resolver.isLiteralConstDeclaration(node)) {
@@ -44591,14 +44706,14 @@ var ts;
}
}
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
- if (node.kind === 218) {
+ if (node.kind === 219) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
}
- else if (node.kind === 145 || node.kind === 144) {
+ else if (node.kind === 146 || node.kind === 145) {
if (ts.hasModifier(node, 32)) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -44606,7 +44721,7 @@ var ts;
ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
}
- else if (node.parent.kind === 221) {
+ else if (node.parent.kind === 222) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -44632,7 +44747,7 @@ var ts;
var elements = [];
for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) {
var element = _a[_i];
- if (element.kind !== 193) {
+ if (element.kind !== 194) {
elements.push(element);
}
}
@@ -44698,7 +44813,7 @@ var ts;
accessorWithTypeAnnotation = node;
var type = getTypeAnnotationFromAccessor(node);
if (!type) {
- var anotherAccessor = node.kind === 149 ? accessors.setAccessor : accessors.getAccessor;
+ var anotherAccessor = node.kind === 150 ? accessors.setAccessor : accessors.getAccessor;
type = getTypeAnnotationFromAccessor(anotherAccessor);
if (type) {
accessorWithTypeAnnotation = anotherAccessor;
@@ -44711,7 +44826,7 @@ var ts;
}
function getTypeAnnotationFromAccessor(accessor) {
if (accessor) {
- return accessor.kind === 149
+ return accessor.kind === 150
? accessor.type
: accessor.parameters.length > 0
? accessor.parameters[0].type
@@ -44720,7 +44835,7 @@ var ts;
}
function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) {
var diagnosticMessage;
- if (accessorWithTypeAnnotation.kind === 150) {
+ if (accessorWithTypeAnnotation.kind === 151) {
if (ts.hasModifier(accessorWithTypeAnnotation.parent, 32)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 :
@@ -44766,17 +44881,17 @@ var ts;
}
if (!resolver.isImplementationOfOverload(node)) {
emitJsDocComments(node);
- if (node.kind === 220) {
+ if (node.kind === 221) {
emitModuleElementDeclarationFlags(node);
}
- else if (node.kind === 147 || node.kind === 148) {
+ else if (node.kind === 148 || node.kind === 149) {
emitClassMemberDeclarationFlags(ts.getModifierFlags(node));
}
- if (node.kind === 220) {
+ if (node.kind === 221) {
write("function ");
writeTextOfNode(currentText, node.name);
}
- else if (node.kind === 148) {
+ else if (node.kind === 149) {
write("constructor");
}
else {
@@ -44796,15 +44911,15 @@ var ts;
var prevEnclosingDeclaration = enclosingDeclaration;
enclosingDeclaration = node;
var closeParenthesizedFunctionType = false;
- if (node.kind === 153) {
+ if (node.kind === 154) {
emitClassMemberDeclarationFlags(ts.getModifierFlags(node));
write("[");
}
else {
- if (node.kind === 152 || node.kind === 157) {
+ if (node.kind === 153 || node.kind === 158) {
write("new ");
}
- else if (node.kind === 156) {
+ else if (node.kind === 157) {
var currentOutput = writer.getText();
if (node.typeParameters && currentOutput.charAt(currentOutput.length - 1) === "<") {
closeParenthesizedFunctionType = true;
@@ -44815,20 +44930,20 @@ var ts;
write("(");
}
emitCommaList(node.parameters, emitParameterDeclaration);
- if (node.kind === 153) {
+ if (node.kind === 154) {
write("]");
}
else {
write(")");
}
- var isFunctionTypeOrConstructorType = node.kind === 156 || node.kind === 157;
- if (isFunctionTypeOrConstructorType || node.parent.kind === 159) {
+ var isFunctionTypeOrConstructorType = node.kind === 157 || node.kind === 158;
+ if (isFunctionTypeOrConstructorType || node.parent.kind === 160) {
if (node.type) {
write(isFunctionTypeOrConstructorType ? " => " : ": ");
emitType(node.type);
}
}
- else if (node.kind !== 148 && !ts.hasModifier(node, 8)) {
+ else if (node.kind !== 149 && !ts.hasModifier(node, 8)) {
writeReturnTypeAtSignature(node, getReturnTypeVisibilityError);
}
enclosingDeclaration = prevEnclosingDeclaration;
@@ -44842,23 +44957,23 @@ var ts;
function getReturnTypeVisibilityError(symbolAccessibilityResult) {
var diagnosticMessage;
switch (node.kind) {
- case 152:
+ case 153:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 151:
+ case 152:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 153:
+ case 154:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
+ case 148:
case 147:
- case 146:
if (ts.hasModifier(node, 32)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -44866,7 +44981,7 @@ var ts;
ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0;
}
- else if (node.parent.kind === 221) {
+ else if (node.parent.kind === 222) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named :
@@ -44879,7 +44994,7 @@ var ts;
ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;
}
break;
- case 220:
+ case 221:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named :
@@ -44911,9 +45026,9 @@ var ts;
write("?");
}
decreaseIndent();
- if (node.parent.kind === 156 ||
- node.parent.kind === 157 ||
- node.parent.parent.kind === 159) {
+ if (node.parent.kind === 157 ||
+ node.parent.kind === 158 ||
+ node.parent.parent.kind === 160) {
emitTypeOfVariableDeclarationFromTypeLiteral(node);
}
else if (!ts.hasModifier(node.parent, 8)) {
@@ -44929,22 +45044,22 @@ var ts;
}
function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
switch (node.parent.kind) {
- case 148:
+ case 149:
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;
- case 152:
+ case 153:
return symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 151:
+ case 152:
return symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
+ case 148:
case 147:
- case 146:
if (ts.hasModifier(node.parent, 32)) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -44952,7 +45067,7 @@ var ts;
ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
}
- else if (node.parent.parent.kind === 221) {
+ else if (node.parent.parent.kind === 222) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -44964,7 +45079,7 @@ var ts;
ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
- case 220:
+ case 221:
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -44975,12 +45090,12 @@ var ts;
}
}
function emitBindingPattern(bindingPattern) {
- if (bindingPattern.kind === 167) {
+ if (bindingPattern.kind === 168) {
write("{");
emitCommaList(bindingPattern.elements, emitBindingElement);
write("}");
}
- else if (bindingPattern.kind === 168) {
+ else if (bindingPattern.kind === 169) {
write("[");
var elements = bindingPattern.elements;
emitCommaList(elements, emitBindingElement);
@@ -44991,10 +45106,10 @@ var ts;
}
}
function emitBindingElement(bindingElement) {
- if (bindingElement.kind === 193) {
+ if (bindingElement.kind === 194) {
write(" ");
}
- else if (bindingElement.kind === 169) {
+ else if (bindingElement.kind === 170) {
if (bindingElement.propertyName) {
writeTextOfNode(currentText, bindingElement.propertyName);
write(": ");
@@ -45004,7 +45119,7 @@ var ts;
emitBindingPattern(bindingElement.name);
}
else {
- ts.Debug.assert(bindingElement.name.kind === 69);
+ ts.Debug.assert(bindingElement.name.kind === 70);
if (bindingElement.dotDotDotToken) {
write("...");
}
@@ -45016,37 +45131,37 @@ var ts;
}
function emitNode(node) {
switch (node.kind) {
- case 220:
- case 225:
- case 229:
- case 222:
case 221:
- case 223:
- case 224:
- return emitModuleElement(node, isModuleElementVisible(node));
- case 200:
- return emitModuleElement(node, isVariableStatementVisible(node));
+ case 226:
case 230:
+ case 223:
+ case 222:
+ case 224:
+ case 225:
+ return emitModuleElement(node, isModuleElementVisible(node));
+ case 201:
+ return emitModuleElement(node, isVariableStatementVisible(node));
+ case 231:
return emitModuleElement(node, !node.importClause);
- case 236:
+ case 237:
return emitExportDeclaration(node);
+ case 149:
case 148:
case 147:
- case 146:
return writeFunctionDeclaration(node);
- case 152:
- case 151:
case 153:
+ case 152:
+ case 154:
return emitSignatureDeclarationWithJsDocComments(node);
- case 149:
case 150:
+ case 151:
return emitAccessorDeclaration(node);
+ case 146:
case 145:
- case 144:
return emitPropertyDeclaration(node);
case 255:
return emitEnumMemberDeclaration(node);
- case 235:
+ case 236:
return emitExportAssignment(node);
case 256:
return emitSourceFile(node);
@@ -45066,7 +45181,7 @@ var ts;
referencesOutput += "/// " + newLine;
}
return addedBundledEmitReference;
- function getDeclFileName(emitFileNames, sourceFiles, isBundledEmit) {
+ function getDeclFileName(emitFileNames, _sourceFiles, isBundledEmit) {
if (isBundledEmit && !addBundledFileReference) {
return;
}
@@ -45131,7 +45246,7 @@ var ts;
emitNodeWithSourceMap: emitNodeWithSourceMap,
emitTokenWithSourceMap: emitTokenWithSourceMap,
getText: getText,
- getSourceMappingURL: getSourceMappingURL
+ getSourceMappingURL: getSourceMappingURL,
};
function initialize(filePath, sourceMapFilePath, sourceFiles, isBundledEmit) {
if (disabled) {
@@ -45334,7 +45449,7 @@ var ts;
sources: sourceMapData.sourceMapSources,
names: sourceMapData.sourceMapNames,
mappings: sourceMapData.sourceMapMappings,
- sourcesContent: sourceMapData.sourceMapSourcesContent
+ sourcesContent: sourceMapData.sourceMapSourcesContent,
});
}
function getSourceMappingURL() {
@@ -45398,7 +45513,7 @@ var ts;
setSourceFile: setSourceFile,
emitNodeWithComments: emitNodeWithComments,
emitBodyWithDetachedComments: emitBodyWithDetachedComments,
- emitTrailingCommentsOfPosition: emitTrailingCommentsOfPosition
+ emitTrailingCommentsOfPosition: emitTrailingCommentsOfPosition,
};
function emitNodeWithComments(emitContext, node, emitCallback) {
if (disabled) {
@@ -45436,7 +45551,7 @@ var ts;
}
if (!skipTrailingComments) {
containerEnd = end;
- if (node.kind === 219) {
+ if (node.kind === 220) {
declarationListContainerEnd = end;
}
}
@@ -45512,7 +45627,7 @@ var ts;
emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos);
}
}
- function emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) {
+ function emitLeadingComment(commentPos, commentEnd, _kind, hasTrailingNewLine, rangePos) {
if (!hasWrittenComment) {
ts.emitNewLineBeforeLeadingCommentOfPosition(currentLineMap, writer, rangePos, commentPos);
hasWrittenComment = true;
@@ -45530,7 +45645,7 @@ var ts;
function emitTrailingComments(pos) {
forEachTrailingCommentToEmit(pos, emitTrailingComment);
}
- function emitTrailingComment(commentPos, commentEnd, kind, hasTrailingNewLine) {
+ function emitTrailingComment(commentPos, commentEnd, _kind, hasTrailingNewLine) {
if (!writer.isAtStartOfLine()) {
writer.write(" ");
}
@@ -45553,7 +45668,7 @@ var ts;
ts.performance.measure("commentTime", "beforeEmitTrailingCommentsOfPosition");
}
}
- function emitTrailingCommentOfPosition(commentPos, commentEnd, kind, hasTrailingNewLine) {
+ function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) {
emitPos(commentPos);
ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine);
emitPos(commentEnd);
@@ -45636,8 +45751,14 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
+ var TempFlags;
+ (function (TempFlags) {
+ TempFlags[TempFlags["Auto"] = 0] = "Auto";
+ TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask";
+ TempFlags[TempFlags["_i"] = 268435456] = "_i";
+ })(TempFlags || (TempFlags = {}));
var id = function (s) { return s; };
- var nullTransformers = [function (ctx) { return id; }];
+ var nullTransformers = [function (_) { return id; }];
function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles) {
var delimiters = createDelimiterMap();
var brackets = createBracketsMap();
@@ -45815,191 +45936,205 @@ var ts;
function pipelineEmitInIdentifierNameContext(node) {
var kind = node.kind;
switch (kind) {
- case 69:
+ case 70:
return emitIdentifier(node);
}
}
function pipelineEmitInUnspecifiedContext(node) {
var kind = node.kind;
switch (kind) {
- case 12:
case 13:
case 14:
+ case 15:
return emitLiteral(node);
- case 69:
+ case 70:
return emitIdentifier(node);
- case 74:
- case 77:
- case 82:
- case 103:
- case 110:
+ case 75:
+ case 78:
+ case 83:
+ case 104:
case 111:
case 112:
case 113:
- case 115:
+ case 114:
+ case 116:
case 117:
case 118:
+ case 119:
case 120:
+ case 121:
case 122:
- case 130:
+ case 123:
+ case 124:
+ case 125:
+ case 126:
+ case 127:
case 128:
+ case 129:
+ case 130:
+ case 131:
case 132:
case 133:
+ case 134:
+ case 135:
+ case 136:
case 137:
+ case 138:
+ case 139:
writeTokenText(kind);
return;
- case 139:
- return emitQualifiedName(node);
case 140:
- return emitComputedPropertyName(node);
+ return emitQualifiedName(node);
case 141:
- return emitTypeParameter(node);
+ return emitComputedPropertyName(node);
case 142:
- return emitParameter(node);
+ return emitTypeParameter(node);
case 143:
- return emitDecorator(node);
+ return emitParameter(node);
case 144:
- return emitPropertySignature(node);
+ return emitDecorator(node);
case 145:
- return emitPropertyDeclaration(node);
+ return emitPropertySignature(node);
case 146:
- return emitMethodSignature(node);
+ return emitPropertyDeclaration(node);
case 147:
- return emitMethodDeclaration(node);
+ return emitMethodSignature(node);
case 148:
- return emitConstructor(node);
+ return emitMethodDeclaration(node);
case 149:
+ return emitConstructor(node);
case 150:
- return emitAccessorDeclaration(node);
case 151:
- return emitCallSignature(node);
+ return emitAccessorDeclaration(node);
case 152:
- return emitConstructSignature(node);
+ return emitCallSignature(node);
case 153:
- return emitIndexSignature(node);
+ return emitConstructSignature(node);
case 154:
- return emitTypePredicate(node);
+ return emitIndexSignature(node);
case 155:
- return emitTypeReference(node);
+ return emitTypePredicate(node);
case 156:
- return emitFunctionType(node);
+ return emitTypeReference(node);
case 157:
- return emitConstructorType(node);
+ return emitFunctionType(node);
case 158:
- return emitTypeQuery(node);
+ return emitConstructorType(node);
case 159:
- return emitTypeLiteral(node);
+ return emitTypeQuery(node);
case 160:
- return emitArrayType(node);
+ return emitTypeLiteral(node);
case 161:
- return emitTupleType(node);
+ return emitArrayType(node);
case 162:
- return emitUnionType(node);
+ return emitTupleType(node);
case 163:
- return emitIntersectionType(node);
+ return emitUnionType(node);
case 164:
- return emitParenthesizedType(node);
- case 194:
- return emitExpressionWithTypeArguments(node);
+ return emitIntersectionType(node);
case 165:
- return emitThisType(node);
+ return emitParenthesizedType(node);
+ case 195:
+ return emitExpressionWithTypeArguments(node);
case 166:
- return emitLiteralType(node);
+ return emitThisType();
case 167:
- return emitObjectBindingPattern(node);
+ return emitLiteralType(node);
case 168:
- return emitArrayBindingPattern(node);
+ return emitObjectBindingPattern(node);
case 169:
+ return emitArrayBindingPattern(node);
+ case 170:
return emitBindingElement(node);
- case 197:
- return emitTemplateSpan(node);
case 198:
- return emitSemicolonClassElement(node);
+ return emitTemplateSpan(node);
case 199:
- return emitBlock(node);
+ return emitSemicolonClassElement();
case 200:
- return emitVariableStatement(node);
+ return emitBlock(node);
case 201:
- return emitEmptyStatement(node);
+ return emitVariableStatement(node);
case 202:
- return emitExpressionStatement(node);
+ return emitEmptyStatement();
case 203:
- return emitIfStatement(node);
+ return emitExpressionStatement(node);
case 204:
- return emitDoStatement(node);
+ return emitIfStatement(node);
case 205:
- return emitWhileStatement(node);
+ return emitDoStatement(node);
case 206:
- return emitForStatement(node);
+ return emitWhileStatement(node);
case 207:
- return emitForInStatement(node);
+ return emitForStatement(node);
case 208:
- return emitForOfStatement(node);
+ return emitForInStatement(node);
case 209:
- return emitContinueStatement(node);
+ return emitForOfStatement(node);
case 210:
- return emitBreakStatement(node);
+ return emitContinueStatement(node);
case 211:
- return emitReturnStatement(node);
+ return emitBreakStatement(node);
case 212:
- return emitWithStatement(node);
+ return emitReturnStatement(node);
case 213:
- return emitSwitchStatement(node);
+ return emitWithStatement(node);
case 214:
- return emitLabeledStatement(node);
+ return emitSwitchStatement(node);
case 215:
- return emitThrowStatement(node);
+ return emitLabeledStatement(node);
case 216:
- return emitTryStatement(node);
+ return emitThrowStatement(node);
case 217:
- return emitDebuggerStatement(node);
+ return emitTryStatement(node);
case 218:
- return emitVariableDeclaration(node);
+ return emitDebuggerStatement(node);
case 219:
- return emitVariableDeclarationList(node);
+ return emitVariableDeclaration(node);
case 220:
- return emitFunctionDeclaration(node);
+ return emitVariableDeclarationList(node);
case 221:
- return emitClassDeclaration(node);
+ return emitFunctionDeclaration(node);
case 222:
- return emitInterfaceDeclaration(node);
+ return emitClassDeclaration(node);
case 223:
- return emitTypeAliasDeclaration(node);
+ return emitInterfaceDeclaration(node);
case 224:
- return emitEnumDeclaration(node);
+ return emitTypeAliasDeclaration(node);
case 225:
- return emitModuleDeclaration(node);
+ return emitEnumDeclaration(node);
case 226:
- return emitModuleBlock(node);
+ return emitModuleDeclaration(node);
case 227:
+ return emitModuleBlock(node);
+ case 228:
return emitCaseBlock(node);
- case 229:
- return emitImportEqualsDeclaration(node);
case 230:
- return emitImportDeclaration(node);
+ return emitImportEqualsDeclaration(node);
case 231:
- return emitImportClause(node);
+ return emitImportDeclaration(node);
case 232:
- return emitNamespaceImport(node);
+ return emitImportClause(node);
case 233:
- return emitNamedImports(node);
+ return emitNamespaceImport(node);
case 234:
- return emitImportSpecifier(node);
+ return emitNamedImports(node);
case 235:
- return emitExportAssignment(node);
+ return emitImportSpecifier(node);
case 236:
- return emitExportDeclaration(node);
+ return emitExportAssignment(node);
case 237:
- return emitNamedExports(node);
+ return emitExportDeclaration(node);
case 238:
- return emitExportSpecifier(node);
+ return emitNamedExports(node);
case 239:
- return;
+ return emitExportSpecifier(node);
case 240:
+ return;
+ case 241:
return emitExternalModuleReference(node);
- case 244:
+ case 10:
return emitJsxText(node);
- case 243:
+ case 244:
return emitJsxOpeningElement(node);
case 245:
return emitJsxClosingElement(node);
@@ -46034,73 +46169,73 @@ var ts;
case 8:
return emitNumericLiteral(node);
case 9:
- case 10:
case 11:
+ case 12:
return emitLiteral(node);
- case 69:
+ case 70:
return emitIdentifier(node);
- case 84:
- case 93:
- case 95:
- case 99:
- case 97:
+ case 85:
+ case 94:
+ case 96:
+ case 100:
+ case 98:
writeTokenText(kind);
return;
- case 170:
- return emitArrayLiteralExpression(node);
case 171:
- return emitObjectLiteralExpression(node);
+ return emitArrayLiteralExpression(node);
case 172:
- return emitPropertyAccessExpression(node);
+ return emitObjectLiteralExpression(node);
case 173:
- return emitElementAccessExpression(node);
+ return emitPropertyAccessExpression(node);
case 174:
- return emitCallExpression(node);
+ return emitElementAccessExpression(node);
case 175:
- return emitNewExpression(node);
+ return emitCallExpression(node);
case 176:
- return emitTaggedTemplateExpression(node);
+ return emitNewExpression(node);
case 177:
- return emitTypeAssertionExpression(node);
+ return emitTaggedTemplateExpression(node);
case 178:
- return emitParenthesizedExpression(node);
+ return emitTypeAssertionExpression(node);
case 179:
- return emitFunctionExpression(node);
+ return emitParenthesizedExpression(node);
case 180:
- return emitArrowFunction(node);
+ return emitFunctionExpression(node);
case 181:
- return emitDeleteExpression(node);
+ return emitArrowFunction(node);
case 182:
- return emitTypeOfExpression(node);
+ return emitDeleteExpression(node);
case 183:
- return emitVoidExpression(node);
+ return emitTypeOfExpression(node);
case 184:
- return emitAwaitExpression(node);
+ return emitVoidExpression(node);
case 185:
- return emitPrefixUnaryExpression(node);
+ return emitAwaitExpression(node);
case 186:
- return emitPostfixUnaryExpression(node);
+ return emitPrefixUnaryExpression(node);
case 187:
- return emitBinaryExpression(node);
+ return emitPostfixUnaryExpression(node);
case 188:
- return emitConditionalExpression(node);
+ return emitBinaryExpression(node);
case 189:
- return emitTemplateExpression(node);
+ return emitConditionalExpression(node);
case 190:
- return emitYieldExpression(node);
+ return emitTemplateExpression(node);
case 191:
- return emitSpreadElementExpression(node);
+ return emitYieldExpression(node);
case 192:
- return emitClassExpression(node);
+ return emitSpreadElementExpression(node);
case 193:
+ return emitClassExpression(node);
+ case 194:
return;
- case 195:
- return emitAsExpression(node);
case 196:
+ return emitAsExpression(node);
+ case 197:
return emitNonNullExpression(node);
- case 241:
- return emitJsxElement(node);
case 242:
+ return emitJsxElement(node);
+ case 243:
return emitJsxSelfClosingElement(node);
case 288:
return emitPartiallyEmittedExpression(node);
@@ -46136,7 +46271,7 @@ var ts;
emit(node.right);
}
function emitEntityName(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
emitExpression(node);
}
else {
@@ -46206,7 +46341,7 @@ var ts;
function emitAccessorDeclaration(node) {
emitDecorators(node, node.decorators);
emitModifiers(node, node.modifiers);
- write(node.kind === 149 ? "get " : "set ");
+ write(node.kind === 150 ? "get " : "set ");
emit(node.name);
emitSignatureAndBody(node, emitSignatureHead);
}
@@ -46234,7 +46369,7 @@ var ts;
emitWithPrefix(": ", node.type);
write(";");
}
- function emitSemicolonClassElement(node) {
+ function emitSemicolonClassElement() {
write(";");
}
function emitTypePredicate(node) {
@@ -46288,7 +46423,7 @@ var ts;
emit(node.type);
write(")");
}
- function emitThisType(node) {
+ function emitThisType() {
write("this");
}
function emitLiteralType(node) {
@@ -46356,7 +46491,7 @@ var ts;
if (!(ts.getEmitFlags(node) & 1048576)) {
var dotRangeStart = node.expression.end;
var dotRangeEnd = ts.skipTrivia(currentText, node.expression.end) + 1;
- var dotToken = { kind: 21, pos: dotRangeStart, end: dotRangeEnd };
+ var dotToken = { kind: 22, pos: dotRangeStart, end: dotRangeEnd };
indentBeforeDot = needsIndentation(node, node.expression, dotToken);
indentAfterDot = needsIndentation(node, dotToken, node.name);
}
@@ -46371,7 +46506,7 @@ var ts;
function needsDotDotForPropertyAccess(expression) {
if (expression.kind === 8) {
var text = getLiteralTextOfNode(expression);
- return text.indexOf(ts.tokenToString(21)) < 0;
+ return text.indexOf(ts.tokenToString(22)) < 0;
}
else if (ts.isPropertyAccessExpression(expression) || ts.isElementAccessExpression(expression)) {
var constantValue = ts.getConstantValue(expression);
@@ -46388,11 +46523,13 @@ var ts;
}
function emitCallExpression(node) {
emitExpression(node.expression);
+ emitTypeArguments(node, node.typeArguments);
emitExpressionList(node, node.arguments, 1296);
}
function emitNewExpression(node) {
write("new ");
emitExpression(node.expression);
+ emitTypeArguments(node, node.typeArguments);
emitExpressionList(node, node.arguments, 9488);
}
function emitTaggedTemplateExpression(node) {
@@ -46452,16 +46589,16 @@ var ts;
}
function shouldEmitWhitespaceBeforeOperand(node) {
var operand = node.operand;
- return operand.kind === 185
- && ((node.operator === 35 && (operand.operator === 35 || operand.operator === 41))
- || (node.operator === 36 && (operand.operator === 36 || operand.operator === 42)));
+ return operand.kind === 186
+ && ((node.operator === 36 && (operand.operator === 36 || operand.operator === 42))
+ || (node.operator === 37 && (operand.operator === 37 || operand.operator === 43)));
}
function emitPostfixUnaryExpression(node) {
emitExpression(node.operand);
writeTokenText(node.operator);
}
function emitBinaryExpression(node) {
- var isCommaOperator = node.operatorToken.kind !== 24;
+ var isCommaOperator = node.operatorToken.kind !== 25;
var indentBeforeOperator = needsIndentation(node, node.left, node.operatorToken);
var indentAfterOperator = needsIndentation(node, node.operatorToken, node.right);
emitExpression(node.left);
@@ -46522,16 +46659,16 @@ var ts;
emitExpression(node.expression);
emit(node.literal);
}
- function emitBlock(node, format) {
+ function emitBlock(node) {
if (isSingleLineEmptyBlock(node)) {
- writeToken(15, node.pos, node);
+ writeToken(16, node.pos, node);
write(" ");
- writeToken(16, node.statements.end, node);
+ writeToken(17, node.statements.end, node);
}
else {
- writeToken(15, node.pos, node);
+ writeToken(16, node.pos, node);
emitBlockStatements(node);
- writeToken(16, node.statements.end, node);
+ writeToken(17, node.statements.end, node);
}
}
function emitBlockStatements(node) {
@@ -46547,7 +46684,7 @@ var ts;
emit(node.declarationList);
write(";");
}
- function emitEmptyStatement(node) {
+ function emitEmptyStatement() {
write(";");
}
function emitExpressionStatement(node) {
@@ -46555,16 +46692,16 @@ var ts;
write(";");
}
function emitIfStatement(node) {
- var openParenPos = writeToken(88, node.pos, node);
+ var openParenPos = writeToken(89, node.pos, node);
write(" ");
- writeToken(17, openParenPos, node);
+ writeToken(18, openParenPos, node);
emitExpression(node.expression);
- writeToken(18, node.expression.end, node);
+ writeToken(19, node.expression.end, node);
emitEmbeddedStatement(node.thenStatement);
if (node.elseStatement) {
writeLine();
- writeToken(80, node.thenStatement.end, node);
- if (node.elseStatement.kind === 203) {
+ writeToken(81, node.thenStatement.end, node);
+ if (node.elseStatement.kind === 204) {
write(" ");
emit(node.elseStatement);
}
@@ -46593,9 +46730,9 @@ var ts;
emitEmbeddedStatement(node.statement);
}
function emitForStatement(node) {
- var openParenPos = writeToken(86, node.pos);
+ var openParenPos = writeToken(87, node.pos);
write(" ");
- writeToken(17, openParenPos, node);
+ writeToken(18, openParenPos, node);
emitForBinding(node.initializer);
write(";");
emitExpressionWithPrefix(" ", node.condition);
@@ -46605,28 +46742,28 @@ var ts;
emitEmbeddedStatement(node.statement);
}
function emitForInStatement(node) {
- var openParenPos = writeToken(86, node.pos);
+ var openParenPos = writeToken(87, node.pos);
write(" ");
- writeToken(17, openParenPos);
+ writeToken(18, openParenPos);
emitForBinding(node.initializer);
write(" in ");
emitExpression(node.expression);
- writeToken(18, node.expression.end);
+ writeToken(19, node.expression.end);
emitEmbeddedStatement(node.statement);
}
function emitForOfStatement(node) {
- var openParenPos = writeToken(86, node.pos);
+ var openParenPos = writeToken(87, node.pos);
write(" ");
- writeToken(17, openParenPos);
+ writeToken(18, openParenPos);
emitForBinding(node.initializer);
write(" of ");
emitExpression(node.expression);
- writeToken(18, node.expression.end);
+ writeToken(19, node.expression.end);
emitEmbeddedStatement(node.statement);
}
function emitForBinding(node) {
if (node !== undefined) {
- if (node.kind === 219) {
+ if (node.kind === 220) {
emit(node);
}
else {
@@ -46635,17 +46772,17 @@ var ts;
}
}
function emitContinueStatement(node) {
- writeToken(75, node.pos);
+ writeToken(76, node.pos);
emitWithPrefix(" ", node.label);
write(";");
}
function emitBreakStatement(node) {
- writeToken(70, node.pos);
+ writeToken(71, node.pos);
emitWithPrefix(" ", node.label);
write(";");
}
function emitReturnStatement(node) {
- writeToken(94, node.pos, node);
+ writeToken(95, node.pos, node);
emitExpressionWithPrefix(" ", node.expression);
write(";");
}
@@ -46656,11 +46793,11 @@ var ts;
emitEmbeddedStatement(node.statement);
}
function emitSwitchStatement(node) {
- var openParenPos = writeToken(96, node.pos);
+ var openParenPos = writeToken(97, node.pos);
write(" ");
- writeToken(17, openParenPos);
+ writeToken(18, openParenPos);
emitExpression(node.expression);
- writeToken(18, node.expression.end);
+ writeToken(19, node.expression.end);
write(" ");
emit(node.caseBlock);
}
@@ -46685,11 +46822,12 @@ var ts;
}
}
function emitDebuggerStatement(node) {
- writeToken(76, node.pos);
+ writeToken(77, node.pos);
write(";");
}
function emitVariableDeclaration(node) {
emit(node.name);
+ emitWithPrefix(": ", node.type);
emitExpressionWithPrefix(" = ", node.initializer);
}
function emitVariableDeclarationList(node) {
@@ -46716,13 +46854,13 @@ var ts;
}
if (ts.getEmitFlags(node) & 4194304) {
emitSignatureHead(node);
- emitBlockFunctionBody(node, body);
+ emitBlockFunctionBody(body);
}
else {
var savedTempFlags = tempFlags;
tempFlags = 0;
emitSignatureHead(node);
- emitBlockFunctionBody(node, body);
+ emitBlockFunctionBody(body);
tempFlags = savedTempFlags;
}
if (indentedFlag) {
@@ -46745,7 +46883,7 @@ var ts;
emitParameters(node, node.parameters);
emitWithPrefix(": ", node.type);
}
- function shouldEmitBlockFunctionBodyOnSingleLine(parentNode, body) {
+ function shouldEmitBlockFunctionBodyOnSingleLine(body) {
if (ts.getEmitFlags(body) & 32) {
return true;
}
@@ -46769,14 +46907,14 @@ var ts;
}
return true;
}
- function emitBlockFunctionBody(parentNode, body) {
+ function emitBlockFunctionBody(body) {
write(" {");
increaseIndent();
- emitBodyWithDetachedComments(body, body.statements, shouldEmitBlockFunctionBodyOnSingleLine(parentNode, body)
+ emitBodyWithDetachedComments(body, body.statements, shouldEmitBlockFunctionBodyOnSingleLine(body)
? emitBlockFunctionBodyOnSingleLine
: emitBlockFunctionBodyWorker);
decreaseIndent();
- writeToken(16, body.statements.end, body);
+ writeToken(17, body.statements.end, body);
}
function emitBlockFunctionBodyOnSingleLine(body) {
emitBlockFunctionBodyWorker(body, true);
@@ -46854,7 +46992,7 @@ var ts;
write(node.flags & 16 ? "namespace " : "module ");
emit(node.name);
var body = node.body;
- while (body.kind === 225) {
+ while (body.kind === 226) {
write(".");
emit(body.name);
body = body.body;
@@ -46877,9 +47015,9 @@ var ts;
}
}
function emitCaseBlock(node) {
- writeToken(15, node.pos);
+ writeToken(16, node.pos);
emitList(node, node.clauses, 65);
- writeToken(16, node.clauses.end);
+ writeToken(17, node.clauses.end);
}
function emitImportEqualsDeclaration(node) {
emitModifiers(node, node.modifiers);
@@ -46890,7 +47028,7 @@ var ts;
write(";");
}
function emitModuleReference(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
emitExpression(node);
}
else {
@@ -47010,7 +47148,7 @@ var ts;
}
}
function emitJsxTagName(node) {
- if (node.kind === 69) {
+ if (node.kind === 70) {
emitExpression(node);
}
else {
@@ -47048,11 +47186,11 @@ var ts;
}
function emitCatchClause(node) {
writeLine();
- var openParenPos = writeToken(72, node.pos);
+ var openParenPos = writeToken(73, node.pos);
write(" ");
- writeToken(17, openParenPos);
+ writeToken(18, openParenPos);
emit(node.variableDeclaration);
- writeToken(18, node.variableDeclaration ? node.variableDeclaration.end : openParenPos);
+ writeToken(19, node.variableDeclaration ? node.variableDeclaration.end : openParenPos);
write(" ");
emit(node.block);
}
@@ -47159,7 +47297,7 @@ var ts;
paramEmitted = true;
helpersEmitted = true;
}
- if (!awaiterEmitted && node.flags & 8192) {
+ if ((languageVersion < 4) && (!awaiterEmitted && node.flags & 8192)) {
writeLines(awaiterHelper);
if (languageVersion < 2) {
writeLines(generatorHelper);
@@ -47468,7 +47606,7 @@ var ts;
&& !ts.rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile);
}
function skipSynthesizedParentheses(node) {
- while (node.kind === 178 && ts.nodeIsSynthesized(node)) {
+ while (node.kind === 179 && ts.nodeIsSynthesized(node)) {
node = node.expression;
}
return node;
@@ -47525,21 +47663,21 @@ var ts;
}
function makeTempVariableName(flags) {
if (flags && !(tempFlags & flags)) {
- var name_44 = flags === 268435456 ? "_i" : "_n";
- if (isUniqueName(name_44)) {
+ var name_41 = flags === 268435456 ? "_i" : "_n";
+ if (isUniqueName(name_41)) {
tempFlags |= flags;
- return name_44;
+ return name_41;
}
}
while (true) {
var count = tempFlags & 268435455;
tempFlags++;
if (count !== 8 && count !== 13) {
- var name_45 = count < 26
+ var name_42 = count < 26
? "_" + String.fromCharCode(97 + count)
: "_" + (count - 26);
- if (isUniqueName(name_45)) {
- return name_45;
+ if (isUniqueName(name_42)) {
+ return name_42;
}
}
}
@@ -47575,19 +47713,19 @@ var ts;
}
function generateNameForNode(node) {
switch (node.kind) {
- case 69:
+ case 70:
return makeUniqueName(getTextOfNode(node));
+ case 226:
case 225:
- case 224:
return generateNameForModuleOrEnum(node);
- case 230:
- case 236:
+ case 231:
+ case 237:
return generateNameForImportOrExportDeclaration(node);
- case 220:
case 221:
- case 235:
+ case 222:
+ case 236:
return generateNameForExportDefault();
- case 192:
+ case 193:
return generateNameForClassExpression();
default:
return makeTempVariableName(0);
@@ -47657,6 +47795,68 @@ var ts;
}
}
ts.emitFiles = emitFiles;
+ var ListFormat;
+ (function (ListFormat) {
+ ListFormat[ListFormat["None"] = 0] = "None";
+ ListFormat[ListFormat["SingleLine"] = 0] = "SingleLine";
+ ListFormat[ListFormat["MultiLine"] = 1] = "MultiLine";
+ ListFormat[ListFormat["PreserveLines"] = 2] = "PreserveLines";
+ ListFormat[ListFormat["LinesMask"] = 3] = "LinesMask";
+ ListFormat[ListFormat["NotDelimited"] = 0] = "NotDelimited";
+ ListFormat[ListFormat["BarDelimited"] = 4] = "BarDelimited";
+ ListFormat[ListFormat["AmpersandDelimited"] = 8] = "AmpersandDelimited";
+ ListFormat[ListFormat["CommaDelimited"] = 16] = "CommaDelimited";
+ ListFormat[ListFormat["DelimitersMask"] = 28] = "DelimitersMask";
+ ListFormat[ListFormat["AllowTrailingComma"] = 32] = "AllowTrailingComma";
+ ListFormat[ListFormat["Indented"] = 64] = "Indented";
+ ListFormat[ListFormat["SpaceBetweenBraces"] = 128] = "SpaceBetweenBraces";
+ ListFormat[ListFormat["SpaceBetweenSiblings"] = 256] = "SpaceBetweenSiblings";
+ ListFormat[ListFormat["Braces"] = 512] = "Braces";
+ ListFormat[ListFormat["Parenthesis"] = 1024] = "Parenthesis";
+ ListFormat[ListFormat["AngleBrackets"] = 2048] = "AngleBrackets";
+ ListFormat[ListFormat["SquareBrackets"] = 4096] = "SquareBrackets";
+ ListFormat[ListFormat["BracketsMask"] = 7680] = "BracketsMask";
+ ListFormat[ListFormat["OptionalIfUndefined"] = 8192] = "OptionalIfUndefined";
+ ListFormat[ListFormat["OptionalIfEmpty"] = 16384] = "OptionalIfEmpty";
+ ListFormat[ListFormat["Optional"] = 24576] = "Optional";
+ ListFormat[ListFormat["PreferNewLine"] = 32768] = "PreferNewLine";
+ ListFormat[ListFormat["NoTrailingNewLine"] = 65536] = "NoTrailingNewLine";
+ ListFormat[ListFormat["NoInterveningComments"] = 131072] = "NoInterveningComments";
+ ListFormat[ListFormat["Modifiers"] = 256] = "Modifiers";
+ ListFormat[ListFormat["HeritageClauses"] = 256] = "HeritageClauses";
+ ListFormat[ListFormat["TypeLiteralMembers"] = 65] = "TypeLiteralMembers";
+ ListFormat[ListFormat["TupleTypeElements"] = 336] = "TupleTypeElements";
+ ListFormat[ListFormat["UnionTypeConstituents"] = 260] = "UnionTypeConstituents";
+ ListFormat[ListFormat["IntersectionTypeConstituents"] = 264] = "IntersectionTypeConstituents";
+ ListFormat[ListFormat["ObjectBindingPatternElements"] = 432] = "ObjectBindingPatternElements";
+ ListFormat[ListFormat["ArrayBindingPatternElements"] = 304] = "ArrayBindingPatternElements";
+ ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 978] = "ObjectLiteralExpressionProperties";
+ ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 4466] = "ArrayLiteralExpressionElements";
+ ListFormat[ListFormat["CallExpressionArguments"] = 1296] = "CallExpressionArguments";
+ ListFormat[ListFormat["NewExpressionArguments"] = 9488] = "NewExpressionArguments";
+ ListFormat[ListFormat["TemplateExpressionSpans"] = 131072] = "TemplateExpressionSpans";
+ ListFormat[ListFormat["SingleLineBlockStatements"] = 384] = "SingleLineBlockStatements";
+ ListFormat[ListFormat["MultiLineBlockStatements"] = 65] = "MultiLineBlockStatements";
+ ListFormat[ListFormat["VariableDeclarationList"] = 272] = "VariableDeclarationList";
+ ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 384] = "SingleLineFunctionBodyStatements";
+ ListFormat[ListFormat["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements";
+ ListFormat[ListFormat["ClassHeritageClauses"] = 256] = "ClassHeritageClauses";
+ ListFormat[ListFormat["ClassMembers"] = 65] = "ClassMembers";
+ ListFormat[ListFormat["InterfaceMembers"] = 65] = "InterfaceMembers";
+ ListFormat[ListFormat["EnumMembers"] = 81] = "EnumMembers";
+ ListFormat[ListFormat["CaseBlockClauses"] = 65] = "CaseBlockClauses";
+ ListFormat[ListFormat["NamedImportsOrExportsElements"] = 432] = "NamedImportsOrExportsElements";
+ ListFormat[ListFormat["JsxElementChildren"] = 131072] = "JsxElementChildren";
+ ListFormat[ListFormat["JsxElementAttributes"] = 131328] = "JsxElementAttributes";
+ ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 81985] = "CaseOrDefaultClauseStatements";
+ ListFormat[ListFormat["HeritageClauseTypes"] = 272] = "HeritageClauseTypes";
+ ListFormat[ListFormat["SourceFileStatements"] = 65537] = "SourceFileStatements";
+ ListFormat[ListFormat["Decorators"] = 24577] = "Decorators";
+ ListFormat[ListFormat["TypeArguments"] = 26960] = "TypeArguments";
+ ListFormat[ListFormat["TypeParameters"] = 26960] = "TypeParameters";
+ ListFormat[ListFormat["Parameters"] = 1360] = "Parameters";
+ ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters";
+ })(ListFormat || (ListFormat = {}));
})(ts || (ts = {}));
var ts;
(function (ts) {
@@ -47876,10 +48076,10 @@ var ts;
var resolutions = [];
var cache = ts.createMap();
for (var _i = 0, names_2 = names; _i < names_2.length; _i++) {
- var name_46 = names_2[_i];
- var result = name_46 in cache
- ? cache[name_46]
- : cache[name_46] = loader(name_46, containingFile);
+ var name_43 = names_2[_i];
+ var result = name_43 in cache
+ ? cache[name_43]
+ : cache[name_43] = loader(name_43, containingFile);
resolutions.push(result);
}
return resolutions;
@@ -48110,7 +48310,7 @@ var ts;
getSourceFiles: program.getSourceFiles,
isSourceFileFromExternalLibrary: function (file) { return !!sourceFilesFoundSearchingNodeModules[file.path]; },
writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }),
- isEmitBlocked: isEmitBlocked
+ isEmitBlocked: isEmitBlocked,
};
}
function getDiagnosticsProducingTypeChecker() {
@@ -48188,7 +48388,7 @@ var ts;
return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken);
}
}
- function getSyntacticDiagnosticsForFile(sourceFile, cancellationToken) {
+ function getSyntacticDiagnosticsForFile(sourceFile) {
return sourceFile.parseDiagnostics;
}
function runWithCancellationToken(func) {
@@ -48209,14 +48409,14 @@ var ts;
ts.Debug.assert(!!sourceFile.bindDiagnostics);
var bindDiagnostics = sourceFile.bindDiagnostics;
var checkDiagnostics = ts.isSourceFileJavaScript(sourceFile) ?
- getJavaScriptSemanticDiagnosticsForFile(sourceFile, cancellationToken) :
+ getJavaScriptSemanticDiagnosticsForFile(sourceFile) :
typeChecker.getDiagnostics(sourceFile, cancellationToken);
var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName);
var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName);
- return bindDiagnostics.concat(checkDiagnostics).concat(fileProcessingDiagnosticsInFile).concat(programDiagnosticsInFile);
+ return bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile);
});
}
- function getJavaScriptSemanticDiagnosticsForFile(sourceFile, cancellationToken) {
+ function getJavaScriptSemanticDiagnosticsForFile(sourceFile) {
return runWithCancellationToken(function () {
var diagnostics = [];
walk(sourceFile);
@@ -48226,16 +48426,16 @@ var ts;
return false;
}
switch (node.kind) {
- case 229:
+ case 230:
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file));
return true;
- case 235:
+ case 236:
if (node.isExportEquals) {
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file));
return true;
}
break;
- case 221:
+ case 222:
var classDeclaration = node;
if (checkModifiers(classDeclaration.modifiers) ||
checkTypeParameters(classDeclaration.typeParameters)) {
@@ -48244,29 +48444,29 @@ var ts;
break;
case 251:
var heritageClause = node;
- if (heritageClause.token === 106) {
+ if (heritageClause.token === 107) {
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file));
return true;
}
break;
- case 222:
+ case 223:
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file));
return true;
- case 225:
+ case 226:
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file));
return true;
- case 223:
+ case 224:
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file));
return true;
- case 147:
- case 146:
case 148:
+ case 147:
case 149:
case 150:
- case 179:
- case 220:
+ case 151:
case 180:
- case 220:
+ case 221:
+ case 181:
+ case 221:
var functionDeclaration = node;
if (checkModifiers(functionDeclaration.modifiers) ||
checkTypeParameters(functionDeclaration.typeParameters) ||
@@ -48274,20 +48474,20 @@ var ts;
return true;
}
break;
- case 200:
+ case 201:
var variableStatement = node;
if (checkModifiers(variableStatement.modifiers)) {
return true;
}
break;
- case 218:
+ case 219:
var variableDeclaration = node;
if (checkTypeAnnotation(variableDeclaration.type)) {
return true;
}
break;
- case 174:
case 175:
+ case 176:
var expression = node;
if (expression.typeArguments && expression.typeArguments.length > 0) {
var start = expression.typeArguments.pos;
@@ -48295,7 +48495,7 @@ var ts;
return true;
}
break;
- case 142:
+ case 143:
var parameter = node;
if (parameter.modifiers) {
var start = parameter.modifiers.pos;
@@ -48311,12 +48511,12 @@ var ts;
return true;
}
break;
- case 145:
+ case 146:
var propertyDeclaration = node;
if (propertyDeclaration.modifiers) {
for (var _i = 0, _a = propertyDeclaration.modifiers; _i < _a.length; _i++) {
var modifier = _a[_i];
- if (modifier.kind !== 113) {
+ if (modifier.kind !== 114) {
diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind)));
return true;
}
@@ -48326,14 +48526,14 @@ var ts;
return true;
}
break;
- case 224:
+ case 225:
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file));
return true;
- case 177:
+ case 178:
var typeAssertionExpression = node;
diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file));
return true;
- case 143:
+ case 144:
if (!options.experimentalDecorators) {
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning));
}
@@ -48361,18 +48561,18 @@ var ts;
for (var _i = 0, modifiers_1 = modifiers; _i < modifiers_1.length; _i++) {
var modifier = modifiers_1[_i];
switch (modifier.kind) {
- case 112:
- case 110:
+ case 113:
case 111:
- case 128:
- case 122:
+ case 112:
+ case 129:
+ case 123:
diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind)));
return true;
- case 113:
- case 82:
- case 74:
- case 77:
- case 115:
+ case 114:
+ case 83:
+ case 75:
+ case 78:
+ case 116:
}
}
}
@@ -48405,7 +48605,7 @@ var ts;
return ts.getBaseFileName(fileName).indexOf(".") >= 0;
}
function processRootFile(fileName, isDefaultLib) {
- processSourceFile(ts.normalizePath(fileName), isDefaultLib, true);
+ processSourceFile(ts.normalizePath(fileName), isDefaultLib);
}
function fileReferenceIsEqualTo(a, b) {
return a.fileName === b.fileName;
@@ -48444,9 +48644,9 @@ var ts;
return;
function collectModuleReferences(node, inAmbientModule) {
switch (node.kind) {
+ case 231:
case 230:
- case 229:
- case 236:
+ case 237:
var moduleNameExpr = ts.getExternalModuleName(node);
if (!moduleNameExpr || moduleNameExpr.kind !== 9) {
break;
@@ -48458,7 +48658,7 @@ var ts;
(imports || (imports = [])).push(moduleNameExpr);
}
break;
- case 225:
+ case 226:
if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2) || ts.isDeclarationFile(file))) {
var moduleName = node.name;
if (isExternalModuleFile || (inAmbientModule && !ts.isExternalModuleNameRelative(moduleName.text))) {
@@ -48485,7 +48685,7 @@ var ts;
}
}
}
- function processSourceFile(fileName, isDefaultLib, isReference, refFile, refPos, refEnd) {
+ function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) {
var diagnosticArgument;
var diagnostic;
if (hasExtension(fileName)) {
@@ -48493,7 +48693,7 @@ var ts;
diagnostic = ts.Diagnostics.File_0_has_unsupported_extension_The_only_supported_extensions_are_1;
diagnosticArgument = [fileName, "'" + supportedExtensions.join("', '") + "'"];
}
- else if (!findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, isReference, refFile, refPos, refEnd)) {
+ else if (!findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd)) {
diagnostic = ts.Diagnostics.File_0_not_found;
diagnosticArgument = [fileName];
}
@@ -48503,13 +48703,13 @@ var ts;
}
}
else {
- var nonTsFile = options.allowNonTsExtensions && findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, isReference, refFile, refPos, refEnd);
+ var nonTsFile = options.allowNonTsExtensions && findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd);
if (!nonTsFile) {
if (options.allowNonTsExtensions) {
diagnostic = ts.Diagnostics.File_0_not_found;
diagnosticArgument = [fileName];
}
- else if (!ts.forEach(supportedExtensions, function (extension) { return findSourceFile(fileName + extension, ts.toPath(fileName + extension, currentDirectory, getCanonicalFileName), isDefaultLib, isReference, refFile, refPos, refEnd); })) {
+ else if (!ts.forEach(supportedExtensions, function (extension) { return findSourceFile(fileName + extension, ts.toPath(fileName + extension, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd); })) {
diagnostic = ts.Diagnostics.File_0_not_found;
fileName += ".ts";
diagnosticArgument = [fileName];
@@ -48533,7 +48733,7 @@ var ts;
fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, existingFileName));
}
}
- function findSourceFile(fileName, path, isDefaultLib, isReference, refFile, refPos, refEnd) {
+ function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd) {
if (filesByName.contains(path)) {
var file_1 = filesByName.get(path);
if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) {
@@ -48542,16 +48742,16 @@ var ts;
if (file_1 && sourceFilesFoundSearchingNodeModules[file_1.path] && currentNodeModulesDepth == 0) {
sourceFilesFoundSearchingNodeModules[file_1.path] = false;
if (!options.noResolve) {
- processReferencedFiles(file_1, ts.getDirectoryPath(fileName), isDefaultLib);
+ processReferencedFiles(file_1, isDefaultLib);
processTypeReferenceDirectives(file_1);
}
modulesWithElidedImports[file_1.path] = false;
- processImportedModules(file_1, ts.getDirectoryPath(fileName));
+ processImportedModules(file_1);
}
else if (file_1 && modulesWithElidedImports[file_1.path]) {
if (currentNodeModulesDepth < maxNodeModulesJsDepth) {
modulesWithElidedImports[file_1.path] = false;
- processImportedModules(file_1, ts.getDirectoryPath(fileName));
+ processImportedModules(file_1);
}
}
return file_1;
@@ -48578,12 +48778,11 @@ var ts;
}
}
skipDefaultLib = skipDefaultLib || file.hasNoDefaultLib;
- var basePath = ts.getDirectoryPath(fileName);
if (!options.noResolve) {
- processReferencedFiles(file, basePath, isDefaultLib);
+ processReferencedFiles(file, isDefaultLib);
processTypeReferenceDirectives(file);
}
- processImportedModules(file, basePath);
+ processImportedModules(file);
if (isDefaultLib) {
files.unshift(file);
}
@@ -48593,10 +48792,10 @@ var ts;
}
return file;
}
- function processReferencedFiles(file, basePath, isDefaultLib) {
+ function processReferencedFiles(file, isDefaultLib) {
ts.forEach(file.referencedFiles, function (ref) {
var referencedFileName = resolveTripleslashReference(ref.fileName, file.fileName);
- processSourceFile(referencedFileName, isDefaultLib, true, file, ref.pos, ref.end);
+ processSourceFile(referencedFileName, isDefaultLib, file, ref.pos, ref.end);
});
}
function processTypeReferenceDirectives(file) {
@@ -48618,7 +48817,7 @@ var ts;
var saveResolution = true;
if (resolvedTypeReferenceDirective) {
if (resolvedTypeReferenceDirective.primary) {
- processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, false, true, refFile, refPos, refEnd);
+ processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, false, refFile, refPos, refEnd);
}
else {
if (previousResolution) {
@@ -48629,7 +48828,7 @@ var ts;
saveResolution = false;
}
else {
- processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, false, true, refFile, refPos, refEnd);
+ processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, false, refFile, refPos, refEnd);
}
}
}
@@ -48655,7 +48854,7 @@ var ts;
function getCanonicalFileName(fileName) {
return host.getCanonicalFileName(fileName);
}
- function processImportedModules(file, basePath) {
+ function processImportedModules(file) {
collectExternalModuleReferences(file);
if (file.imports.length || file.moduleAugmentations.length) {
file.resolvedModules = ts.createMap();
@@ -48675,7 +48874,7 @@ var ts;
modulesWithElidedImports[file.path] = true;
}
else if (shouldAddFile) {
- findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end);
+ findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end);
}
if (isFromNodeModulesSearch) {
currentNodeModulesDepth--;
@@ -48845,7 +49044,7 @@ var ts;
if (!options.noEmit && !options.suppressOutputPathCheck) {
var emitHost = getEmitHost();
var emitFilesSeen_1 = ts.createFileMap(!host.useCaseSensitiveFileNames() ? function (key) { return key.toLocaleLowerCase(); } : undefined);
- ts.forEachExpectedEmitFile(emitHost, function (emitFileNames, sourceFiles, isBundledEmit) {
+ ts.forEachExpectedEmitFile(emitHost, function (emitFileNames) {
verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1);
verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1);
});
@@ -48854,10 +49053,10 @@ var ts;
if (emitFileName) {
var emitFilePath = ts.toPath(emitFileName, currentDirectory, getCanonicalFileName);
if (filesByName.contains(emitFilePath)) {
- createEmitBlockingDiagnostics(emitFileName, emitFilePath, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file);
+ createEmitBlockingDiagnostics(emitFileName, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file);
}
if (emitFilesSeen.contains(emitFilePath)) {
- createEmitBlockingDiagnostics(emitFileName, emitFilePath, ts.Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files);
+ createEmitBlockingDiagnostics(emitFileName, ts.Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files);
}
else {
emitFilesSeen.set(emitFilePath, true);
@@ -48865,7 +49064,7 @@ var ts;
}
}
}
- function createEmitBlockingDiagnostics(emitFileName, emitFilePath, message) {
+ function createEmitBlockingDiagnostics(emitFileName, message) {
hasEmitBlockingDiagnostics.set(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName), true);
programDiagnostics.add(ts.createCompilerDiagnostic(message, emitFileName));
}
@@ -48873,6 +49072,1090 @@ var ts;
ts.createProgram = createProgram;
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" };
+ ts.optionDeclarations = [
+ {
+ name: "charset",
+ type: "string",
+ },
+ ts.compileOnSaveCommandLineOption,
+ {
+ name: "declaration",
+ shortName: "d",
+ type: "boolean",
+ description: ts.Diagnostics.Generates_corresponding_d_ts_file,
+ },
+ {
+ name: "declarationDir",
+ type: "string",
+ isFilePath: true,
+ paramType: ts.Diagnostics.DIRECTORY,
+ },
+ {
+ name: "diagnostics",
+ type: "boolean",
+ },
+ {
+ name: "extendedDiagnostics",
+ type: "boolean",
+ experimental: true
+ },
+ {
+ name: "emitBOM",
+ type: "boolean"
+ },
+ {
+ name: "help",
+ shortName: "h",
+ type: "boolean",
+ description: ts.Diagnostics.Print_this_message,
+ },
+ {
+ name: "help",
+ shortName: "?",
+ type: "boolean"
+ },
+ {
+ name: "init",
+ type: "boolean",
+ description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,
+ },
+ {
+ name: "inlineSourceMap",
+ type: "boolean",
+ },
+ {
+ name: "inlineSources",
+ type: "boolean",
+ },
+ {
+ name: "jsx",
+ type: ts.createMap({
+ "preserve": 1,
+ "react": 2
+ }),
+ paramType: ts.Diagnostics.KIND,
+ description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react,
+ },
+ {
+ name: "reactNamespace",
+ type: "string",
+ description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit
+ },
+ {
+ name: "listFiles",
+ type: "boolean",
+ },
+ {
+ name: "locale",
+ type: "string",
+ },
+ {
+ name: "mapRoot",
+ type: "string",
+ isFilePath: true,
+ description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,
+ paramType: ts.Diagnostics.LOCATION,
+ },
+ {
+ name: "module",
+ shortName: "m",
+ type: ts.createMap({
+ "none": ts.ModuleKind.None,
+ "commonjs": ts.ModuleKind.CommonJS,
+ "amd": ts.ModuleKind.AMD,
+ "system": ts.ModuleKind.System,
+ "umd": ts.ModuleKind.UMD,
+ "es6": ts.ModuleKind.ES2015,
+ "es2015": ts.ModuleKind.ES2015,
+ }),
+ description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015,
+ paramType: ts.Diagnostics.KIND,
+ },
+ {
+ name: "newLine",
+ type: ts.createMap({
+ "crlf": 0,
+ "lf": 1
+ }),
+ description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix,
+ paramType: ts.Diagnostics.NEWLINE,
+ },
+ {
+ name: "noEmit",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_emit_outputs,
+ },
+ {
+ name: "noEmitHelpers",
+ type: "boolean"
+ },
+ {
+ name: "noEmitOnError",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported,
+ },
+ {
+ name: "noErrorTruncation",
+ type: "boolean"
+ },
+ {
+ name: "noImplicitAny",
+ type: "boolean",
+ description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type,
+ },
+ {
+ name: "noImplicitThis",
+ type: "boolean",
+ description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type,
+ },
+ {
+ name: "noUnusedLocals",
+ type: "boolean",
+ description: ts.Diagnostics.Report_errors_on_unused_locals,
+ },
+ {
+ name: "noUnusedParameters",
+ type: "boolean",
+ description: ts.Diagnostics.Report_errors_on_unused_parameters,
+ },
+ {
+ name: "noLib",
+ type: "boolean",
+ },
+ {
+ name: "noResolve",
+ type: "boolean",
+ },
+ {
+ name: "skipDefaultLibCheck",
+ type: "boolean",
+ },
+ {
+ name: "skipLibCheck",
+ type: "boolean",
+ description: ts.Diagnostics.Skip_type_checking_of_declaration_files,
+ },
+ {
+ name: "out",
+ type: "string",
+ isFilePath: false,
+ paramType: ts.Diagnostics.FILE,
+ },
+ {
+ name: "outFile",
+ type: "string",
+ isFilePath: true,
+ description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file,
+ paramType: ts.Diagnostics.FILE,
+ },
+ {
+ name: "outDir",
+ type: "string",
+ isFilePath: true,
+ description: ts.Diagnostics.Redirect_output_structure_to_the_directory,
+ paramType: ts.Diagnostics.DIRECTORY,
+ },
+ {
+ name: "preserveConstEnums",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code
+ },
+ {
+ name: "pretty",
+ description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental,
+ type: "boolean"
+ },
+ {
+ name: "project",
+ shortName: "p",
+ type: "string",
+ isFilePath: true,
+ description: ts.Diagnostics.Compile_the_project_in_the_given_directory,
+ paramType: ts.Diagnostics.DIRECTORY
+ },
+ {
+ name: "removeComments",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_emit_comments_to_output,
+ },
+ {
+ name: "rootDir",
+ type: "string",
+ isFilePath: true,
+ paramType: ts.Diagnostics.LOCATION,
+ description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir,
+ },
+ {
+ name: "isolatedModules",
+ type: "boolean",
+ },
+ {
+ name: "sourceMap",
+ type: "boolean",
+ description: ts.Diagnostics.Generates_corresponding_map_file,
+ },
+ {
+ name: "sourceRoot",
+ type: "string",
+ isFilePath: true,
+ description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations,
+ paramType: ts.Diagnostics.LOCATION,
+ },
+ {
+ name: "suppressExcessPropertyErrors",
+ type: "boolean",
+ description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals,
+ experimental: true
+ },
+ {
+ name: "suppressImplicitAnyIndexErrors",
+ type: "boolean",
+ description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures,
+ },
+ {
+ name: "stripInternal",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation,
+ experimental: true
+ },
+ {
+ name: "target",
+ shortName: "t",
+ type: ts.createMap({
+ "es3": 0,
+ "es5": 1,
+ "es6": 2,
+ "es2015": 2,
+ "es2016": 3,
+ "es2017": 4,
+ }),
+ description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015,
+ paramType: ts.Diagnostics.VERSION,
+ },
+ {
+ name: "version",
+ shortName: "v",
+ type: "boolean",
+ description: ts.Diagnostics.Print_the_compiler_s_version,
+ },
+ {
+ name: "watch",
+ shortName: "w",
+ type: "boolean",
+ description: ts.Diagnostics.Watch_input_files,
+ },
+ {
+ name: "experimentalDecorators",
+ type: "boolean",
+ description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators
+ },
+ {
+ name: "emitDecoratorMetadata",
+ type: "boolean",
+ experimental: true,
+ description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators
+ },
+ {
+ name: "moduleResolution",
+ type: ts.createMap({
+ "node": ts.ModuleResolutionKind.NodeJs,
+ "classic": ts.ModuleResolutionKind.Classic,
+ }),
+ description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6,
+ paramType: ts.Diagnostics.STRATEGY,
+ },
+ {
+ name: "allowUnusedLabels",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_report_errors_on_unused_labels
+ },
+ {
+ name: "noImplicitReturns",
+ type: "boolean",
+ description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value
+ },
+ {
+ name: "noFallthroughCasesInSwitch",
+ type: "boolean",
+ description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement
+ },
+ {
+ name: "allowUnreachableCode",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code
+ },
+ {
+ name: "forceConsistentCasingInFileNames",
+ type: "boolean",
+ description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file
+ },
+ {
+ name: "baseUrl",
+ type: "string",
+ isFilePath: true,
+ description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names
+ },
+ {
+ name: "paths",
+ type: "object",
+ isTSConfigOnly: true
+ },
+ {
+ name: "rootDirs",
+ type: "list",
+ isTSConfigOnly: true,
+ element: {
+ name: "rootDirs",
+ type: "string",
+ isFilePath: true
+ }
+ },
+ {
+ name: "typeRoots",
+ type: "list",
+ element: {
+ name: "typeRoots",
+ type: "string",
+ isFilePath: true
+ }
+ },
+ {
+ name: "types",
+ type: "list",
+ element: {
+ name: "types",
+ type: "string"
+ },
+ description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation
+ },
+ {
+ name: "traceResolution",
+ type: "boolean",
+ description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process
+ },
+ {
+ name: "allowJs",
+ type: "boolean",
+ description: ts.Diagnostics.Allow_javascript_files_to_be_compiled
+ },
+ {
+ name: "allowSyntheticDefaultImports",
+ type: "boolean",
+ description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking
+ },
+ {
+ name: "noImplicitUseStrict",
+ type: "boolean",
+ description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output
+ },
+ {
+ name: "maxNodeModuleJsDepth",
+ type: "number",
+ description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files
+ },
+ {
+ name: "listEmittedFiles",
+ type: "boolean"
+ },
+ {
+ name: "lib",
+ type: "list",
+ element: {
+ name: "lib",
+ type: ts.createMap({
+ "es5": "lib.es5.d.ts",
+ "es6": "lib.es2015.d.ts",
+ "es2015": "lib.es2015.d.ts",
+ "es7": "lib.es2016.d.ts",
+ "es2016": "lib.es2016.d.ts",
+ "es2017": "lib.es2017.d.ts",
+ "dom": "lib.dom.d.ts",
+ "dom.iterable": "lib.dom.iterable.d.ts",
+ "webworker": "lib.webworker.d.ts",
+ "scripthost": "lib.scripthost.d.ts",
+ "es2015.core": "lib.es2015.core.d.ts",
+ "es2015.collection": "lib.es2015.collection.d.ts",
+ "es2015.generator": "lib.es2015.generator.d.ts",
+ "es2015.iterable": "lib.es2015.iterable.d.ts",
+ "es2015.promise": "lib.es2015.promise.d.ts",
+ "es2015.proxy": "lib.es2015.proxy.d.ts",
+ "es2015.reflect": "lib.es2015.reflect.d.ts",
+ "es2015.symbol": "lib.es2015.symbol.d.ts",
+ "es2015.symbol.wellknown": "lib.es2015.symbol.wellknown.d.ts",
+ "es2016.array.include": "lib.es2016.array.include.d.ts",
+ "es2017.object": "lib.es2017.object.d.ts",
+ "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts"
+ }),
+ },
+ description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon
+ },
+ {
+ name: "disableSizeLimit",
+ type: "boolean"
+ },
+ {
+ name: "strictNullChecks",
+ type: "boolean",
+ description: ts.Diagnostics.Enable_strict_null_checks
+ },
+ {
+ name: "importHelpers",
+ type: "boolean",
+ description: ts.Diagnostics.Import_emit_helpers_from_tslib
+ },
+ {
+ name: "alwaysStrict",
+ type: "boolean",
+ description: ts.Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file
+ }
+ ];
+ ts.typingOptionDeclarations = [
+ {
+ name: "enableAutoDiscovery",
+ type: "boolean",
+ },
+ {
+ name: "include",
+ type: "list",
+ element: {
+ name: "include",
+ type: "string"
+ }
+ },
+ {
+ name: "exclude",
+ type: "list",
+ element: {
+ name: "exclude",
+ type: "string"
+ }
+ }
+ ];
+ ts.defaultInitCompilerOptions = {
+ module: ts.ModuleKind.CommonJS,
+ target: 1,
+ noImplicitAny: false,
+ sourceMap: false,
+ };
+ var optionNameMapCache;
+ function getOptionNameMap() {
+ if (optionNameMapCache) {
+ return optionNameMapCache;
+ }
+ var optionNameMap = ts.createMap();
+ var shortOptionNames = ts.createMap();
+ ts.forEach(ts.optionDeclarations, function (option) {
+ optionNameMap[option.name.toLowerCase()] = option;
+ if (option.shortName) {
+ shortOptionNames[option.shortName] = option.name;
+ }
+ });
+ optionNameMapCache = { optionNameMap: optionNameMap, shortOptionNames: shortOptionNames };
+ return optionNameMapCache;
+ }
+ ts.getOptionNameMap = getOptionNameMap;
+ function createCompilerDiagnosticForInvalidCustomType(opt) {
+ var namesOfType = Object.keys(opt.type).map(function (key) { return "'" + key + "'"; }).join(", ");
+ return ts.createCompilerDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
+ }
+ ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
+ function parseCustomTypeOption(opt, value, errors) {
+ var key = trimString((value || "")).toLowerCase();
+ var map = opt.type;
+ if (key in map) {
+ return map[key];
+ }
+ else {
+ errors.push(createCompilerDiagnosticForInvalidCustomType(opt));
+ }
+ }
+ ts.parseCustomTypeOption = parseCustomTypeOption;
+ function parseListTypeOption(opt, value, errors) {
+ if (value === void 0) { value = ""; }
+ value = trimString(value);
+ if (ts.startsWith(value, "-")) {
+ return undefined;
+ }
+ if (value === "") {
+ return [];
+ }
+ var values = value.split(",");
+ switch (opt.element.type) {
+ case "number":
+ return ts.map(values, parseInt);
+ case "string":
+ return ts.map(values, function (v) { return v || ""; });
+ default:
+ return ts.filter(ts.map(values, function (v) { return parseCustomTypeOption(opt.element, v, errors); }), function (v) { return !!v; });
+ }
+ }
+ ts.parseListTypeOption = parseListTypeOption;
+ function parseCommandLine(commandLine, readFile) {
+ var options = {};
+ var fileNames = [];
+ var errors = [];
+ var _a = getOptionNameMap(), optionNameMap = _a.optionNameMap, shortOptionNames = _a.shortOptionNames;
+ parseStrings(commandLine);
+ return {
+ options: options,
+ fileNames: fileNames,
+ errors: errors
+ };
+ function parseStrings(args) {
+ var i = 0;
+ while (i < args.length) {
+ var s = args[i];
+ i++;
+ if (s.charCodeAt(0) === 64) {
+ parseResponseFile(s.slice(1));
+ }
+ else if (s.charCodeAt(0) === 45) {
+ s = s.slice(s.charCodeAt(1) === 45 ? 2 : 1).toLowerCase();
+ if (s in shortOptionNames) {
+ s = shortOptionNames[s];
+ }
+ if (s in optionNameMap) {
+ var opt = optionNameMap[s];
+ if (opt.isTSConfigOnly) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name));
+ }
+ else {
+ if (!args[i] && opt.type !== "boolean") {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_expects_an_argument, opt.name));
+ }
+ switch (opt.type) {
+ case "number":
+ options[opt.name] = parseInt(args[i]);
+ i++;
+ break;
+ case "boolean":
+ options[opt.name] = true;
+ break;
+ case "string":
+ options[opt.name] = args[i] || "";
+ i++;
+ break;
+ case "list":
+ var result = parseListTypeOption(opt, args[i], errors);
+ options[opt.name] = result || [];
+ if (result) {
+ i++;
+ }
+ break;
+ default:
+ options[opt.name] = parseCustomTypeOption(opt, args[i], errors);
+ i++;
+ break;
+ }
+ }
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_compiler_option_0, s));
+ }
+ }
+ else {
+ fileNames.push(s);
+ }
+ }
+ }
+ function parseResponseFile(fileName) {
+ var text = readFile ? readFile(fileName) : ts.sys.readFile(fileName);
+ if (!text) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, fileName));
+ return;
+ }
+ var args = [];
+ var pos = 0;
+ while (true) {
+ while (pos < text.length && text.charCodeAt(pos) <= 32)
+ pos++;
+ if (pos >= text.length)
+ break;
+ var start = pos;
+ if (text.charCodeAt(start) === 34) {
+ pos++;
+ while (pos < text.length && text.charCodeAt(pos) !== 34)
+ pos++;
+ if (pos < text.length) {
+ args.push(text.substring(start + 1, pos));
+ pos++;
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unterminated_quoted_string_in_response_file_0, fileName));
+ }
+ }
+ else {
+ while (text.charCodeAt(pos) > 32)
+ pos++;
+ args.push(text.substring(start, pos));
+ }
+ }
+ parseStrings(args);
+ }
+ }
+ ts.parseCommandLine = parseCommandLine;
+ function readConfigFile(fileName, readFile) {
+ var text = "";
+ try {
+ text = readFile(fileName);
+ }
+ catch (e) {
+ return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) };
+ }
+ return parseConfigFileTextToJson(fileName, text);
+ }
+ ts.readConfigFile = readConfigFile;
+ function parseConfigFileTextToJson(fileName, jsonText, stripComments) {
+ if (stripComments === void 0) { stripComments = true; }
+ try {
+ var jsonTextToParse = stripComments ? removeComments(jsonText) : jsonText;
+ return { config: /\S/.test(jsonTextToParse) ? JSON.parse(jsonTextToParse) : {} };
+ }
+ catch (e) {
+ return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Failed_to_parse_file_0_Colon_1, fileName, e.message) };
+ }
+ }
+ ts.parseConfigFileTextToJson = parseConfigFileTextToJson;
+ function generateTSConfig(options, fileNames) {
+ var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions);
+ var configurations = {
+ compilerOptions: serializeCompilerOptions(compilerOptions)
+ };
+ if (fileNames && fileNames.length) {
+ configurations.files = fileNames;
+ }
+ return configurations;
+ function getCustomTypeMapOfCommandLineOption(optionDefinition) {
+ if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") {
+ return undefined;
+ }
+ else if (optionDefinition.type === "list") {
+ return getCustomTypeMapOfCommandLineOption(optionDefinition.element);
+ }
+ else {
+ return optionDefinition.type;
+ }
+ }
+ function getNameOfCompilerOptionValue(value, customTypeMap) {
+ for (var key in customTypeMap) {
+ if (customTypeMap[key] === value) {
+ return key;
+ }
+ }
+ return undefined;
+ }
+ function serializeCompilerOptions(options) {
+ var result = ts.createMap();
+ var optionsNameMap = getOptionNameMap().optionNameMap;
+ for (var name_44 in options) {
+ if (ts.hasProperty(options, name_44)) {
+ switch (name_44) {
+ case "init":
+ case "watch":
+ case "version":
+ case "help":
+ case "project":
+ break;
+ default:
+ var value = options[name_44];
+ var optionDefinition = optionsNameMap[name_44.toLowerCase()];
+ if (optionDefinition) {
+ var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition);
+ if (!customTypeMap) {
+ result[name_44] = value;
+ }
+ else {
+ if (optionDefinition.type === "list") {
+ var convertedValue = [];
+ for (var _i = 0, _a = value; _i < _a.length; _i++) {
+ var element = _a[_i];
+ convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap));
+ }
+ result[name_44] = convertedValue;
+ }
+ else {
+ result[name_44] = getNameOfCompilerOptionValue(value, customTypeMap);
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+ return result;
+ }
+ }
+ ts.generateTSConfig = generateTSConfig;
+ function removeComments(jsonText) {
+ var output = "";
+ var scanner = ts.createScanner(1, false, 0, jsonText);
+ var token;
+ while ((token = scanner.scan()) !== 1) {
+ switch (token) {
+ case 2:
+ case 3:
+ output += scanner.getTokenText().replace(/\S/g, " ");
+ break;
+ default:
+ output += scanner.getTokenText();
+ break;
+ }
+ }
+ return output;
+ }
+ function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack) {
+ if (existingOptions === void 0) { existingOptions = {}; }
+ if (resolutionStack === void 0) { resolutionStack = []; }
+ var errors = [];
+ var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames);
+ var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName);
+ if (resolutionStack.indexOf(resolvedPath) >= 0) {
+ return {
+ options: {},
+ fileNames: [],
+ typingOptions: {},
+ raw: json,
+ errors: [ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> "))],
+ wildcardDirectories: {}
+ };
+ }
+ var options = convertCompilerOptionsFromJsonWorker(json["compilerOptions"], basePath, errors, configFileName);
+ var typingOptions = convertTypingOptionsFromJsonWorker(json["typingOptions"], basePath, errors, configFileName);
+ if (json["extends"]) {
+ var _a = [undefined, undefined, undefined, {}], include = _a[0], exclude = _a[1], files = _a[2], baseOptions = _a[3];
+ if (typeof json["extends"] === "string") {
+ _b = (tryExtendsName(json["extends"]) || [include, exclude, files, baseOptions]), include = _b[0], exclude = _b[1], files = _b[2], baseOptions = _b[3];
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", "string"));
+ }
+ if (include && !json["include"]) {
+ json["include"] = include;
+ }
+ if (exclude && !json["exclude"]) {
+ json["exclude"] = exclude;
+ }
+ if (files && !json["files"]) {
+ json["files"] = files;
+ }
+ options = ts.assign({}, baseOptions, options);
+ }
+ options = ts.extend(existingOptions, options);
+ options.configFilePath = configFileName;
+ var _c = getFileNames(errors), fileNames = _c.fileNames, wildcardDirectories = _c.wildcardDirectories;
+ var compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors);
+ return {
+ options: options,
+ fileNames: fileNames,
+ typingOptions: typingOptions,
+ raw: json,
+ errors: errors,
+ wildcardDirectories: wildcardDirectories,
+ compileOnSave: compileOnSave
+ };
+ function tryExtendsName(extendedConfig) {
+ if (!(ts.isRootedDiskPath(extendedConfig) || ts.startsWith(ts.normalizeSlashes(extendedConfig), "./") || ts.startsWith(ts.normalizeSlashes(extendedConfig), "../"))) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.The_path_in_an_extends_options_must_be_relative_or_rooted));
+ return;
+ }
+ var extendedConfigPath = ts.toPath(extendedConfig, basePath, getCanonicalFileName);
+ if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json")) {
+ extendedConfigPath = extendedConfigPath + ".json";
+ if (!host.fileExists(extendedConfigPath)) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_does_not_exist, extendedConfig));
+ return;
+ }
+ }
+ var extendedResult = readConfigFile(extendedConfigPath, function (path) { return host.readFile(path); });
+ if (extendedResult.error) {
+ errors.push(extendedResult.error);
+ return;
+ }
+ var extendedDirname = ts.getDirectoryPath(extendedConfigPath);
+ var relativeDifference = ts.convertToRelativePath(extendedDirname, basePath, getCanonicalFileName);
+ var updatePath = function (path) { return ts.isRootedDiskPath(path) ? path : ts.combinePaths(relativeDifference, path); };
+ var result = parseJsonConfigFileContent(extendedResult.config, host, extendedDirname, undefined, ts.getBaseFileName(extendedConfigPath), resolutionStack.concat([resolvedPath]));
+ errors.push.apply(errors, result.errors);
+ var _a = ts.map(["include", "exclude", "files"], function (key) {
+ if (!json[key] && extendedResult.config[key]) {
+ return ts.map(extendedResult.config[key], updatePath);
+ }
+ }), include = _a[0], exclude = _a[1], files = _a[2];
+ return [include, exclude, files, result.options];
+ }
+ function getFileNames(errors) {
+ var fileNames;
+ if (ts.hasProperty(json, "files")) {
+ if (ts.isArray(json["files"])) {
+ fileNames = json["files"];
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "files", "Array"));
+ }
+ }
+ var includeSpecs;
+ if (ts.hasProperty(json, "include")) {
+ if (ts.isArray(json["include"])) {
+ includeSpecs = json["include"];
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "include", "Array"));
+ }
+ }
+ var excludeSpecs;
+ if (ts.hasProperty(json, "exclude")) {
+ if (ts.isArray(json["exclude"])) {
+ excludeSpecs = json["exclude"];
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "exclude", "Array"));
+ }
+ }
+ else if (ts.hasProperty(json, "excludes")) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));
+ }
+ else {
+ excludeSpecs = ["node_modules", "bower_components", "jspm_packages"];
+ var outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"];
+ if (outDir) {
+ excludeSpecs.push(outDir);
+ }
+ }
+ if (fileNames === undefined && includeSpecs === undefined) {
+ includeSpecs = ["**/*"];
+ }
+ return matchFileNames(fileNames, includeSpecs, excludeSpecs, basePath, options, host, errors);
+ }
+ var _b;
+ }
+ ts.parseJsonConfigFileContent = parseJsonConfigFileContent;
+ function convertCompileOnSaveOptionFromJson(jsonOption, basePath, errors) {
+ if (!ts.hasProperty(jsonOption, ts.compileOnSaveCommandLineOption.name)) {
+ return false;
+ }
+ var result = convertJsonOption(ts.compileOnSaveCommandLineOption, jsonOption["compileOnSave"], basePath, errors);
+ if (typeof result === "boolean" && result) {
+ return result;
+ }
+ return false;
+ }
+ ts.convertCompileOnSaveOptionFromJson = convertCompileOnSaveOptionFromJson;
+ function convertCompilerOptionsFromJson(jsonOptions, basePath, configFileName) {
+ var errors = [];
+ var options = convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName);
+ return { options: options, errors: errors };
+ }
+ ts.convertCompilerOptionsFromJson = convertCompilerOptionsFromJson;
+ function convertTypingOptionsFromJson(jsonOptions, basePath, configFileName) {
+ var errors = [];
+ var options = convertTypingOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName);
+ return { options: options, errors: errors };
+ }
+ ts.convertTypingOptionsFromJson = convertTypingOptionsFromJson;
+ function convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) {
+ var options = ts.getBaseFileName(configFileName) === "jsconfig.json"
+ ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true }
+ : {};
+ convertOptionsFromJson(ts.optionDeclarations, jsonOptions, basePath, options, ts.Diagnostics.Unknown_compiler_option_0, errors);
+ return options;
+ }
+ function convertTypingOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) {
+ var options = ts.getBaseFileName(configFileName) === "jsconfig.json"
+ ? { enableAutoDiscovery: true, include: [], exclude: [] }
+ : { enableAutoDiscovery: false, include: [], exclude: [] };
+ convertOptionsFromJson(ts.typingOptionDeclarations, jsonOptions, basePath, options, ts.Diagnostics.Unknown_typing_option_0, errors);
+ return options;
+ }
+ function convertOptionsFromJson(optionDeclarations, jsonOptions, basePath, defaultOptions, diagnosticMessage, errors) {
+ if (!jsonOptions) {
+ return;
+ }
+ var optionNameMap = ts.arrayToMap(optionDeclarations, function (opt) { return opt.name; });
+ for (var id in jsonOptions) {
+ if (id in optionNameMap) {
+ var opt = optionNameMap[id];
+ defaultOptions[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors);
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(diagnosticMessage, id));
+ }
+ }
+ }
+ function convertJsonOption(opt, value, basePath, errors) {
+ var optType = opt.type;
+ var expectedType = typeof optType === "string" ? optType : "string";
+ if (optType === "list" && ts.isArray(value)) {
+ return convertJsonOptionOfListType(opt, value, basePath, errors);
+ }
+ else if (typeof value === expectedType) {
+ if (typeof optType !== "string") {
+ return convertJsonOptionOfCustomType(opt, value, errors);
+ }
+ else {
+ if (opt.isFilePath) {
+ value = ts.normalizePath(ts.combinePaths(basePath, value));
+ if (value === "") {
+ value = ".";
+ }
+ }
+ }
+ return value;
+ }
+ else {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, opt.name, expectedType));
+ }
+ }
+ function convertJsonOptionOfCustomType(opt, value, errors) {
+ var key = value.toLowerCase();
+ if (key in opt.type) {
+ return opt.type[key];
+ }
+ else {
+ errors.push(createCompilerDiagnosticForInvalidCustomType(opt));
+ }
+ }
+ function convertJsonOptionOfListType(option, values, basePath, errors) {
+ return ts.filter(ts.map(values, function (v) { return convertJsonOption(option.element, v, basePath, errors); }), function (v) { return !!v; });
+ }
+ function trimString(s) {
+ return typeof s.trim === "function" ? s.trim() : s.replace(/^[\s]+|[\s]+$/g, "");
+ }
+ var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/;
+ var invalidMultipleRecursionPatterns = /(^|\/)\*\*\/(.*\/)?\*\*($|\/)/;
+ var invalidDotDotAfterRecursiveWildcardPattern = /(^|\/)\*\*\/(.*\/)?\.\.($|\/)/;
+ var watchRecursivePattern = /\/[^/]*?[*?][^/]*\//;
+ var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/;
+ function matchFileNames(fileNames, include, exclude, basePath, options, host, errors) {
+ basePath = ts.normalizePath(basePath);
+ var keyMapper = host.useCaseSensitiveFileNames ? caseSensitiveKeyMapper : caseInsensitiveKeyMapper;
+ var literalFileMap = ts.createMap();
+ var wildcardFileMap = ts.createMap();
+ if (include) {
+ include = validateSpecs(include, errors, false);
+ }
+ if (exclude) {
+ exclude = validateSpecs(exclude, errors, true);
+ }
+ var wildcardDirectories = getWildcardDirectories(include, exclude, basePath, host.useCaseSensitiveFileNames);
+ var supportedExtensions = ts.getSupportedExtensions(options);
+ if (fileNames) {
+ for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) {
+ var fileName = fileNames_1[_i];
+ var file = ts.combinePaths(basePath, fileName);
+ literalFileMap[keyMapper(file)] = file;
+ }
+ }
+ if (include && include.length > 0) {
+ for (var _a = 0, _b = host.readDirectory(basePath, supportedExtensions, exclude, include); _a < _b.length; _a++) {
+ var file = _b[_a];
+ if (hasFileWithHigherPriorityExtension(file, literalFileMap, wildcardFileMap, supportedExtensions, keyMapper)) {
+ continue;
+ }
+ removeWildcardFilesWithLowerPriorityExtension(file, wildcardFileMap, supportedExtensions, keyMapper);
+ var key = keyMapper(file);
+ if (!(key in literalFileMap) && !(key in wildcardFileMap)) {
+ wildcardFileMap[key] = file;
+ }
+ }
+ }
+ var literalFiles = ts.reduceProperties(literalFileMap, addFileToOutput, []);
+ var wildcardFiles = ts.reduceProperties(wildcardFileMap, addFileToOutput, []);
+ wildcardFiles.sort(host.useCaseSensitiveFileNames ? ts.compareStrings : ts.compareStringsCaseInsensitive);
+ return {
+ fileNames: literalFiles.concat(wildcardFiles),
+ wildcardDirectories: wildcardDirectories
+ };
+ }
+ function validateSpecs(specs, errors, allowTrailingRecursion) {
+ var validSpecs = [];
+ for (var _i = 0, specs_2 = specs; _i < specs_2.length; _i++) {
+ var spec = specs_2[_i];
+ if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec));
+ }
+ else if (invalidMultipleRecursionPatterns.test(spec)) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0, spec));
+ }
+ else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) {
+ errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec));
+ }
+ else {
+ validSpecs.push(spec);
+ }
+ }
+ return validSpecs;
+ }
+ function getWildcardDirectories(include, exclude, path, useCaseSensitiveFileNames) {
+ var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude");
+ var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i");
+ var wildcardDirectories = ts.createMap();
+ if (include !== undefined) {
+ var recursiveKeys = [];
+ for (var _i = 0, include_1 = include; _i < include_1.length; _i++) {
+ var file = include_1[_i];
+ var name_45 = ts.normalizePath(ts.combinePaths(path, file));
+ if (excludeRegex && excludeRegex.test(name_45)) {
+ continue;
+ }
+ var match = wildcardDirectoryPattern.exec(name_45);
+ if (match) {
+ var key = useCaseSensitiveFileNames ? match[0] : match[0].toLowerCase();
+ var flags = watchRecursivePattern.test(name_45) ? 1 : 0;
+ var existingFlags = wildcardDirectories[key];
+ if (existingFlags === undefined || existingFlags < flags) {
+ wildcardDirectories[key] = flags;
+ if (flags === 1) {
+ recursiveKeys.push(key);
+ }
+ }
+ }
+ }
+ for (var key in wildcardDirectories) {
+ for (var _a = 0, recursiveKeys_1 = recursiveKeys; _a < recursiveKeys_1.length; _a++) {
+ var recursiveKey = recursiveKeys_1[_a];
+ if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) {
+ delete wildcardDirectories[key];
+ }
+ }
+ }
+ }
+ return wildcardDirectories;
+ }
+ function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) {
+ var extensionPriority = ts.getExtensionPriority(file, extensions);
+ var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority);
+ for (var i = 0; i < adjustedExtensionPriority; i++) {
+ var higherPriorityExtension = extensions[i];
+ var higherPriorityPath = keyMapper(ts.changeExtension(file, higherPriorityExtension));
+ if (higherPriorityPath in literalFiles || higherPriorityPath in wildcardFiles) {
+ return true;
+ }
+ }
+ return false;
+ }
+ function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) {
+ var extensionPriority = ts.getExtensionPriority(file, extensions);
+ var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority);
+ for (var i = nextExtensionPriority; i < extensions.length; i++) {
+ var lowerPriorityExtension = extensions[i];
+ var lowerPriorityPath = keyMapper(ts.changeExtension(file, lowerPriorityExtension));
+ delete wildcardFiles[lowerPriorityPath];
+ }
+ }
+ function addFileToOutput(output, file) {
+ output.push(file);
+ return output;
+ }
+ function caseSensitiveKeyMapper(key) {
+ return key;
+ }
+ function caseInsensitiveKeyMapper(key) {
+ return key.toLowerCase();
+ }
+})(ts || (ts = {}));
+var ts;
(function (ts) {
var ScriptSnapshot;
(function (ScriptSnapshot) {
@@ -48886,7 +50169,7 @@ var ts;
StringScriptSnapshot.prototype.getLength = function () {
return this.text.length;
};
- StringScriptSnapshot.prototype.getChangeRange = function (oldSnapshot) {
+ StringScriptSnapshot.prototype.getChangeRange = function () {
return undefined;
};
return StringScriptSnapshot;
@@ -48940,6 +50223,22 @@ var ts;
SymbolDisplayPartKind[SymbolDisplayPartKind["regularExpressionLiteral"] = 21] = "regularExpressionLiteral";
})(ts.SymbolDisplayPartKind || (ts.SymbolDisplayPartKind = {}));
var SymbolDisplayPartKind = ts.SymbolDisplayPartKind;
+ (function (OutputFileType) {
+ OutputFileType[OutputFileType["JavaScript"] = 0] = "JavaScript";
+ OutputFileType[OutputFileType["SourceMap"] = 1] = "SourceMap";
+ OutputFileType[OutputFileType["Declaration"] = 2] = "Declaration";
+ })(ts.OutputFileType || (ts.OutputFileType = {}));
+ var OutputFileType = ts.OutputFileType;
+ (function (EndOfLineState) {
+ EndOfLineState[EndOfLineState["None"] = 0] = "None";
+ EndOfLineState[EndOfLineState["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia";
+ EndOfLineState[EndOfLineState["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral";
+ EndOfLineState[EndOfLineState["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral";
+ EndOfLineState[EndOfLineState["InTemplateHeadOrNoSubstitutionTemplate"] = 4] = "InTemplateHeadOrNoSubstitutionTemplate";
+ EndOfLineState[EndOfLineState["InTemplateMiddleOrTail"] = 5] = "InTemplateMiddleOrTail";
+ EndOfLineState[EndOfLineState["InTemplateSubstitutionPosition"] = 6] = "InTemplateSubstitutionPosition";
+ })(ts.EndOfLineState || (ts.EndOfLineState = {}));
+ var EndOfLineState = ts.EndOfLineState;
(function (TokenClass) {
TokenClass[TokenClass["Punctuation"] = 0] = "Punctuation";
TokenClass[TokenClass["Keyword"] = 1] = "Keyword";
@@ -49027,40 +50326,75 @@ var ts;
ClassificationTypeNames.jsxText = "jsx text";
ClassificationTypeNames.jsxAttributeStringLiteralValue = "jsx attribute string literal value";
ts.ClassificationTypeNames = ClassificationTypeNames;
+ (function (ClassificationType) {
+ ClassificationType[ClassificationType["comment"] = 1] = "comment";
+ ClassificationType[ClassificationType["identifier"] = 2] = "identifier";
+ ClassificationType[ClassificationType["keyword"] = 3] = "keyword";
+ ClassificationType[ClassificationType["numericLiteral"] = 4] = "numericLiteral";
+ ClassificationType[ClassificationType["operator"] = 5] = "operator";
+ ClassificationType[ClassificationType["stringLiteral"] = 6] = "stringLiteral";
+ ClassificationType[ClassificationType["regularExpressionLiteral"] = 7] = "regularExpressionLiteral";
+ ClassificationType[ClassificationType["whiteSpace"] = 8] = "whiteSpace";
+ ClassificationType[ClassificationType["text"] = 9] = "text";
+ ClassificationType[ClassificationType["punctuation"] = 10] = "punctuation";
+ ClassificationType[ClassificationType["className"] = 11] = "className";
+ ClassificationType[ClassificationType["enumName"] = 12] = "enumName";
+ ClassificationType[ClassificationType["interfaceName"] = 13] = "interfaceName";
+ ClassificationType[ClassificationType["moduleName"] = 14] = "moduleName";
+ ClassificationType[ClassificationType["typeParameterName"] = 15] = "typeParameterName";
+ ClassificationType[ClassificationType["typeAliasName"] = 16] = "typeAliasName";
+ ClassificationType[ClassificationType["parameterName"] = 17] = "parameterName";
+ ClassificationType[ClassificationType["docCommentTagName"] = 18] = "docCommentTagName";
+ ClassificationType[ClassificationType["jsxOpenTagName"] = 19] = "jsxOpenTagName";
+ ClassificationType[ClassificationType["jsxCloseTagName"] = 20] = "jsxCloseTagName";
+ ClassificationType[ClassificationType["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName";
+ ClassificationType[ClassificationType["jsxAttribute"] = 22] = "jsxAttribute";
+ ClassificationType[ClassificationType["jsxText"] = 23] = "jsxText";
+ ClassificationType[ClassificationType["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue";
+ })(ts.ClassificationType || (ts.ClassificationType = {}));
+ var ClassificationType = ts.ClassificationType;
})(ts || (ts = {}));
var ts;
(function (ts) {
- ts.scanner = ts.createScanner(2, true);
+ ts.scanner = ts.createScanner(4, true);
ts.emptyArray = [];
+ (function (SemanticMeaning) {
+ SemanticMeaning[SemanticMeaning["None"] = 0] = "None";
+ SemanticMeaning[SemanticMeaning["Value"] = 1] = "Value";
+ SemanticMeaning[SemanticMeaning["Type"] = 2] = "Type";
+ SemanticMeaning[SemanticMeaning["Namespace"] = 4] = "Namespace";
+ SemanticMeaning[SemanticMeaning["All"] = 7] = "All";
+ })(ts.SemanticMeaning || (ts.SemanticMeaning = {}));
+ var SemanticMeaning = ts.SemanticMeaning;
function getMeaningFromDeclaration(node) {
switch (node.kind) {
- case 142:
- case 218:
- case 169:
+ case 143:
+ case 219:
+ case 170:
+ case 146:
case 145:
- case 144:
case 253:
case 254:
case 255:
- case 147:
- case 146:
case 148:
+ case 147:
case 149:
case 150:
- case 220:
- case 179:
+ case 151:
+ case 221:
case 180:
+ case 181:
case 252:
return 1;
- case 141:
- case 222:
+ case 142:
case 223:
- case 159:
- return 2;
- case 221:
case 224:
- return 1 | 2;
+ case 160:
+ return 2;
+ case 222:
case 225:
+ return 1 | 2;
+ case 226:
if (ts.isAmbientModule(node)) {
return 4 | 1;
}
@@ -49070,12 +50404,12 @@ var ts;
else {
return 4;
}
- case 233:
case 234:
- case 229:
- case 230:
case 235:
+ case 230:
+ case 231:
case 236:
+ case 237:
return 1 | 2 | 4;
case 256:
return 4 | 1;
@@ -49084,7 +50418,7 @@ var ts;
}
ts.getMeaningFromDeclaration = getMeaningFromDeclaration;
function getMeaningFromLocation(node) {
- if (node.parent.kind === 235) {
+ if (node.parent.kind === 236) {
return 1 | 2 | 4;
}
else if (isInRightSideOfImport(node)) {
@@ -49105,16 +50439,16 @@ var ts;
}
ts.getMeaningFromLocation = getMeaningFromLocation;
function getMeaningFromRightHandSideOfImportEquals(node) {
- ts.Debug.assert(node.kind === 69);
- if (node.parent.kind === 139 &&
+ ts.Debug.assert(node.kind === 70);
+ if (node.parent.kind === 140 &&
node.parent.right === node &&
- node.parent.parent.kind === 229) {
+ node.parent.parent.kind === 230) {
return 1 | 2 | 4;
}
return 4;
}
function isInRightSideOfImport(node) {
- while (node.parent.kind === 139) {
+ while (node.parent.kind === 140) {
node = node.parent;
}
return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node;
@@ -49125,27 +50459,27 @@ var ts;
function isQualifiedNameNamespaceReference(node) {
var root = node;
var isLastClause = true;
- if (root.parent.kind === 139) {
- while (root.parent && root.parent.kind === 139) {
+ if (root.parent.kind === 140) {
+ while (root.parent && root.parent.kind === 140) {
root = root.parent;
}
isLastClause = root.right === node;
}
- return root.parent.kind === 155 && !isLastClause;
+ return root.parent.kind === 156 && !isLastClause;
}
function isPropertyAccessNamespaceReference(node) {
var root = node;
var isLastClause = true;
- if (root.parent.kind === 172) {
- while (root.parent && root.parent.kind === 172) {
+ if (root.parent.kind === 173) {
+ while (root.parent && root.parent.kind === 173) {
root = root.parent;
}
isLastClause = root.name === node;
}
- if (!isLastClause && root.parent.kind === 194 && root.parent.parent.kind === 251) {
+ if (!isLastClause && root.parent.kind === 195 && root.parent.parent.kind === 251) {
var decl = root.parent.parent.parent;
- return (decl.kind === 221 && root.parent.parent.token === 106) ||
- (decl.kind === 222 && root.parent.parent.token === 83);
+ return (decl.kind === 222 && root.parent.parent.token === 107) ||
+ (decl.kind === 223 && root.parent.parent.token === 84);
}
return false;
}
@@ -49153,17 +50487,17 @@ var ts;
if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) {
node = node.parent;
}
- return node.parent.kind === 155 ||
- (node.parent.kind === 194 && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) ||
- (node.kind === 97 && !ts.isPartOfExpression(node)) ||
- node.kind === 165;
+ return node.parent.kind === 156 ||
+ (node.parent.kind === 195 && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) ||
+ (node.kind === 98 && !ts.isPartOfExpression(node)) ||
+ node.kind === 166;
}
function isCallExpressionTarget(node) {
- return isCallOrNewExpressionTarget(node, 174);
+ return isCallOrNewExpressionTarget(node, 175);
}
ts.isCallExpressionTarget = isCallExpressionTarget;
function isNewExpressionTarget(node) {
- return isCallOrNewExpressionTarget(node, 175);
+ return isCallOrNewExpressionTarget(node, 176);
}
ts.isNewExpressionTarget = isNewExpressionTarget;
function isCallOrNewExpressionTarget(node, kind) {
@@ -49176,7 +50510,7 @@ var ts;
ts.climbPastPropertyAccess = climbPastPropertyAccess;
function getTargetLabel(referenceNode, labelName) {
while (referenceNode) {
- if (referenceNode.kind === 214 && referenceNode.label.text === labelName) {
+ if (referenceNode.kind === 215 && referenceNode.label.text === labelName) {
return referenceNode.label;
}
referenceNode = referenceNode.parent;
@@ -49185,14 +50519,14 @@ var ts;
}
ts.getTargetLabel = getTargetLabel;
function isJumpStatementTarget(node) {
- return node.kind === 69 &&
- (node.parent.kind === 210 || node.parent.kind === 209) &&
+ return node.kind === 70 &&
+ (node.parent.kind === 211 || node.parent.kind === 210) &&
node.parent.label === node;
}
ts.isJumpStatementTarget = isJumpStatementTarget;
function isLabelOfLabeledStatement(node) {
- return node.kind === 69 &&
- node.parent.kind === 214 &&
+ return node.kind === 70 &&
+ node.parent.kind === 215 &&
node.parent.label === node;
}
function isLabelName(node) {
@@ -49200,38 +50534,38 @@ var ts;
}
ts.isLabelName = isLabelName;
function isRightSideOfQualifiedName(node) {
- return node.parent.kind === 139 && node.parent.right === node;
+ return node.parent.kind === 140 && node.parent.right === node;
}
ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName;
function isRightSideOfPropertyAccess(node) {
- return node && node.parent && node.parent.kind === 172 && node.parent.name === node;
+ return node && node.parent && node.parent.kind === 173 && node.parent.name === node;
}
ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess;
function isNameOfModuleDeclaration(node) {
- return node.parent.kind === 225 && node.parent.name === node;
+ return node.parent.kind === 226 && node.parent.name === node;
}
ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration;
function isNameOfFunctionDeclaration(node) {
- return node.kind === 69 &&
+ return node.kind === 70 &&
ts.isFunctionLike(node.parent) && node.parent.name === node;
}
ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration;
function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) {
if (node.kind === 9 || node.kind === 8) {
switch (node.parent.kind) {
+ case 146:
case 145:
- case 144:
case 253:
case 255:
+ case 148:
case 147:
- case 146:
- case 149:
case 150:
- case 225:
+ case 151:
+ case 226:
return node.parent.name === node;
- case 173:
+ case 174:
return node.parent.argumentExpression === node;
- case 140:
+ case 141:
return true;
}
}
@@ -49276,16 +50610,16 @@ var ts;
}
switch (node.kind) {
case 256:
+ case 148:
case 147:
- case 146:
- case 220:
- case 179:
- case 149:
- case 150:
case 221:
+ case 180:
+ case 150:
+ case 151:
case 222:
- case 224:
+ case 223:
case 225:
+ case 226:
return node;
}
}
@@ -49295,42 +50629,42 @@ var ts;
switch (node.kind) {
case 256:
return ts.isExternalModule(node) ? ts.ScriptElementKind.moduleElement : ts.ScriptElementKind.scriptElement;
- case 225:
+ case 226:
return ts.ScriptElementKind.moduleElement;
- case 221:
- case 192:
+ case 222:
+ case 193:
return ts.ScriptElementKind.classElement;
- case 222: return ts.ScriptElementKind.interfaceElement;
- case 223: return ts.ScriptElementKind.typeElement;
- case 224: return ts.ScriptElementKind.enumElement;
- case 218:
+ case 223: return ts.ScriptElementKind.interfaceElement;
+ case 224: return ts.ScriptElementKind.typeElement;
+ case 225: return ts.ScriptElementKind.enumElement;
+ case 219:
return getKindOfVariableDeclaration(node);
- case 169:
+ case 170:
return getKindOfVariableDeclaration(ts.getRootDeclaration(node));
+ case 181:
+ case 221:
case 180:
- case 220:
- case 179:
return ts.ScriptElementKind.functionElement;
- case 149: return ts.ScriptElementKind.memberGetAccessorElement;
- case 150: return ts.ScriptElementKind.memberSetAccessorElement;
+ case 150: return ts.ScriptElementKind.memberGetAccessorElement;
+ case 151: return ts.ScriptElementKind.memberSetAccessorElement;
+ case 148:
case 147:
- case 146:
return ts.ScriptElementKind.memberFunctionElement;
+ case 146:
case 145:
- case 144:
return ts.ScriptElementKind.memberVariableElement;
- case 153: return ts.ScriptElementKind.indexSignatureElement;
- case 152: return ts.ScriptElementKind.constructSignatureElement;
- case 151: return ts.ScriptElementKind.callSignatureElement;
- case 148: return ts.ScriptElementKind.constructorImplementationElement;
- case 141: return ts.ScriptElementKind.typeParameterElement;
+ case 154: return ts.ScriptElementKind.indexSignatureElement;
+ case 153: return ts.ScriptElementKind.constructSignatureElement;
+ case 152: return ts.ScriptElementKind.callSignatureElement;
+ case 149: return ts.ScriptElementKind.constructorImplementationElement;
+ case 142: return ts.ScriptElementKind.typeParameterElement;
case 255: return ts.ScriptElementKind.enumMemberElement;
- case 142: return ts.hasModifier(node, 92) ? ts.ScriptElementKind.memberVariableElement : ts.ScriptElementKind.parameterElement;
- case 229:
- case 234:
- case 231:
- case 238:
+ case 143: return ts.hasModifier(node, 92) ? ts.ScriptElementKind.memberVariableElement : ts.ScriptElementKind.parameterElement;
+ case 230:
+ case 235:
case 232:
+ case 239:
+ case 233:
return ts.ScriptElementKind.alias;
case 279:
return ts.ScriptElementKind.typeElement;
@@ -49347,7 +50681,7 @@ var ts;
}
ts.getNodeKind = getNodeKind;
function getStringLiteralTypeForNode(node, typeChecker) {
- var searchNode = node.parent.kind === 166 ? node.parent : node;
+ var searchNode = node.parent.kind === 167 ? node.parent : node;
var type = typeChecker.getTypeAtLocation(searchNode);
if (type && type.flags & 32) {
return type;
@@ -49357,10 +50691,10 @@ var ts;
ts.getStringLiteralTypeForNode = getStringLiteralTypeForNode;
function isThis(node) {
switch (node.kind) {
- case 97:
+ case 98:
return true;
- case 69:
- return ts.identifierIsThisKeyword(node) && node.parent.kind === 142;
+ case 70:
+ return ts.identifierIsThisKeyword(node) && node.parent.kind === 143;
default:
return false;
}
@@ -49404,107 +50738,107 @@ var ts;
return false;
}
switch (n.kind) {
- case 221:
case 222:
- case 224:
- case 171:
- case 167:
- case 159:
- case 199:
- case 226:
+ case 223:
+ case 225:
+ case 172:
+ case 168:
+ case 160:
+ case 200:
case 227:
- case 233:
- case 237:
- return nodeEndsWith(n, 16, sourceFile);
+ case 228:
+ case 234:
+ case 238:
+ return nodeEndsWith(n, 17, sourceFile);
case 252:
return isCompletedNode(n.block, sourceFile);
- case 175:
+ case 176:
if (!n.arguments) {
return true;
}
- case 174:
- case 178:
- case 164:
- return nodeEndsWith(n, 18, sourceFile);
- case 156:
+ case 175:
+ case 179:
+ case 165:
+ return nodeEndsWith(n, 19, sourceFile);
case 157:
+ case 158:
return isCompletedNode(n.type, sourceFile);
- case 148:
case 149:
case 150:
- case 220:
- case 179:
- case 147:
- case 146:
- case 152:
case 151:
+ case 221:
case 180:
+ case 148:
+ case 147:
+ case 153:
+ case 152:
+ case 181:
if (n.body) {
return isCompletedNode(n.body, sourceFile);
}
if (n.type) {
return isCompletedNode(n.type, sourceFile);
}
- return hasChildOfKind(n, 18, sourceFile);
- case 225:
+ return hasChildOfKind(n, 19, sourceFile);
+ case 226:
return n.body && isCompletedNode(n.body, sourceFile);
- case 203:
+ case 204:
if (n.elseStatement) {
return isCompletedNode(n.elseStatement, sourceFile);
}
return isCompletedNode(n.thenStatement, sourceFile);
- case 202:
+ case 203:
return isCompletedNode(n.expression, sourceFile) ||
- hasChildOfKind(n, 23);
- case 170:
- case 168:
- case 173:
- case 140:
- case 161:
- return nodeEndsWith(n, 20, sourceFile);
- case 153:
+ hasChildOfKind(n, 24);
+ case 171:
+ case 169:
+ case 174:
+ case 141:
+ case 162:
+ return nodeEndsWith(n, 21, sourceFile);
+ case 154:
if (n.type) {
return isCompletedNode(n.type, sourceFile);
}
- return hasChildOfKind(n, 20, sourceFile);
+ return hasChildOfKind(n, 21, sourceFile);
case 249:
case 250:
return false;
- case 206:
case 207:
case 208:
- case 205:
+ case 209:
+ case 206:
return isCompletedNode(n.statement, sourceFile);
- case 204:
- var hasWhileKeyword = findChildOfKind(n, 104, sourceFile);
+ case 205:
+ var hasWhileKeyword = findChildOfKind(n, 105, sourceFile);
if (hasWhileKeyword) {
- return nodeEndsWith(n, 18, sourceFile);
+ return nodeEndsWith(n, 19, sourceFile);
}
return isCompletedNode(n.statement, sourceFile);
- case 158:
+ case 159:
return isCompletedNode(n.exprName, sourceFile);
- case 182:
- case 181:
case 183:
- case 190:
+ case 182:
+ case 184:
case 191:
+ case 192:
var unaryWordExpression = n;
return isCompletedNode(unaryWordExpression.expression, sourceFile);
- case 176:
+ case 177:
return isCompletedNode(n.template, sourceFile);
- case 189:
+ case 190:
var lastSpan = ts.lastOrUndefined(n.templateSpans);
return isCompletedNode(lastSpan, sourceFile);
- case 197:
+ case 198:
return ts.nodeIsPresent(n.literal);
- case 236:
- case 230:
+ case 237:
+ case 231:
return ts.nodeIsPresent(n.moduleSpecifier);
- case 185:
+ case 186:
return isCompletedNode(n.operand, sourceFile);
- case 187:
- return isCompletedNode(n.right, sourceFile);
case 188:
+ return isCompletedNode(n.right, sourceFile);
+ case 189:
return isCompletedNode(n.whenFalse, sourceFile);
default:
return true;
@@ -49518,7 +50852,7 @@ var ts;
if (last.kind === expectedLastToken) {
return true;
}
- else if (last.kind === 23 && children.length !== 1) {
+ else if (last.kind === 24 && children.length !== 1) {
return children[children.length - 2].kind === expectedLastToken;
}
}
@@ -49655,7 +50989,7 @@ var ts;
function findPrecedingToken(position, sourceFile, startNode) {
return find(startNode || sourceFile);
function findRightmostToken(n) {
- if (isToken(n) || n.kind === 244) {
+ if (isToken(n)) {
return n;
}
var children = n.getChildren();
@@ -49663,16 +50997,16 @@ var ts;
return candidate && findRightmostToken(candidate);
}
function find(n) {
- if (isToken(n) || n.kind === 244) {
+ if (isToken(n)) {
return n;
}
var children = n.getChildren();
for (var i = 0, len = children.length; i < len; i++) {
var child = children[i];
- if (position < child.end && (nodeHasTokens(child) || child.kind === 244)) {
+ if (position < child.end && (nodeHasTokens(child) || child.kind === 10)) {
var start = child.getStart(sourceFile);
var lookInPreviousChild = (start >= position) ||
- (child.kind === 244 && start === child.end);
+ (child.kind === 10 && start === child.end);
if (lookInPreviousChild) {
var candidate = findRightmostChildNodeWithTokens(children, i);
return candidate && findRightmostToken(candidate);
@@ -49721,19 +51055,19 @@ var ts;
if (!token) {
return false;
}
- if (token.kind === 244) {
+ if (token.kind === 10) {
return true;
}
- if (token.kind === 25 && token.parent.kind === 244) {
+ if (token.kind === 26 && token.parent.kind === 10) {
return true;
}
- if (token.kind === 25 && token.parent.kind === 248) {
+ if (token.kind === 26 && token.parent.kind === 248) {
return true;
}
- if (token && token.kind === 16 && token.parent.kind === 248) {
+ if (token && token.kind === 17 && token.parent.kind === 248) {
return true;
}
- if (token.kind === 25 && token.parent.kind === 245) {
+ if (token.kind === 26 && token.parent.kind === 245) {
return true;
}
return false;
@@ -49772,9 +51106,9 @@ var ts;
var node = ts.getTokenAtPosition(sourceFile, position);
if (isToken(node)) {
switch (node.kind) {
- case 102:
- case 108:
- case 74:
+ case 103:
+ case 109:
+ case 75:
node = node.parent === undefined ? undefined : node.parent.parent;
break;
default:
@@ -49824,21 +51158,21 @@ var ts;
}
ts.getNodeModifiers = getNodeModifiers;
function getTypeArgumentOrTypeParameterList(node) {
- if (node.kind === 155 || node.kind === 174) {
+ if (node.kind === 156 || node.kind === 175) {
return node.typeArguments;
}
- if (ts.isFunctionLike(node) || node.kind === 221 || node.kind === 222) {
+ if (ts.isFunctionLike(node) || node.kind === 222 || node.kind === 223) {
return node.typeParameters;
}
return undefined;
}
ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList;
function isToken(n) {
- return n.kind >= 0 && n.kind <= 138;
+ return n.kind >= 0 && n.kind <= 139;
}
ts.isToken = isToken;
function isWord(kind) {
- return kind === 69 || ts.isKeyword(kind);
+ return kind === 70 || ts.isKeyword(kind);
}
ts.isWord = isWord;
function isPropertyName(kind) {
@@ -49850,7 +51184,7 @@ var ts;
ts.isComment = isComment;
function isStringOrRegularExpressionOrTemplateLiteral(kind) {
if (kind === 9
- || kind === 10
+ || kind === 11
|| ts.isTemplateLiteralKind(kind)) {
return true;
}
@@ -49858,7 +51192,7 @@ var ts;
}
ts.isStringOrRegularExpressionOrTemplateLiteral = isStringOrRegularExpressionOrTemplateLiteral;
function isPunctuation(kind) {
- return 15 <= kind && kind <= 68;
+ return 16 <= kind && kind <= 69;
}
ts.isPunctuation = isPunctuation;
function isInsideTemplateLiteral(node, position) {
@@ -49868,9 +51202,9 @@ var ts;
ts.isInsideTemplateLiteral = isInsideTemplateLiteral;
function isAccessibilityModifier(kind) {
switch (kind) {
- case 112:
- case 110:
+ case 113:
case 111:
+ case 112:
return true;
}
return false;
@@ -49893,14 +51227,14 @@ var ts;
}
ts.compareDataObjects = compareDataObjects;
function isArrayLiteralOrObjectLiteralDestructuringPattern(node) {
- if (node.kind === 170 ||
- node.kind === 171) {
- if (node.parent.kind === 187 &&
+ if (node.kind === 171 ||
+ node.kind === 172) {
+ if (node.parent.kind === 188 &&
node.parent.left === node &&
- node.parent.operatorToken.kind === 56) {
+ node.parent.operatorToken.kind === 57) {
return true;
}
- if (node.parent.kind === 208 &&
+ if (node.parent.kind === 209 &&
node.parent.initializer === node) {
return true;
}
@@ -49935,7 +51269,7 @@ var ts;
})(ts || (ts = {}));
(function (ts) {
function isFirstDeclarationOfSymbolParameter(symbol) {
- return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 142;
+ return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 143;
}
ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter;
var displayPartWriter = getDisplayPartWriter();
@@ -49988,7 +51322,7 @@ var ts;
}
}
function symbolPart(text, symbol) {
- return displayPart(text, displayPartKind(symbol), symbol);
+ return displayPart(text, displayPartKind(symbol));
function displayPartKind(symbol) {
var flags = symbol.flags;
if (flags & 3) {
@@ -50037,7 +51371,7 @@ var ts;
}
}
ts.symbolPart = symbolPart;
- function displayPart(text, kind, symbol) {
+ function displayPart(text, kind) {
return {
text: text,
kind: ts.SymbolDisplayPartKind[kind]
@@ -50110,7 +51444,7 @@ var ts;
return location.getText();
}
else if (ts.isStringOrNumericLiteral(location.kind) &&
- location.parent.kind === 140) {
+ location.parent.kind === 141) {
return location.text;
}
var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol);
@@ -50120,7 +51454,7 @@ var ts;
ts.getDeclaredName = getDeclaredName;
function isImportOrExportSpecifierName(location) {
return location.parent &&
- (location.parent.kind === 234 || location.parent.kind === 238) &&
+ (location.parent.kind === 235 || location.parent.kind === 239) &&
location.parent.propertyName === location;
}
ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName;
@@ -50225,157 +51559,157 @@ var ts;
function spanInNode(node) {
if (node) {
switch (node.kind) {
- case 200:
+ case 201:
return spanInVariableDeclaration(node.declarationList.declarations[0]);
- case 218:
- case 145:
- case 144:
- return spanInVariableDeclaration(node);
- case 142:
- return spanInParameterDeclaration(node);
- case 220:
- case 147:
+ case 219:
case 146:
- case 149:
- case 150:
+ case 145:
+ return spanInVariableDeclaration(node);
+ case 143:
+ return spanInParameterDeclaration(node);
+ case 221:
case 148:
- case 179:
+ case 147:
+ case 150:
+ case 151:
+ case 149:
case 180:
+ case 181:
return spanInFunctionDeclaration(node);
- case 199:
+ case 200:
if (ts.isFunctionBlock(node)) {
return spanInFunctionBlock(node);
}
- case 226:
+ case 227:
return spanInBlock(node);
case 252:
return spanInBlock(node.block);
- case 202:
- return textSpan(node.expression);
- case 211:
- return textSpan(node.getChildAt(0), node.expression);
- case 205:
- return textSpanEndingAtNextToken(node, node.expression);
- case 204:
- return spanInNode(node.statement);
- case 217:
- return textSpan(node.getChildAt(0));
case 203:
- return textSpanEndingAtNextToken(node, node.expression);
- case 214:
- return spanInNode(node.statement);
- case 210:
- case 209:
- return textSpan(node.getChildAt(0), node.label);
+ return textSpan(node.expression);
+ case 212:
+ return textSpan(node.getChildAt(0), node.expression);
case 206:
- return spanInForStatement(node);
- case 207:
return textSpanEndingAtNextToken(node, node.expression);
+ case 205:
+ return spanInNode(node.statement);
+ case 218:
+ return textSpan(node.getChildAt(0));
+ case 204:
+ return textSpanEndingAtNextToken(node, node.expression);
+ case 215:
+ return spanInNode(node.statement);
+ case 211:
+ case 210:
+ return textSpan(node.getChildAt(0), node.label);
+ case 207:
+ return spanInForStatement(node);
case 208:
+ return textSpanEndingAtNextToken(node, node.expression);
+ case 209:
return spanInInitializerOfForLike(node);
- case 213:
+ case 214:
return textSpanEndingAtNextToken(node, node.expression);
case 249:
case 250:
return spanInNode(node.statements[0]);
- case 216:
+ case 217:
return spanInBlock(node.tryBlock);
- case 215:
+ case 216:
return textSpan(node, node.expression);
- case 235:
- return textSpan(node, node.expression);
- case 229:
- return textSpan(node, node.moduleReference);
- case 230:
- return textSpan(node, node.moduleSpecifier);
case 236:
+ return textSpan(node, node.expression);
+ case 230:
+ return textSpan(node, node.moduleReference);
+ case 231:
return textSpan(node, node.moduleSpecifier);
- case 225:
+ case 237:
+ return textSpan(node, node.moduleSpecifier);
+ case 226:
if (ts.getModuleInstanceState(node) !== 1) {
return undefined;
}
- case 221:
- case 224:
- case 255:
- case 169:
- return textSpan(node);
- case 212:
- return spanInNode(node.statement);
- case 143:
- return spanInNodeArray(node.parent.decorators);
- case 167:
- case 168:
- return spanInBindingPattern(node);
case 222:
+ case 225:
+ case 255:
+ case 170:
+ return textSpan(node);
+ case 213:
+ return spanInNode(node.statement);
+ case 144:
+ return spanInNodeArray(node.parent.decorators);
+ case 168:
+ case 169:
+ return spanInBindingPattern(node);
case 223:
+ case 224:
return undefined;
- case 23:
+ case 24:
case 1:
return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile));
- case 24:
- return spanInPreviousNode(node);
- case 15:
- return spanInOpenBraceToken(node);
- case 16:
- return spanInCloseBraceToken(node);
- case 20:
- return spanInCloseBracketToken(node);
- case 17:
- return spanInOpenParenToken(node);
- case 18:
- return spanInCloseParenToken(node);
- case 54:
- return spanInColonToken(node);
- case 27:
case 25:
+ return spanInPreviousNode(node);
+ case 16:
+ return spanInOpenBraceToken(node);
+ case 17:
+ return spanInCloseBraceToken(node);
+ case 21:
+ return spanInCloseBracketToken(node);
+ case 18:
+ return spanInOpenParenToken(node);
+ case 19:
+ return spanInCloseParenToken(node);
+ case 55:
+ return spanInColonToken(node);
+ case 28:
+ case 26:
return spanInGreaterThanOrLessThanToken(node);
- case 104:
+ case 105:
return spanInWhileKeyword(node);
- case 80:
- case 72:
- case 85:
+ case 81:
+ case 73:
+ case 86:
return spanInNextNode(node);
- case 138:
+ case 139:
return spanInOfKeyword(node);
default:
if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node)) {
return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node);
}
- if ((node.kind === 69 ||
- node.kind == 191 ||
+ if ((node.kind === 70 ||
+ node.kind == 192 ||
node.kind === 253 ||
node.kind === 254) &&
ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) {
return textSpan(node);
}
- if (node.kind === 187) {
+ if (node.kind === 188) {
var binaryExpression = node;
if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left)) {
return spanInArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left);
}
- if (binaryExpression.operatorToken.kind === 56 &&
+ if (binaryExpression.operatorToken.kind === 57 &&
ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.parent)) {
return textSpan(node);
}
- if (binaryExpression.operatorToken.kind === 24) {
+ if (binaryExpression.operatorToken.kind === 25) {
return spanInNode(binaryExpression.left);
}
}
if (ts.isPartOfExpression(node)) {
switch (node.parent.kind) {
- case 204:
+ case 205:
return spanInPreviousNode(node);
- case 143:
+ case 144:
return spanInNode(node.parent);
- case 206:
- case 208:
+ case 207:
+ case 209:
return textSpan(node);
- case 187:
- if (node.parent.operatorToken.kind === 24) {
+ case 188:
+ if (node.parent.operatorToken.kind === 25) {
return textSpan(node);
}
break;
- case 180:
+ case 181:
if (node.parent.body === node) {
return textSpan(node);
}
@@ -50387,14 +51721,14 @@ var ts;
!ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) {
return spanInNode(node.parent.initializer);
}
- if (node.parent.kind === 177 && node.parent.type === node) {
+ if (node.parent.kind === 178 && node.parent.type === node) {
return spanInNextNode(node.parent.type);
}
if (ts.isFunctionLike(node.parent) && node.parent.type === node) {
return spanInPreviousNode(node);
}
- if ((node.parent.kind === 218 ||
- node.parent.kind === 142)) {
+ if ((node.parent.kind === 219 ||
+ node.parent.kind === 143)) {
var paramOrVarDecl = node.parent;
if (paramOrVarDecl.initializer === node ||
paramOrVarDecl.type === node ||
@@ -50402,7 +51736,7 @@ var ts;
return spanInPreviousNode(node);
}
}
- if (node.parent.kind === 187) {
+ if (node.parent.kind === 188) {
var binaryExpression = node.parent;
if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) &&
(binaryExpression.right === node ||
@@ -50423,7 +51757,7 @@ var ts;
}
}
function spanInVariableDeclaration(variableDeclaration) {
- if (variableDeclaration.parent.parent.kind === 207) {
+ if (variableDeclaration.parent.parent.kind === 208) {
return spanInNode(variableDeclaration.parent.parent);
}
if (ts.isBindingPattern(variableDeclaration.name)) {
@@ -50431,7 +51765,7 @@ var ts;
}
if (variableDeclaration.initializer ||
ts.hasModifier(variableDeclaration, 1) ||
- variableDeclaration.parent.parent.kind === 208) {
+ variableDeclaration.parent.parent.kind === 209) {
return textSpanFromVariableDeclaration(variableDeclaration);
}
var declarations = variableDeclaration.parent.declarations;
@@ -50463,7 +51797,7 @@ var ts;
}
function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) {
return ts.hasModifier(functionDeclaration, 1) ||
- (functionDeclaration.parent.kind === 221 && functionDeclaration.kind !== 148);
+ (functionDeclaration.parent.kind === 222 && functionDeclaration.kind !== 149);
}
function spanInFunctionDeclaration(functionDeclaration) {
if (!functionDeclaration.body) {
@@ -50483,22 +51817,22 @@ var ts;
}
function spanInBlock(block) {
switch (block.parent.kind) {
- case 225:
+ case 226:
if (ts.getModuleInstanceState(block.parent) !== 1) {
return undefined;
}
- case 205:
- case 203:
- case 207:
- return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]);
case 206:
+ case 204:
case 208:
+ return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]);
+ case 207:
+ case 209:
return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]);
}
return spanInNode(block.statements[0]);
}
function spanInInitializerOfForLike(forLikeStatement) {
- if (forLikeStatement.initializer.kind === 219) {
+ if (forLikeStatement.initializer.kind === 220) {
var variableDeclarationList = forLikeStatement.initializer;
if (variableDeclarationList.declarations.length > 0) {
return spanInNode(variableDeclarationList.declarations[0]);
@@ -50520,62 +51854,62 @@ var ts;
}
}
function spanInBindingPattern(bindingPattern) {
- var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 193 ? element : undefined; });
+ var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 194 ? element : undefined; });
if (firstBindingElement) {
return spanInNode(firstBindingElement);
}
- if (bindingPattern.parent.kind === 169) {
+ if (bindingPattern.parent.kind === 170) {
return textSpan(bindingPattern.parent);
}
return textSpanFromVariableDeclaration(bindingPattern.parent);
}
function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) {
- ts.Debug.assert(node.kind !== 168 && node.kind !== 167);
- var elements = node.kind === 170 ?
+ ts.Debug.assert(node.kind !== 169 && node.kind !== 168);
+ var elements = node.kind === 171 ?
node.elements :
node.properties;
- var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 193 ? element : undefined; });
+ var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 194 ? element : undefined; });
if (firstBindingElement) {
return spanInNode(firstBindingElement);
}
- return textSpan(node.parent.kind === 187 ? node.parent : node);
+ return textSpan(node.parent.kind === 188 ? node.parent : node);
}
function spanInOpenBraceToken(node) {
switch (node.parent.kind) {
- case 224:
+ case 225:
var enumDeclaration = node.parent;
return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile));
- case 221:
+ case 222:
var classDeclaration = node.parent;
return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile));
- case 227:
+ case 228:
return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]);
}
return spanInNode(node.parent);
}
function spanInCloseBraceToken(node) {
switch (node.parent.kind) {
- case 226:
+ case 227:
if (ts.getModuleInstanceState(node.parent.parent) !== 1) {
return undefined;
}
- case 224:
- case 221:
+ case 225:
+ case 222:
return textSpan(node);
- case 199:
+ case 200:
if (ts.isFunctionBlock(node.parent)) {
return textSpan(node);
}
case 252:
return spanInNode(ts.lastOrUndefined(node.parent.statements));
- case 227:
+ case 228:
var caseBlock = node.parent;
var lastClause = ts.lastOrUndefined(caseBlock.clauses);
if (lastClause) {
return spanInNode(ts.lastOrUndefined(lastClause.statements));
}
return undefined;
- case 167:
+ case 168:
var bindingPattern = node.parent;
return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern);
default:
@@ -50588,7 +51922,7 @@ var ts;
}
function spanInCloseBracketToken(node) {
switch (node.parent.kind) {
- case 168:
+ case 169:
var bindingPattern = node.parent;
return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern);
default:
@@ -50600,33 +51934,33 @@ var ts;
}
}
function spanInOpenParenToken(node) {
- if (node.parent.kind === 204 ||
- node.parent.kind === 174 ||
- node.parent.kind === 175) {
+ if (node.parent.kind === 205 ||
+ node.parent.kind === 175 ||
+ node.parent.kind === 176) {
return spanInPreviousNode(node);
}
- if (node.parent.kind === 178) {
+ if (node.parent.kind === 179) {
return spanInNextNode(node);
}
return spanInNode(node.parent);
}
function spanInCloseParenToken(node) {
switch (node.parent.kind) {
- case 179:
- case 220:
case 180:
- case 147:
- case 146:
- case 149:
- case 150:
+ case 221:
+ case 181:
case 148:
- case 205:
- case 204:
+ case 147:
+ case 150:
+ case 151:
+ case 149:
case 206:
- case 208:
- case 174:
+ case 205:
+ case 207:
+ case 209:
case 175:
- case 178:
+ case 176:
+ case 179:
return spanInPreviousNode(node);
default:
return spanInNode(node.parent);
@@ -50635,25 +51969,25 @@ var ts;
function spanInColonToken(node) {
if (ts.isFunctionLike(node.parent) ||
node.parent.kind === 253 ||
- node.parent.kind === 142) {
+ node.parent.kind === 143) {
return spanInPreviousNode(node);
}
return spanInNode(node.parent);
}
function spanInGreaterThanOrLessThanToken(node) {
- if (node.parent.kind === 177) {
+ if (node.parent.kind === 178) {
return spanInNextNode(node);
}
return spanInNode(node.parent);
}
function spanInWhileKeyword(node) {
- if (node.parent.kind === 204) {
+ if (node.parent.kind === 205) {
return textSpanEndingAtNextToken(node, node.parent.expression);
}
return spanInNode(node.parent);
}
function spanInOfKeyword(node) {
- if (node.parent.kind === 208) {
+ if (node.parent.kind === 209) {
return spanInNextNode(node);
}
return spanInNode(node.parent);
@@ -50666,27 +52000,27 @@ var ts;
var ts;
(function (ts) {
function createClassifier() {
- var scanner = ts.createScanner(2, false);
+ var scanner = ts.createScanner(4, false);
var noRegexTable = [];
- noRegexTable[69] = true;
+ noRegexTable[70] = true;
noRegexTable[9] = true;
noRegexTable[8] = true;
- noRegexTable[10] = true;
- noRegexTable[97] = true;
- noRegexTable[41] = true;
+ noRegexTable[11] = true;
+ noRegexTable[98] = true;
noRegexTable[42] = true;
- noRegexTable[18] = true;
- noRegexTable[20] = true;
- noRegexTable[16] = true;
- noRegexTable[99] = true;
- noRegexTable[84] = true;
+ noRegexTable[43] = true;
+ noRegexTable[19] = true;
+ noRegexTable[21] = true;
+ noRegexTable[17] = true;
+ noRegexTable[100] = true;
+ noRegexTable[85] = true;
var templateStack = [];
function canFollow(keyword1, keyword2) {
if (ts.isAccessibilityModifier(keyword1)) {
- if (keyword2 === 123 ||
- keyword2 === 131 ||
- keyword2 === 121 ||
- keyword2 === 113) {
+ if (keyword2 === 124 ||
+ keyword2 === 132 ||
+ keyword2 === 122 ||
+ keyword2 === 114) {
return true;
}
return false;
@@ -50769,7 +52103,7 @@ var ts;
text = "}\n" + text;
offset = 2;
case 6:
- templateStack.push(12);
+ templateStack.push(13);
break;
}
scanner.setText(text);
@@ -50781,55 +52115,55 @@ var ts;
do {
token = scanner.scan();
if (!ts.isTrivia(token)) {
- if ((token === 39 || token === 61) && !noRegexTable[lastNonTriviaToken]) {
- if (scanner.reScanSlashToken() === 10) {
- token = 10;
+ if ((token === 40 || token === 62) && !noRegexTable[lastNonTriviaToken]) {
+ if (scanner.reScanSlashToken() === 11) {
+ token = 11;
}
}
- else if (lastNonTriviaToken === 21 && isKeyword(token)) {
- token = 69;
+ else if (lastNonTriviaToken === 22 && isKeyword(token)) {
+ token = 70;
}
else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) {
- token = 69;
+ token = 70;
}
- else if (lastNonTriviaToken === 69 &&
- token === 25) {
+ else if (lastNonTriviaToken === 70 &&
+ token === 26) {
angleBracketStack++;
}
- else if (token === 27 && angleBracketStack > 0) {
+ else if (token === 28 && angleBracketStack > 0) {
angleBracketStack--;
}
- else if (token === 117 ||
- token === 132 ||
- token === 130 ||
- token === 120 ||
- token === 133) {
+ else if (token === 118 ||
+ token === 133 ||
+ token === 131 ||
+ token === 121 ||
+ token === 134) {
if (angleBracketStack > 0 && !syntacticClassifierAbsent) {
- token = 69;
+ token = 70;
}
}
- else if (token === 12) {
+ else if (token === 13) {
templateStack.push(token);
}
- else if (token === 15) {
+ else if (token === 16) {
if (templateStack.length > 0) {
templateStack.push(token);
}
}
- else if (token === 16) {
+ else if (token === 17) {
if (templateStack.length > 0) {
var lastTemplateStackToken = ts.lastOrUndefined(templateStack);
- if (lastTemplateStackToken === 12) {
+ if (lastTemplateStackToken === 13) {
token = scanner.reScanTemplateToken();
- if (token === 14) {
+ if (token === 15) {
templateStack.pop();
}
else {
- ts.Debug.assert(token === 13, "Should have been a template middle. Was " + token);
+ ts.Debug.assert(token === 14, "Should have been a template middle. Was " + token);
}
}
else {
- ts.Debug.assert(lastTemplateStackToken === 15, "Should have been an open brace. Was: " + token);
+ ts.Debug.assert(lastTemplateStackToken === 16, "Should have been an open brace. Was: " + token);
templateStack.pop();
}
}
@@ -50867,10 +52201,10 @@ var ts;
}
else if (ts.isTemplateLiteralKind(token)) {
if (scanner.isUnterminated()) {
- if (token === 14) {
+ if (token === 15) {
result.endOfLineState = 5;
}
- else if (token === 11) {
+ else if (token === 12) {
result.endOfLineState = 4;
}
else {
@@ -50878,7 +52212,7 @@ var ts;
}
}
}
- else if (templateStack.length > 0 && ts.lastOrUndefined(templateStack) === 12) {
+ else if (templateStack.length > 0 && ts.lastOrUndefined(templateStack) === 13) {
result.endOfLineState = 6;
}
}
@@ -50902,43 +52236,43 @@ var ts;
}
function isBinaryExpressionOperatorToken(token) {
switch (token) {
- case 37:
- case 39:
+ case 38:
case 40:
- case 35:
+ case 41:
case 36:
- case 43:
+ case 37:
case 44:
case 45:
- case 25:
- case 27:
+ case 46:
+ case 26:
case 28:
case 29:
- case 91:
- case 90:
- case 116:
case 30:
+ case 92:
+ case 91:
+ case 117:
case 31:
case 32:
case 33:
- case 46:
- case 48:
+ case 34:
case 47:
- case 51:
+ case 49:
+ case 48:
case 52:
- case 67:
- case 66:
+ case 53:
case 68:
- case 63:
+ case 67:
+ case 69:
case 64:
case 65:
- case 57:
+ case 66:
case 58:
case 59:
- case 61:
+ case 60:
case 62:
- case 56:
- case 24:
+ case 63:
+ case 57:
+ case 25:
return true;
default:
return false;
@@ -50946,19 +52280,19 @@ var ts;
}
function isPrefixUnaryExpressionOperatorToken(token) {
switch (token) {
- case 35:
case 36:
+ case 37:
+ case 51:
case 50:
- case 49:
- case 41:
case 42:
+ case 43:
return true;
default:
return false;
}
}
function isKeyword(token) {
- return token >= 70 && token <= 138;
+ return token >= 71 && token <= 139;
}
function classFromKind(token) {
if (isKeyword(token)) {
@@ -50967,7 +52301,7 @@ var ts;
else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) {
return 5;
}
- else if (token >= 15 && token <= 68) {
+ else if (token >= 16 && token <= 69) {
return 10;
}
switch (token) {
@@ -50975,7 +52309,7 @@ var ts;
return 4;
case 9:
return 6;
- case 10:
+ case 11:
return 7;
case 7:
case 3:
@@ -50984,7 +52318,7 @@ var ts;
case 5:
case 4:
return 8;
- case 69:
+ case 70:
default:
if (ts.isTemplateLiteralKind(token)) {
return 6;
@@ -51004,10 +52338,10 @@ var ts;
ts.getSemanticClassifications = getSemanticClassifications;
function checkForClassificationCancellation(cancellationToken, kind) {
switch (kind) {
- case 225:
- case 221:
+ case 226:
case 222:
- case 220:
+ case 223:
+ case 221:
cancellationToken.throwIfCancellationRequested();
}
}
@@ -51051,7 +52385,7 @@ var ts;
return undefined;
function hasValueSideModule(symbol) {
return ts.forEach(symbol.declarations, function (declaration) {
- return declaration.kind === 225 &&
+ return declaration.kind === 226 &&
ts.getModuleInstanceState(declaration) === 1;
});
}
@@ -51060,7 +52394,7 @@ var ts;
if (node && ts.textSpanIntersectsWith(span, node.getFullStart(), node.getFullWidth())) {
var kind = node.kind;
checkForClassificationCancellation(cancellationToken, kind);
- if (kind === 69 && !ts.nodeIsMissing(node)) {
+ if (kind === 70 && !ts.nodeIsMissing(node)) {
var identifier = node;
if (classifiableNames[identifier.text]) {
var symbol = typeChecker.getSymbolAtLocation(node);
@@ -51123,8 +52457,8 @@ var ts;
function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) {
var spanStart = span.start;
var spanLength = span.length;
- var triviaScanner = ts.createScanner(2, false, sourceFile.languageVariant, sourceFile.text);
- var mergeConflictScanner = ts.createScanner(2, false, sourceFile.languageVariant, sourceFile.text);
+ var triviaScanner = ts.createScanner(4, false, sourceFile.languageVariant, sourceFile.text);
+ var mergeConflictScanner = ts.createScanner(4, false, sourceFile.languageVariant, sourceFile.text);
var result = [];
processElement(sourceFile);
return { spans: result, endOfLineState: 0 };
@@ -51266,10 +52600,10 @@ var ts;
return true;
}
var classifiedElementName = tryClassifyJsxElementName(node);
- if (!ts.isToken(node) && node.kind !== 244 && classifiedElementName === undefined) {
+ if (!ts.isToken(node) && node.kind !== 10 && classifiedElementName === undefined) {
return false;
}
- var tokenStart = node.kind === 244 ? node.pos : classifyLeadingTriviaAndGetTokenStart(node);
+ var tokenStart = node.kind === 10 ? node.pos : classifyLeadingTriviaAndGetTokenStart(node);
var tokenWidth = node.end - tokenStart;
ts.Debug.assert(tokenWidth >= 0);
if (tokenWidth > 0) {
@@ -51282,7 +52616,7 @@ var ts;
}
function tryClassifyJsxElementName(token) {
switch (token.parent && token.parent.kind) {
- case 243:
+ case 244:
if (token.parent.tagName === token) {
return 19;
}
@@ -51292,7 +52626,7 @@ var ts;
return 20;
}
break;
- case 242:
+ case 243:
if (token.parent.tagName === token) {
return 21;
}
@@ -51309,25 +52643,25 @@ var ts;
if (ts.isKeyword(tokenKind)) {
return 3;
}
- if (tokenKind === 25 || tokenKind === 27) {
+ if (tokenKind === 26 || tokenKind === 28) {
if (token && ts.getTypeArgumentOrTypeParameterList(token.parent)) {
return 10;
}
}
if (ts.isPunctuation(tokenKind)) {
if (token) {
- if (tokenKind === 56) {
- if (token.parent.kind === 218 ||
- token.parent.kind === 145 ||
- token.parent.kind === 142 ||
+ if (tokenKind === 57) {
+ if (token.parent.kind === 219 ||
+ token.parent.kind === 146 ||
+ token.parent.kind === 143 ||
token.parent.kind === 246) {
return 5;
}
}
- if (token.parent.kind === 187 ||
- token.parent.kind === 185 ||
+ if (token.parent.kind === 188 ||
token.parent.kind === 186 ||
- token.parent.kind === 188) {
+ token.parent.kind === 187 ||
+ token.parent.kind === 189) {
return 5;
}
}
@@ -51339,44 +52673,44 @@ var ts;
else if (tokenKind === 9) {
return token.parent.kind === 246 ? 24 : 6;
}
- else if (tokenKind === 10) {
+ else if (tokenKind === 11) {
return 6;
}
else if (ts.isTemplateLiteralKind(tokenKind)) {
return 6;
}
- else if (tokenKind === 244) {
+ else if (tokenKind === 10) {
return 23;
}
- else if (tokenKind === 69) {
+ else if (tokenKind === 70) {
if (token) {
switch (token.parent.kind) {
- case 221:
+ case 222:
if (token.parent.name === token) {
return 11;
}
return;
- case 141:
+ case 142:
if (token.parent.name === token) {
return 15;
}
return;
- case 222:
+ case 223:
if (token.parent.name === token) {
return 13;
}
return;
- case 224:
+ case 225:
if (token.parent.name === token) {
return 12;
}
return;
- case 225:
+ case 226:
if (token.parent.name === token) {
return 14;
}
return;
- case 142:
+ case 143:
if (token.parent.name === token) {
return ts.isThisIdentifier(token) ? 3 : 17;
}
@@ -51437,7 +52771,7 @@ var ts;
name: tagName.text,
kind: undefined,
kindModifiers: undefined,
- sortText: "0"
+ sortText: "0",
});
}
else {
@@ -51453,13 +52787,13 @@ var ts;
function getJavaScriptCompletionEntries(sourceFile, position, uniqueNames) {
var entries = [];
var nameTable = ts.getNameTable(sourceFile);
- for (var name_47 in nameTable) {
- if (nameTable[name_47] === position) {
+ for (var name_46 in nameTable) {
+ if (nameTable[name_46] === position) {
continue;
}
- if (!uniqueNames[name_47]) {
- uniqueNames[name_47] = name_47;
- var displayName = getCompletionEntryDisplayName(ts.unescapeIdentifier(name_47), compilerOptions.target, true);
+ if (!uniqueNames[name_46]) {
+ uniqueNames[name_46] = name_46;
+ var displayName = getCompletionEntryDisplayName(ts.unescapeIdentifier(name_46), compilerOptions.target, true);
if (displayName) {
var entry = {
name: displayName,
@@ -51482,7 +52816,7 @@ var ts;
name: displayName,
kind: ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location),
kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol),
- sortText: "0"
+ sortText: "0",
};
}
function getCompletionEntriesFromSymbols(symbols, entries, location, performCharacterChecks) {
@@ -51510,20 +52844,20 @@ var ts;
return undefined;
}
if (node.parent.kind === 253 &&
- node.parent.parent.kind === 171 &&
+ node.parent.parent.kind === 172 &&
node.parent.name === node) {
return getStringLiteralCompletionEntriesFromPropertyAssignment(node.parent);
}
else if (ts.isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) {
return getStringLiteralCompletionEntriesFromElementAccess(node.parent);
}
- else if (node.parent.kind === 230 || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node) || ts.isRequireCall(node.parent, false)) {
+ else if (node.parent.kind === 231 || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node) || ts.isRequireCall(node.parent, false)) {
return getStringLiteralCompletionEntriesFromModuleNames(node);
}
else {
var argumentInfo = ts.SignatureHelp.getContainingArgumentInfo(node, position, sourceFile);
if (argumentInfo) {
- return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, node);
+ return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo);
}
return getStringLiteralCompletionEntriesFromContextualType(node);
}
@@ -51538,7 +52872,7 @@ var ts;
}
}
}
- function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, location) {
+ function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo) {
var candidates = [];
var entries = [];
typeChecker.getResolvedSignature(argumentInfo.invocation, candidates);
@@ -51848,7 +53182,7 @@ var ts;
if (typeRoots) {
for (var _b = 0, typeRoots_2 = typeRoots; _b < typeRoots_2.length; _b++) {
var root = typeRoots_2[_b];
- getCompletionEntriesFromDirectories(host, options, root, span, result);
+ getCompletionEntriesFromDirectories(host, root, span, result);
}
}
}
@@ -51856,12 +53190,12 @@ var ts;
for (var _c = 0, _d = findPackageJsons(scriptPath); _c < _d.length; _c++) {
var packageJson = _d[_c];
var typesDir = ts.combinePaths(ts.getDirectoryPath(packageJson), "node_modules/@types");
- getCompletionEntriesFromDirectories(host, options, typesDir, span, result);
+ getCompletionEntriesFromDirectories(host, typesDir, span, result);
}
}
return result;
}
- function getCompletionEntriesFromDirectories(host, options, directory, span, result) {
+ function getCompletionEntriesFromDirectories(host, directory, span, result) {
if (host.getDirectories && tryDirectoryExists(host, directory)) {
var directories = tryGetDirectories(host, directory);
if (directories) {
@@ -52055,12 +53389,12 @@ var ts;
return undefined;
}
var parent_17 = contextToken.parent, kind = contextToken.kind;
- if (kind === 21) {
- if (parent_17.kind === 172) {
+ if (kind === 22) {
+ if (parent_17.kind === 173) {
node = contextToken.parent.expression;
isRightOfDot = true;
}
- else if (parent_17.kind === 139) {
+ else if (parent_17.kind === 140) {
node = contextToken.parent.left;
isRightOfDot = true;
}
@@ -52069,11 +53403,11 @@ var ts;
}
}
else if (sourceFile.languageVariant === 1) {
- if (kind === 25) {
+ if (kind === 26) {
isRightOfOpenTag = true;
location = contextToken;
}
- else if (kind === 39 && contextToken.parent.kind === 245) {
+ else if (kind === 40 && contextToken.parent.kind === 245) {
isStartingCloseTag = true;
location = contextToken;
}
@@ -52111,7 +53445,6 @@ var ts;
if (!tryGetGlobalSymbols()) {
return undefined;
}
- isGlobalCompletion = true;
}
log("getCompletionData: Semantic work: " + (ts.timestamp() - semanticStart));
return { symbols: symbols, isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), isJsDocTagName: isJsDocTagName };
@@ -52119,7 +53452,7 @@ var ts;
isGlobalCompletion = false;
isMemberCompletion = true;
isNewIdentifierLocation = false;
- if (node.kind === 69 || node.kind === 139 || node.kind === 172) {
+ if (node.kind === 70 || node.kind === 140 || node.kind === 173) {
var symbol = typeChecker.getSymbolAtLocation(node);
if (symbol && symbol.flags & 8388608) {
symbol = typeChecker.getAliasedSymbol(symbol);
@@ -52165,9 +53498,8 @@ var ts;
}
if (jsxContainer = tryGetContainingJsxElement(contextToken)) {
var attrsType = void 0;
- if ((jsxContainer.kind === 242) || (jsxContainer.kind === 243)) {
+ if ((jsxContainer.kind === 243) || (jsxContainer.kind === 244)) {
attrsType = typeChecker.getJsxElementAttributesType(jsxContainer);
- isGlobalCompletion = false;
if (attrsType) {
symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), jsxContainer.attributes);
isMemberCompletion = true;
@@ -52185,6 +53517,13 @@ var ts;
previousToken.getStart() :
position;
var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile;
+ if (scopeNode) {
+ isGlobalCompletion =
+ scopeNode.kind === 256 ||
+ scopeNode.kind === 190 ||
+ scopeNode.kind === 248 ||
+ ts.isStatement(scopeNode);
+ }
var symbolMeanings = 793064 | 107455 | 1920 | 8388608;
symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings);
return true;
@@ -52206,15 +53545,15 @@ var ts;
return result;
}
function isInJsxText(contextToken) {
- if (contextToken.kind === 244) {
+ if (contextToken.kind === 10) {
return true;
}
- if (contextToken.kind === 27 && contextToken.parent) {
- if (contextToken.parent.kind === 243) {
+ if (contextToken.kind === 28 && contextToken.parent) {
+ if (contextToken.parent.kind === 244) {
return true;
}
- if (contextToken.parent.kind === 245 || contextToken.parent.kind === 242) {
- return contextToken.parent.parent && contextToken.parent.parent.kind === 241;
+ if (contextToken.parent.kind === 245 || contextToken.parent.kind === 243) {
+ return contextToken.parent.parent && contextToken.parent.parent.kind === 242;
}
}
return false;
@@ -52223,41 +53562,41 @@ var ts;
if (previousToken) {
var containingNodeKind = previousToken.parent.kind;
switch (previousToken.kind) {
- case 24:
- return containingNodeKind === 174
- || containingNodeKind === 148
- || containingNodeKind === 175
- || containingNodeKind === 170
- || containingNodeKind === 187
- || containingNodeKind === 156;
- case 17:
- return containingNodeKind === 174
- || containingNodeKind === 148
- || containingNodeKind === 175
- || containingNodeKind === 178
- || containingNodeKind === 164;
- case 19:
- return containingNodeKind === 170
- || containingNodeKind === 153
- || containingNodeKind === 140;
- case 125:
+ case 25:
+ return containingNodeKind === 175
+ || containingNodeKind === 149
+ || containingNodeKind === 176
+ || containingNodeKind === 171
+ || containingNodeKind === 188
+ || containingNodeKind === 157;
+ case 18:
+ return containingNodeKind === 175
+ || containingNodeKind === 149
+ || containingNodeKind === 176
+ || containingNodeKind === 179
+ || containingNodeKind === 165;
+ case 20:
+ return containingNodeKind === 171
+ || containingNodeKind === 154
+ || containingNodeKind === 141;
case 126:
+ case 127:
return true;
- case 21:
- return containingNodeKind === 225;
- case 15:
- return containingNodeKind === 221;
- case 56:
- return containingNodeKind === 218
- || containingNodeKind === 187;
- case 12:
- return containingNodeKind === 189;
+ case 22:
+ return containingNodeKind === 226;
+ case 16:
+ return containingNodeKind === 222;
+ case 57:
+ return containingNodeKind === 219
+ || containingNodeKind === 188;
case 13:
- return containingNodeKind === 197;
- case 112:
- case 110:
+ return containingNodeKind === 190;
+ case 14:
+ return containingNodeKind === 198;
+ case 113:
case 111:
- return containingNodeKind === 145;
+ case 112:
+ return containingNodeKind === 146;
}
switch (previousToken.getText()) {
case "public":
@@ -52270,7 +53609,7 @@ var ts;
}
function isInStringOrRegularExpressionOrTemplateLiteral(contextToken) {
if (contextToken.kind === 9
- || contextToken.kind === 10
+ || contextToken.kind === 11
|| ts.isTemplateLiteralKind(contextToken.kind)) {
var start_3 = contextToken.getStart();
var end = contextToken.getEnd();
@@ -52279,7 +53618,7 @@ var ts;
}
if (position === end) {
return !!contextToken.isUnterminated
- || contextToken.kind === 10;
+ || contextToken.kind === 11;
}
}
return false;
@@ -52288,22 +53627,22 @@ var ts;
isMemberCompletion = true;
var typeForObject;
var existingMembers;
- if (objectLikeContainer.kind === 171) {
+ if (objectLikeContainer.kind === 172) {
isNewIdentifierLocation = true;
typeForObject = typeChecker.getContextualType(objectLikeContainer);
typeForObject = typeForObject && typeForObject.getNonNullableType();
existingMembers = objectLikeContainer.properties;
}
- else if (objectLikeContainer.kind === 167) {
+ else if (objectLikeContainer.kind === 168) {
isNewIdentifierLocation = false;
var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent);
if (ts.isVariableLike(rootDeclaration)) {
var canGetType = !!(rootDeclaration.initializer || rootDeclaration.type);
- if (!canGetType && rootDeclaration.kind === 142) {
+ if (!canGetType && rootDeclaration.kind === 143) {
if (ts.isExpression(rootDeclaration.parent)) {
canGetType = !!typeChecker.getContextualType(rootDeclaration.parent);
}
- else if (rootDeclaration.parent.kind === 147 || rootDeclaration.parent.kind === 150) {
+ else if (rootDeclaration.parent.kind === 148 || rootDeclaration.parent.kind === 151) {
canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent);
}
}
@@ -52329,9 +53668,9 @@ var ts;
return true;
}
function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) {
- var declarationKind = namedImportsOrExports.kind === 233 ?
- 230 :
- 236;
+ var declarationKind = namedImportsOrExports.kind === 234 ?
+ 231 :
+ 237;
var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind);
var moduleSpecifier = importOrExportDeclaration.moduleSpecifier;
if (!moduleSpecifier) {
@@ -52350,10 +53689,10 @@ var ts;
function tryGetObjectLikeCompletionContainer(contextToken) {
if (contextToken) {
switch (contextToken.kind) {
- case 15:
- case 24:
+ case 16:
+ case 25:
var parent_18 = contextToken.parent;
- if (parent_18 && (parent_18.kind === 171 || parent_18.kind === 167)) {
+ if (parent_18 && (parent_18.kind === 172 || parent_18.kind === 168)) {
return parent_18;
}
break;
@@ -52364,11 +53703,11 @@ var ts;
function tryGetNamedImportsOrExportsForCompletion(contextToken) {
if (contextToken) {
switch (contextToken.kind) {
- case 15:
- case 24:
+ case 16:
+ case 25:
switch (contextToken.parent.kind) {
- case 233:
- case 237:
+ case 234:
+ case 238:
return contextToken.parent;
}
}
@@ -52379,12 +53718,12 @@ var ts;
if (contextToken) {
var parent_19 = contextToken.parent;
switch (contextToken.kind) {
- case 26:
- case 39:
- case 69:
+ case 27:
+ case 40:
+ case 70:
case 246:
case 247:
- if (parent_19 && (parent_19.kind === 242 || parent_19.kind === 243)) {
+ if (parent_19 && (parent_19.kind === 243 || parent_19.kind === 244)) {
return parent_19;
}
else if (parent_19.kind === 246) {
@@ -52396,7 +53735,7 @@ var ts;
return parent_19.parent;
}
break;
- case 16:
+ case 17:
if (parent_19 &&
parent_19.kind === 248 &&
parent_19.parent &&
@@ -52413,16 +53752,16 @@ var ts;
}
function isFunction(kind) {
switch (kind) {
- case 179:
case 180:
- case 220:
+ case 181:
+ case 221:
+ case 148:
case 147:
- case 146:
- case 149:
case 150:
case 151:
case 152:
case 153:
+ case 154:
return true;
}
return false;
@@ -52430,67 +53769,67 @@ var ts;
function isSolelyIdentifierDefinitionLocation(contextToken) {
var containingNodeKind = contextToken.parent.kind;
switch (contextToken.kind) {
- case 24:
- return containingNodeKind === 218 ||
- containingNodeKind === 219 ||
- containingNodeKind === 200 ||
- containingNodeKind === 224 ||
+ case 25:
+ return containingNodeKind === 219 ||
+ containingNodeKind === 220 ||
+ containingNodeKind === 201 ||
+ containingNodeKind === 225 ||
isFunction(containingNodeKind) ||
- containingNodeKind === 221 ||
- containingNodeKind === 192 ||
containingNodeKind === 222 ||
- containingNodeKind === 168 ||
- containingNodeKind === 223;
- case 21:
- return containingNodeKind === 168;
- case 54:
+ containingNodeKind === 193 ||
+ containingNodeKind === 223 ||
+ containingNodeKind === 169 ||
+ containingNodeKind === 224;
+ case 22:
return containingNodeKind === 169;
- case 19:
- return containingNodeKind === 168;
- case 17:
+ case 55:
+ return containingNodeKind === 170;
+ case 20:
+ return containingNodeKind === 169;
+ case 18:
return containingNodeKind === 252 ||
isFunction(containingNodeKind);
- case 15:
- return containingNodeKind === 224 ||
- containingNodeKind === 222 ||
- containingNodeKind === 159;
- case 23:
- return containingNodeKind === 144 &&
- contextToken.parent && contextToken.parent.parent &&
- (contextToken.parent.parent.kind === 222 ||
- contextToken.parent.parent.kind === 159);
- case 25:
- return containingNodeKind === 221 ||
- containingNodeKind === 192 ||
- containingNodeKind === 222 ||
+ case 16:
+ return containingNodeKind === 225 ||
containingNodeKind === 223 ||
+ containingNodeKind === 160;
+ case 24:
+ return containingNodeKind === 145 &&
+ contextToken.parent && contextToken.parent.parent &&
+ (contextToken.parent.parent.kind === 223 ||
+ contextToken.parent.parent.kind === 160);
+ case 26:
+ return containingNodeKind === 222 ||
+ containingNodeKind === 193 ||
+ containingNodeKind === 223 ||
+ containingNodeKind === 224 ||
isFunction(containingNodeKind);
- case 113:
- return containingNodeKind === 145;
- case 22:
- return containingNodeKind === 142 ||
- (contextToken.parent && contextToken.parent.parent &&
- contextToken.parent.parent.kind === 168);
- case 112:
- case 110:
- case 111:
- return containingNodeKind === 142;
- case 116:
- return containingNodeKind === 234 ||
- containingNodeKind === 238 ||
- containingNodeKind === 232;
- case 73:
- case 81:
- case 107:
- case 87:
- case 102:
- case 123:
- case 131:
- case 89:
- case 108:
- case 74:
case 114:
- case 134:
+ return containingNodeKind === 146;
+ case 23:
+ return containingNodeKind === 143 ||
+ (contextToken.parent && contextToken.parent.parent &&
+ contextToken.parent.parent.kind === 169);
+ case 113:
+ case 111:
+ case 112:
+ return containingNodeKind === 143;
+ case 117:
+ return containingNodeKind === 235 ||
+ containingNodeKind === 239 ||
+ containingNodeKind === 233;
+ case 74:
+ case 82:
+ case 108:
+ case 88:
+ case 103:
+ case 124:
+ case 132:
+ case 90:
+ case 109:
+ case 75:
+ case 115:
+ case 135:
return true;
}
switch (contextToken.getText()) {
@@ -52527,8 +53866,8 @@ var ts;
if (element.getStart() <= position && position <= element.getEnd()) {
continue;
}
- var name_48 = element.propertyName || element.name;
- existingImportsOrExports[name_48.text] = true;
+ var name_47 = element.propertyName || element.name;
+ existingImportsOrExports[name_47.text] = true;
}
if (!ts.someProperties(existingImportsOrExports)) {
return ts.filter(exportsOfModule, function (e) { return e.name !== "default"; });
@@ -52544,16 +53883,16 @@ var ts;
var m = existingMembers_1[_i];
if (m.kind !== 253 &&
m.kind !== 254 &&
- m.kind !== 169 &&
- m.kind !== 147) {
+ m.kind !== 170 &&
+ m.kind !== 148) {
continue;
}
if (m.getStart() <= position && position <= m.getEnd()) {
continue;
}
var existingName = void 0;
- if (m.kind === 169 && m.propertyName) {
- if (m.propertyName.kind === 69) {
+ if (m.kind === 170 && m.propertyName) {
+ if (m.propertyName.kind === 70) {
existingName = m.propertyName.text;
}
}
@@ -52604,7 +53943,7 @@ var ts;
return name;
}
var keywordCompletions = [];
- for (var i = 70; i <= 138; i++) {
+ for (var i = 71; i <= 139; i++) {
keywordCompletions.push({
name: ts.tokenToString(i),
kind: ts.ScriptElementKind.keyword,
@@ -52666,10 +54005,10 @@ var ts;
};
}
function getSemanticDocumentHighlights(node) {
- if (node.kind === 69 ||
- node.kind === 97 ||
- node.kind === 165 ||
- node.kind === 95 ||
+ if (node.kind === 70 ||
+ node.kind === 98 ||
+ node.kind === 166 ||
+ node.kind === 96 ||
node.kind === 9 ||
ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) {
var referencedSymbols = ts.FindAllReferences.getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFilesToSearch, false, false, false);
@@ -52718,77 +54057,77 @@ var ts;
function getHighlightSpans(node) {
if (node) {
switch (node.kind) {
- case 88:
- case 80:
- if (hasKind(node.parent, 203)) {
+ case 89:
+ case 81:
+ if (hasKind(node.parent, 204)) {
return getIfElseOccurrences(node.parent);
}
break;
- case 94:
- if (hasKind(node.parent, 211)) {
+ case 95:
+ if (hasKind(node.parent, 212)) {
return getReturnOccurrences(node.parent);
}
break;
- case 98:
- if (hasKind(node.parent, 215)) {
+ case 99:
+ if (hasKind(node.parent, 216)) {
return getThrowOccurrences(node.parent);
}
break;
- case 72:
- if (hasKind(parent(parent(node)), 216)) {
+ case 73:
+ if (hasKind(parent(parent(node)), 217)) {
return getTryCatchFinallyOccurrences(node.parent.parent);
}
break;
- case 100:
- case 85:
- if (hasKind(parent(node), 216)) {
+ case 101:
+ case 86:
+ if (hasKind(parent(node), 217)) {
return getTryCatchFinallyOccurrences(node.parent);
}
break;
- case 96:
- if (hasKind(node.parent, 213)) {
+ case 97:
+ if (hasKind(node.parent, 214)) {
return getSwitchCaseDefaultOccurrences(node.parent);
}
break;
- case 71:
- case 77:
- if (hasKind(parent(parent(parent(node))), 213)) {
+ case 72:
+ case 78:
+ if (hasKind(parent(parent(parent(node))), 214)) {
return getSwitchCaseDefaultOccurrences(node.parent.parent.parent);
}
break;
- case 70:
- case 75:
- if (hasKind(node.parent, 210) || hasKind(node.parent, 209)) {
+ case 71:
+ case 76:
+ if (hasKind(node.parent, 211) || hasKind(node.parent, 210)) {
return getBreakOrContinueStatementOccurrences(node.parent);
}
break;
- case 86:
- if (hasKind(node.parent, 206) ||
- hasKind(node.parent, 207) ||
- hasKind(node.parent, 208)) {
+ case 87:
+ if (hasKind(node.parent, 207) ||
+ hasKind(node.parent, 208) ||
+ hasKind(node.parent, 209)) {
return getLoopBreakContinueOccurrences(node.parent);
}
break;
- case 104:
- case 79:
- if (hasKind(node.parent, 205) || hasKind(node.parent, 204)) {
+ case 105:
+ case 80:
+ if (hasKind(node.parent, 206) || hasKind(node.parent, 205)) {
return getLoopBreakContinueOccurrences(node.parent);
}
break;
- case 121:
- if (hasKind(node.parent, 148)) {
+ case 122:
+ if (hasKind(node.parent, 149)) {
return getConstructorOccurrences(node.parent);
}
break;
- case 123:
- case 131:
- if (hasKind(node.parent, 149) || hasKind(node.parent, 150)) {
+ case 124:
+ case 132:
+ if (hasKind(node.parent, 150) || hasKind(node.parent, 151)) {
return getGetAndSetOccurrences(node.parent);
}
break;
default:
if (ts.isModifierKind(node.kind) && node.parent &&
- (ts.isDeclaration(node.parent) || node.parent.kind === 200)) {
+ (ts.isDeclaration(node.parent) || node.parent.kind === 201)) {
return getModifierOccurrences(node.kind, node.parent);
}
}
@@ -52800,10 +54139,10 @@ var ts;
aggregate(node);
return statementAccumulator;
function aggregate(node) {
- if (node.kind === 215) {
+ if (node.kind === 216) {
statementAccumulator.push(node);
}
- else if (node.kind === 216) {
+ else if (node.kind === 217) {
var tryStatement = node;
if (tryStatement.catchClause) {
aggregate(tryStatement.catchClause);
@@ -52827,7 +54166,7 @@ var ts;
if (ts.isFunctionBlock(parent_20) || parent_20.kind === 256) {
return parent_20;
}
- if (parent_20.kind === 216) {
+ if (parent_20.kind === 217) {
var tryStatement = parent_20;
if (tryStatement.tryBlock === child && tryStatement.catchClause) {
return child;
@@ -52842,7 +54181,7 @@ var ts;
aggregate(node);
return statementAccumulator;
function aggregate(node) {
- if (node.kind === 210 || node.kind === 209) {
+ if (node.kind === 211 || node.kind === 210) {
statementAccumulator.push(node);
}
else if (!ts.isFunctionLike(node)) {
@@ -52857,15 +54196,15 @@ var ts;
function getBreakOrContinueOwner(statement) {
for (var node_1 = statement.parent; node_1; node_1 = node_1.parent) {
switch (node_1.kind) {
- case 213:
- if (statement.kind === 209) {
+ case 214:
+ if (statement.kind === 210) {
continue;
}
- case 206:
case 207:
case 208:
+ case 209:
+ case 206:
case 205:
- case 204:
if (!statement.label || isLabeledBy(node_1, statement.label.text)) {
return node_1;
}
@@ -52882,24 +54221,24 @@ var ts;
function getModifierOccurrences(modifier, declaration) {
var container = declaration.parent;
if (ts.isAccessibilityModifier(modifier)) {
- if (!(container.kind === 221 ||
- container.kind === 192 ||
- (declaration.kind === 142 && hasKind(container, 148)))) {
+ if (!(container.kind === 222 ||
+ container.kind === 193 ||
+ (declaration.kind === 143 && hasKind(container, 149)))) {
return undefined;
}
}
- else if (modifier === 113) {
- if (!(container.kind === 221 || container.kind === 192)) {
+ else if (modifier === 114) {
+ if (!(container.kind === 222 || container.kind === 193)) {
return undefined;
}
}
- else if (modifier === 82 || modifier === 122) {
- if (!(container.kind === 226 || container.kind === 256)) {
+ else if (modifier === 83 || modifier === 123) {
+ if (!(container.kind === 227 || container.kind === 256)) {
return undefined;
}
}
- else if (modifier === 115) {
- if (!(container.kind === 221 || declaration.kind === 221)) {
+ else if (modifier === 116) {
+ if (!(container.kind === 222 || declaration.kind === 222)) {
return undefined;
}
}
@@ -52910,7 +54249,7 @@ var ts;
var modifierFlag = getFlagFromModifier(modifier);
var nodes;
switch (container.kind) {
- case 226:
+ case 227:
case 256:
if (modifierFlag & 128) {
nodes = declaration.members.concat(declaration);
@@ -52919,15 +54258,15 @@ var ts;
nodes = container.statements;
}
break;
- case 148:
+ case 149:
nodes = container.parameters.concat(container.parent.members);
break;
- case 221:
- case 192:
+ case 222:
+ case 193:
nodes = container.members;
if (modifierFlag & 28) {
var constructor = ts.forEach(container.members, function (member) {
- return member.kind === 148 && member;
+ return member.kind === 149 && member;
});
if (constructor) {
nodes = nodes.concat(constructor.parameters);
@@ -52948,19 +54287,19 @@ var ts;
return ts.map(keywords, getHighlightSpanForNode);
function getFlagFromModifier(modifier) {
switch (modifier) {
- case 112:
- return 4;
- case 110:
- return 8;
- case 111:
- return 16;
case 113:
+ return 4;
+ case 111:
+ return 8;
+ case 112:
+ return 16;
+ case 114:
return 32;
- case 82:
+ case 83:
return 1;
- case 122:
+ case 123:
return 2;
- case 115:
+ case 116:
return 128;
default:
ts.Debug.fail();
@@ -52980,13 +54319,13 @@ var ts;
}
function getGetAndSetOccurrences(accessorDeclaration) {
var keywords = [];
- tryPushAccessorKeyword(accessorDeclaration.symbol, 149);
tryPushAccessorKeyword(accessorDeclaration.symbol, 150);
+ tryPushAccessorKeyword(accessorDeclaration.symbol, 151);
return ts.map(keywords, getHighlightSpanForNode);
function tryPushAccessorKeyword(accessorSymbol, accessorKind) {
var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind);
if (accessor) {
- ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 123, 131); });
+ ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 124, 132); });
}
}
}
@@ -52995,18 +54334,18 @@ var ts;
var keywords = [];
ts.forEach(declarations, function (declaration) {
ts.forEach(declaration.getChildren(), function (token) {
- return pushKeywordIf(keywords, token, 121);
+ return pushKeywordIf(keywords, token, 122);
});
});
return ts.map(keywords, getHighlightSpanForNode);
}
function getLoopBreakContinueOccurrences(loopNode) {
var keywords = [];
- if (pushKeywordIf(keywords, loopNode.getFirstToken(), 86, 104, 79)) {
- if (loopNode.kind === 204) {
+ if (pushKeywordIf(keywords, loopNode.getFirstToken(), 87, 105, 80)) {
+ if (loopNode.kind === 205) {
var loopTokens = loopNode.getChildren();
for (var i = loopTokens.length - 1; i >= 0; i--) {
- if (pushKeywordIf(keywords, loopTokens[i], 104)) {
+ if (pushKeywordIf(keywords, loopTokens[i], 105)) {
break;
}
}
@@ -53015,7 +54354,7 @@ var ts;
var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement);
ts.forEach(breaksAndContinues, function (statement) {
if (ownsBreakOrContinueStatement(loopNode, statement)) {
- pushKeywordIf(keywords, statement.getFirstToken(), 70, 75);
+ pushKeywordIf(keywords, statement.getFirstToken(), 71, 76);
}
});
return ts.map(keywords, getHighlightSpanForNode);
@@ -53024,13 +54363,13 @@ var ts;
var owner = getBreakOrContinueOwner(breakOrContinueStatement);
if (owner) {
switch (owner.kind) {
- case 206:
case 207:
case 208:
- case 204:
+ case 209:
case 205:
+ case 206:
return getLoopBreakContinueOccurrences(owner);
- case 213:
+ case 214:
return getSwitchCaseDefaultOccurrences(owner);
}
}
@@ -53038,13 +54377,13 @@ var ts;
}
function getSwitchCaseDefaultOccurrences(switchStatement) {
var keywords = [];
- pushKeywordIf(keywords, switchStatement.getFirstToken(), 96);
+ pushKeywordIf(keywords, switchStatement.getFirstToken(), 97);
ts.forEach(switchStatement.caseBlock.clauses, function (clause) {
- pushKeywordIf(keywords, clause.getFirstToken(), 71, 77);
+ pushKeywordIf(keywords, clause.getFirstToken(), 72, 78);
var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause);
ts.forEach(breaksAndContinues, function (statement) {
if (ownsBreakOrContinueStatement(switchStatement, statement)) {
- pushKeywordIf(keywords, statement.getFirstToken(), 70);
+ pushKeywordIf(keywords, statement.getFirstToken(), 71);
}
});
});
@@ -53052,13 +54391,13 @@ var ts;
}
function getTryCatchFinallyOccurrences(tryStatement) {
var keywords = [];
- pushKeywordIf(keywords, tryStatement.getFirstToken(), 100);
+ pushKeywordIf(keywords, tryStatement.getFirstToken(), 101);
if (tryStatement.catchClause) {
- pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 72);
+ pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 73);
}
if (tryStatement.finallyBlock) {
- var finallyKeyword = ts.findChildOfKind(tryStatement, 85, sourceFile);
- pushKeywordIf(keywords, finallyKeyword, 85);
+ var finallyKeyword = ts.findChildOfKind(tryStatement, 86, sourceFile);
+ pushKeywordIf(keywords, finallyKeyword, 86);
}
return ts.map(keywords, getHighlightSpanForNode);
}
@@ -53069,50 +54408,50 @@ var ts;
}
var keywords = [];
ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) {
- pushKeywordIf(keywords, throwStatement.getFirstToken(), 98);
+ pushKeywordIf(keywords, throwStatement.getFirstToken(), 99);
});
if (ts.isFunctionBlock(owner)) {
ts.forEachReturnStatement(owner, function (returnStatement) {
- pushKeywordIf(keywords, returnStatement.getFirstToken(), 94);
+ pushKeywordIf(keywords, returnStatement.getFirstToken(), 95);
});
}
return ts.map(keywords, getHighlightSpanForNode);
}
function getReturnOccurrences(returnStatement) {
var func = ts.getContainingFunction(returnStatement);
- if (!(func && hasKind(func.body, 199))) {
+ if (!(func && hasKind(func.body, 200))) {
return undefined;
}
var keywords = [];
ts.forEachReturnStatement(func.body, function (returnStatement) {
- pushKeywordIf(keywords, returnStatement.getFirstToken(), 94);
+ pushKeywordIf(keywords, returnStatement.getFirstToken(), 95);
});
ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) {
- pushKeywordIf(keywords, throwStatement.getFirstToken(), 98);
+ pushKeywordIf(keywords, throwStatement.getFirstToken(), 99);
});
return ts.map(keywords, getHighlightSpanForNode);
}
function getIfElseOccurrences(ifStatement) {
var keywords = [];
- while (hasKind(ifStatement.parent, 203) && ifStatement.parent.elseStatement === ifStatement) {
+ while (hasKind(ifStatement.parent, 204) && ifStatement.parent.elseStatement === ifStatement) {
ifStatement = ifStatement.parent;
}
while (ifStatement) {
var children = ifStatement.getChildren();
- pushKeywordIf(keywords, children[0], 88);
+ pushKeywordIf(keywords, children[0], 89);
for (var i = children.length - 1; i >= 0; i--) {
- if (pushKeywordIf(keywords, children[i], 80)) {
+ if (pushKeywordIf(keywords, children[i], 81)) {
break;
}
}
- if (!hasKind(ifStatement.elseStatement, 203)) {
+ if (!hasKind(ifStatement.elseStatement, 204)) {
break;
}
ifStatement = ifStatement.elseStatement;
}
var result = [];
for (var i = 0; i < keywords.length; i++) {
- if (keywords[i].kind === 80 && i < keywords.length - 1) {
+ if (keywords[i].kind === 81 && i < keywords.length - 1) {
var elseKeyword = keywords[i];
var ifKeyword = keywords[i + 1];
var shouldCombindElseAndIf = true;
@@ -53140,7 +54479,7 @@ var ts;
}
DocumentHighlights.getDocumentHighlights = getDocumentHighlights;
function isLabeledBy(node, labelName) {
- for (var owner = node.parent; owner.kind === 214; owner = owner.parent) {
+ for (var owner = node.parent; owner.kind === 215; owner = owner.parent) {
if (owner.label.text === labelName) {
return true;
}
@@ -53265,9 +54604,9 @@ var ts;
if (!ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) {
break;
}
- case 69:
- case 97:
- case 121:
+ case 70:
+ case 98:
+ case 122:
case 9:
return getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, findInStrings, findInComments, false);
}
@@ -53288,7 +54627,7 @@ var ts;
if (ts.isThis(node)) {
return getReferencesForThisKeyword(node, sourceFiles);
}
- if (node.kind === 95) {
+ if (node.kind === 96) {
return getReferencesForSuperKeyword(node);
}
}
@@ -53313,7 +54652,7 @@ var ts;
getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex);
}
else {
- var internedName = getInternedName(symbol, node, declarations);
+ var internedName = getInternedName(symbol, node);
for (var _i = 0, sourceFiles_8 = sourceFiles; _i < sourceFiles_8.length; _i++) {
var sourceFile = sourceFiles_8[_i];
cancellationToken.throwIfCancellationRequested();
@@ -53344,16 +54683,16 @@ var ts;
}
function getAliasSymbolForPropertyNameSymbol(symbol, location) {
if (symbol.flags & 8388608) {
- var defaultImport = ts.getDeclarationOfKind(symbol, 231);
+ var defaultImport = ts.getDeclarationOfKind(symbol, 232);
if (defaultImport) {
return typeChecker.getAliasedSymbol(symbol);
}
- var importOrExportSpecifier = ts.forEach(symbol.declarations, function (declaration) { return (declaration.kind === 234 ||
- declaration.kind === 238) ? declaration : undefined; });
+ var importOrExportSpecifier = ts.forEach(symbol.declarations, function (declaration) { return (declaration.kind === 235 ||
+ declaration.kind === 239) ? declaration : undefined; });
if (importOrExportSpecifier &&
(!importOrExportSpecifier.propertyName ||
importOrExportSpecifier.propertyName === location)) {
- return importOrExportSpecifier.kind === 234 ?
+ return importOrExportSpecifier.kind === 235 ?
typeChecker.getAliasedSymbol(symbol) :
typeChecker.getExportSpecifierLocalTargetSymbol(importOrExportSpecifier);
}
@@ -53368,20 +54707,20 @@ var ts;
typeChecker.getPropertySymbolOfDestructuringAssignment(location);
}
function isObjectBindingPatternElementWithoutPropertyName(symbol) {
- var bindingElement = ts.getDeclarationOfKind(symbol, 169);
+ var bindingElement = ts.getDeclarationOfKind(symbol, 170);
return bindingElement &&
- bindingElement.parent.kind === 167 &&
+ bindingElement.parent.kind === 168 &&
!bindingElement.propertyName;
}
function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol) {
if (isObjectBindingPatternElementWithoutPropertyName(symbol)) {
- var bindingElement = ts.getDeclarationOfKind(symbol, 169);
+ var bindingElement = ts.getDeclarationOfKind(symbol, 170);
var typeOfPattern = typeChecker.getTypeAtLocation(bindingElement.parent);
return typeOfPattern && typeChecker.getPropertyOfType(typeOfPattern, bindingElement.name.text);
}
return undefined;
}
- function getInternedName(symbol, location, declarations) {
+ function getInternedName(symbol, location) {
if (ts.isImportOrExportSpecifierName(location)) {
return location.getText();
}
@@ -53391,13 +54730,13 @@ var ts;
}
function getSymbolScope(symbol) {
var valueDeclaration = symbol.valueDeclaration;
- if (valueDeclaration && (valueDeclaration.kind === 179 || valueDeclaration.kind === 192)) {
+ if (valueDeclaration && (valueDeclaration.kind === 180 || valueDeclaration.kind === 193)) {
return valueDeclaration;
}
if (symbol.flags & (4 | 8192)) {
var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (ts.getModifierFlags(d) & 8) ? d : undefined; });
if (privateDeclaration) {
- return ts.getAncestor(privateDeclaration, 221);
+ return ts.getAncestor(privateDeclaration, 222);
}
}
if (symbol.flags & 8388608) {
@@ -53443,8 +54782,8 @@ var ts;
if (position > end)
break;
var endPosition = position + symbolNameLength;
- if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) &&
- (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) {
+ if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 4)) &&
+ (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 4))) {
positions.push(position);
}
position = text.indexOf(symbolName, position + symbolNameLength + 1);
@@ -53481,7 +54820,7 @@ var ts;
function isValidReferencePosition(node, searchSymbolName) {
if (node) {
switch (node.kind) {
- case 69:
+ case 70:
return node.getWidth() === searchSymbolName.length;
case 9:
if (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) ||
@@ -53531,14 +54870,14 @@ var ts;
if (referenceSymbol) {
var referenceSymbolDeclaration = referenceSymbol.valueDeclaration;
var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
- var relatedSymbol = getRelatedSymbol(searchSymbols_1, referenceSymbol, referenceLocation, searchLocation.kind === 121, parents, inheritsFromCache);
+ var relatedSymbol = getRelatedSymbol(searchSymbols_1, referenceSymbol, referenceLocation, searchLocation.kind === 122, parents, inheritsFromCache);
if (relatedSymbol) {
addReferenceToRelatedSymbol(referenceLocation, relatedSymbol);
}
else if (!(referenceSymbol.flags & 67108864) && searchSymbols_1.indexOf(shorthandValueSymbol) >= 0) {
addReferenceToRelatedSymbol(referenceSymbolDeclaration.name, shorthandValueSymbol);
}
- else if (searchLocation.kind === 121) {
+ else if (searchLocation.kind === 122) {
findAdditionalConstructorReferences(referenceSymbol, referenceLocation);
}
}
@@ -53588,17 +54927,17 @@ var ts;
var result = [];
for (var _i = 0, _a = classSymbol.members["__constructor"].declarations; _i < _a.length; _i++) {
var decl = _a[_i];
- ts.Debug.assert(decl.kind === 148);
+ ts.Debug.assert(decl.kind === 149);
var ctrKeyword = decl.getChildAt(0);
- ts.Debug.assert(ctrKeyword.kind === 121);
+ ts.Debug.assert(ctrKeyword.kind === 122);
result.push(ctrKeyword);
}
ts.forEachProperty(classSymbol.exports, function (member) {
var decl = member.valueDeclaration;
- if (decl && decl.kind === 147) {
+ if (decl && decl.kind === 148) {
var body = decl.body;
if (body) {
- forEachDescendantOfKind(body, 97, function (thisKeyword) {
+ forEachDescendantOfKind(body, 98, function (thisKeyword) {
if (ts.isNewExpressionTarget(thisKeyword)) {
result.push(thisKeyword);
}
@@ -53617,10 +54956,10 @@ var ts;
var result = [];
for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) {
var decl = _a[_i];
- ts.Debug.assert(decl.kind === 148);
+ ts.Debug.assert(decl.kind === 149);
var body = decl.body;
if (body) {
- forEachDescendantOfKind(body, 95, function (node) {
+ forEachDescendantOfKind(body, 96, function (node) {
if (ts.isCallExpressionTarget(node)) {
result.push(node);
}
@@ -53657,7 +54996,7 @@ var ts;
if (ts.isDeclarationName(refNode) && isImplementation(refNode.parent)) {
result.push(getReferenceEntryFromNode(refNode.parent));
}
- else if (refNode.kind === 69) {
+ else if (refNode.kind === 70) {
if (refNode.parent.kind === 254) {
getReferenceEntriesForShorthandPropertyAssignment(refNode, typeChecker, result);
}
@@ -53673,7 +55012,7 @@ var ts;
maybeAdd(getReferenceEntryFromNode(parent_21.initializer));
}
else if (ts.isFunctionLike(parent_21) && parent_21.type === containingTypeReference && parent_21.body) {
- if (parent_21.body.kind === 199) {
+ if (parent_21.body.kind === 200) {
ts.forEachReturnStatement(parent_21.body, function (returnStatement) {
if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) {
maybeAdd(getReferenceEntryFromNode(returnStatement.expression));
@@ -53720,26 +55059,26 @@ var ts;
}
function getContainingClassIfInHeritageClause(node) {
if (node && node.parent) {
- if (node.kind === 194
+ if (node.kind === 195
&& node.parent.kind === 251
&& ts.isClassLike(node.parent.parent)) {
return node.parent.parent;
}
- else if (node.kind === 69 || node.kind === 172) {
+ else if (node.kind === 70 || node.kind === 173) {
return getContainingClassIfInHeritageClause(node.parent);
}
}
return undefined;
}
function isImplementationExpression(node) {
- if (node.kind === 178) {
+ if (node.kind === 179) {
return isImplementationExpression(node.expression);
}
- return node.kind === 180 ||
- node.kind === 179 ||
- node.kind === 171 ||
- node.kind === 192 ||
- node.kind === 170;
+ return node.kind === 181 ||
+ node.kind === 180 ||
+ node.kind === 172 ||
+ node.kind === 193 ||
+ node.kind === 171;
}
function explicitlyInheritsFrom(child, parent, cachedResults) {
var parentIsInterface = parent.getFlags() & 64;
@@ -53768,7 +55107,7 @@ var ts;
}
return searchTypeReference(ts.getClassExtendsHeritageClauseElement(declaration));
}
- else if (declaration.kind === 222) {
+ else if (declaration.kind === 223) {
if (parentIsInterface) {
return ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), searchTypeReference);
}
@@ -53795,13 +55134,13 @@ var ts;
}
var staticFlag = 32;
switch (searchSpaceNode.kind) {
- case 145:
- case 144:
- case 147:
case 146:
+ case 145:
case 148:
+ case 147:
case 149:
case 150:
+ case 151:
staticFlag &= ts.getModifierFlags(searchSpaceNode);
searchSpaceNode = searchSpaceNode.parent;
break;
@@ -53814,7 +55153,7 @@ var ts;
ts.forEach(possiblePositions, function (position) {
cancellationToken.throwIfCancellationRequested();
var node = ts.getTouchingWord(sourceFile, position);
- if (!node || node.kind !== 95) {
+ if (!node || node.kind !== 96) {
return;
}
var container = ts.getSuperContainer(node, false);
@@ -53829,16 +55168,16 @@ var ts;
var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false);
var staticFlag = 32;
switch (searchSpaceNode.kind) {
+ case 148:
case 147:
- case 146:
if (ts.isObjectLiteralMethod(searchSpaceNode)) {
break;
}
+ case 146:
case 145:
- case 144:
- case 148:
case 149:
case 150:
+ case 151:
staticFlag &= ts.getModifierFlags(searchSpaceNode);
searchSpaceNode = searchSpaceNode.parent;
break;
@@ -53846,8 +55185,8 @@ var ts;
if (ts.isExternalModule(searchSpaceNode)) {
return undefined;
}
- case 220:
- case 179:
+ case 221:
+ case 180:
break;
default:
return undefined;
@@ -53888,20 +55227,20 @@ var ts;
}
var container = ts.getThisContainer(node, false);
switch (searchSpaceNode.kind) {
- case 179:
- case 220:
+ case 180:
+ case 221:
if (searchSpaceNode.symbol === container.symbol) {
result.push(getReferenceEntryFromNode(node));
}
break;
+ case 148:
case 147:
- case 146:
if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) {
result.push(getReferenceEntryFromNode(node));
}
break;
- case 192:
- case 221:
+ case 193:
+ case 222:
if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32) === staticFlag) {
result.push(getReferenceEntryFromNode(node));
}
@@ -53975,7 +55314,7 @@ var ts;
result.push(shorthandValueSymbol);
}
}
- if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 142 &&
+ if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 143 &&
ts.isParameterPropertyDeclaration(symbol.valueDeclaration)) {
result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name));
}
@@ -54006,7 +55345,7 @@ var ts;
getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration));
ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference);
}
- else if (declaration.kind === 222) {
+ else if (declaration.kind === 223) {
ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference);
}
});
@@ -54069,7 +55408,7 @@ var ts;
});
}
function getNameFromObjectLiteralElement(node) {
- if (node.name.kind === 140) {
+ if (node.name.kind === 141) {
var nameExpression = node.name.expression;
if (ts.isStringOrNumericLiteral(nameExpression.kind)) {
return nameExpression.text;
@@ -54138,7 +55477,7 @@ var ts;
if (node.initializer) {
return true;
}
- else if (node.kind === 218) {
+ else if (node.kind === 219) {
var parentStatement = getParentStatementOfVariableDeclaration(node);
return parentStatement && ts.hasModifier(parentStatement, 2);
}
@@ -54148,18 +55487,18 @@ var ts;
}
else {
switch (node.kind) {
- case 221:
- case 192:
- case 224:
+ case 222:
+ case 193:
case 225:
+ case 226:
return true;
}
}
return false;
}
function getParentStatementOfVariableDeclaration(node) {
- if (node.parent && node.parent.parent && node.parent.parent.kind === 200) {
- ts.Debug.assert(node.parent.kind === 219);
+ if (node.parent && node.parent.parent && node.parent.parent.kind === 201) {
+ ts.Debug.assert(node.parent.kind === 220);
return node.parent.parent;
}
}
@@ -54192,17 +55531,17 @@ var ts;
}
FindAllReferences.getReferenceEntryFromNode = getReferenceEntryFromNode;
function isWriteAccess(node) {
- if (node.kind === 69 && ts.isDeclarationName(node)) {
+ if (node.kind === 70 && ts.isDeclarationName(node)) {
return true;
}
var parent = node.parent;
if (parent) {
- if (parent.kind === 186 || parent.kind === 185) {
+ if (parent.kind === 187 || parent.kind === 186) {
return true;
}
- else if (parent.kind === 187 && parent.left === node) {
+ else if (parent.kind === 188 && parent.left === node) {
var operator = parent.operatorToken.kind;
- return 56 <= operator && operator <= 68;
+ return 57 <= operator && operator <= 69;
}
}
return false;
@@ -54219,10 +55558,10 @@ var ts;
switch (node.kind) {
case 9:
case 8:
- if (node.parent.kind === 140) {
+ if (node.parent.kind === 141) {
return isObjectLiteralPropertyDeclaration(node.parent.parent) ? node.parent.parent : undefined;
}
- case 69:
+ case 70:
return isObjectLiteralPropertyDeclaration(node.parent) && node.parent.name === node ? node.parent : undefined;
}
return undefined;
@@ -54231,9 +55570,9 @@ var ts;
switch (node.kind) {
case 253:
case 254:
- case 147:
- case 149:
+ case 148:
case 150:
+ case 151:
return true;
}
return false;
@@ -54290,9 +55629,9 @@ var ts;
}
if (symbol.flags & 8388608) {
var declaration = symbol.declarations[0];
- if (node.kind === 69 &&
+ if (node.kind === 70 &&
(node.parent === declaration ||
- (declaration.kind === 234 && declaration.parent && declaration.parent.kind === 233))) {
+ (declaration.kind === 235 && declaration.parent && declaration.parent.kind === 234))) {
symbol = typeChecker.getAliasedSymbol(symbol);
}
}
@@ -54350,7 +55689,7 @@ var ts;
}
return result;
function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) {
- if (ts.isNewExpressionTarget(location) || location.kind === 121) {
+ if (ts.isNewExpressionTarget(location) || location.kind === 122) {
if (symbol.flags & 32) {
for (var _i = 0, _a = symbol.getDeclarations(); _i < _a.length; _i++) {
var declaration = _a[_i];
@@ -54373,8 +55712,8 @@ var ts;
var declarations = [];
var definition;
ts.forEach(signatureDeclarations, function (d) {
- if ((selectConstructors && d.kind === 148) ||
- (!selectConstructors && (d.kind === 220 || d.kind === 147 || d.kind === 146))) {
+ if ((selectConstructors && d.kind === 149) ||
+ (!selectConstructors && (d.kind === 221 || d.kind === 148 || d.kind === 147))) {
declarations.push(d);
if (d.body)
definition = d;
@@ -54455,7 +55794,7 @@ var ts;
ts.FindAllReferences.getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result);
return result.length > 0 ? result : undefined;
}
- else if (node.kind === 95 || ts.isSuperProperty(node.parent)) {
+ else if (node.kind === 96 || ts.isSuperProperty(node.parent)) {
var symbol = typeChecker.getSymbolAtLocation(node);
return symbol.valueDeclaration && [ts.FindAllReferences.getReferenceEntryFromNode(symbol.valueDeclaration)];
}
@@ -54519,7 +55858,7 @@ var ts;
"version"
];
var jsDocCompletionEntries;
- function getJsDocCommentsFromDeclarations(declarations, name, canUseParsedParamTagComments) {
+ function getJsDocCommentsFromDeclarations(declarations) {
var documentationComment = [];
forEachUnique(declarations, function (declaration) {
var comments = ts.getJSDocComments(declaration, true);
@@ -54558,7 +55897,7 @@ var ts;
name: tagName,
kind: ts.ScriptElementKind.keyword,
kindModifiers: "",
- sortText: "0"
+ sortText: "0",
};
}));
}
@@ -54575,16 +55914,16 @@ var ts;
var commentOwner;
findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) {
switch (commentOwner.kind) {
- case 220:
- case 147:
- case 148:
case 221:
- case 200:
+ case 148:
+ case 149:
+ case 222:
+ case 201:
break findOwner;
case 256:
return undefined;
- case 225:
- if (commentOwner.parent.kind === 225) {
+ case 226:
+ if (commentOwner.parent.kind === 226) {
return undefined;
}
break findOwner;
@@ -54600,7 +55939,7 @@ var ts;
var docParams = "";
for (var i = 0, numParams = parameters.length; i < numParams; i++) {
var currentName = parameters[i].name;
- var paramName = currentName.kind === 69 ?
+ var paramName = currentName.kind === 70 ?
currentName.text :
"param" + i;
docParams += indentationStr + " * @param " + paramName + newLine;
@@ -54618,7 +55957,7 @@ var ts;
if (ts.isFunctionLike(commentOwner)) {
return commentOwner.parameters;
}
- if (commentOwner.kind === 200) {
+ if (commentOwner.kind === 201) {
var varStatement = commentOwner;
var varDeclarations = varStatement.declarationList.declarations;
if (varDeclarations.length === 1 && varDeclarations[0].initializer) {
@@ -54628,17 +55967,17 @@ var ts;
return ts.emptyArray;
}
function getParametersFromRightHandSideOfAssignment(rightHandSide) {
- while (rightHandSide.kind === 178) {
+ while (rightHandSide.kind === 179) {
rightHandSide = rightHandSide.expression;
}
switch (rightHandSide.kind) {
- case 179:
case 180:
+ case 181:
return rightHandSide.parameters;
- case 192:
+ case 193:
for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind === 148) {
+ if (member.kind === 149) {
return member.parameters;
}
}
@@ -54649,13 +55988,153 @@ var ts;
})(JsDoc = ts.JsDoc || (ts.JsDoc = {}));
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ var JsTyping;
+ (function (JsTyping) {
+ ;
+ ;
+ var safeList;
+ var EmptySafeList = ts.createMap();
+ function discoverTypings(host, fileNames, projectRootPath, safeListPath, packageNameToTypingLocation, typingOptions) {
+ var inferredTypings = ts.createMap();
+ if (!typingOptions || !typingOptions.enableAutoDiscovery) {
+ return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] };
+ }
+ fileNames = ts.filter(ts.map(fileNames, ts.normalizePath), function (f) {
+ var kind = ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f));
+ return kind === 1 || kind === 2;
+ });
+ if (!safeList) {
+ var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); });
+ safeList = result.config ? ts.createMap(result.config) : EmptySafeList;
+ }
+ var filesToWatch = [];
+ var searchDirs = [];
+ var exclude = [];
+ mergeTypings(typingOptions.include);
+ exclude = typingOptions.exclude || [];
+ var possibleSearchDirs = ts.map(fileNames, ts.getDirectoryPath);
+ if (projectRootPath !== undefined) {
+ possibleSearchDirs.push(projectRootPath);
+ }
+ searchDirs = ts.deduplicate(possibleSearchDirs);
+ for (var _i = 0, searchDirs_1 = searchDirs; _i < searchDirs_1.length; _i++) {
+ var searchDir = searchDirs_1[_i];
+ var packageJsonPath = ts.combinePaths(searchDir, "package.json");
+ getTypingNamesFromJson(packageJsonPath, filesToWatch);
+ var bowerJsonPath = ts.combinePaths(searchDir, "bower.json");
+ getTypingNamesFromJson(bowerJsonPath, filesToWatch);
+ var nodeModulesPath = ts.combinePaths(searchDir, "node_modules");
+ getTypingNamesFromNodeModuleFolder(nodeModulesPath);
+ }
+ getTypingNamesFromSourceFileNames(fileNames);
+ for (var name_48 in packageNameToTypingLocation) {
+ if (name_48 in inferredTypings && !inferredTypings[name_48]) {
+ inferredTypings[name_48] = packageNameToTypingLocation[name_48];
+ }
+ }
+ for (var _a = 0, exclude_1 = exclude; _a < exclude_1.length; _a++) {
+ var excludeTypingName = exclude_1[_a];
+ delete inferredTypings[excludeTypingName];
+ }
+ var newTypingNames = [];
+ var cachedTypingPaths = [];
+ for (var typing in inferredTypings) {
+ if (inferredTypings[typing] !== undefined) {
+ cachedTypingPaths.push(inferredTypings[typing]);
+ }
+ else {
+ newTypingNames.push(typing);
+ }
+ }
+ return { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };
+ function mergeTypings(typingNames) {
+ if (!typingNames) {
+ return;
+ }
+ for (var _i = 0, typingNames_1 = typingNames; _i < typingNames_1.length; _i++) {
+ var typing = typingNames_1[_i];
+ if (!(typing in inferredTypings)) {
+ inferredTypings[typing] = undefined;
+ }
+ }
+ }
+ function getTypingNamesFromJson(jsonPath, filesToWatch) {
+ var result = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); });
+ if (result.config) {
+ var jsonConfig = result.config;
+ filesToWatch.push(jsonPath);
+ if (jsonConfig.dependencies) {
+ mergeTypings(ts.getOwnKeys(jsonConfig.dependencies));
+ }
+ if (jsonConfig.devDependencies) {
+ mergeTypings(ts.getOwnKeys(jsonConfig.devDependencies));
+ }
+ if (jsonConfig.optionalDependencies) {
+ mergeTypings(ts.getOwnKeys(jsonConfig.optionalDependencies));
+ }
+ if (jsonConfig.peerDependencies) {
+ mergeTypings(ts.getOwnKeys(jsonConfig.peerDependencies));
+ }
+ }
+ }
+ function getTypingNamesFromSourceFileNames(fileNames) {
+ var jsFileNames = ts.filter(fileNames, ts.hasJavaScriptFileExtension);
+ var inferredTypingNames = ts.map(jsFileNames, function (f) { return ts.removeFileExtension(ts.getBaseFileName(f.toLowerCase())); });
+ var cleanedTypingNames = ts.map(inferredTypingNames, function (f) { return f.replace(/((?:\.|-)min(?=\.|$))|((?:-|\.)\d+)/g, ""); });
+ if (safeList !== EmptySafeList) {
+ mergeTypings(ts.filter(cleanedTypingNames, function (f) { return f in safeList; }));
+ }
+ var hasJsxFile = ts.forEach(fileNames, function (f) { return ts.ensureScriptKind(f, ts.getScriptKindFromFileName(f)) === 2; });
+ if (hasJsxFile) {
+ mergeTypings(["react"]);
+ }
+ }
+ function getTypingNamesFromNodeModuleFolder(nodeModulesPath) {
+ if (!host.directoryExists(nodeModulesPath)) {
+ return;
+ }
+ var typingNames = [];
+ var fileNames = host.readDirectory(nodeModulesPath, [".json"], undefined, undefined, 2);
+ for (var _i = 0, fileNames_2 = fileNames; _i < fileNames_2.length; _i++) {
+ var fileName = fileNames_2[_i];
+ var normalizedFileName = ts.normalizePath(fileName);
+ if (ts.getBaseFileName(normalizedFileName) !== "package.json") {
+ continue;
+ }
+ var result = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); });
+ if (!result.config) {
+ continue;
+ }
+ var packageJson = result.config;
+ if (packageJson._requiredBy &&
+ ts.filter(packageJson._requiredBy, function (r) { return r[0] === "#" || r === "/"; }).length === 0) {
+ continue;
+ }
+ if (!packageJson.name) {
+ continue;
+ }
+ if (packageJson.typings) {
+ var absolutePath = ts.getNormalizedAbsolutePath(packageJson.typings, ts.getDirectoryPath(normalizedFileName));
+ inferredTypings[packageJson.name] = absolutePath;
+ }
+ else {
+ typingNames.push(packageJson.name);
+ }
+ }
+ mergeTypings(typingNames);
+ }
+ }
+ JsTyping.discoverTypings = discoverTypings;
+ })(JsTyping = ts.JsTyping || (ts.JsTyping = {}));
+})(ts || (ts = {}));
+var ts;
(function (ts) {
var NavigateTo;
(function (NavigateTo) {
function getNavigateToItems(sourceFiles, checker, cancellationToken, searchValue, maxResultCount, excludeDtsFiles) {
var patternMatcher = ts.createPatternMatcher(searchValue);
var rawItems = [];
- var baseSensitivity = { sensitivity: "base" };
ts.forEach(sourceFiles, function (sourceFile) {
cancellationToken.throwIfCancellationRequested();
if (excludeDtsFiles && ts.fileExtensionIs(sourceFile.fileName, ".d.ts")) {
@@ -54690,7 +56169,7 @@ var ts;
});
rawItems = ts.filter(rawItems, function (item) {
var decl = item.declaration;
- if (decl.kind === 231 || decl.kind === 234 || decl.kind === 229) {
+ if (decl.kind === 232 || decl.kind === 235 || decl.kind === 230) {
var importer = checker.getSymbolAtLocation(decl.name);
var imported = checker.getAliasedSymbol(importer);
return importer.name !== imported.name;
@@ -54717,7 +56196,7 @@ var ts;
}
function getTextOfIdentifierOrLiteral(node) {
if (node) {
- if (node.kind === 69 ||
+ if (node.kind === 70 ||
node.kind === 9 ||
node.kind === 8) {
return node.text;
@@ -54731,7 +56210,7 @@ var ts;
if (text !== undefined) {
containers.unshift(text);
}
- else if (declaration.name.kind === 140) {
+ else if (declaration.name.kind === 141) {
return tryAddComputedPropertyName(declaration.name.expression, containers, true);
}
else {
@@ -54748,7 +56227,7 @@ var ts;
}
return true;
}
- if (expression.kind === 172) {
+ if (expression.kind === 173) {
var propertyAccess = expression;
if (includeLastPortion) {
containers.unshift(propertyAccess.name.text);
@@ -54759,7 +56238,7 @@ var ts;
}
function getContainers(declaration) {
var containers = [];
- if (declaration.name.kind === 140) {
+ if (declaration.name.kind === 141) {
if (!tryAddComputedPropertyName(declaration.name.expression, containers, false)) {
return undefined;
}
@@ -54787,8 +56266,8 @@ var ts;
}
function compareNavigateToItems(i1, i2) {
return i1.matchKind - i2.matchKind ||
- i1.name.localeCompare(i2.name, undefined, baseSensitivity) ||
- i1.name.localeCompare(i2.name);
+ ts.compareStringsCaseInsensitive(i1.name, i2.name) ||
+ ts.compareStrings(i1.name, i2.name);
}
function createNavigateToItem(rawItem) {
var declaration = rawItem.declaration;
@@ -54891,7 +56370,7 @@ var ts;
return;
}
switch (node.kind) {
- case 148:
+ case 149:
var ctr = node;
addNodeWithRecursiveChild(ctr, ctr.body);
for (var _i = 0, _a = ctr.parameters; _i < _a.length; _i++) {
@@ -54901,28 +56380,28 @@ var ts;
}
}
break;
- case 147:
- case 149:
+ case 148:
case 150:
- case 146:
+ case 151:
+ case 147:
if (!ts.hasDynamicName(node)) {
addNodeWithRecursiveChild(node, node.body);
}
break;
+ case 146:
case 145:
- case 144:
if (!ts.hasDynamicName(node)) {
addLeafNode(node);
}
break;
- case 231:
+ case 232:
var importClause = node;
if (importClause.name) {
addLeafNode(importClause);
}
var namedBindings = importClause.namedBindings;
if (namedBindings) {
- if (namedBindings.kind === 232) {
+ if (namedBindings.kind === 233) {
addLeafNode(namedBindings);
}
else {
@@ -54933,8 +56412,8 @@ var ts;
}
}
break;
- case 169:
- case 218:
+ case 170:
+ case 219:
var decl = node;
var name_50 = decl.name;
if (ts.isBindingPattern(name_50)) {
@@ -54947,12 +56426,12 @@ var ts;
addNodeWithRecursiveChild(decl, decl.initializer);
}
break;
+ case 181:
+ case 221:
case 180:
- case 220:
- case 179:
addNodeWithRecursiveChild(node, node.body);
break;
- case 224:
+ case 225:
startNode(node);
for (var _d = 0, _e = node.members; _d < _e.length; _d++) {
var member = _e[_d];
@@ -54962,9 +56441,9 @@ var ts;
}
endNode();
break;
- case 221:
- case 192:
case 222:
+ case 193:
+ case 223:
startNode(node);
for (var _f = 0, _g = node.members; _f < _g.length; _f++) {
var member = _g[_f];
@@ -54972,15 +56451,15 @@ var ts;
}
endNode();
break;
- case 225:
+ case 226:
addNodeWithRecursiveChild(node, getInteriorModule(node).body);
break;
- case 238:
- case 229:
- case 153:
- case 151:
+ case 239:
+ case 230:
+ case 154:
case 152:
- case 223:
+ case 153:
+ case 224:
addLeafNode(node);
break;
default:
@@ -55034,12 +56513,12 @@ var ts;
}
});
function shouldReallyMerge(a, b) {
- return a.kind === b.kind && (a.kind !== 225 || areSameModule(a, b));
+ return a.kind === b.kind && (a.kind !== 226 || areSameModule(a, b));
function areSameModule(a, b) {
if (a.body.kind !== b.body.kind) {
return false;
}
- if (a.body.kind !== 225) {
+ if (a.body.kind !== 226) {
return true;
}
return areSameModule(a.body, b.body);
@@ -55072,9 +56551,8 @@ var ts;
return name1 ? 1 : name2 ? -1 : navigationBarNodeKind(child1) - navigationBarNodeKind(child2);
}
}
- var collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined;
- var localeCompareIsCorrect = collator && collator.compare("a", "B") < 0;
- var localeCompareFix = localeCompareIsCorrect ? collator.compare : function (a, b) {
+ var localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0;
+ var localeCompareFix = localeCompareIsCorrect ? ts.collator.compare : function (a, b) {
for (var i = 0; i < Math.min(a.length, b.length); i++) {
var chA = a.charAt(i), chB = b.charAt(i);
if (chA === "\"" && chB === "'") {
@@ -55083,7 +56561,7 @@ var ts;
if (chA === "'" && chB === "\"") {
return -1;
}
- var cmp = chA.toLocaleLowerCase().localeCompare(chB.toLocaleLowerCase());
+ var cmp = ts.compareStrings(chA.toLocaleLowerCase(), chB.toLocaleLowerCase());
if (cmp !== 0) {
return cmp;
}
@@ -55091,7 +56569,7 @@ var ts;
return a.length - b.length;
};
function tryGetName(node) {
- if (node.kind === 225) {
+ if (node.kind === 226) {
return getModuleName(node);
}
var decl = node;
@@ -55099,9 +56577,9 @@ var ts;
return ts.getPropertyNameForPropertyNameNode(decl.name);
}
switch (node.kind) {
- case 179:
case 180:
- case 192:
+ case 181:
+ case 193:
return getFunctionOrClassName(node);
case 279:
return getJSDocTypedefTagName(node);
@@ -55110,7 +56588,7 @@ var ts;
}
}
function getItemName(node) {
- if (node.kind === 225) {
+ if (node.kind === 226) {
return getModuleName(node);
}
var name = node.name;
@@ -55126,22 +56604,22 @@ var ts;
return ts.isExternalModule(sourceFile)
? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\""
: "";
- case 180:
- case 220:
- case 179:
+ case 181:
case 221:
- case 192:
+ case 180:
+ case 222:
+ case 193:
if (ts.getModifierFlags(node) & 512) {
return "default";
}
return getFunctionOrClassName(node);
- case 148:
+ case 149:
return "constructor";
- case 152:
- return "new()";
- case 151:
- return "()";
case 153:
+ return "new()";
+ case 152:
+ return "()";
+ case 154:
return "[]";
case 279:
return getJSDocTypedefTagName(node);
@@ -55155,10 +56633,10 @@ var ts;
}
else {
var parentNode = node.parent && node.parent.parent;
- if (parentNode && parentNode.kind === 200) {
+ if (parentNode && parentNode.kind === 201) {
if (parentNode.declarationList.declarations.length > 0) {
var nameIdentifier = parentNode.declarationList.declarations[0].name;
- if (nameIdentifier.kind === 69) {
+ if (nameIdentifier.kind === 70) {
return nameIdentifier.text;
}
}
@@ -55183,24 +56661,24 @@ var ts;
return topLevel;
function isTopLevel(item) {
switch (navigationBarNodeKind(item)) {
- case 221:
- case 192:
- case 224:
case 222:
+ case 193:
case 225:
- case 256:
case 223:
+ case 226:
+ case 256:
+ case 224:
case 279:
return true;
- case 148:
- case 147:
case 149:
+ case 148:
case 150:
- case 218:
+ case 151:
+ case 219:
return hasSomeImportantChild(item);
+ case 181:
+ case 221:
case 180:
- case 220:
- case 179:
return isTopLevelFunctionDeclaration(item);
default:
return false;
@@ -55210,10 +56688,10 @@ var ts;
return false;
}
switch (navigationBarNodeKind(item.parent)) {
- case 226:
+ case 227:
case 256:
- case 147:
case 148:
+ case 149:
return true;
default:
return hasSomeImportantChild(item);
@@ -55222,7 +56700,7 @@ var ts;
function hasSomeImportantChild(item) {
return ts.forEach(item.children, function (child) {
var childKind = navigationBarNodeKind(child);
- return childKind !== 218 && childKind !== 169;
+ return childKind !== 219 && childKind !== 170;
});
}
}
@@ -55277,17 +56755,17 @@ var ts;
}
var result = [];
result.push(moduleDeclaration.name.text);
- while (moduleDeclaration.body && moduleDeclaration.body.kind === 225) {
+ while (moduleDeclaration.body && moduleDeclaration.body.kind === 226) {
moduleDeclaration = moduleDeclaration.body;
result.push(moduleDeclaration.name.text);
}
return result.join(".");
}
function getInteriorModule(decl) {
- return decl.body.kind === 225 ? getInteriorModule(decl.body) : decl;
+ return decl.body.kind === 226 ? getInteriorModule(decl.body) : decl;
}
function isComputedProperty(member) {
- return !member.name || member.name.kind === 140;
+ return !member.name || member.name.kind === 141;
}
function getNodeSpan(node) {
return node.kind === 256
@@ -55298,11 +56776,11 @@ var ts;
if (node.name && ts.getFullWidth(node.name) > 0) {
return ts.declarationNameToString(node.name);
}
- else if (node.parent.kind === 218) {
+ else if (node.parent.kind === 219) {
return ts.declarationNameToString(node.parent.name);
}
- else if (node.parent.kind === 187 &&
- node.parent.operatorToken.kind === 56) {
+ else if (node.parent.kind === 188 &&
+ node.parent.operatorToken.kind === 57) {
return nodeText(node.parent.left);
}
else if (node.parent.kind === 253 && node.parent.name) {
@@ -55316,7 +56794,7 @@ var ts;
}
}
function isFunctionOrClassExpression(node) {
- return node.kind === 179 || node.kind === 180 || node.kind === 192;
+ return node.kind === 180 || node.kind === 181 || node.kind === 193;
}
})(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {}));
})(ts || (ts = {}));
@@ -55388,7 +56866,7 @@ var ts;
}
}
function autoCollapse(node) {
- return ts.isFunctionBlock(node) && node.parent.kind !== 180;
+ return ts.isFunctionBlock(node) && node.parent.kind !== 181;
}
var depth = 0;
var maxDepth = 20;
@@ -55400,30 +56878,30 @@ var ts;
addOutliningForLeadingCommentsForNode(n);
}
switch (n.kind) {
- case 199:
+ case 200:
if (!ts.isFunctionBlock(n)) {
var parent_22 = n.parent;
- var openBrace = ts.findChildOfKind(n, 15, sourceFile);
- var closeBrace = ts.findChildOfKind(n, 16, sourceFile);
- if (parent_22.kind === 204 ||
- parent_22.kind === 207 ||
+ var openBrace = ts.findChildOfKind(n, 16, sourceFile);
+ var closeBrace = ts.findChildOfKind(n, 17, sourceFile);
+ if (parent_22.kind === 205 ||
parent_22.kind === 208 ||
+ parent_22.kind === 209 ||
+ parent_22.kind === 207 ||
+ parent_22.kind === 204 ||
parent_22.kind === 206 ||
- parent_22.kind === 203 ||
- parent_22.kind === 205 ||
- parent_22.kind === 212 ||
+ parent_22.kind === 213 ||
parent_22.kind === 252) {
addOutliningSpan(parent_22, openBrace, closeBrace, autoCollapse(n));
break;
}
- if (parent_22.kind === 216) {
+ if (parent_22.kind === 217) {
var tryStatement = parent_22;
if (tryStatement.tryBlock === n) {
addOutliningSpan(parent_22, openBrace, closeBrace, autoCollapse(n));
break;
}
else if (tryStatement.finallyBlock === n) {
- var finallyKeyword = ts.findChildOfKind(tryStatement, 85, sourceFile);
+ var finallyKeyword = ts.findChildOfKind(tryStatement, 86, sourceFile);
if (finallyKeyword) {
addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n));
break;
@@ -55439,25 +56917,25 @@ var ts;
});
break;
}
- case 226: {
- var openBrace = ts.findChildOfKind(n, 15, sourceFile);
- var closeBrace = ts.findChildOfKind(n, 16, sourceFile);
+ case 227: {
+ var openBrace = ts.findChildOfKind(n, 16, sourceFile);
+ var closeBrace = ts.findChildOfKind(n, 17, sourceFile);
addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n));
break;
}
- case 221:
case 222:
- case 224:
- case 171:
- case 227: {
- var openBrace = ts.findChildOfKind(n, 15, sourceFile);
- var closeBrace = ts.findChildOfKind(n, 16, sourceFile);
+ case 223:
+ case 225:
+ case 172:
+ case 228: {
+ var openBrace = ts.findChildOfKind(n, 16, sourceFile);
+ var closeBrace = ts.findChildOfKind(n, 17, sourceFile);
addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n));
break;
}
- case 170:
- var openBracket = ts.findChildOfKind(n, 19, sourceFile);
- var closeBracket = ts.findChildOfKind(n, 20, sourceFile);
+ case 171:
+ var openBracket = ts.findChildOfKind(n, 20, sourceFile);
+ var closeBracket = ts.findChildOfKind(n, 21, sourceFile);
addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n));
break;
}
@@ -55700,7 +57178,7 @@ var ts;
if (ch >= 65 && ch <= 90) {
return true;
}
- if (ch < 127 || !ts.isUnicodeIdentifierStart(ch, 2)) {
+ if (ch < 127 || !ts.isUnicodeIdentifierStart(ch, 4)) {
return false;
}
var str = String.fromCharCode(ch);
@@ -55710,7 +57188,7 @@ var ts;
if (ch >= 97 && ch <= 122) {
return true;
}
- if (ch < 127 || !ts.isUnicodeIdentifierStart(ch, 2)) {
+ if (ch < 127 || !ts.isUnicodeIdentifierStart(ch, 4)) {
return false;
}
var str = String.fromCharCode(ch);
@@ -55893,10 +57371,10 @@ var ts;
var externalModule = false;
function nextToken() {
var token = ts.scanner.scan();
- if (token === 15) {
+ if (token === 16) {
braceNesting++;
}
- else if (token === 16) {
+ else if (token === 17) {
braceNesting--;
}
return token;
@@ -55944,9 +57422,9 @@ var ts;
}
function tryConsumeDeclare() {
var token = ts.scanner.getToken();
- if (token === 122) {
+ if (token === 123) {
token = nextToken();
- if (token === 125) {
+ if (token === 126) {
token = nextToken();
if (token === 9) {
recordAmbientExternalModule();
@@ -55958,42 +57436,42 @@ var ts;
}
function tryConsumeImport() {
var token = ts.scanner.getToken();
- if (token === 89) {
+ if (token === 90) {
token = nextToken();
if (token === 9) {
recordModuleName();
return true;
}
else {
- if (token === 69 || ts.isKeyword(token)) {
+ if (token === 70 || ts.isKeyword(token)) {
token = nextToken();
- if (token === 136) {
+ if (token === 137) {
token = nextToken();
if (token === 9) {
recordModuleName();
return true;
}
}
- else if (token === 56) {
+ else if (token === 57) {
if (tryConsumeRequireCall(true)) {
return true;
}
}
- else if (token === 24) {
+ else if (token === 25) {
token = nextToken();
}
else {
return true;
}
}
- if (token === 15) {
+ if (token === 16) {
token = nextToken();
- while (token !== 16 && token !== 1) {
+ while (token !== 17 && token !== 1) {
token = nextToken();
}
- if (token === 16) {
+ if (token === 17) {
token = nextToken();
- if (token === 136) {
+ if (token === 137) {
token = nextToken();
if (token === 9) {
recordModuleName();
@@ -56001,13 +57479,13 @@ var ts;
}
}
}
- else if (token === 37) {
+ else if (token === 38) {
token = nextToken();
- if (token === 116) {
+ if (token === 117) {
token = nextToken();
- if (token === 69 || ts.isKeyword(token)) {
+ if (token === 70 || ts.isKeyword(token)) {
token = nextToken();
- if (token === 136) {
+ if (token === 137) {
token = nextToken();
if (token === 9) {
recordModuleName();
@@ -56023,17 +57501,17 @@ var ts;
}
function tryConsumeExport() {
var token = ts.scanner.getToken();
- if (token === 82) {
+ if (token === 83) {
markAsExternalModuleIfTopLevel();
token = nextToken();
- if (token === 15) {
+ if (token === 16) {
token = nextToken();
- while (token !== 16 && token !== 1) {
+ while (token !== 17 && token !== 1) {
token = nextToken();
}
- if (token === 16) {
+ if (token === 17) {
token = nextToken();
- if (token === 136) {
+ if (token === 137) {
token = nextToken();
if (token === 9) {
recordModuleName();
@@ -56041,20 +57519,20 @@ var ts;
}
}
}
- else if (token === 37) {
+ else if (token === 38) {
token = nextToken();
- if (token === 136) {
+ if (token === 137) {
token = nextToken();
if (token === 9) {
recordModuleName();
}
}
}
- else if (token === 89) {
+ else if (token === 90) {
token = nextToken();
- if (token === 69 || ts.isKeyword(token)) {
+ if (token === 70 || ts.isKeyword(token)) {
token = nextToken();
- if (token === 56) {
+ if (token === 57) {
if (tryConsumeRequireCall(true)) {
return true;
}
@@ -56067,9 +57545,9 @@ var ts;
}
function tryConsumeRequireCall(skipCurrentToken) {
var token = skipCurrentToken ? nextToken() : ts.scanner.getToken();
- if (token === 129) {
+ if (token === 130) {
token = nextToken();
- if (token === 17) {
+ if (token === 18) {
token = nextToken();
if (token === 9) {
recordModuleName();
@@ -56081,27 +57559,27 @@ var ts;
}
function tryConsumeDefine() {
var token = ts.scanner.getToken();
- if (token === 69 && ts.scanner.getTokenValue() === "define") {
+ if (token === 70 && ts.scanner.getTokenValue() === "define") {
token = nextToken();
- if (token !== 17) {
+ if (token !== 18) {
return true;
}
token = nextToken();
if (token === 9) {
token = nextToken();
- if (token === 24) {
+ if (token === 25) {
token = nextToken();
}
else {
return true;
}
}
- if (token !== 19) {
+ if (token !== 20) {
return true;
}
token = nextToken();
var i = 0;
- while (token !== 20 && token !== 1) {
+ while (token !== 21 && token !== 1) {
if (token === 9) {
recordModuleName();
i++;
@@ -56173,7 +57651,7 @@ var ts;
var canonicalDefaultLibName = getCanonicalFileName(ts.normalizePath(defaultLibFileName));
var node = ts.getTouchingWord(sourceFile, position, true);
if (node) {
- if (node.kind === 69 ||
+ if (node.kind === 70 ||
node.kind === 9 ||
ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) ||
ts.isThis(node)) {
@@ -56261,6 +57739,12 @@ var ts;
var SignatureHelp;
(function (SignatureHelp) {
var emptyArray = [];
+ (function (ArgumentListKind) {
+ ArgumentListKind[ArgumentListKind["TypeArguments"] = 0] = "TypeArguments";
+ ArgumentListKind[ArgumentListKind["CallArguments"] = 1] = "CallArguments";
+ ArgumentListKind[ArgumentListKind["TaggedTemplateArguments"] = 2] = "TaggedTemplateArguments";
+ })(SignatureHelp.ArgumentListKind || (SignatureHelp.ArgumentListKind = {}));
+ var ArgumentListKind = SignatureHelp.ArgumentListKind;
function getSignatureHelpItems(program, sourceFile, position, cancellationToken) {
var typeChecker = program.getTypeChecker();
var startingToken = ts.findTokenOnLeftOfPosition(sourceFile, position);
@@ -56286,14 +57770,14 @@ var ts;
}
SignatureHelp.getSignatureHelpItems = getSignatureHelpItems;
function createJavaScriptSignatureHelpItems(argumentInfo, program) {
- if (argumentInfo.invocation.kind !== 174) {
+ if (argumentInfo.invocation.kind !== 175) {
return undefined;
}
var callExpression = argumentInfo.invocation;
var expression = callExpression.expression;
- var name = expression.kind === 69
+ var name = expression.kind === 70
? expression
- : expression.kind === 172
+ : expression.kind === 173
? expression.name
: undefined;
if (!name || !name.text) {
@@ -56322,10 +57806,10 @@ var ts;
}
}
function getImmediatelyContainingArgumentInfo(node, position, sourceFile) {
- if (node.parent.kind === 174 || node.parent.kind === 175) {
+ if (node.parent.kind === 175 || node.parent.kind === 176) {
var callExpression = node.parent;
- if (node.kind === 25 ||
- node.kind === 17) {
+ if (node.kind === 26 ||
+ node.kind === 18) {
var list = getChildListThatStartsWithOpenerToken(callExpression, node, sourceFile);
var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos;
ts.Debug.assert(list !== undefined);
@@ -56354,24 +57838,24 @@ var ts;
}
return undefined;
}
- else if (node.kind === 11 && node.parent.kind === 176) {
+ else if (node.kind === 12 && node.parent.kind === 177) {
if (ts.isInsideTemplateLiteral(node, position)) {
return getArgumentListInfoForTemplate(node.parent, 0, sourceFile);
}
}
- else if (node.kind === 12 && node.parent.parent.kind === 176) {
+ else if (node.kind === 13 && node.parent.parent.kind === 177) {
var templateExpression = node.parent;
var tagExpression = templateExpression.parent;
- ts.Debug.assert(templateExpression.kind === 189);
+ ts.Debug.assert(templateExpression.kind === 190);
var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1;
return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile);
}
- else if (node.parent.kind === 197 && node.parent.parent.parent.kind === 176) {
+ else if (node.parent.kind === 198 && node.parent.parent.parent.kind === 177) {
var templateSpan = node.parent;
var templateExpression = templateSpan.parent;
var tagExpression = templateExpression.parent;
- ts.Debug.assert(templateExpression.kind === 189);
- if (node.kind === 14 && !ts.isInsideTemplateLiteral(node, position)) {
+ ts.Debug.assert(templateExpression.kind === 190);
+ if (node.kind === 15 && !ts.isInsideTemplateLiteral(node, position)) {
return undefined;
}
var spanIndex = templateExpression.templateSpans.indexOf(templateSpan);
@@ -56388,7 +57872,7 @@ var ts;
if (child === node) {
break;
}
- if (child.kind !== 24) {
+ if (child.kind !== 25) {
argumentIndex++;
}
}
@@ -56396,8 +57880,8 @@ var ts;
}
function getArgumentCount(argumentsList) {
var listChildren = argumentsList.getChildren();
- var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 24; });
- if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 24) {
+ var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 25; });
+ if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 25) {
argumentCount++;
}
return argumentCount;
@@ -56413,7 +57897,7 @@ var ts;
return spanIndex + 1;
}
function getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile) {
- var argumentCount = tagExpression.template.kind === 11
+ var argumentCount = tagExpression.template.kind === 12
? 1
: tagExpression.template.templateSpans.length + 1;
ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex);
@@ -56434,7 +57918,7 @@ var ts;
var template = taggedTemplate.template;
var applicableSpanStart = template.getStart();
var applicableSpanEnd = template.getEnd();
- if (template.kind === 189) {
+ if (template.kind === 190) {
var lastSpan = ts.lastOrUndefined(template.templateSpans);
if (lastSpan.literal.getFullWidth() === 0) {
applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false);
@@ -56494,10 +57978,10 @@ var ts;
ts.addRange(prefixDisplayParts, callTargetDisplayParts);
}
if (isTypeParameterList) {
- prefixDisplayParts.push(ts.punctuationPart(25));
+ prefixDisplayParts.push(ts.punctuationPart(26));
var typeParameters = candidateSignature.typeParameters;
signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray;
- suffixDisplayParts.push(ts.punctuationPart(27));
+ suffixDisplayParts.push(ts.punctuationPart(28));
var parameterParts = ts.mapToDisplayParts(function (writer) {
return typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.thisParameter, candidateSignature.parameters, writer, invocation);
});
@@ -56508,10 +57992,10 @@ var ts;
return typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation);
});
ts.addRange(prefixDisplayParts, typeParameterParts);
- prefixDisplayParts.push(ts.punctuationPart(17));
+ prefixDisplayParts.push(ts.punctuationPart(18));
var parameters = candidateSignature.parameters;
signatureHelpParameters = parameters.length > 0 ? ts.map(parameters, createSignatureHelpParameterForParameter) : emptyArray;
- suffixDisplayParts.push(ts.punctuationPart(18));
+ suffixDisplayParts.push(ts.punctuationPart(19));
}
var returnTypeParts = ts.mapToDisplayParts(function (writer) {
return typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation);
@@ -56521,7 +58005,7 @@ var ts;
isVariadic: candidateSignature.hasRestParameter,
prefixDisplayParts: prefixDisplayParts,
suffixDisplayParts: suffixDisplayParts,
- separatorDisplayParts: [ts.punctuationPart(24), ts.spacePart()],
+ separatorDisplayParts: [ts.punctuationPart(25), ts.spacePart()],
parameters: signatureHelpParameters,
documentation: candidateSignature.getDocumentationComment()
};
@@ -56572,7 +58056,7 @@ var ts;
function getSymbolKind(typeChecker, symbol, location) {
var flags = symbol.getFlags();
if (flags & 32)
- return ts.getDeclarationOfKind(symbol, 192) ?
+ return ts.getDeclarationOfKind(symbol, 193) ?
ts.ScriptElementKind.localClassElement : ts.ScriptElementKind.classElement;
if (flags & 384)
return ts.ScriptElementKind.enumElement;
@@ -56603,7 +58087,7 @@ var ts;
if (typeChecker.isArgumentsSymbol(symbol)) {
return ts.ScriptElementKind.localVariableElement;
}
- if (location.kind === 97 && ts.isExpression(location)) {
+ if (location.kind === 98 && ts.isExpression(location)) {
return ts.ScriptElementKind.parameterElement;
}
if (flags & 3) {
@@ -56663,7 +58147,7 @@ var ts;
var symbolFlags = symbol.flags;
var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, symbolFlags, location);
var hasAddedSymbolInfo;
- var isThisExpression = location.kind === 97 && ts.isExpression(location);
+ var isThisExpression = location.kind === 98 && ts.isExpression(location);
var type;
if (symbolKind !== ts.ScriptElementKind.unknown || symbolFlags & 32 || symbolFlags & 8388608) {
if (symbolKind === ts.ScriptElementKind.memberGetAccessorElement || symbolKind === ts.ScriptElementKind.memberSetAccessorElement) {
@@ -56672,14 +58156,14 @@ var ts;
var signature = void 0;
type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location);
if (type) {
- if (location.parent && location.parent.kind === 172) {
+ if (location.parent && location.parent.kind === 173) {
var right = location.parent.name;
if (right === location || (right && right.getFullWidth() === 0)) {
location = location.parent;
}
}
var callExpression = void 0;
- if (location.kind === 174 || location.kind === 175) {
+ if (location.kind === 175 || location.kind === 176) {
callExpression = location;
}
else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) {
@@ -56691,7 +58175,7 @@ var ts;
if (!signature && candidateSignatures.length) {
signature = candidateSignatures[0];
}
- var useConstructSignatures = callExpression.kind === 175 || callExpression.expression.kind === 95;
+ var useConstructSignatures = callExpression.kind === 176 || callExpression.expression.kind === 96;
var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures();
if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) {
signature = allSignatures.length ? allSignatures[0] : undefined;
@@ -56706,7 +58190,7 @@ var ts;
pushTypePart(symbolKind);
displayParts.push(ts.spacePart());
if (useConstructSignatures) {
- displayParts.push(ts.keywordPart(92));
+ displayParts.push(ts.keywordPart(93));
displayParts.push(ts.spacePart());
}
addFullSymbolName(symbol);
@@ -56721,10 +58205,10 @@ var ts;
case ts.ScriptElementKind.letElement:
case ts.ScriptElementKind.parameterElement:
case ts.ScriptElementKind.localVariableElement:
- displayParts.push(ts.punctuationPart(54));
+ displayParts.push(ts.punctuationPart(55));
displayParts.push(ts.spacePart());
if (useConstructSignatures) {
- displayParts.push(ts.keywordPart(92));
+ displayParts.push(ts.keywordPart(93));
displayParts.push(ts.spacePart());
}
if (!(type.flags & 2097152) && type.symbol) {
@@ -56739,21 +58223,21 @@ var ts;
}
}
else if ((ts.isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) ||
- (location.kind === 121 && location.parent.kind === 148)) {
+ (location.kind === 122 && location.parent.kind === 149)) {
var functionDeclaration = location.parent;
- var allSignatures = functionDeclaration.kind === 148 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures();
+ var allSignatures = functionDeclaration.kind === 149 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures();
if (!typeChecker.isImplementationOfOverload(functionDeclaration)) {
signature = typeChecker.getSignatureFromDeclaration(functionDeclaration);
}
else {
signature = allSignatures[0];
}
- if (functionDeclaration.kind === 148) {
+ if (functionDeclaration.kind === 149) {
symbolKind = ts.ScriptElementKind.constructorImplementationElement;
addPrefixForAnyFunctionOrVar(type.symbol, symbolKind);
}
else {
- addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 151 &&
+ addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 152 &&
!(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind);
}
addSignatureDisplayParts(signature, allSignatures);
@@ -56762,11 +58246,11 @@ var ts;
}
}
if (symbolFlags & 32 && !hasAddedSymbolInfo && !isThisExpression) {
- if (ts.getDeclarationOfKind(symbol, 192)) {
+ if (ts.getDeclarationOfKind(symbol, 193)) {
pushTypePart(ts.ScriptElementKind.localClassElement);
}
else {
- displayParts.push(ts.keywordPart(73));
+ displayParts.push(ts.keywordPart(74));
}
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
@@ -56774,72 +58258,72 @@ var ts;
}
if ((symbolFlags & 64) && (semanticMeaning & 2)) {
addNewLineIfDisplayPartsExist();
- displayParts.push(ts.keywordPart(107));
+ displayParts.push(ts.keywordPart(108));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
writeTypeParametersOfSymbol(symbol, sourceFile);
}
if (symbolFlags & 524288) {
addNewLineIfDisplayPartsExist();
- displayParts.push(ts.keywordPart(134));
+ displayParts.push(ts.keywordPart(135));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
writeTypeParametersOfSymbol(symbol, sourceFile);
displayParts.push(ts.spacePart());
- displayParts.push(ts.operatorPart(56));
+ displayParts.push(ts.operatorPart(57));
displayParts.push(ts.spacePart());
ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 512));
}
if (symbolFlags & 384) {
addNewLineIfDisplayPartsExist();
if (ts.forEach(symbol.declarations, ts.isConstEnumDeclaration)) {
- displayParts.push(ts.keywordPart(74));
+ displayParts.push(ts.keywordPart(75));
displayParts.push(ts.spacePart());
}
- displayParts.push(ts.keywordPart(81));
+ displayParts.push(ts.keywordPart(82));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
}
if (symbolFlags & 1536) {
addNewLineIfDisplayPartsExist();
- var declaration = ts.getDeclarationOfKind(symbol, 225);
- var isNamespace = declaration && declaration.name && declaration.name.kind === 69;
- displayParts.push(ts.keywordPart(isNamespace ? 126 : 125));
+ var declaration = ts.getDeclarationOfKind(symbol, 226);
+ var isNamespace = declaration && declaration.name && declaration.name.kind === 70;
+ displayParts.push(ts.keywordPart(isNamespace ? 127 : 126));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
}
if ((symbolFlags & 262144) && (semanticMeaning & 2)) {
addNewLineIfDisplayPartsExist();
- displayParts.push(ts.punctuationPart(17));
- displayParts.push(ts.textPart("type parameter"));
displayParts.push(ts.punctuationPart(18));
+ displayParts.push(ts.textPart("type parameter"));
+ displayParts.push(ts.punctuationPart(19));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
displayParts.push(ts.spacePart());
- displayParts.push(ts.keywordPart(90));
+ displayParts.push(ts.keywordPart(91));
displayParts.push(ts.spacePart());
if (symbol.parent) {
addFullSymbolName(symbol.parent, enclosingDeclaration);
writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration);
}
else {
- var declaration = ts.getDeclarationOfKind(symbol, 141);
+ var declaration = ts.getDeclarationOfKind(symbol, 142);
ts.Debug.assert(declaration !== undefined);
declaration = declaration.parent;
if (declaration) {
if (ts.isFunctionLikeKind(declaration.kind)) {
var signature = typeChecker.getSignatureFromDeclaration(declaration);
- if (declaration.kind === 152) {
- displayParts.push(ts.keywordPart(92));
+ if (declaration.kind === 153) {
+ displayParts.push(ts.keywordPart(93));
displayParts.push(ts.spacePart());
}
- else if (declaration.kind !== 151 && declaration.name) {
+ else if (declaration.kind !== 152 && declaration.name) {
addFullSymbolName(declaration.symbol);
}
ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32));
}
else {
- displayParts.push(ts.keywordPart(134));
+ displayParts.push(ts.keywordPart(135));
displayParts.push(ts.spacePart());
addFullSymbolName(declaration.symbol);
writeTypeParametersOfSymbol(declaration.symbol, sourceFile);
@@ -56854,7 +58338,7 @@ var ts;
var constantValue = typeChecker.getConstantValue(declaration);
if (constantValue !== undefined) {
displayParts.push(ts.spacePart());
- displayParts.push(ts.operatorPart(56));
+ displayParts.push(ts.operatorPart(57));
displayParts.push(ts.spacePart());
displayParts.push(ts.displayPart(constantValue.toString(), ts.SymbolDisplayPartKind.numericLiteral));
}
@@ -56862,33 +58346,33 @@ var ts;
}
if (symbolFlags & 8388608) {
addNewLineIfDisplayPartsExist();
- if (symbol.declarations[0].kind === 228) {
- displayParts.push(ts.keywordPart(82));
+ if (symbol.declarations[0].kind === 229) {
+ displayParts.push(ts.keywordPart(83));
displayParts.push(ts.spacePart());
- displayParts.push(ts.keywordPart(126));
+ displayParts.push(ts.keywordPart(127));
}
else {
- displayParts.push(ts.keywordPart(89));
+ displayParts.push(ts.keywordPart(90));
}
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
ts.forEach(symbol.declarations, function (declaration) {
- if (declaration.kind === 229) {
+ if (declaration.kind === 230) {
var importEqualsDeclaration = declaration;
if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) {
displayParts.push(ts.spacePart());
- displayParts.push(ts.operatorPart(56));
+ displayParts.push(ts.operatorPart(57));
displayParts.push(ts.spacePart());
- displayParts.push(ts.keywordPart(129));
- displayParts.push(ts.punctuationPart(17));
- displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral));
+ displayParts.push(ts.keywordPart(130));
displayParts.push(ts.punctuationPart(18));
+ displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral));
+ displayParts.push(ts.punctuationPart(19));
}
else {
var internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference);
if (internalAliasSymbol) {
displayParts.push(ts.spacePart());
- displayParts.push(ts.operatorPart(56));
+ displayParts.push(ts.operatorPart(57));
displayParts.push(ts.spacePart());
addFullSymbolName(internalAliasSymbol, enclosingDeclaration);
}
@@ -56902,7 +58386,7 @@ var ts;
if (type) {
if (isThisExpression) {
addNewLineIfDisplayPartsExist();
- displayParts.push(ts.keywordPart(97));
+ displayParts.push(ts.keywordPart(98));
}
else {
addPrefixForAnyFunctionOrVar(symbol, symbolKind);
@@ -56911,7 +58395,7 @@ var ts;
symbolFlags & 3 ||
symbolKind === ts.ScriptElementKind.localVariableElement ||
isThisExpression) {
- displayParts.push(ts.punctuationPart(54));
+ displayParts.push(ts.punctuationPart(55));
displayParts.push(ts.spacePart());
if (type.symbol && type.symbol.flags & 262144) {
var typeParameterParts = ts.mapToDisplayParts(function (writer) {
@@ -56944,7 +58428,7 @@ var ts;
if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 256; })) {
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (!declaration.parent || declaration.parent.kind !== 187) {
+ if (!declaration.parent || declaration.parent.kind !== 188) {
continue;
}
var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right);
@@ -56987,9 +58471,9 @@ var ts;
displayParts.push(ts.textOrKeywordPart(symbolKind));
return;
default:
- displayParts.push(ts.punctuationPart(17));
- displayParts.push(ts.textOrKeywordPart(symbolKind));
displayParts.push(ts.punctuationPart(18));
+ displayParts.push(ts.textOrKeywordPart(symbolKind));
+ displayParts.push(ts.punctuationPart(19));
return;
}
}
@@ -56997,12 +58481,12 @@ var ts;
ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32));
if (allSignatures.length > 1) {
displayParts.push(ts.spacePart());
- displayParts.push(ts.punctuationPart(17));
- displayParts.push(ts.operatorPart(35));
+ displayParts.push(ts.punctuationPart(18));
+ displayParts.push(ts.operatorPart(36));
displayParts.push(ts.displayPart((allSignatures.length - 1).toString(), ts.SymbolDisplayPartKind.numericLiteral));
displayParts.push(ts.spacePart());
displayParts.push(ts.textPart(allSignatures.length === 2 ? "overload" : "overloads"));
- displayParts.push(ts.punctuationPart(18));
+ displayParts.push(ts.punctuationPart(19));
}
documentation = signature.getDocumentationComment();
}
@@ -57019,14 +58503,14 @@ var ts;
return false;
}
return ts.forEach(symbol.declarations, function (declaration) {
- if (declaration.kind === 179) {
+ if (declaration.kind === 180) {
return true;
}
- if (declaration.kind !== 218 && declaration.kind !== 220) {
+ if (declaration.kind !== 219 && declaration.kind !== 221) {
return false;
}
for (var parent_23 = declaration.parent; !ts.isFunctionBlock(parent_23); parent_23 = parent_23.parent) {
- if (parent_23.kind === 256 || parent_23.kind === 226) {
+ if (parent_23.kind === 256 || parent_23.kind === 227) {
return false;
}
}
@@ -57067,8 +58551,8 @@ var ts;
var outputText;
var sourceMapText;
var compilerHost = {
- getSourceFile: function (fileName, target) { return fileName === ts.normalizePath(inputFileName) ? sourceFile : undefined; },
- writeFile: function (name, text, writeByteOrderMark) {
+ getSourceFile: function (fileName) { return fileName === ts.normalizePath(inputFileName) ? sourceFile : undefined; },
+ writeFile: function (name, text) {
if (ts.fileExtensionIs(name, ".map")) {
ts.Debug.assert(sourceMapText === undefined, "Unexpected multiple source map outputs for the file '" + name + "'");
sourceMapText = text;
@@ -57084,9 +58568,9 @@ var ts;
getCurrentDirectory: function () { return ""; },
getNewLine: function () { return newLine; },
fileExists: function (fileName) { return fileName === inputFileName; },
- readFile: function (fileName) { return ""; },
- directoryExists: function (directoryExists) { return true; },
- getDirectories: function (path) { return []; }
+ readFile: function () { return ""; },
+ directoryExists: function () { return true; },
+ getDirectories: function () { return []; }
};
var program = ts.createProgram([inputFileName], options, compilerHost);
if (transpileOptions.reportDiagnostics) {
@@ -57135,11 +58619,20 @@ var ts;
(function (ts) {
var formatting;
(function (formatting) {
- var standardScanner = ts.createScanner(2, false, 0);
- var jsxScanner = ts.createScanner(2, false, 1);
+ var standardScanner = ts.createScanner(4, false, 0);
+ var jsxScanner = ts.createScanner(4, false, 1);
var scanner;
+ var ScanAction;
+ (function (ScanAction) {
+ ScanAction[ScanAction["Scan"] = 0] = "Scan";
+ ScanAction[ScanAction["RescanGreaterThanToken"] = 1] = "RescanGreaterThanToken";
+ ScanAction[ScanAction["RescanSlashToken"] = 2] = "RescanSlashToken";
+ ScanAction[ScanAction["RescanTemplateToken"] = 3] = "RescanTemplateToken";
+ ScanAction[ScanAction["RescanJsxIdentifier"] = 4] = "RescanJsxIdentifier";
+ ScanAction[ScanAction["RescanJsxText"] = 5] = "RescanJsxText";
+ })(ScanAction || (ScanAction = {}));
function getFormattingScanner(sourceFile, startPos, endPos) {
- ts.Debug.assert(scanner === undefined);
+ ts.Debug.assert(scanner === undefined, "Scanner should be undefined");
scanner = sourceFile.languageVariant === 1 ? jsxScanner : standardScanner;
scanner.setText(sourceFile.text);
scanner.setTextPos(startPos);
@@ -57164,7 +58657,7 @@ var ts;
}
};
function advance() {
- ts.Debug.assert(scanner !== undefined);
+ ts.Debug.assert(scanner !== undefined, "Scanner should be present");
lastTokenInfo = undefined;
var isStarted = scanner.getStartPos() !== startPos;
if (isStarted) {
@@ -57204,11 +58697,11 @@ var ts;
function shouldRescanGreaterThanToken(node) {
if (node) {
switch (node.kind) {
- case 29:
- case 64:
+ case 30:
case 65:
+ case 66:
+ case 46:
case 45:
- case 44:
return true;
}
}
@@ -57218,26 +58711,26 @@ var ts;
if (node.parent) {
switch (node.parent.kind) {
case 246:
- case 243:
+ case 244:
case 245:
- case 242:
- return node.kind === 69;
+ case 243:
+ return node.kind === 70;
}
}
return false;
}
function shouldRescanJsxText(node) {
- return node && node.kind === 244;
+ return node && node.kind === 10;
}
function shouldRescanSlashToken(container) {
- return container.kind === 10;
+ return container.kind === 11;
}
function shouldRescanTemplateToken(container) {
- return container.kind === 13 ||
- container.kind === 14;
+ return container.kind === 14 ||
+ container.kind === 15;
}
function startsWithSlashToken(t) {
- return t === 39 || t === 61;
+ return t === 40 || t === 62;
}
function readTokenInfo(n) {
ts.Debug.assert(scanner !== undefined);
@@ -57268,7 +58761,7 @@ var ts;
scanner.scan();
}
var currentToken = scanner.getToken();
- if (expectedScanAction === 1 && currentToken === 27) {
+ if (expectedScanAction === 1 && currentToken === 28) {
currentToken = scanner.reScanGreaterToken();
ts.Debug.assert(n.kind === currentToken);
lastScanAction = 1;
@@ -57278,11 +58771,11 @@ var ts;
ts.Debug.assert(n.kind === currentToken);
lastScanAction = 2;
}
- else if (expectedScanAction === 3 && currentToken === 16) {
+ else if (expectedScanAction === 3 && currentToken === 17) {
currentToken = scanner.reScanTemplateToken();
lastScanAction = 3;
}
- else if (expectedScanAction === 4 && currentToken === 69) {
+ else if (expectedScanAction === 4 && currentToken === 70) {
currentToken = scanner.scanJsxIdentifier();
lastScanAction = 4;
}
@@ -57416,8 +58909,8 @@ var ts;
return startLine === endLine;
};
FormattingContext.prototype.BlockIsOnOneLine = function (node) {
- var openBrace = ts.findChildOfKind(node, 15, this.sourceFile);
- var closeBrace = ts.findChildOfKind(node, 16, this.sourceFile);
+ var openBrace = ts.findChildOfKind(node, 16, this.sourceFile);
+ var closeBrace = ts.findChildOfKind(node, 17, this.sourceFile);
if (openBrace && closeBrace) {
var startLine = this.sourceFile.getLineAndCharacterOfPosition(openBrace.getEnd()).line;
var endLine = this.sourceFile.getLineAndCharacterOfPosition(closeBrace.getStart(this.sourceFile)).line;
@@ -57431,6 +58924,20 @@ var ts;
})(formatting = ts.formatting || (ts.formatting = {}));
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ var formatting;
+ (function (formatting) {
+ (function (FormattingRequestKind) {
+ FormattingRequestKind[FormattingRequestKind["FormatDocument"] = 0] = "FormatDocument";
+ FormattingRequestKind[FormattingRequestKind["FormatSelection"] = 1] = "FormatSelection";
+ FormattingRequestKind[FormattingRequestKind["FormatOnEnter"] = 2] = "FormatOnEnter";
+ FormattingRequestKind[FormattingRequestKind["FormatOnSemicolon"] = 3] = "FormatOnSemicolon";
+ FormattingRequestKind[FormattingRequestKind["FormatOnClosingCurlyBrace"] = 4] = "FormatOnClosingCurlyBrace";
+ })(formatting.FormattingRequestKind || (formatting.FormattingRequestKind = {}));
+ var FormattingRequestKind = formatting.FormattingRequestKind;
+ })(formatting = ts.formatting || (ts.formatting = {}));
+})(ts || (ts = {}));
+var ts;
(function (ts) {
var formatting;
(function (formatting) {
@@ -57452,6 +58959,19 @@ var ts;
})(formatting = ts.formatting || (ts.formatting = {}));
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ var formatting;
+ (function (formatting) {
+ (function (RuleAction) {
+ RuleAction[RuleAction["Ignore"] = 1] = "Ignore";
+ RuleAction[RuleAction["Space"] = 2] = "Space";
+ RuleAction[RuleAction["NewLine"] = 4] = "NewLine";
+ RuleAction[RuleAction["Delete"] = 8] = "Delete";
+ })(formatting.RuleAction || (formatting.RuleAction = {}));
+ var RuleAction = formatting.RuleAction;
+ })(formatting = ts.formatting || (ts.formatting = {}));
+})(ts || (ts = {}));
+var ts;
(function (ts) {
var formatting;
(function (formatting) {
@@ -57482,6 +59002,17 @@ var ts;
})(formatting = ts.formatting || (ts.formatting = {}));
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ var formatting;
+ (function (formatting) {
+ (function (RuleFlags) {
+ RuleFlags[RuleFlags["None"] = 0] = "None";
+ RuleFlags[RuleFlags["CanDeleteNewLines"] = 1] = "CanDeleteNewLines";
+ })(formatting.RuleFlags || (formatting.RuleFlags = {}));
+ var RuleFlags = formatting.RuleFlags;
+ })(formatting = ts.formatting || (ts.formatting = {}));
+})(ts || (ts = {}));
+var ts;
(function (ts) {
var formatting;
(function (formatting) {
@@ -57546,88 +59077,88 @@ var ts;
function Rules() {
this.IgnoreBeforeComment = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.Comments), formatting.RuleOperation.create1(1));
this.IgnoreAfterLineComment = new formatting.Rule(formatting.RuleDescriptor.create3(2, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create1(1));
- this.NoSpaceBeforeSemicolon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 23), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeColon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 54), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8));
- this.NoSpaceBeforeQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 53), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8));
- this.SpaceAfterColon = new formatting.Rule(formatting.RuleDescriptor.create3(54, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 2));
- this.SpaceAfterQuestionMarkInConditionalOperator = new formatting.Rule(formatting.RuleDescriptor.create3(53, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsConditionalOperatorContext), 2));
- this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(53, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2));
- this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(16, 80), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(16, 104), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.FromTokens([18, 20, 24, 23])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 21), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(21, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(20, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBeforeBlockInFunctionDeclarationContext), 8));
+ this.NoSpaceBeforeSemicolon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeColon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 55), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8));
+ this.NoSpaceBeforeQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 54), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8));
+ this.SpaceAfterColon = new formatting.Rule(formatting.RuleDescriptor.create3(55, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 2));
+ this.SpaceAfterQuestionMarkInConditionalOperator = new formatting.Rule(formatting.RuleDescriptor.create3(54, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsConditionalOperatorContext), 2));
+ this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(54, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2));
+ this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(17, 81), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(17, 105), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.FromTokens([19, 21, 25, 24])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(22, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(21, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBeforeBlockInFunctionDeclarationContext), 8));
this.FunctionOpenBraceLeftTokenRange = formatting.Shared.TokenRange.AnyIncludingMultilineComments;
- this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1);
- this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([69, 3, 73, 82, 89]);
- this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1);
- this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([18, 3, 79, 100, 85, 80]);
- this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1);
- this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2));
- this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2));
- this.NoSpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8));
- this.NoSpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8));
- this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(15, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectContext), 8));
- this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4));
- this.NewLineBeforeCloseBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.AnyIncludingMultilineComments, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4));
+ this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1);
+ this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([70, 3, 74, 83, 90]);
+ this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1);
+ this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([19, 3, 80, 101, 86, 81]);
+ this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1);
+ this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2));
+ this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2));
+ this.NoSpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8));
+ this.NoSpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 8));
+ this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(16, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectContext), 8));
+ this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4));
+ this.NewLineBeforeCloseBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.AnyIncludingMultilineComments, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4));
this.NoSpaceAfterUnaryPrefixOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.UnaryPrefixOperators, formatting.Shared.TokenRange.UnaryPrefixExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8));
- this.NoSpaceAfterUnaryPreincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(41, formatting.Shared.TokenRange.UnaryPreincrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterUnaryPredecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(42, formatting.Shared.TokenRange.UnaryPredecrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeUnaryPostincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostincrementExpressions, 41), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeUnaryPostdecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 42), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceAfterPostincrementWhenFollowedByAdd = new formatting.Rule(formatting.RuleDescriptor.create1(41, 35), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
- this.SpaceAfterAddWhenFollowedByUnaryPlus = new formatting.Rule(formatting.RuleDescriptor.create1(35, 35), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
- this.SpaceAfterAddWhenFollowedByPreincrement = new formatting.Rule(formatting.RuleDescriptor.create1(35, 41), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
- this.SpaceAfterPostdecrementWhenFollowedBySubtract = new formatting.Rule(formatting.RuleDescriptor.create1(42, 36), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
- this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(36, 36), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
- this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(36, 42), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
- this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([102, 98, 92, 78, 94, 101, 119]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([108, 74]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2));
- this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8));
- this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(87, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2));
- this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 8));
- this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(103, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsVoidOpContext), 2));
- this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(94, 23), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([18, 79, 80, 71]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNotForContext), 2));
- this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([100, 85]), 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([123, 131]), 69), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2));
+ this.NoSpaceAfterUnaryPreincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(42, formatting.Shared.TokenRange.UnaryPreincrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterUnaryPredecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(43, formatting.Shared.TokenRange.UnaryPredecrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeUnaryPostincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostincrementExpressions, 42), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeUnaryPostdecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 43), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceAfterPostincrementWhenFollowedByAdd = new formatting.Rule(formatting.RuleDescriptor.create1(42, 36), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
+ this.SpaceAfterAddWhenFollowedByUnaryPlus = new formatting.Rule(formatting.RuleDescriptor.create1(36, 36), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
+ this.SpaceAfterAddWhenFollowedByPreincrement = new formatting.Rule(formatting.RuleDescriptor.create1(36, 42), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
+ this.SpaceAfterPostdecrementWhenFollowedBySubtract = new formatting.Rule(formatting.RuleDescriptor.create1(43, 37), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
+ this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(37, 37), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
+ this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(37, 43), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
+ this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 25), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([103, 99, 93, 79, 95, 102, 120]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([109, 75]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2));
+ this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8));
+ this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(88, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2));
+ this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsFunctionDeclContext), 8));
+ this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(104, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsVoidOpContext), 2));
+ this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(95, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([19, 80, 81, 72]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNotForContext), 2));
+ this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([101, 86]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([124, 132]), 70), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2));
this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
- this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(121, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([125, 129]), 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([115, 73, 122, 77, 81, 82, 83, 123, 106, 89, 107, 125, 126, 110, 112, 111, 131, 113, 134, 136]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([83, 106, 136])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(9, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2));
- this.SpaceBeforeArrow = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 34), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(34, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(22, 69), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(53, formatting.Shared.TokenRange.FromTokens([18, 24])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8));
- this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 25), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
- this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(18, 25), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
- this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
- this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 27), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
- this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(27, formatting.Shared.TokenRange.FromTokens([17, 19, 27, 24])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
- this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(15, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectTypeContext), 8));
- this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 55), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(55, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([115, 69, 82, 77, 73, 113, 112, 110, 111, 123, 131, 19, 37])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2));
- this.NoSpaceBetweenFunctionKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(87, 37), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 8));
- this.SpaceAfterStarInGeneratorDeclaration = new formatting.Rule(formatting.RuleDescriptor.create3(37, formatting.Shared.TokenRange.FromTokens([69, 17])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 2));
- this.NoSpaceBetweenYieldKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(114, 37), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 8));
- this.SpaceBetweenYieldOrYieldStarAndOperand = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([114, 37]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 2));
- this.SpaceBetweenAsyncAndOpenParen = new formatting.Rule(formatting.RuleDescriptor.create1(118, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsArrowFunctionContext, Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceBetweenAsyncAndFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(118, 87), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(69, formatting.Shared.TokenRange.FromTokens([11, 12])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceBeforeJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 69), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNextTokenParentJsxAttribute, Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceBeforeSlashInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 39), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceBeforeGreaterThanTokenInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create1(39, 27), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 56), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create3(56, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(122, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([126, 130]), 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([116, 74, 123, 78, 82, 83, 84, 124, 107, 90, 108, 126, 127, 111, 113, 112, 132, 114, 135, 137]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([84, 107, 137])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(9, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2));
+ this.SpaceBeforeArrow = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 35), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(35, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(23, 70), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(54, formatting.Shared.TokenRange.FromTokens([19, 25])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNotBinaryOpContext), 8));
+ this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 26), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
+ this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(19, 26), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
+ this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(26, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
+ this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 28), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
+ this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(28, formatting.Shared.TokenRange.FromTokens([18, 20, 28, 25])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), 8));
+ this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(16, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectTypeContext), 8));
+ this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 56), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(56, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([116, 70, 83, 78, 74, 114, 113, 111, 112, 124, 132, 20, 38])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2));
+ this.NoSpaceBetweenFunctionKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(88, 38), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 8));
+ this.SpaceAfterStarInGeneratorDeclaration = new formatting.Rule(formatting.RuleDescriptor.create3(38, formatting.Shared.TokenRange.FromTokens([70, 18])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 2));
+ this.NoSpaceBetweenYieldKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(115, 38), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 8));
+ this.SpaceBetweenYieldOrYieldStarAndOperand = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([115, 38]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 2));
+ this.SpaceBetweenAsyncAndOpenParen = new formatting.Rule(formatting.RuleDescriptor.create1(119, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsArrowFunctionContext, Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceBetweenAsyncAndFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(119, 88), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(70, formatting.Shared.TokenRange.FromTokens([12, 13])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceBeforeJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 70), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNextTokenParentJsxAttribute, Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceBeforeSlashInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 40), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceBeforeGreaterThanTokenInJsxOpeningElement = new formatting.Rule(formatting.RuleDescriptor.create1(40, 28), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxSelfClosingElementContext, Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 57), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterEqualInJsxAttribute = new formatting.Rule(formatting.RuleDescriptor.create3(57, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsJsxAttributeContext, Rules.IsNonJsxSameLineTokenContext), 8));
this.HighPriorityCommonRules = [
this.IgnoreBeforeComment, this.IgnoreAfterLineComment,
this.NoSpaceBeforeColon, this.SpaceAfterColon, this.NoSpaceBeforeQuestionMark, this.SpaceAfterQuestionMarkInConditionalOperator,
@@ -57682,41 +59213,41 @@ var ts;
this.NoSpaceBeforeOpenParenInFuncDecl,
this.SpaceBetweenStatements, this.SpaceAfterTryFinally
];
- this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNextTokenNotCloseBracket), 2));
- this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext), 8));
+ this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext, Rules.IsNextTokenNotCloseBracket), 2));
+ this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsNonJsxElementContext), 8));
this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
this.SpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 2));
this.NoSpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 8));
this.NoSpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsBinaryOpContext), 8));
- this.SpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 2));
- this.NoSpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 8));
- this.NewLineBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 4), 1);
- this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 4), 1);
- this.NewLineBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 4), 1);
- this.SpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsForContext), 2));
- this.NoSpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsForContext), 8));
- this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(17, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(17, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.SpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceBetweenBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(19, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.NoSpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([12, 13]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([12, 13]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([13, 14])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
- this.SpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([13, 14])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
- this.NoSpaceAfterOpenBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 8));
- this.SpaceAfterOpenBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 2));
- this.NoSpaceBeforeCloseBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 8));
- this.SpaceBeforeCloseBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 2));
- this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(87, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2));
- this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(87, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8));
- this.NoSpaceAfterTypeAssertion = new formatting.Rule(formatting.RuleDescriptor.create3(27, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeAssertionContext), 8));
- this.SpaceAfterTypeAssertion = new formatting.Rule(formatting.RuleDescriptor.create3(27, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeAssertionContext), 2));
+ this.SpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 2));
+ this.NoSpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 8));
+ this.NewLineBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 4), 1);
+ this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 4), 1);
+ this.NewLineBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 4), 1);
+ this.SpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsForContext), 2));
+ this.NoSpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsForContext), 8));
+ this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(18, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(18, 19), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(18, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(20, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.SpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 21), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceBetweenBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(20, 21), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(20, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 21), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.NoSpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([13, 14]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([13, 14]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([14, 15])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8));
+ this.SpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([14, 15])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 2));
+ this.NoSpaceAfterOpenBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 8));
+ this.SpaceAfterOpenBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 2));
+ this.NoSpaceBeforeCloseBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 8));
+ this.SpaceBeforeCloseBraceInJsxExpression = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsJsxExpressionContext), 2));
+ this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(88, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2));
+ this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(88, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8));
+ this.NoSpaceAfterTypeAssertion = new formatting.Rule(formatting.RuleDescriptor.create3(28, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeAssertionContext), 8));
+ this.SpaceAfterTypeAssertion = new formatting.Rule(formatting.RuleDescriptor.create3(28, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeAssertionContext), 2));
}
Rules.prototype.getRuleName = function (rule) {
var o = this;
@@ -57728,35 +59259,35 @@ var ts;
throw new Error("Unknown rule");
};
Rules.IsForContext = function (context) {
- return context.contextNode.kind === 206;
+ return context.contextNode.kind === 207;
};
Rules.IsNotForContext = function (context) {
return !Rules.IsForContext(context);
};
Rules.IsBinaryOpContext = function (context) {
switch (context.contextNode.kind) {
- case 187:
case 188:
- case 195:
- case 238:
- case 234:
- case 154:
- case 162:
+ case 189:
+ case 196:
+ case 239:
+ case 235:
+ case 155:
case 163:
+ case 164:
return true;
- case 169:
- case 223:
- case 229:
- case 218:
- case 142:
+ case 170:
+ case 224:
+ case 230:
+ case 219:
+ case 143:
case 255:
+ case 146:
case 145:
- case 144:
- return context.currentTokenSpan.kind === 56 || context.nextTokenSpan.kind === 56;
- case 207:
- return context.currentTokenSpan.kind === 90 || context.nextTokenSpan.kind === 90;
+ return context.currentTokenSpan.kind === 57 || context.nextTokenSpan.kind === 57;
case 208:
- return context.currentTokenSpan.kind === 138 || context.nextTokenSpan.kind === 138;
+ return context.currentTokenSpan.kind === 91 || context.nextTokenSpan.kind === 91;
+ case 209:
+ return context.currentTokenSpan.kind === 139 || context.nextTokenSpan.kind === 139;
}
return false;
};
@@ -57764,7 +59295,7 @@ var ts;
return !Rules.IsBinaryOpContext(context);
};
Rules.IsConditionalOperatorContext = function (context) {
- return context.contextNode.kind === 188;
+ return context.contextNode.kind === 189;
};
Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) {
return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context);
@@ -57789,76 +59320,76 @@ var ts;
return true;
}
switch (node.kind) {
- case 199:
+ case 200:
+ case 228:
+ case 172:
case 227:
- case 171:
- case 226:
return true;
}
return false;
};
Rules.IsFunctionDeclContext = function (context) {
switch (context.contextNode.kind) {
- case 220:
+ case 221:
+ case 148:
case 147:
- case 146:
- case 149:
case 150:
case 151:
- case 179:
- case 148:
+ case 152:
case 180:
- case 222:
+ case 149:
+ case 181:
+ case 223:
return true;
}
return false;
};
Rules.IsFunctionDeclarationOrFunctionExpressionContext = function (context) {
- return context.contextNode.kind === 220 || context.contextNode.kind === 179;
+ return context.contextNode.kind === 221 || context.contextNode.kind === 180;
};
Rules.IsTypeScriptDeclWithBlockContext = function (context) {
return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode);
};
Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) {
switch (node.kind) {
- case 221:
- case 192:
case 222:
- case 224:
- case 159:
+ case 193:
+ case 223:
case 225:
- case 236:
+ case 160:
+ case 226:
case 237:
- case 230:
- case 233:
+ case 238:
+ case 231:
+ case 234:
return true;
}
return false;
};
Rules.IsAfterCodeBlockContext = function (context) {
switch (context.currentTokenParent.kind) {
- case 221:
- case 225:
- case 224:
- case 199:
- case 252:
+ case 222:
case 226:
- case 213:
+ case 225:
+ case 200:
+ case 252:
+ case 227:
+ case 214:
return true;
}
return false;
};
Rules.IsControlDeclContext = function (context) {
switch (context.contextNode.kind) {
- case 203:
- case 213:
- case 206:
+ case 204:
+ case 214:
case 207:
case 208:
+ case 209:
+ case 206:
+ case 217:
case 205:
- case 216:
- case 204:
- case 212:
+ case 213:
case 252:
return true;
default:
@@ -57866,31 +59397,31 @@ var ts;
}
};
Rules.IsObjectContext = function (context) {
- return context.contextNode.kind === 171;
+ return context.contextNode.kind === 172;
};
Rules.IsFunctionCallContext = function (context) {
- return context.contextNode.kind === 174;
+ return context.contextNode.kind === 175;
};
Rules.IsNewContext = function (context) {
- return context.contextNode.kind === 175;
+ return context.contextNode.kind === 176;
};
Rules.IsFunctionCallOrNewContext = function (context) {
return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context);
};
Rules.IsPreviousTokenNotComma = function (context) {
- return context.currentTokenSpan.kind !== 24;
+ return context.currentTokenSpan.kind !== 25;
};
Rules.IsNextTokenNotCloseBracket = function (context) {
- return context.nextTokenSpan.kind !== 20;
+ return context.nextTokenSpan.kind !== 21;
};
Rules.IsArrowFunctionContext = function (context) {
- return context.contextNode.kind === 180;
+ return context.contextNode.kind === 181;
};
Rules.IsNonJsxSameLineTokenContext = function (context) {
- return context.TokensAreOnSameLine() && context.contextNode.kind !== 244;
+ return context.TokensAreOnSameLine() && context.contextNode.kind !== 10;
};
Rules.IsNonJsxElementContext = function (context) {
- return context.contextNode.kind !== 241;
+ return context.contextNode.kind !== 242;
};
Rules.IsJsxExpressionContext = function (context) {
return context.contextNode.kind === 248;
@@ -57902,7 +59433,7 @@ var ts;
return context.contextNode.kind === 246;
};
Rules.IsJsxSelfClosingElementContext = function (context) {
- return context.contextNode.kind === 242;
+ return context.contextNode.kind === 243;
};
Rules.IsNotBeforeBlockInFunctionDeclarationContext = function (context) {
return !Rules.IsFunctionDeclContext(context) && !Rules.IsBeforeBlockContext(context);
@@ -57917,41 +59448,41 @@ var ts;
while (ts.isPartOfExpression(node)) {
node = node.parent;
}
- return node.kind === 143;
+ return node.kind === 144;
};
Rules.IsStartOfVariableDeclarationList = function (context) {
- return context.currentTokenParent.kind === 219 &&
+ return context.currentTokenParent.kind === 220 &&
context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos;
};
Rules.IsNotFormatOnEnter = function (context) {
return context.formattingRequestKind !== 2;
};
Rules.IsModuleDeclContext = function (context) {
- return context.contextNode.kind === 225;
+ return context.contextNode.kind === 226;
};
Rules.IsObjectTypeContext = function (context) {
- return context.contextNode.kind === 159;
+ return context.contextNode.kind === 160;
};
Rules.IsTypeArgumentOrParameterOrAssertion = function (token, parent) {
- if (token.kind !== 25 && token.kind !== 27) {
+ if (token.kind !== 26 && token.kind !== 28) {
return false;
}
switch (parent.kind) {
- case 155:
- case 177:
- case 221:
- case 192:
+ case 156:
+ case 178:
case 222:
- case 220:
- case 179:
+ case 193:
+ case 223:
+ case 221:
case 180:
+ case 181:
+ case 148:
case 147:
- case 146:
- case 151:
case 152:
- case 174:
+ case 153:
case 175:
- case 194:
+ case 176:
+ case 195:
return true;
default:
return false;
@@ -57962,13 +59493,13 @@ var ts;
Rules.IsTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent);
};
Rules.IsTypeAssertionContext = function (context) {
- return context.contextNode.kind === 177;
+ return context.contextNode.kind === 178;
};
Rules.IsVoidOpContext = function (context) {
- return context.currentTokenSpan.kind === 103 && context.currentTokenParent.kind === 183;
+ return context.currentTokenSpan.kind === 104 && context.currentTokenParent.kind === 184;
};
Rules.IsYieldOrYieldStarWithOperand = function (context) {
- return context.contextNode.kind === 190 && context.contextNode.expression !== undefined;
+ return context.contextNode.kind === 191 && context.contextNode.expression !== undefined;
};
return Rules;
}());
@@ -57990,7 +59521,7 @@ var ts;
return result;
};
RulesMap.prototype.Initialize = function (rules) {
- this.mapRowLength = 138 + 1;
+ this.mapRowLength = 139 + 1;
this.map = new Array(this.mapRowLength * this.mapRowLength);
var rulesBucketConstructionStateList = new Array(this.map.length);
this.FillRules(rules, rulesBucketConstructionStateList);
@@ -58003,6 +59534,7 @@ var ts;
});
};
RulesMap.prototype.GetRuleBucketIndex = function (row, column) {
+ ts.Debug.assert(row <= 139 && column <= 139, "Must compute formatting context from tokens");
var rulesBucketIndex = (row * this.mapRowLength) + column;
return rulesBucketIndex;
};
@@ -58166,12 +59698,12 @@ var ts;
}
TokenAllAccess.prototype.GetTokens = function () {
var result = [];
- for (var token = 0; token <= 138; token++) {
+ for (var token = 0; token <= 139; token++) {
result.push(token);
}
return result;
};
- TokenAllAccess.prototype.Contains = function (tokenValue) {
+ TokenAllAccess.prototype.Contains = function () {
return true;
};
TokenAllAccess.prototype.toString = function () {
@@ -58210,17 +59742,17 @@ var ts;
}());
TokenRange.Any = TokenRange.AllTokens();
TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3]));
- TokenRange.Keywords = TokenRange.FromRange(70, 138);
- TokenRange.BinaryOperators = TokenRange.FromRange(25, 68);
- TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([90, 91, 138, 116, 124]);
- TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([41, 42, 50, 49]);
- TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([8, 69, 17, 19, 15, 97, 92]);
- TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([69, 17, 97, 92]);
- TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([69, 18, 20, 92]);
- TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([69, 17, 97, 92]);
- TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([69, 18, 20, 92]);
+ TokenRange.Keywords = TokenRange.FromRange(71, 139);
+ TokenRange.BinaryOperators = TokenRange.FromRange(26, 69);
+ TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([91, 92, 139, 117, 125]);
+ TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([42, 43, 51, 50]);
+ TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([8, 70, 18, 20, 16, 98, 93]);
+ TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([70, 18, 98, 93]);
+ TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([70, 19, 21, 93]);
+ TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([70, 18, 98, 93]);
+ TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([70, 19, 21, 93]);
TokenRange.Comments = TokenRange.FromTokens([2, 3]);
- TokenRange.TypeNames = TokenRange.FromTokens([69, 130, 132, 120, 133, 103, 117]);
+ TokenRange.TypeNames = TokenRange.FromTokens([70, 131, 133, 121, 134, 104, 118]);
Shared.TokenRange = TokenRange;
})(Shared = formatting.Shared || (formatting.Shared = {}));
})(formatting = ts.formatting || (ts.formatting = {}));
@@ -58356,6 +59888,10 @@ var ts;
(function (ts) {
var formatting;
(function (formatting) {
+ var Constants;
+ (function (Constants) {
+ Constants[Constants["Unknown"] = -1] = "Unknown";
+ })(Constants || (Constants = {}));
function formatOnEnter(position, sourceFile, rulesProvider, options) {
var line = sourceFile.getLineAndCharacterOfPosition(position).line;
if (line === 0) {
@@ -58376,11 +59912,11 @@ var ts;
}
formatting.formatOnEnter = formatOnEnter;
function formatOnSemicolon(position, sourceFile, rulesProvider, options) {
- return formatOutermostParent(position, 23, sourceFile, options, rulesProvider, 3);
+ return formatOutermostParent(position, 24, sourceFile, options, rulesProvider, 3);
}
formatting.formatOnSemicolon = formatOnSemicolon;
function formatOnClosingCurly(position, sourceFile, rulesProvider, options) {
- return formatOutermostParent(position, 16, sourceFile, options, rulesProvider, 4);
+ return formatOutermostParent(position, 17, sourceFile, options, rulesProvider, 4);
}
formatting.formatOnClosingCurly = formatOnClosingCurly;
function formatDocument(sourceFile, rulesProvider, options) {
@@ -58428,15 +59964,15 @@ var ts;
}
function isListElement(parent, node) {
switch (parent.kind) {
- case 221:
case 222:
+ case 223:
return ts.rangeContainsRange(parent.members, node);
- case 225:
- var body = parent.body;
- return body && body.kind === 226 && ts.rangeContainsRange(body.statements, node);
- case 256:
- case 199:
case 226:
+ var body = parent.body;
+ return body && body.kind === 227 && ts.rangeContainsRange(body.statements, node);
+ case 256:
+ case 200:
+ case 227:
return ts.rangeContainsRange(parent.statements, node);
case 252:
return ts.rangeContainsRange(parent.block.statements, node);
@@ -58482,7 +60018,7 @@ var ts;
index++;
}
};
- function rangeHasNoErrors(r) {
+ function rangeHasNoErrors() {
return false;
}
}
@@ -58594,18 +60130,18 @@ var ts;
return node.modifiers[0].kind;
}
switch (node.kind) {
- case 221: return 73;
- case 222: return 107;
- case 220: return 87;
- case 224: return 224;
- case 149: return 123;
- case 150: return 131;
- case 147:
+ case 222: return 74;
+ case 223: return 108;
+ case 221: return 88;
+ case 225: return 225;
+ case 150: return 124;
+ case 151: return 132;
+ case 148:
if (node.asteriskToken) {
- return 37;
+ return 38;
}
- case 145:
- case 142:
+ case 146:
+ case 143:
return node.name.kind;
}
}
@@ -58613,9 +60149,9 @@ var ts;
return {
getIndentationForComment: function (kind, tokenIndentation, container) {
switch (kind) {
- case 16:
- case 20:
- case 18:
+ case 17:
+ case 21:
+ case 19:
return indentation + getEffectiveDelta(delta, container);
}
return tokenIndentation !== -1 ? tokenIndentation : indentation;
@@ -58627,15 +60163,15 @@ var ts;
}
}
switch (kind) {
- case 15:
case 16:
- case 19:
- case 20:
case 17:
+ case 20:
+ case 21:
case 18:
- case 80:
- case 104:
- case 55:
+ case 19:
+ case 81:
+ case 105:
+ case 56:
return indentation;
default:
return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation;
@@ -58715,17 +60251,17 @@ var ts;
if (!formattingScanner.isOnToken()) {
return inheritedIndentation;
}
- if (ts.isToken(child)) {
+ if (ts.isToken(child) && child.kind !== 10) {
var tokenInfo = formattingScanner.readTokenInfo(child);
- ts.Debug.assert(tokenInfo.token.end === child.end);
+ ts.Debug.assert(tokenInfo.token.end === child.end, "Token end is child end");
consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child);
return inheritedIndentation;
}
- var effectiveParentStartLine = child.kind === 143 ? childStartLine : undecoratedParentStartLine;
+ var effectiveParentStartLine = child.kind === 144 ? childStartLine : undecoratedParentStartLine;
var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine);
processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta);
childContextNode = node;
- if (isFirstListItem && parent.kind === 170 && inheritedIndentation === -1) {
+ if (isFirstListItem && parent.kind === 171 && inheritedIndentation === -1) {
inheritedIndentation = childIndentation.indentation;
}
return inheritedIndentation;
@@ -59029,41 +60565,41 @@ var ts;
}
function getOpenTokenForList(node, list) {
switch (node.kind) {
- case 148:
- case 220:
- case 179:
- case 147:
- case 146:
+ case 149:
+ case 221:
case 180:
+ case 148:
+ case 147:
+ case 181:
if (node.typeParameters === list) {
- return 25;
+ return 26;
}
else if (node.parameters === list) {
- return 17;
+ return 18;
}
break;
- case 174:
case 175:
+ case 176:
if (node.typeArguments === list) {
- return 25;
+ return 26;
}
else if (node.arguments === list) {
- return 17;
+ return 18;
}
break;
- case 155:
+ case 156:
if (node.typeArguments === list) {
- return 25;
+ return 26;
}
}
return 0;
}
function getCloseTokenForOpenToken(kind) {
switch (kind) {
- case 17:
- return 18;
- case 25:
- return 27;
+ case 18:
+ return 19;
+ case 26:
+ return 28;
}
return 0;
}
@@ -59124,6 +60660,10 @@ var ts;
(function (formatting) {
var SmartIndenter;
(function (SmartIndenter) {
+ var Value;
+ (function (Value) {
+ Value[Value["Unknown"] = -1] = "Unknown";
+ })(Value || (Value = {}));
function getIndentation(position, sourceFile, options) {
if (position > sourceFile.text.length) {
return getBaseIndentation(options);
@@ -59152,7 +60692,7 @@ var ts;
var lineStart = ts.getLineStartPositionForPosition(current_1, sourceFile);
return SmartIndenter.findFirstNonWhitespaceColumn(lineStart, current_1, sourceFile, options);
}
- if (precedingToken.kind === 24 && precedingToken.parent.kind !== 187) {
+ if (precedingToken.kind === 25 && precedingToken.parent.kind !== 188) {
var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options);
if (actualIndentation !== -1) {
return actualIndentation;
@@ -59265,10 +60805,10 @@ var ts;
if (!nextToken) {
return false;
}
- if (nextToken.kind === 15) {
+ if (nextToken.kind === 16) {
return true;
}
- else if (nextToken.kind === 16) {
+ else if (nextToken.kind === 17) {
var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line;
return lineAtPosition === nextTokenStartLine;
}
@@ -59278,8 +60818,8 @@ var ts;
return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile));
}
function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) {
- if (parent.kind === 203 && parent.elseStatement === child) {
- var elseKeyword = ts.findChildOfKind(parent, 80, sourceFile);
+ if (parent.kind === 204 && parent.elseStatement === child) {
+ var elseKeyword = ts.findChildOfKind(parent, 81, sourceFile);
ts.Debug.assert(elseKeyword !== undefined);
var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line;
return elseKeywordStartLine === childStartLine;
@@ -59290,23 +60830,23 @@ var ts;
function getContainingList(node, sourceFile) {
if (node.parent) {
switch (node.parent.kind) {
- case 155:
+ case 156:
if (node.parent.typeArguments &&
ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) {
return node.parent.typeArguments;
}
break;
- case 171:
+ case 172:
return node.parent.properties;
- case 170:
+ case 171:
return node.parent.elements;
- case 220:
- case 179:
+ case 221:
case 180:
+ case 181:
+ case 148:
case 147:
- case 146:
- case 151:
- case 152: {
+ case 152:
+ case 153: {
var start = node.getStart(sourceFile);
if (node.parent.typeParameters &&
ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) {
@@ -59317,8 +60857,8 @@ var ts;
}
break;
}
- case 175:
- case 174: {
+ case 176:
+ case 175: {
var start = node.getStart(sourceFile);
if (node.parent.typeArguments &&
ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) {
@@ -59343,11 +60883,11 @@ var ts;
}
}
function getLineIndentationWhenExpressionIsInMultiLine(node, sourceFile, options) {
- if (node.kind === 18) {
+ if (node.kind === 19) {
return -1;
}
- if (node.parent && (node.parent.kind === 174 ||
- node.parent.kind === 175) &&
+ if (node.parent && (node.parent.kind === 175 ||
+ node.parent.kind === 176) &&
node.parent.expression !== node) {
var fullCallOrNewExpression = node.parent.expression;
var startingExpression = getStartingExpression(fullCallOrNewExpression);
@@ -59365,10 +60905,10 @@ var ts;
function getStartingExpression(node) {
while (true) {
switch (node.kind) {
- case 174:
case 175:
- case 172:
+ case 176:
case 173:
+ case 174:
node = node.expression;
break;
default:
@@ -59382,7 +60922,7 @@ var ts;
var node = list[index];
var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile);
for (var i = index - 1; i >= 0; i--) {
- if (list[i].kind === 24) {
+ if (list[i].kind === 25) {
continue;
}
var prevEndLine = sourceFile.getLineAndCharacterOfPosition(list[i].end).line;
@@ -59422,48 +60962,48 @@ var ts;
SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn;
function nodeContentIsAlwaysIndented(kind) {
switch (kind) {
- case 202:
- case 221:
- case 192:
+ case 203:
case 222:
- case 224:
+ case 193:
case 223:
- case 170:
- case 199:
- case 226:
+ case 225:
+ case 224:
case 171:
- case 159:
- case 161:
+ case 200:
case 227:
+ case 172:
+ case 160:
+ case 162:
+ case 228:
case 250:
case 249:
- case 178:
- case 172:
- case 174:
+ case 179:
+ case 173:
case 175:
- case 200:
- case 218:
- case 235:
- case 211:
- case 188:
- case 168:
- case 167:
- case 243:
- case 242:
- case 248:
- case 146:
- case 151:
- case 152:
- case 142:
- case 156:
- case 157:
- case 164:
case 176:
- case 184:
- case 237:
- case 233:
+ case 201:
+ case 219:
+ case 236:
+ case 212:
+ case 189:
+ case 169:
+ case 168:
+ case 244:
+ case 243:
+ case 248:
+ case 147:
+ case 152:
+ case 153:
+ case 143:
+ case 157:
+ case 158:
+ case 165:
+ case 177:
+ case 185:
case 238:
case 234:
+ case 239:
+ case 235:
return true;
}
return false;
@@ -59471,26 +61011,26 @@ var ts;
function nodeWillIndentChild(parent, child, indentByDefault) {
var childKind = child ? child.kind : 0;
switch (parent.kind) {
- case 204:
case 205:
- case 207:
- case 208:
case 206:
- case 203:
- case 220:
- case 179:
- case 147:
+ case 208:
+ case 209:
+ case 207:
+ case 204:
+ case 221:
case 180:
case 148:
+ case 181:
case 149:
case 150:
- return childKind !== 199;
- case 236:
- return childKind !== 237;
- case 230:
- return childKind !== 231 ||
- (child.namedBindings && child.namedBindings.kind !== 233);
- case 241:
+ case 151:
+ return childKind !== 200;
+ case 237:
+ return childKind !== 238;
+ case 231:
+ return childKind !== 232 ||
+ (child.namedBindings && child.namedBindings.kind !== 234);
+ case 242:
return childKind !== 245;
}
return indentByDefault;
@@ -59549,7 +61089,7 @@ var ts;
getCodeActions: function (context) {
var sourceFile = context.sourceFile;
var token = ts.getTokenAtPosition(sourceFile, context.span.start);
- if (token.kind !== 121) {
+ if (token.kind !== 122) {
return undefined;
}
var newPosition = getOpenBraceEnd(token.parent, sourceFile);
@@ -59564,7 +61104,7 @@ var ts;
getCodeActions: function (context) {
var sourceFile = context.sourceFile;
var token = ts.getTokenAtPosition(sourceFile, context.span.start);
- if (token.kind !== 97) {
+ if (token.kind !== 98) {
return undefined;
}
var constructor = ts.getContainingFunction(token);
@@ -59572,7 +61112,7 @@ var ts;
if (!superCall) {
return undefined;
}
- if (superCall.expression && superCall.expression.kind == 174) {
+ if (superCall.expression && superCall.expression.kind == 175) {
var arguments_1 = superCall.expression.arguments;
for (var i = 0; i < arguments_1.length; i++) {
if (arguments_1[i].expression === token) {
@@ -59596,7 +61136,7 @@ var ts;
changes: changes
}];
function findSuperCall(n) {
- if (n.kind === 202 && ts.isSuperCall(n.expression)) {
+ if (n.kind === 203 && ts.isSuperCall(n.expression)) {
return n;
}
if (ts.isFunctionLike(n)) {
@@ -59612,8 +61152,8 @@ var ts;
(function (ts) {
ts.servicesVersion = "0.5";
function createNode(kind, pos, end, parent) {
- var node = kind >= 139 ? new NodeObject(kind, pos, end) :
- kind === 69 ? new IdentifierObject(69, pos, end) :
+ var node = kind >= 140 ? new NodeObject(kind, pos, end) :
+ kind === 70 ? new IdentifierObject(70, pos, end) :
new TokenObject(kind, pos, end);
node.parent = parent;
return node;
@@ -59690,7 +61230,7 @@ var ts;
NodeObject.prototype.createChildren = function (sourceFile) {
var _this = this;
var children;
- if (this.kind >= 139) {
+ if (this.kind >= 140) {
ts.scanner.setText((sourceFile || this.getSourceFile()).text);
children = [];
var pos_3 = this.pos;
@@ -59748,7 +61288,7 @@ var ts;
return undefined;
}
var child = children[0];
- return child.kind < 139 ? child : child.getFirstToken(sourceFile);
+ return child.kind < 140 ? child : child.getFirstToken(sourceFile);
};
NodeObject.prototype.getLastToken = function (sourceFile) {
var children = this.getChildren(sourceFile);
@@ -59756,7 +61296,7 @@ var ts;
if (!child) {
return undefined;
}
- return child.kind < 139 ? child : child.getLastToken(sourceFile);
+ return child.kind < 140 ? child : child.getLastToken(sourceFile);
};
return NodeObject;
}());
@@ -59794,19 +61334,19 @@ var ts;
TokenOrIdentifierObject.prototype.getText = function (sourceFile) {
return (sourceFile || this.getSourceFile()).text.substring(this.getStart(), this.getEnd());
};
- TokenOrIdentifierObject.prototype.getChildCount = function (sourceFile) {
+ TokenOrIdentifierObject.prototype.getChildCount = function () {
return 0;
};
- TokenOrIdentifierObject.prototype.getChildAt = function (index, sourceFile) {
+ TokenOrIdentifierObject.prototype.getChildAt = function () {
return undefined;
};
- TokenOrIdentifierObject.prototype.getChildren = function (sourceFile) {
+ TokenOrIdentifierObject.prototype.getChildren = function () {
return ts.emptyArray;
};
- TokenOrIdentifierObject.prototype.getFirstToken = function (sourceFile) {
+ TokenOrIdentifierObject.prototype.getFirstToken = function () {
return undefined;
};
- TokenOrIdentifierObject.prototype.getLastToken = function (sourceFile) {
+ TokenOrIdentifierObject.prototype.getLastToken = function () {
return undefined;
};
return TokenOrIdentifierObject;
@@ -59827,7 +61367,7 @@ var ts;
};
SymbolObject.prototype.getDocumentationComment = function () {
if (this.documentationComment === undefined) {
- this.documentationComment = ts.JsDoc.getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & 4));
+ this.documentationComment = ts.JsDoc.getJsDocCommentsFromDeclarations(this.declarations);
}
return this.documentationComment;
};
@@ -59844,12 +61384,12 @@ var ts;
}(TokenOrIdentifierObject));
var IdentifierObject = (function (_super) {
__extends(IdentifierObject, _super);
- function IdentifierObject(kind, pos, end) {
+ function IdentifierObject(_kind, pos, end) {
return _super.call(this, pos, end) || this;
}
return IdentifierObject;
}(TokenOrIdentifierObject));
- IdentifierObject.prototype.kind = 69;
+ IdentifierObject.prototype.kind = 70;
var TypeObject = (function () {
function TypeObject(checker, flags) {
this.checker = checker;
@@ -59910,7 +61450,7 @@ var ts;
};
SignatureObject.prototype.getDocumentationComment = function () {
if (this.documentationComment === undefined) {
- this.documentationComment = this.declaration ? ts.JsDoc.getJsDocCommentsFromDeclarations([this.declaration], undefined, false) : [];
+ this.documentationComment = this.declaration ? ts.JsDoc.getJsDocCommentsFromDeclarations([this.declaration]) : [];
}
return this.documentationComment;
};
@@ -59958,9 +61498,9 @@ var ts;
if (result_6 !== undefined) {
return result_6;
}
- if (declaration.name.kind === 140) {
+ if (declaration.name.kind === 141) {
var expr = declaration.name.expression;
- if (expr.kind === 172) {
+ if (expr.kind === 173) {
return expr.name.text;
}
return getTextOfIdentifierOrLiteral(expr);
@@ -59970,7 +61510,7 @@ var ts;
}
function getTextOfIdentifierOrLiteral(node) {
if (node) {
- if (node.kind === 69 ||
+ if (node.kind === 70 ||
node.kind === 9 ||
node.kind === 8) {
return node.text;
@@ -59980,10 +61520,10 @@ var ts;
}
function visit(node) {
switch (node.kind) {
- case 220:
- case 179:
+ case 221:
+ case 180:
+ case 148:
case 147:
- case 146:
var functionDeclaration = node;
var declarationName = getDeclarationName(functionDeclaration);
if (declarationName) {
@@ -60000,30 +61540,30 @@ var ts;
ts.forEachChild(node, visit);
}
break;
- case 221:
- case 192:
case 222:
+ case 193:
case 223:
case 224:
case 225:
- case 229:
- case 238:
- case 234:
- case 229:
- case 231:
+ case 226:
+ case 230:
+ case 239:
+ case 235:
+ case 230:
case 232:
- case 149:
+ case 233:
case 150:
- case 159:
+ case 151:
+ case 160:
addDeclaration(node);
ts.forEachChild(node, visit);
break;
- case 142:
+ case 143:
if (!ts.hasModifier(node, 92)) {
break;
}
- case 218:
- case 169: {
+ case 219:
+ case 170: {
var decl = node;
if (ts.isBindingPattern(decl.name)) {
ts.forEachChild(decl.name, visit);
@@ -60033,23 +61573,23 @@ var ts;
visit(decl.initializer);
}
case 255:
+ case 146:
case 145:
- case 144:
addDeclaration(node);
break;
- case 236:
+ case 237:
if (node.exportClause) {
ts.forEach(node.exportClause.elements, visit);
}
break;
- case 230:
+ case 231:
var importClause = node.importClause;
if (importClause) {
if (importClause.name) {
addDeclaration(importClause);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 232) {
+ if (importClause.namedBindings.kind === 233) {
addDeclaration(importClause.namedBindings);
}
else {
@@ -60073,7 +61613,7 @@ var ts;
getSourceFileConstructor: function () { return SourceFileObject; },
getSymbolConstructor: function () { return SymbolObject; },
getTypeConstructor: function () { return TypeObject; },
- getSignatureConstructor: function () { return SignatureObject; }
+ getSignatureConstructor: function () { return SignatureObject; },
};
}
function toEditorSettings(optionsAsMap) {
@@ -60165,7 +61705,7 @@ var ts;
};
HostCache.prototype.getRootFileNames = function () {
var fileNames = [];
- this.fileNameToEntry.forEachValue(function (path, value) {
+ this.fileNameToEntry.forEachValue(function (_path, value) {
if (value) {
fileNames.push(value.hostFileName);
}
@@ -60195,7 +61735,7 @@ var ts;
var version = this.host.getScriptVersion(fileName);
var sourceFile;
if (this.currentFileName !== fileName) {
- sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, version, true, scriptKind);
+ sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 4, version, true, scriptKind);
}
else if (this.currentFileVersion !== version) {
var editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot);
@@ -60348,7 +61888,7 @@ var ts;
useCaseSensitiveFileNames: function () { return useCaseSensitivefileNames; },
getNewLine: function () { return ts.getNewLineOrDefaultFromHost(host); },
getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); },
- writeFile: function (fileName, data, writeByteOrderMark) { },
+ writeFile: function () { },
getCurrentDirectory: function () { return currentDirectory; },
fileExists: function (fileName) {
return hostCache.getOrCreateEntry(fileName) !== undefined;
@@ -60490,12 +62030,12 @@ var ts;
var symbol = typeChecker.getSymbolAtLocation(node);
if (!symbol || typeChecker.isUnknownSymbol(symbol)) {
switch (node.kind) {
- case 69:
- case 172:
- case 139:
- case 97:
- case 165:
- case 95:
+ case 70:
+ case 173:
+ case 140:
+ case 98:
+ case 166:
+ case 96:
var type = typeChecker.getTypeAtLocation(node);
if (type) {
return {
@@ -60616,23 +62156,23 @@ var ts;
function getSourceFile(fileName) {
return getNonBoundSourceFile(fileName);
}
- function getNameOrDottedNameSpan(fileName, startPos, endPos) {
+ function getNameOrDottedNameSpan(fileName, startPos, _endPos) {
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
var node = ts.getTouchingPropertyName(sourceFile, startPos);
if (node === sourceFile) {
return;
}
switch (node.kind) {
- case 172:
- case 139:
+ case 173:
+ case 140:
case 9:
- case 84:
- case 99:
- case 93:
- case 95:
- case 97:
- case 165:
- case 69:
+ case 85:
+ case 100:
+ case 94:
+ case 96:
+ case 98:
+ case 166:
+ case 70:
break;
default:
return;
@@ -60643,7 +62183,7 @@ var ts;
nodeForStartPos = nodeForStartPos.parent;
}
else if (ts.isNameOfModuleDeclaration(nodeForStartPos)) {
- if (nodeForStartPos.parent.parent.kind === 225 &&
+ if (nodeForStartPos.parent.parent.kind === 226 &&
nodeForStartPos.parent.parent.body === nodeForStartPos.parent) {
nodeForStartPos = nodeForStartPos.parent.parent.name;
}
@@ -60723,14 +62263,14 @@ var ts;
return result;
function getMatchingTokenKind(token) {
switch (token.kind) {
- case 15: return 16;
- case 17: return 18;
- case 19: return 20;
- case 25: return 27;
- case 16: return 15;
- case 18: return 17;
- case 20: return 19;
- case 27: return 25;
+ case 16: return 17;
+ case 18: return 19;
+ case 20: return 21;
+ case 26: return 28;
+ case 17: return 16;
+ case 19: return 18;
+ case 21: return 20;
+ case 28: return 26;
}
return undefined;
}
@@ -60933,13 +62473,13 @@ var ts;
sourceFile.nameTable = nameTable;
function walk(node) {
switch (node.kind) {
- case 69:
+ case 70:
nameTable[node.text] = nameTable[node.text] === undefined ? node.pos : -1;
break;
case 9:
case 8:
if (ts.isDeclarationName(node) ||
- node.parent.kind === 240 ||
+ node.parent.kind === 241 ||
isArgumentOfElementAccessExpression(node) ||
ts.isLiteralComputedPropertyDeclarationName(node)) {
nameTable[node.text] = nameTable[node.text] === undefined ? node.pos : -1;
@@ -60959,7 +62499,7 @@ var ts;
function isArgumentOfElementAccessExpression(node) {
return node &&
node.parent &&
- node.parent.kind === 173 &&
+ node.parent.kind === 174 &&
node.parent.argumentExpression === node;
}
function getDefaultLibFilePath(options) {
@@ -60974,6 +62514,933 @@ var ts;
}
initializeServices();
})(ts || (ts = {}));
+var debugObjectHost = (function () { return this; })();
+var ts;
+(function (ts) {
+ function logInternalError(logger, err) {
+ if (logger) {
+ logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message);
+ }
+ }
+ var ScriptSnapshotShimAdapter = (function () {
+ function ScriptSnapshotShimAdapter(scriptSnapshotShim) {
+ this.scriptSnapshotShim = scriptSnapshotShim;
+ }
+ ScriptSnapshotShimAdapter.prototype.getText = function (start, end) {
+ return this.scriptSnapshotShim.getText(start, end);
+ };
+ ScriptSnapshotShimAdapter.prototype.getLength = function () {
+ return this.scriptSnapshotShim.getLength();
+ };
+ ScriptSnapshotShimAdapter.prototype.getChangeRange = function (oldSnapshot) {
+ var oldSnapshotShim = oldSnapshot;
+ var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim);
+ if (encoded == null) {
+ return null;
+ }
+ var decoded = JSON.parse(encoded);
+ return ts.createTextChangeRange(ts.createTextSpan(decoded.span.start, decoded.span.length), decoded.newLength);
+ };
+ ScriptSnapshotShimAdapter.prototype.dispose = function () {
+ if ("dispose" in this.scriptSnapshotShim) {
+ this.scriptSnapshotShim.dispose();
+ }
+ };
+ return ScriptSnapshotShimAdapter;
+ }());
+ var LanguageServiceShimHostAdapter = (function () {
+ function LanguageServiceShimHostAdapter(shimHost) {
+ var _this = this;
+ this.shimHost = shimHost;
+ this.loggingEnabled = false;
+ this.tracingEnabled = false;
+ if ("getModuleResolutionsForFile" in this.shimHost) {
+ this.resolveModuleNames = function (moduleNames, containingFile) {
+ var resolutionsInFile = JSON.parse(_this.shimHost.getModuleResolutionsForFile(containingFile));
+ return ts.map(moduleNames, function (name) {
+ var result = ts.getProperty(resolutionsInFile, name);
+ return result ? { resolvedFileName: result } : undefined;
+ });
+ };
+ }
+ if ("directoryExists" in this.shimHost) {
+ this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); };
+ }
+ if ("getTypeReferenceDirectiveResolutionsForFile" in this.shimHost) {
+ this.resolveTypeReferenceDirectives = function (typeDirectiveNames, containingFile) {
+ var typeDirectivesForFile = JSON.parse(_this.shimHost.getTypeReferenceDirectiveResolutionsForFile(containingFile));
+ return ts.map(typeDirectiveNames, function (name) { return ts.getProperty(typeDirectivesForFile, name); });
+ };
+ }
+ }
+ LanguageServiceShimHostAdapter.prototype.log = function (s) {
+ if (this.loggingEnabled) {
+ this.shimHost.log(s);
+ }
+ };
+ LanguageServiceShimHostAdapter.prototype.trace = function (s) {
+ if (this.tracingEnabled) {
+ this.shimHost.trace(s);
+ }
+ };
+ LanguageServiceShimHostAdapter.prototype.error = function (s) {
+ this.shimHost.error(s);
+ };
+ LanguageServiceShimHostAdapter.prototype.getProjectVersion = function () {
+ if (!this.shimHost.getProjectVersion) {
+ return undefined;
+ }
+ return this.shimHost.getProjectVersion();
+ };
+ LanguageServiceShimHostAdapter.prototype.getTypeRootsVersion = function () {
+ if (!this.shimHost.getTypeRootsVersion) {
+ return 0;
+ }
+ return this.shimHost.getTypeRootsVersion();
+ };
+ LanguageServiceShimHostAdapter.prototype.useCaseSensitiveFileNames = function () {
+ return this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false;
+ };
+ LanguageServiceShimHostAdapter.prototype.getCompilationSettings = function () {
+ var settingsJson = this.shimHost.getCompilationSettings();
+ if (settingsJson == null || settingsJson == "") {
+ throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");
+ }
+ return JSON.parse(settingsJson);
+ };
+ LanguageServiceShimHostAdapter.prototype.getScriptFileNames = function () {
+ var encoded = this.shimHost.getScriptFileNames();
+ return this.files = JSON.parse(encoded);
+ };
+ LanguageServiceShimHostAdapter.prototype.getScriptSnapshot = function (fileName) {
+ var scriptSnapshot = this.shimHost.getScriptSnapshot(fileName);
+ return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot);
+ };
+ LanguageServiceShimHostAdapter.prototype.getScriptKind = function (fileName) {
+ if ("getScriptKind" in this.shimHost) {
+ return this.shimHost.getScriptKind(fileName);
+ }
+ else {
+ return 0;
+ }
+ };
+ LanguageServiceShimHostAdapter.prototype.getScriptVersion = function (fileName) {
+ return this.shimHost.getScriptVersion(fileName);
+ };
+ LanguageServiceShimHostAdapter.prototype.getLocalizedDiagnosticMessages = function () {
+ var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages();
+ if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") {
+ return null;
+ }
+ try {
+ return JSON.parse(diagnosticMessagesJson);
+ }
+ catch (e) {
+ this.log(e.description || "diagnosticMessages.generated.json has invalid JSON format");
+ return null;
+ }
+ };
+ LanguageServiceShimHostAdapter.prototype.getCancellationToken = function () {
+ var hostCancellationToken = this.shimHost.getCancellationToken();
+ return new ThrottledCancellationToken(hostCancellationToken);
+ };
+ LanguageServiceShimHostAdapter.prototype.getCurrentDirectory = function () {
+ return this.shimHost.getCurrentDirectory();
+ };
+ LanguageServiceShimHostAdapter.prototype.getDirectories = function (path) {
+ return JSON.parse(this.shimHost.getDirectories(path));
+ };
+ LanguageServiceShimHostAdapter.prototype.getDefaultLibFileName = function (options) {
+ return this.shimHost.getDefaultLibFileName(JSON.stringify(options));
+ };
+ LanguageServiceShimHostAdapter.prototype.readDirectory = function (path, extensions, exclude, include, depth) {
+ var pattern = ts.getFileMatcherPatterns(path, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory());
+ return JSON.parse(this.shimHost.readDirectory(path, JSON.stringify(extensions), JSON.stringify(pattern.basePaths), pattern.excludePattern, pattern.includeFilePattern, pattern.includeDirectoryPattern, depth));
+ };
+ LanguageServiceShimHostAdapter.prototype.readFile = function (path, encoding) {
+ return this.shimHost.readFile(path, encoding);
+ };
+ LanguageServiceShimHostAdapter.prototype.fileExists = function (path) {
+ return this.shimHost.fileExists(path);
+ };
+ return LanguageServiceShimHostAdapter;
+ }());
+ ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter;
+ var ThrottledCancellationToken = (function () {
+ function ThrottledCancellationToken(hostCancellationToken) {
+ this.hostCancellationToken = hostCancellationToken;
+ this.lastCancellationCheckTime = 0;
+ }
+ ThrottledCancellationToken.prototype.isCancellationRequested = function () {
+ var time = ts.timestamp();
+ var duration = Math.abs(time - this.lastCancellationCheckTime);
+ if (duration > 10) {
+ this.lastCancellationCheckTime = time;
+ return this.hostCancellationToken.isCancellationRequested();
+ }
+ return false;
+ };
+ return ThrottledCancellationToken;
+ }());
+ var CoreServicesShimHostAdapter = (function () {
+ function CoreServicesShimHostAdapter(shimHost) {
+ var _this = this;
+ this.shimHost = shimHost;
+ this.useCaseSensitiveFileNames = this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false;
+ if ("directoryExists" in this.shimHost) {
+ this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); };
+ }
+ if ("realpath" in this.shimHost) {
+ this.realpath = function (path) { return _this.shimHost.realpath(path); };
+ }
+ }
+ CoreServicesShimHostAdapter.prototype.readDirectory = function (rootDir, extensions, exclude, include, depth) {
+ try {
+ var pattern = ts.getFileMatcherPatterns(rootDir, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory());
+ return JSON.parse(this.shimHost.readDirectory(rootDir, JSON.stringify(extensions), JSON.stringify(pattern.basePaths), pattern.excludePattern, pattern.includeFilePattern, pattern.includeDirectoryPattern, depth));
+ }
+ catch (e) {
+ var results = [];
+ for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) {
+ var extension = extensions_2[_i];
+ for (var _a = 0, _b = this.readDirectoryFallback(rootDir, extension, exclude); _a < _b.length; _a++) {
+ var file = _b[_a];
+ if (!ts.contains(results, file)) {
+ results.push(file);
+ }
+ }
+ }
+ return results;
+ }
+ };
+ CoreServicesShimHostAdapter.prototype.fileExists = function (fileName) {
+ return this.shimHost.fileExists(fileName);
+ };
+ CoreServicesShimHostAdapter.prototype.readFile = function (fileName) {
+ return this.shimHost.readFile(fileName);
+ };
+ CoreServicesShimHostAdapter.prototype.readDirectoryFallback = function (rootDir, extension, exclude) {
+ return JSON.parse(this.shimHost.readDirectory(rootDir, extension, JSON.stringify(exclude)));
+ };
+ CoreServicesShimHostAdapter.prototype.getDirectories = function (path) {
+ return JSON.parse(this.shimHost.getDirectories(path));
+ };
+ return CoreServicesShimHostAdapter;
+ }());
+ ts.CoreServicesShimHostAdapter = CoreServicesShimHostAdapter;
+ function simpleForwardCall(logger, actionDescription, action, logPerformance) {
+ var start;
+ if (logPerformance) {
+ logger.log(actionDescription);
+ start = ts.timestamp();
+ }
+ var result = action();
+ if (logPerformance) {
+ var end = ts.timestamp();
+ logger.log(actionDescription + " completed in " + (end - start) + " msec");
+ if (typeof result === "string") {
+ var str = result;
+ if (str.length > 128) {
+ str = str.substring(0, 128) + "...";
+ }
+ logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'");
+ }
+ }
+ return result;
+ }
+ function forwardJSONCall(logger, actionDescription, action, logPerformance) {
+ return forwardCall(logger, actionDescription, true, action, logPerformance);
+ }
+ function forwardCall(logger, actionDescription, returnJson, action, logPerformance) {
+ try {
+ var result = simpleForwardCall(logger, actionDescription, action, logPerformance);
+ return returnJson ? JSON.stringify({ result: result }) : result;
+ }
+ catch (err) {
+ if (err instanceof ts.OperationCanceledException) {
+ return JSON.stringify({ canceled: true });
+ }
+ logInternalError(logger, err);
+ err.description = actionDescription;
+ return JSON.stringify({ error: err });
+ }
+ }
+ var ShimBase = (function () {
+ function ShimBase(factory) {
+ this.factory = factory;
+ factory.registerShim(this);
+ }
+ ShimBase.prototype.dispose = function (_dummy) {
+ this.factory.unregisterShim(this);
+ };
+ return ShimBase;
+ }());
+ function realizeDiagnostics(diagnostics, newLine) {
+ return diagnostics.map(function (d) { return realizeDiagnostic(d, newLine); });
+ }
+ ts.realizeDiagnostics = realizeDiagnostics;
+ function realizeDiagnostic(diagnostic, newLine) {
+ return {
+ message: ts.flattenDiagnosticMessageText(diagnostic.messageText, newLine),
+ start: diagnostic.start,
+ length: diagnostic.length,
+ category: ts.DiagnosticCategory[diagnostic.category].toLowerCase(),
+ code: diagnostic.code
+ };
+ }
+ var LanguageServiceShimObject = (function (_super) {
+ __extends(LanguageServiceShimObject, _super);
+ function LanguageServiceShimObject(factory, host, languageService) {
+ var _this = _super.call(this, factory) || this;
+ _this.host = host;
+ _this.languageService = languageService;
+ _this.logPerformance = false;
+ _this.logger = _this.host;
+ return _this;
+ }
+ LanguageServiceShimObject.prototype.forwardJSONCall = function (actionDescription, action) {
+ return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance);
+ };
+ LanguageServiceShimObject.prototype.dispose = function (dummy) {
+ this.logger.log("dispose()");
+ this.languageService.dispose();
+ this.languageService = null;
+ if (debugObjectHost && debugObjectHost.CollectGarbage) {
+ debugObjectHost.CollectGarbage();
+ this.logger.log("CollectGarbage()");
+ }
+ this.logger = null;
+ _super.prototype.dispose.call(this, dummy);
+ };
+ LanguageServiceShimObject.prototype.refresh = function (throwOnError) {
+ this.forwardJSONCall("refresh(" + throwOnError + ")", function () { return null; });
+ };
+ LanguageServiceShimObject.prototype.cleanupSemanticCache = function () {
+ var _this = this;
+ this.forwardJSONCall("cleanupSemanticCache()", function () {
+ _this.languageService.cleanupSemanticCache();
+ return null;
+ });
+ };
+ LanguageServiceShimObject.prototype.realizeDiagnostics = function (diagnostics) {
+ var newLine = ts.getNewLineOrDefaultFromHost(this.host);
+ return ts.realizeDiagnostics(diagnostics, newLine);
+ };
+ LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) {
+ var _this = this;
+ return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); });
+ };
+ LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) {
+ var _this = this;
+ return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); });
+ };
+ LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) {
+ var _this = this;
+ return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); });
+ };
+ LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) {
+ var _this = this;
+ return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); });
+ };
+ LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) {
+ var _this = this;
+ return this.forwardJSONCall("getSyntacticDiagnostics('" + fileName + "')", function () {
+ var diagnostics = _this.languageService.getSyntacticDiagnostics(fileName);
+ return _this.realizeDiagnostics(diagnostics);
+ });
+ };
+ LanguageServiceShimObject.prototype.getSemanticDiagnostics = function (fileName) {
+ var _this = this;
+ return this.forwardJSONCall("getSemanticDiagnostics('" + fileName + "')", function () {
+ var diagnostics = _this.languageService.getSemanticDiagnostics(fileName);
+ return _this.realizeDiagnostics(diagnostics);
+ });
+ };
+ LanguageServiceShimObject.prototype.getCompilerOptionsDiagnostics = function () {
+ var _this = this;
+ return this.forwardJSONCall("getCompilerOptionsDiagnostics()", function () {
+ var diagnostics = _this.languageService.getCompilerOptionsDiagnostics();
+ return _this.realizeDiagnostics(diagnostics);
+ });
+ };
+ LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) {
+ var _this = this;
+ return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); });
+ };
+ LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { return _this.languageService.getSignatureHelpItems(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getImplementationAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getImplementationAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getImplementationAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments) {
+ var _this = this;
+ return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); });
+ };
+ LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.isValidBraceCompletionAtPosition = function (fileName, position, openingBrace) {
+ var _this = this;
+ return this.forwardJSONCall("isValidBraceCompletionAtPosition('" + fileName + "', " + position + ", " + openingBrace + ")", function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); });
+ };
+ LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options) {
+ var _this = this;
+ return this.forwardJSONCall("getIndentationAtPosition('" + fileName + "', " + position + ")", function () {
+ var localOptions = JSON.parse(options);
+ return _this.languageService.getIndentationAtPosition(fileName, position, localOptions);
+ });
+ };
+ LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getReferencesAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.findReferences = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { return _this.languageService.findReferences(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) {
+ var _this = this;
+ return this.forwardJSONCall("getDocumentHighlights('" + fileName + "', " + position + ")", function () {
+ var results = _this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
+ var normalizedName = ts.normalizeSlashes(fileName).toLowerCase();
+ return ts.filter(results, function (r) { return ts.normalizeSlashes(r.fileName).toLowerCase() === normalizedName; });
+ });
+ };
+ LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName) {
+ var _this = this;
+ return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () { return _this.languageService.getCompletionEntryDetails(fileName, position, entryName); });
+ };
+ LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options) {
+ var _this = this;
+ return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () {
+ var localOptions = JSON.parse(options);
+ return _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions);
+ });
+ };
+ LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options) {
+ var _this = this;
+ return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () {
+ var localOptions = JSON.parse(options);
+ return _this.languageService.getFormattingEditsForDocument(fileName, localOptions);
+ });
+ };
+ LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options) {
+ var _this = this;
+ return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () {
+ var localOptions = JSON.parse(options);
+ return _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions);
+ });
+ };
+ LanguageServiceShimObject.prototype.getDocCommentTemplateAtPosition = function (fileName, position) {
+ var _this = this;
+ return this.forwardJSONCall("getDocCommentTemplateAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDocCommentTemplateAtPosition(fileName, position); });
+ };
+ LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount, fileName) {
+ var _this = this;
+ return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ", " + fileName + ")", function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); });
+ };
+ LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) {
+ var _this = this;
+ return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { return _this.languageService.getNavigationBarItems(fileName); });
+ };
+ LanguageServiceShimObject.prototype.getNavigationTree = function (fileName) {
+ var _this = this;
+ return this.forwardJSONCall("getNavigationTree('" + fileName + "')", function () { return _this.languageService.getNavigationTree(fileName); });
+ };
+ LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) {
+ var _this = this;
+ return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { return _this.languageService.getOutliningSpans(fileName); });
+ };
+ LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) {
+ var _this = this;
+ return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); });
+ };
+ LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) {
+ var _this = this;
+ return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () { return _this.languageService.getEmitOutput(fileName); });
+ };
+ LanguageServiceShimObject.prototype.getEmitOutputObject = function (fileName) {
+ var _this = this;
+ return forwardCall(this.logger, "getEmitOutput('" + fileName + "')", false, function () { return _this.languageService.getEmitOutput(fileName); }, this.logPerformance);
+ };
+ return LanguageServiceShimObject;
+ }(ShimBase));
+ function convertClassifications(classifications) {
+ return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState };
+ }
+ var ClassifierShimObject = (function (_super) {
+ __extends(ClassifierShimObject, _super);
+ function ClassifierShimObject(factory, logger) {
+ var _this = _super.call(this, factory) || this;
+ _this.logger = logger;
+ _this.logPerformance = false;
+ _this.classifier = ts.createClassifier();
+ return _this;
+ }
+ ClassifierShimObject.prototype.getEncodedLexicalClassifications = function (text, lexState, syntacticClassifierAbsent) {
+ var _this = this;
+ return forwardJSONCall(this.logger, "getEncodedLexicalClassifications", function () { return convertClassifications(_this.classifier.getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent)); }, this.logPerformance);
+ };
+ ClassifierShimObject.prototype.getClassificationsForLine = function (text, lexState, classifyKeywordsInGenerics) {
+ var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics);
+ var result = "";
+ for (var _i = 0, _a = classification.entries; _i < _a.length; _i++) {
+ var item = _a[_i];
+ result += item.length + "\n";
+ result += item.classification + "\n";
+ }
+ result += classification.finalLexState;
+ return result;
+ };
+ return ClassifierShimObject;
+ }(ShimBase));
+ var CoreServicesShimObject = (function (_super) {
+ __extends(CoreServicesShimObject, _super);
+ function CoreServicesShimObject(factory, logger, host) {
+ var _this = _super.call(this, factory) || this;
+ _this.logger = logger;
+ _this.host = host;
+ _this.logPerformance = false;
+ return _this;
+ }
+ CoreServicesShimObject.prototype.forwardJSONCall = function (actionDescription, action) {
+ return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance);
+ };
+ CoreServicesShimObject.prototype.resolveModuleName = function (fileName, moduleName, compilerOptionsJson) {
+ var _this = this;
+ return this.forwardJSONCall("resolveModuleName('" + fileName + "')", function () {
+ var compilerOptions = JSON.parse(compilerOptionsJson);
+ var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
+ return {
+ resolvedFileName: result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined,
+ failedLookupLocations: result.failedLookupLocations
+ };
+ });
+ };
+ CoreServicesShimObject.prototype.resolveTypeReferenceDirective = function (fileName, typeReferenceDirective, compilerOptionsJson) {
+ var _this = this;
+ return this.forwardJSONCall("resolveTypeReferenceDirective(" + fileName + ")", function () {
+ var compilerOptions = JSON.parse(compilerOptionsJson);
+ var result = ts.resolveTypeReferenceDirective(typeReferenceDirective, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
+ return {
+ resolvedFileName: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.resolvedFileName : undefined,
+ primary: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.primary : true,
+ failedLookupLocations: result.failedLookupLocations
+ };
+ });
+ };
+ CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) {
+ var _this = this;
+ return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () {
+ var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()), true, true);
+ return {
+ referencedFiles: _this.convertFileReferences(result.referencedFiles),
+ importedFiles: _this.convertFileReferences(result.importedFiles),
+ ambientExternalModules: result.ambientExternalModules,
+ isLibFile: result.isLibFile,
+ typeReferenceDirectives: _this.convertFileReferences(result.typeReferenceDirectives)
+ };
+ });
+ };
+ CoreServicesShimObject.prototype.getAutomaticTypeDirectiveNames = function (compilerOptionsJson) {
+ var _this = this;
+ return this.forwardJSONCall("getAutomaticTypeDirectiveNames('" + compilerOptionsJson + "')", function () {
+ var compilerOptions = JSON.parse(compilerOptionsJson);
+ return ts.getAutomaticTypeDirectiveNames(compilerOptions, _this.host);
+ });
+ };
+ CoreServicesShimObject.prototype.convertFileReferences = function (refs) {
+ if (!refs) {
+ return undefined;
+ }
+ var result = [];
+ for (var _i = 0, refs_2 = refs; _i < refs_2.length; _i++) {
+ var ref = refs_2[_i];
+ result.push({
+ path: ts.normalizeSlashes(ref.fileName),
+ position: ref.pos,
+ length: ref.end - ref.pos
+ });
+ }
+ return result;
+ };
+ CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) {
+ var _this = this;
+ return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () {
+ var text = sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength());
+ var result = ts.parseConfigFileTextToJson(fileName, text);
+ if (result.error) {
+ return {
+ options: {},
+ typingOptions: {},
+ files: [],
+ raw: {},
+ errors: [realizeDiagnostic(result.error, "\r\n")]
+ };
+ }
+ var normalizedFileName = ts.normalizeSlashes(fileName);
+ var configFile = ts.parseJsonConfigFileContent(result.config, _this.host, ts.getDirectoryPath(normalizedFileName), {}, normalizedFileName);
+ return {
+ options: configFile.options,
+ typingOptions: configFile.typingOptions,
+ files: configFile.fileNames,
+ raw: configFile.raw,
+ errors: realizeDiagnostics(configFile.errors, "\r\n")
+ };
+ });
+ };
+ CoreServicesShimObject.prototype.getDefaultCompilationSettings = function () {
+ return this.forwardJSONCall("getDefaultCompilationSettings()", function () { return ts.getDefaultCompilerOptions(); });
+ };
+ CoreServicesShimObject.prototype.discoverTypings = function (discoverTypingsJson) {
+ var _this = this;
+ var getCanonicalFileName = ts.createGetCanonicalFileName(false);
+ return this.forwardJSONCall("discoverTypings()", function () {
+ var info = JSON.parse(discoverTypingsJson);
+ return ts.JsTyping.discoverTypings(_this.host, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), ts.toPath(info.safeListPath, info.safeListPath, getCanonicalFileName), info.packageNameToTypingLocation, info.typingOptions);
+ });
+ };
+ return CoreServicesShimObject;
+ }(ShimBase));
+ var TypeScriptServicesFactory = (function () {
+ function TypeScriptServicesFactory() {
+ this._shims = [];
+ }
+ TypeScriptServicesFactory.prototype.getServicesVersion = function () {
+ return ts.servicesVersion;
+ };
+ TypeScriptServicesFactory.prototype.createLanguageServiceShim = function (host) {
+ try {
+ if (this.documentRegistry === undefined) {
+ this.documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory());
+ }
+ var hostAdapter = new LanguageServiceShimHostAdapter(host);
+ var languageService = ts.createLanguageService(hostAdapter, this.documentRegistry);
+ return new LanguageServiceShimObject(this, host, languageService);
+ }
+ catch (err) {
+ logInternalError(host, err);
+ throw err;
+ }
+ };
+ TypeScriptServicesFactory.prototype.createClassifierShim = function (logger) {
+ try {
+ return new ClassifierShimObject(this, logger);
+ }
+ catch (err) {
+ logInternalError(logger, err);
+ throw err;
+ }
+ };
+ TypeScriptServicesFactory.prototype.createCoreServicesShim = function (host) {
+ try {
+ var adapter = new CoreServicesShimHostAdapter(host);
+ return new CoreServicesShimObject(this, host, adapter);
+ }
+ catch (err) {
+ logInternalError(host, err);
+ throw err;
+ }
+ };
+ TypeScriptServicesFactory.prototype.close = function () {
+ this._shims = [];
+ this.documentRegistry = undefined;
+ };
+ TypeScriptServicesFactory.prototype.registerShim = function (shim) {
+ this._shims.push(shim);
+ };
+ TypeScriptServicesFactory.prototype.unregisterShim = function (shim) {
+ for (var i = 0, n = this._shims.length; i < n; i++) {
+ if (this._shims[i] === shim) {
+ delete this._shims[i];
+ return;
+ }
+ }
+ throw new Error("Invalid operation");
+ };
+ return TypeScriptServicesFactory;
+ }());
+ ts.TypeScriptServicesFactory = TypeScriptServicesFactory;
+ if (typeof module !== "undefined" && module.exports) {
+ module.exports = ts;
+ }
+})(ts || (ts = {}));
+var TypeScript;
+(function (TypeScript) {
+ var Services;
+ (function (Services) {
+ Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory;
+ })(Services = TypeScript.Services || (TypeScript.Services = {}));
+})(TypeScript || (TypeScript = {}));
+var toolsVersion = "2.1";
+var ts;
+(function (ts) {
+ var server;
+ (function (server) {
+ (function (LogLevel) {
+ LogLevel[LogLevel["terse"] = 0] = "terse";
+ LogLevel[LogLevel["normal"] = 1] = "normal";
+ LogLevel[LogLevel["requestTime"] = 2] = "requestTime";
+ LogLevel[LogLevel["verbose"] = 3] = "verbose";
+ })(server.LogLevel || (server.LogLevel = {}));
+ var LogLevel = server.LogLevel;
+ server.emptyArray = [];
+ var Msg;
+ (function (Msg) {
+ Msg.Err = "Err";
+ Msg.Info = "Info";
+ Msg.Perf = "Perf";
+ })(Msg = server.Msg || (server.Msg = {}));
+ function getProjectRootPath(project) {
+ switch (project.projectKind) {
+ case server.ProjectKind.Configured:
+ return ts.getDirectoryPath(project.getProjectName());
+ case server.ProjectKind.Inferred:
+ return "";
+ case server.ProjectKind.External:
+ var projectName = ts.normalizeSlashes(project.getProjectName());
+ return project.projectService.host.fileExists(projectName) ? ts.getDirectoryPath(projectName) : projectName;
+ }
+ }
+ function createInstallTypingsRequest(project, typingOptions, cachePath) {
+ return {
+ projectName: project.getProjectName(),
+ fileNames: project.getFileNames(),
+ compilerOptions: project.getCompilerOptions(),
+ typingOptions: typingOptions,
+ projectRootPath: getProjectRootPath(project),
+ cachePath: cachePath,
+ kind: "discover"
+ };
+ }
+ server.createInstallTypingsRequest = createInstallTypingsRequest;
+ var Errors;
+ (function (Errors) {
+ function ThrowNoProject() {
+ throw new Error("No Project.");
+ }
+ Errors.ThrowNoProject = ThrowNoProject;
+ function ThrowProjectLanguageServiceDisabled() {
+ throw new Error("The project's language service is disabled.");
+ }
+ Errors.ThrowProjectLanguageServiceDisabled = ThrowProjectLanguageServiceDisabled;
+ function ThrowProjectDoesNotContainDocument(fileName, project) {
+ throw new Error("Project '" + project.getProjectName() + "' does not contain document '" + fileName + "'");
+ }
+ Errors.ThrowProjectDoesNotContainDocument = ThrowProjectDoesNotContainDocument;
+ })(Errors = server.Errors || (server.Errors = {}));
+ function getDefaultFormatCodeSettings(host) {
+ return {
+ indentSize: 4,
+ tabSize: 4,
+ newLineCharacter: host.newLine || "\n",
+ convertTabsToSpaces: true,
+ indentStyle: ts.IndentStyle.Smart,
+ insertSpaceAfterCommaDelimiter: true,
+ insertSpaceAfterSemicolonInForStatements: true,
+ insertSpaceBeforeAndAfterBinaryOperators: true,
+ insertSpaceAfterKeywordsInControlFlowStatements: true,
+ insertSpaceAfterFunctionKeywordForAnonymousFunctions: false,
+ insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false,
+ insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false,
+ insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false,
+ insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false,
+ placeOpenBraceOnNewLineForFunctions: false,
+ placeOpenBraceOnNewLineForControlBlocks: false,
+ };
+ }
+ server.getDefaultFormatCodeSettings = getDefaultFormatCodeSettings;
+ function mergeMaps(target, source) {
+ for (var key in source) {
+ if (ts.hasProperty(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
+ server.mergeMaps = mergeMaps;
+ function removeItemFromSet(items, itemToRemove) {
+ if (items.length === 0) {
+ return;
+ }
+ var index = items.indexOf(itemToRemove);
+ if (index < 0) {
+ return;
+ }
+ if (index === items.length - 1) {
+ items.pop();
+ }
+ else {
+ items[index] = items.pop();
+ }
+ }
+ server.removeItemFromSet = removeItemFromSet;
+ function toNormalizedPath(fileName) {
+ return ts.normalizePath(fileName);
+ }
+ server.toNormalizedPath = toNormalizedPath;
+ function normalizedPathToPath(normalizedPath, currentDirectory, getCanonicalFileName) {
+ var f = ts.isRootedDiskPath(normalizedPath) ? normalizedPath : ts.getNormalizedAbsolutePath(normalizedPath, currentDirectory);
+ return getCanonicalFileName(f);
+ }
+ server.normalizedPathToPath = normalizedPathToPath;
+ function asNormalizedPath(fileName) {
+ return fileName;
+ }
+ server.asNormalizedPath = asNormalizedPath;
+ function createNormalizedPathMap() {
+ var map = Object.create(null);
+ return {
+ get: function (path) {
+ return map[path];
+ },
+ set: function (path, value) {
+ map[path] = value;
+ },
+ contains: function (path) {
+ return ts.hasProperty(map, path);
+ },
+ remove: function (path) {
+ delete map[path];
+ }
+ };
+ }
+ server.createNormalizedPathMap = createNormalizedPathMap;
+ function throwLanguageServiceIsDisabledError() {
+ throw new Error("LanguageService is disabled");
+ }
+ server.nullLanguageService = {
+ cleanupSemanticCache: throwLanguageServiceIsDisabledError,
+ getSyntacticDiagnostics: throwLanguageServiceIsDisabledError,
+ getSemanticDiagnostics: throwLanguageServiceIsDisabledError,
+ getCompilerOptionsDiagnostics: throwLanguageServiceIsDisabledError,
+ getSyntacticClassifications: throwLanguageServiceIsDisabledError,
+ getEncodedSyntacticClassifications: throwLanguageServiceIsDisabledError,
+ getSemanticClassifications: throwLanguageServiceIsDisabledError,
+ getEncodedSemanticClassifications: throwLanguageServiceIsDisabledError,
+ getCompletionsAtPosition: throwLanguageServiceIsDisabledError,
+ findReferences: throwLanguageServiceIsDisabledError,
+ getCompletionEntryDetails: throwLanguageServiceIsDisabledError,
+ getQuickInfoAtPosition: throwLanguageServiceIsDisabledError,
+ findRenameLocations: throwLanguageServiceIsDisabledError,
+ getNameOrDottedNameSpan: throwLanguageServiceIsDisabledError,
+ getBreakpointStatementAtPosition: throwLanguageServiceIsDisabledError,
+ getBraceMatchingAtPosition: throwLanguageServiceIsDisabledError,
+ getSignatureHelpItems: throwLanguageServiceIsDisabledError,
+ getDefinitionAtPosition: throwLanguageServiceIsDisabledError,
+ getRenameInfo: throwLanguageServiceIsDisabledError,
+ getTypeDefinitionAtPosition: throwLanguageServiceIsDisabledError,
+ getReferencesAtPosition: throwLanguageServiceIsDisabledError,
+ getDocumentHighlights: throwLanguageServiceIsDisabledError,
+ getOccurrencesAtPosition: throwLanguageServiceIsDisabledError,
+ getNavigateToItems: throwLanguageServiceIsDisabledError,
+ getNavigationBarItems: throwLanguageServiceIsDisabledError,
+ getNavigationTree: throwLanguageServiceIsDisabledError,
+ getOutliningSpans: throwLanguageServiceIsDisabledError,
+ getTodoComments: throwLanguageServiceIsDisabledError,
+ getIndentationAtPosition: throwLanguageServiceIsDisabledError,
+ getFormattingEditsForRange: throwLanguageServiceIsDisabledError,
+ getFormattingEditsForDocument: throwLanguageServiceIsDisabledError,
+ getFormattingEditsAfterKeystroke: throwLanguageServiceIsDisabledError,
+ getDocCommentTemplateAtPosition: throwLanguageServiceIsDisabledError,
+ isValidBraceCompletionAtPosition: throwLanguageServiceIsDisabledError,
+ getEmitOutput: throwLanguageServiceIsDisabledError,
+ getProgram: throwLanguageServiceIsDisabledError,
+ getNonBoundSourceFile: throwLanguageServiceIsDisabledError,
+ dispose: throwLanguageServiceIsDisabledError,
+ getCompletionEntrySymbol: throwLanguageServiceIsDisabledError,
+ getImplementationAtPosition: throwLanguageServiceIsDisabledError,
+ getSourceFile: throwLanguageServiceIsDisabledError,
+ getCodeFixesAtPosition: throwLanguageServiceIsDisabledError
+ };
+ server.nullLanguageServiceHost = {
+ setCompilationSettings: function () { return undefined; },
+ notifyFileRemoved: function () { return undefined; }
+ };
+ function isInferredProjectName(name) {
+ return /dev\/null\/inferredProject\d+\*/.test(name);
+ }
+ server.isInferredProjectName = isInferredProjectName;
+ function makeInferredProjectName(counter) {
+ return "/dev/null/inferredProject" + counter + "*";
+ }
+ server.makeInferredProjectName = makeInferredProjectName;
+ var ThrottledOperations = (function () {
+ function ThrottledOperations(host) {
+ this.host = host;
+ this.pendingTimeouts = ts.createMap();
+ }
+ ThrottledOperations.prototype.schedule = function (operationId, delay, cb) {
+ if (ts.hasProperty(this.pendingTimeouts, operationId)) {
+ this.host.clearTimeout(this.pendingTimeouts[operationId]);
+ }
+ this.pendingTimeouts[operationId] = this.host.setTimeout(ThrottledOperations.run, delay, this, operationId, cb);
+ };
+ ThrottledOperations.run = function (self, operationId, cb) {
+ delete self.pendingTimeouts[operationId];
+ cb();
+ };
+ return ThrottledOperations;
+ }());
+ server.ThrottledOperations = ThrottledOperations;
+ var GcTimer = (function () {
+ function GcTimer(host, delay, logger) {
+ this.host = host;
+ this.delay = delay;
+ this.logger = logger;
+ }
+ GcTimer.prototype.scheduleCollect = function () {
+ if (!this.host.gc || this.timerId != undefined) {
+ return;
+ }
+ this.timerId = this.host.setTimeout(GcTimer.run, this.delay, this);
+ };
+ GcTimer.run = function (self) {
+ self.timerId = undefined;
+ var log = self.logger.hasLevel(LogLevel.requestTime);
+ var before = log && self.host.getMemoryUsage();
+ self.host.gc();
+ if (log) {
+ var after = self.host.getMemoryUsage();
+ self.logger.perftrc("GC::before " + before + ", after " + after);
+ }
+ };
+ return GcTimer;
+ }());
+ server.GcTimer = GcTimer;
+ })(server = ts.server || (ts.server = {}));
+})(ts || (ts = {}));
var ts;
(function (ts) {
var server;
@@ -61045,7 +63512,6 @@ var ts;
if (this.containingProjects.length === 0) {
return server.Errors.ThrowNoProject();
}
- ts.Debug.assert(this.containingProjects.length !== 0);
return this.containingProjects[0];
};
ScriptInfo.prototype.setFormatOptions = function (formatSettings) {
@@ -61077,12 +63543,12 @@ var ts;
var snap = this.snap();
this.host.writeFile(fileName, snap.getText(0, snap.getLength()));
};
- ScriptInfo.prototype.reloadFromFile = function () {
+ ScriptInfo.prototype.reloadFromFile = function (tempFileName) {
if (this.hasMixedContent) {
this.reload("");
}
else {
- this.svc.reloadFromFile(this.fileName);
+ this.svc.reloadFromFile(tempFileName || this.fileName);
this.markContainingProjectsAsDirty();
}
};
@@ -61294,8 +63760,8 @@ var ts;
(function (server) {
server.nullTypingsInstaller = {
enqueueInstallTypingsRequest: function () { },
- attach: function (projectService) { },
- onProjectClosed: function (p) { },
+ attach: function () { },
+ onProjectClosed: function () { },
globalTypingsCacheLocation: undefined
};
var TypingsCacheEntry = (function () {
@@ -61411,7 +63877,7 @@ var ts;
BuilderFileInfo.prototype.containsOnlyAmbientModules = function (sourceFile) {
for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
var statement = _a[_i];
- if (statement.kind !== 225 || statement.name.kind !== 9) {
+ if (statement.kind !== 226 || statement.name.kind !== 9) {
return false;
}
}
@@ -61473,7 +63939,7 @@ var ts;
this.fileInfos.remove(path);
};
AbstractBuilder.prototype.forEachFileInfo = function (action) {
- this.fileInfos.forEachValue(function (path, value) { return action(value); });
+ this.fileInfos.forEachValue(function (_path, value) { return action(value); });
};
AbstractBuilder.prototype.emitFile = function (scriptInfo, writeFile) {
var fileInfo = this.getFileInfo(scriptInfo.path);
@@ -62037,11 +64503,11 @@ var ts;
this.markAsDirty();
}
};
- Project.prototype.reloadScript = function (filename) {
+ Project.prototype.reloadScript = function (filename, tempFileName) {
var script = this.projectService.getScriptInfoForNormalizedPath(filename);
if (script) {
ts.Debug.assert(script.isAttached(this));
- script.reloadFromFile();
+ script.reloadFromFile(tempFileName);
return true;
}
return false;
@@ -62332,6 +64798,66 @@ var ts;
var server;
(function (server) {
server.maxProgramSizeForNonTsFiles = 20 * 1024 * 1024;
+ function prepareConvertersForEnumLikeCompilerOptions(commandLineOptions) {
+ var map = ts.createMap();
+ for (var _i = 0, commandLineOptions_1 = commandLineOptions; _i < commandLineOptions_1.length; _i++) {
+ var option = commandLineOptions_1[_i];
+ if (typeof option.type === "object") {
+ var optionMap = option.type;
+ for (var id in optionMap) {
+ ts.Debug.assert(typeof optionMap[id] === "number");
+ }
+ map[option.name] = optionMap;
+ }
+ }
+ return map;
+ }
+ var compilerOptionConverters = prepareConvertersForEnumLikeCompilerOptions(ts.optionDeclarations);
+ var indentStyle = ts.createMap({
+ "none": ts.IndentStyle.None,
+ "block": ts.IndentStyle.Block,
+ "smart": ts.IndentStyle.Smart
+ });
+ function convertFormatOptions(protocolOptions) {
+ if (typeof protocolOptions.indentStyle === "string") {
+ protocolOptions.indentStyle = indentStyle[protocolOptions.indentStyle.toLowerCase()];
+ ts.Debug.assert(protocolOptions.indentStyle !== undefined);
+ }
+ return protocolOptions;
+ }
+ server.convertFormatOptions = convertFormatOptions;
+ function convertCompilerOptions(protocolOptions) {
+ for (var id in compilerOptionConverters) {
+ var propertyValue = protocolOptions[id];
+ if (typeof propertyValue === "string") {
+ var mappedValues = compilerOptionConverters[id];
+ protocolOptions[id] = mappedValues[propertyValue.toLowerCase()];
+ }
+ }
+ return protocolOptions;
+ }
+ server.convertCompilerOptions = convertCompilerOptions;
+ function tryConvertScriptKindName(scriptKindName) {
+ return typeof scriptKindName === "string"
+ ? convertScriptKindName(scriptKindName)
+ : scriptKindName;
+ }
+ server.tryConvertScriptKindName = tryConvertScriptKindName;
+ function convertScriptKindName(scriptKindName) {
+ switch (scriptKindName) {
+ case "JS":
+ return 1;
+ case "JSX":
+ return 2;
+ case "TS":
+ return 3;
+ case "TSX":
+ return 4;
+ default:
+ return 0;
+ }
+ }
+ server.convertScriptKindName = convertScriptKindName;
function combineProjectOutput(projects, action, comparer, areEqual) {
var result = projects.reduce(function (previous, current) { return ts.concatenate(previous, action(current)); }, []).sort(comparer);
return projects.length > 1 ? ts.deduplicate(result, areEqual) : result;
@@ -62344,7 +64870,7 @@ var ts;
};
var externalFilePropertyReader = {
getFileName: function (x) { return x.fileName; },
- getScriptKind: function (x) { return x.scriptKind; },
+ getScriptKind: function (x) { return tryConvertScriptKindName(x.scriptKind); },
hasMixedContent: function (x) { return x.hasMixedContent; }
};
function findProjectByName(projectName, projects) {
@@ -62429,6 +64955,9 @@ var ts;
ProjectService.prototype.ensureInferredProjectsUpToDate_TestOnly = function () {
this.ensureInferredProjectsUpToDate();
};
+ ProjectService.prototype.getCompilerOptionsForInferredProjects = function () {
+ return this.compilerOptionsForInferredProjects;
+ };
ProjectService.prototype.updateTypingsForProject = function (response) {
var project = this.findProject(response.projectName);
if (!project) {
@@ -62445,11 +64974,11 @@ var ts;
}
};
ProjectService.prototype.setCompilerOptionsForInferredProjects = function (projectCompilerOptions) {
- this.compilerOptionsForInferredProjects = projectCompilerOptions;
+ this.compilerOptionsForInferredProjects = convertCompilerOptions(projectCompilerOptions);
this.compileOnSaveForInferredProjects = projectCompilerOptions.compileOnSave;
for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) {
var proj = _a[_i];
- proj.setCompilerOptions(projectCompilerOptions);
+ proj.setCompilerOptions(this.compilerOptionsForInferredProjects);
proj.compileOnSaveEnabled = projectCompilerOptions.compileOnSave;
}
this.updateProjectGraphs(this.inferredProjects);
@@ -62573,12 +65102,12 @@ var ts;
return;
}
this.logger.info("Detected source file changes: " + fileName);
- this.throttledOperations.schedule(project.configFileName, 250, function () { return _this.handleChangeInSourceFileForConfiguredProject(project); });
+ this.throttledOperations.schedule(project.configFileName, 250, function () { return _this.handleChangeInSourceFileForConfiguredProject(project, fileName); });
};
- ProjectService.prototype.handleChangeInSourceFileForConfiguredProject = function (project) {
+ ProjectService.prototype.handleChangeInSourceFileForConfiguredProject = function (project, triggerFile) {
var _this = this;
var _a = this.convertConfigFileContentToProjectOptions(project.configFileName), projectOptions = _a.projectOptions, configFileErrors = _a.configFileErrors;
- this.reportConfigFileDiagnostics(project.getProjectName(), configFileErrors);
+ this.reportConfigFileDiagnostics(project.getProjectName(), configFileErrors, triggerFile);
var newRootFiles = projectOptions.files.map((function (f) { return _this.getCanonicalFileName(f); }));
var currentRootFiles = project.getRootFiles().map((function (f) { return _this.getCanonicalFileName(f); }));
if (!ts.arrayIsEqualTo(currentRootFiles.sort(), newRootFiles.sort())) {
@@ -62598,7 +65127,7 @@ var ts;
return;
}
var configFileErrors = this.convertConfigFileContentToProjectOptions(fileName).configFileErrors;
- this.reportConfigFileDiagnostics(fileName, configFileErrors);
+ this.reportConfigFileDiagnostics(fileName, configFileErrors, fileName);
this.logger.info("Detected newly added tsconfig file: " + fileName);
this.reloadProjects();
};
@@ -62829,7 +65358,8 @@ var ts;
return false;
};
ProjectService.prototype.createAndAddExternalProject = function (projectFileName, files, options, typingOptions) {
- var project = new server.ExternalProject(projectFileName, this, this.documentRegistry, options, !this.exceededTotalSizeLimitForNonTsFiles(options, files, externalFilePropertyReader), options.compileOnSave === undefined ? true : options.compileOnSave);
+ var compilerOptions = convertCompilerOptions(options);
+ var project = new server.ExternalProject(projectFileName, this, this.documentRegistry, compilerOptions, !this.exceededTotalSizeLimitForNonTsFiles(compilerOptions, files, externalFilePropertyReader), options.compileOnSave === undefined ? true : options.compileOnSave);
this.addFilesToProjectAndUpdateGraph(project, files, externalFilePropertyReader, undefined, typingOptions, undefined);
this.externalProjects.push(project);
return project;
@@ -63051,7 +65581,7 @@ var ts;
if (args.file) {
var info = this.getScriptInfoForNormalizedPath(server.toNormalizedPath(args.file));
if (info) {
- info.setFormatOptions(args.formatOptions);
+ info.setFormatOptions(convertFormatOptions(args.formatOptions));
this.logger.info("Host configuration update for file " + args.file);
}
}
@@ -63061,7 +65591,7 @@ var ts;
this.logger.info("Host information " + args.hostInfo);
}
if (args.formatOptions) {
- server.mergeMaps(this.hostConfiguration.formatCodeOptions, args.formatOptions);
+ server.mergeMaps(this.hostConfiguration.formatCodeOptions, convertFormatOptions(args.formatOptions));
this.logger.info("Format host information updated");
}
}
@@ -63152,7 +65682,7 @@ var ts;
var scriptInfo = this.getScriptInfo(file.fileName);
ts.Debug.assert(!scriptInfo || !scriptInfo.isOpen);
var normalizedPath = scriptInfo ? scriptInfo.fileName : server.toNormalizedPath(file.fileName);
- this.openClientFileWithNormalizedPath(normalizedPath, file.content, file.scriptKind, file.hasMixedContent);
+ this.openClientFileWithNormalizedPath(normalizedPath, file.content, tryConvertScriptKindName(file.scriptKind), file.hasMixedContent);
}
}
if (changedFiles) {
@@ -63237,7 +65767,7 @@ var ts;
var exisingConfigFiles;
if (externalProject) {
if (!tsConfigFiles) {
- this.updateNonInferredProject(externalProject, proj.rootFiles, externalFilePropertyReader, proj.options, proj.typingOptions, proj.options.compileOnSave, undefined);
+ this.updateNonInferredProject(externalProject, proj.rootFiles, externalFilePropertyReader, convertCompilerOptions(proj.options), proj.typingOptions, proj.options.compileOnSave, undefined);
return;
}
this.closeExternalProject(proj.projectFileName, true);
@@ -63523,23 +66053,7 @@ var ts;
return _this.requiredResponse(_this.getRenameInfo(request.arguments));
},
_a[CommandNames.Open] = function (request) {
- var openArgs = request.arguments;
- var scriptKind;
- switch (openArgs.scriptKindName) {
- case "TS":
- scriptKind = 3;
- break;
- case "JS":
- scriptKind = 1;
- break;
- case "TSX":
- scriptKind = 4;
- break;
- case "JSX":
- scriptKind = 2;
- break;
- }
- _this.openClientFile(server.toNormalizedPath(openArgs.file), openArgs.fileContent, scriptKind);
+ _this.openClientFile(server.toNormalizedPath(request.arguments.file), request.arguments.fileContent, server.convertScriptKindName(request.arguments.scriptKindName));
return _this.notRequired();
},
_a[CommandNames.Quickinfo] = function (request) {
@@ -63611,7 +66125,7 @@ var ts;
_a[CommandNames.EncodedSemanticClassificationsFull] = function (request) {
return _this.requiredResponse(_this.getEncodedSemanticClassifications(request.arguments));
},
- _a[CommandNames.Cleanup] = function (request) {
+ _a[CommandNames.Cleanup] = function () {
_this.cleanup();
return _this.requiredResponse(true);
},
@@ -63686,12 +66200,13 @@ var ts;
return _this.requiredResponse(_this.getDocumentHighlights(request.arguments, false));
},
_a[CommandNames.CompilerOptionsForInferredProjects] = function (request) {
- return _this.requiredResponse(_this.setCompilerOptionsForInferredProjects(request.arguments));
+ _this.setCompilerOptionsForInferredProjects(request.arguments);
+ return _this.requiredResponse(true);
},
_a[CommandNames.ProjectInfo] = function (request) {
return _this.requiredResponse(_this.getProjectInfo(request.arguments));
},
- _a[CommandNames.ReloadProjects] = function (request) {
+ _a[CommandNames.ReloadProjects] = function () {
_this.projectService.reloadProjects();
return _this.notRequired();
},
@@ -63701,7 +66216,7 @@ var ts;
_a[CommandNames.GetCodeFixesFull] = function (request) {
return _this.requiredResponse(_this.getCodeFixes(request.arguments, false));
},
- _a[CommandNames.GetSupportedCodeFixes] = function (request) {
+ _a[CommandNames.GetSupportedCodeFixes] = function () {
return _this.requiredResponse(_this.getSupportedCodeFixes());
},
_a));
@@ -63763,7 +66278,7 @@ var ts;
seq: 0,
type: "event",
event: eventName,
- body: info
+ body: info,
};
this.send(ev);
};
@@ -63774,7 +66289,7 @@ var ts;
type: "response",
command: cmdName,
request_seq: reqSeq,
- success: !errorMsg
+ success: !errorMsg,
};
if (!errorMsg) {
res.body = info;
@@ -63899,9 +66414,9 @@ var ts;
endLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start + d.length)
}); });
};
- Session.prototype.getDiagnosticsWorker = function (args, selector, includeLinePosition) {
+ Session.prototype.getDiagnosticsWorker = function (args, isSemantic, selector, includeLinePosition) {
var _a = this.getFileAndProject(args), project = _a.project, file = _a.file;
- if (shouldSkipSematicCheck(project)) {
+ if (isSemantic && shouldSkipSematicCheck(project)) {
return [];
}
var scriptInfo = project.getScriptInfoForNormalizedPath(file);
@@ -63985,15 +66500,15 @@ var ts;
start: start,
end: end,
file: fileName,
- isWriteAccess: isWriteAccess
+ isWriteAccess: isWriteAccess,
};
});
};
Session.prototype.getSyntacticDiagnosticsSync = function (args) {
- return this.getDiagnosticsWorker(args, function (project, file) { return project.getLanguageService().getSyntacticDiagnostics(file); }, args.includeLinePosition);
+ return this.getDiagnosticsWorker(args, false, function (project, file) { return project.getLanguageService().getSyntacticDiagnostics(file); }, args.includeLinePosition);
};
Session.prototype.getSemanticDiagnosticsSync = function (args) {
- return this.getDiagnosticsWorker(args, function (project, file) { return project.getLanguageService().getSemanticDiagnostics(file); }, args.includeLinePosition);
+ return this.getDiagnosticsWorker(args, true, function (project, file) { return project.getLanguageService().getSemanticDiagnostics(file); }, args.includeLinePosition);
};
Session.prototype.getDocumentHighlights = function (args, simplifiedResult) {
var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
@@ -64090,7 +66605,7 @@ var ts;
return {
file: location.fileName,
start: locationScriptInfo.positionToLineOffset(location.textSpan.start),
- end: locationScriptInfo.positionToLineOffset(ts.textSpanEnd(location.textSpan))
+ end: locationScriptInfo.positionToLineOffset(ts.textSpanEnd(location.textSpan)),
};
});
}, compareRenameLocation, function (a, b) { return a.file === b.file && a.start.line === b.start.line && a.start.offset === b.start.offset; });
@@ -64204,7 +66719,7 @@ var ts;
if (this.eventHander) {
this.eventHander({
eventName: "configFileDiag",
- data: { fileName: fileName, configFileName: configFileName, diagnostics: configFileErrors || [] }
+ data: { triggerFile: fileName, configFileName: configFileName, diagnostics: configFileErrors || [] }
});
}
};
@@ -64244,7 +66759,7 @@ var ts;
Session.prototype.getIndentation = function (args) {
var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project;
var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file));
- var options = args.options || this.projectService.getFormatCodeOptions(file);
+ var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file);
var indentation = project.getLanguageService(false).getIndentationAtPosition(file, position, options);
return { position: position, indentation: indentation };
};
@@ -64279,7 +66794,7 @@ var ts;
start: scriptInfo.positionToLineOffset(quickInfo.textSpan.start),
end: scriptInfo.positionToLineOffset(ts.textSpanEnd(quickInfo.textSpan)),
displayString: displayString,
- documentation: docString
+ documentation: docString,
};
}
else {
@@ -64300,17 +66815,17 @@ var ts;
};
Session.prototype.getFormattingEditsForRangeFull = function (args) {
var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project;
- var options = args.options || this.projectService.getFormatCodeOptions(file);
+ var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file);
return project.getLanguageService(false).getFormattingEditsForRange(file, args.position, args.endPosition, options);
};
Session.prototype.getFormattingEditsForDocumentFull = function (args) {
var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project;
- var options = args.options || this.projectService.getFormatCodeOptions(file);
+ var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file);
return project.getLanguageService(false).getFormattingEditsForDocument(file, options);
};
Session.prototype.getFormattingEditsAfterKeystrokeFull = function (args) {
var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project;
- var options = args.options || this.projectService.getFormatCodeOptions(file);
+ var options = args.options ? server.convertFormatOptions(args.options) : this.projectService.getFormatCodeOptions(file);
return project.getLanguageService(false).getFormattingEditsAfterKeystroke(file, args.position, args.key, options);
};
Session.prototype.getFormattingEditsAfterKeystroke = function (args) {
@@ -64377,7 +66892,7 @@ var ts;
result.push({ name: name_53, kind: kind, kindModifiers: kindModifiers, sortText: sortText, replacementSpan: convertedSpan });
}
return result;
- }, []).sort(function (a, b) { return a.name.localeCompare(b.name); });
+ }, []).sort(function (a, b) { return ts.compareStrings(a.name, b.name); });
}
else {
return completions;
@@ -64440,7 +66955,7 @@ var ts;
},
selectedItemIndex: helpItems.selectedItemIndex,
argumentIndex: helpItems.argumentIndex,
- argumentCount: helpItems.argumentCount
+ argumentCount: helpItems.argumentCount,
};
}
else {
@@ -64477,10 +66992,11 @@ var ts;
};
Session.prototype.reload = function (args, reqSeq) {
var file = server.toNormalizedPath(args.file);
+ var tempFileName = args.tmpfile && server.toNormalizedPath(args.tmpfile);
var project = this.projectService.getDefaultProjectForFile(file, true);
if (project) {
this.changeSeq++;
- if (project.reloadScript(file)) {
+ if (project.reloadScript(file, tempFileName)) {
this.output(undefined, CommandNames.Reload, reqSeq);
}
}
@@ -64561,7 +67077,7 @@ var ts;
kind: navItem.kind,
file: navItem.fileName,
start: start,
- end: end
+ end: end,
};
if (navItem.kindModifiers && (navItem.kindModifiers !== "")) {
bakedItem.kindModifiers = navItem.kindModifiers;
@@ -64670,7 +67186,7 @@ var ts;
if (languageServiceDisabled) {
return;
}
- var fileNamesInProject = fileNames.filter(function (value, index, array) { return value.indexOf("lib.d.ts") < 0; });
+ var fileNamesInProject = fileNames.filter(function (value) { return value.indexOf("lib.d.ts") < 0; });
var highPriorityFiles = [];
var mediumPriorityFiles = [];
var lowPriorityFiles = [];
@@ -64790,7 +67306,7 @@ var ts;
this.goSubtree = true;
this.done = false;
}
- BaseLineIndexWalker.prototype.leaf = function (rangeStart, rangeLength, ll) {
+ BaseLineIndexWalker.prototype.leaf = function (_rangeStart, _rangeLength, _ll) {
};
return BaseLineIndexWalker;
}());
@@ -64885,14 +67401,14 @@ var ts;
}
return this.lineIndex;
};
- EditWalker.prototype.post = function (relativeStart, relativeLength, lineCollection, parent, nodeType) {
+ EditWalker.prototype.post = function (_relativeStart, _relativeLength, lineCollection) {
if (lineCollection === this.lineCollectionAtBranch) {
this.state = CharRangeSection.End;
}
this.stack.length--;
return undefined;
};
- EditWalker.prototype.pre = function (relativeStart, relativeLength, lineCollection, parent, nodeType) {
+ EditWalker.prototype.pre = function (_relativeStart, _relativeLength, lineCollection, _parent, nodeType) {
var currentNode = this.stack[this.stack.length - 1];
if ((this.state === CharRangeSection.Entire) && (nodeType === CharRangeSection.Start)) {
this.state = CharRangeSection.Start;
@@ -65117,7 +67633,7 @@ var ts;
var starts = [-1];
var count = 1;
var pos = 0;
- this.index.every(function (ll, s, len) {
+ this.index.every(function (ll) {
starts[count] = pos;
count++;
pos += ll.text.length;
@@ -65411,7 +67927,7 @@ var ts;
if (!childInfo.child) {
return {
line: lineNumber,
- offset: charOffset
+ offset: charOffset,
};
}
else if (childInfo.childIndex < this.children.length) {
@@ -65617,694 +68133,5 @@ var ts;
server.LineLeaf = LineLeaf;
})(server = ts.server || (ts.server = {}));
})(ts || (ts = {}));
-var debugObjectHost = (function () { return this; })();
-var ts;
-(function (ts) {
- function logInternalError(logger, err) {
- if (logger) {
- logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message);
- }
- }
- var ScriptSnapshotShimAdapter = (function () {
- function ScriptSnapshotShimAdapter(scriptSnapshotShim) {
- this.scriptSnapshotShim = scriptSnapshotShim;
- }
- ScriptSnapshotShimAdapter.prototype.getText = function (start, end) {
- return this.scriptSnapshotShim.getText(start, end);
- };
- ScriptSnapshotShimAdapter.prototype.getLength = function () {
- return this.scriptSnapshotShim.getLength();
- };
- ScriptSnapshotShimAdapter.prototype.getChangeRange = function (oldSnapshot) {
- var oldSnapshotShim = oldSnapshot;
- var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim);
- if (encoded == null) {
- return null;
- }
- var decoded = JSON.parse(encoded);
- return ts.createTextChangeRange(ts.createTextSpan(decoded.span.start, decoded.span.length), decoded.newLength);
- };
- ScriptSnapshotShimAdapter.prototype.dispose = function () {
- if ("dispose" in this.scriptSnapshotShim) {
- this.scriptSnapshotShim.dispose();
- }
- };
- return ScriptSnapshotShimAdapter;
- }());
- var LanguageServiceShimHostAdapter = (function () {
- function LanguageServiceShimHostAdapter(shimHost) {
- var _this = this;
- this.shimHost = shimHost;
- this.loggingEnabled = false;
- this.tracingEnabled = false;
- if ("getModuleResolutionsForFile" in this.shimHost) {
- this.resolveModuleNames = function (moduleNames, containingFile) {
- var resolutionsInFile = JSON.parse(_this.shimHost.getModuleResolutionsForFile(containingFile));
- return ts.map(moduleNames, function (name) {
- var result = ts.getProperty(resolutionsInFile, name);
- return result ? { resolvedFileName: result } : undefined;
- });
- };
- }
- if ("directoryExists" in this.shimHost) {
- this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); };
- }
- if ("getTypeReferenceDirectiveResolutionsForFile" in this.shimHost) {
- this.resolveTypeReferenceDirectives = function (typeDirectiveNames, containingFile) {
- var typeDirectivesForFile = JSON.parse(_this.shimHost.getTypeReferenceDirectiveResolutionsForFile(containingFile));
- return ts.map(typeDirectiveNames, function (name) { return ts.getProperty(typeDirectivesForFile, name); });
- };
- }
- }
- LanguageServiceShimHostAdapter.prototype.log = function (s) {
- if (this.loggingEnabled) {
- this.shimHost.log(s);
- }
- };
- LanguageServiceShimHostAdapter.prototype.trace = function (s) {
- if (this.tracingEnabled) {
- this.shimHost.trace(s);
- }
- };
- LanguageServiceShimHostAdapter.prototype.error = function (s) {
- this.shimHost.error(s);
- };
- LanguageServiceShimHostAdapter.prototype.getProjectVersion = function () {
- if (!this.shimHost.getProjectVersion) {
- return undefined;
- }
- return this.shimHost.getProjectVersion();
- };
- LanguageServiceShimHostAdapter.prototype.getTypeRootsVersion = function () {
- if (!this.shimHost.getTypeRootsVersion) {
- return 0;
- }
- return this.shimHost.getTypeRootsVersion();
- };
- LanguageServiceShimHostAdapter.prototype.useCaseSensitiveFileNames = function () {
- return this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false;
- };
- LanguageServiceShimHostAdapter.prototype.getCompilationSettings = function () {
- var settingsJson = this.shimHost.getCompilationSettings();
- if (settingsJson == null || settingsJson == "") {
- throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");
- }
- return JSON.parse(settingsJson);
- };
- LanguageServiceShimHostAdapter.prototype.getScriptFileNames = function () {
- var encoded = this.shimHost.getScriptFileNames();
- return this.files = JSON.parse(encoded);
- };
- LanguageServiceShimHostAdapter.prototype.getScriptSnapshot = function (fileName) {
- var scriptSnapshot = this.shimHost.getScriptSnapshot(fileName);
- return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot);
- };
- LanguageServiceShimHostAdapter.prototype.getScriptKind = function (fileName) {
- if ("getScriptKind" in this.shimHost) {
- return this.shimHost.getScriptKind(fileName);
- }
- else {
- return 0;
- }
- };
- LanguageServiceShimHostAdapter.prototype.getScriptVersion = function (fileName) {
- return this.shimHost.getScriptVersion(fileName);
- };
- LanguageServiceShimHostAdapter.prototype.getLocalizedDiagnosticMessages = function () {
- var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages();
- if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") {
- return null;
- }
- try {
- return JSON.parse(diagnosticMessagesJson);
- }
- catch (e) {
- this.log(e.description || "diagnosticMessages.generated.json has invalid JSON format");
- return null;
- }
- };
- LanguageServiceShimHostAdapter.prototype.getCancellationToken = function () {
- var hostCancellationToken = this.shimHost.getCancellationToken();
- return new ThrottledCancellationToken(hostCancellationToken);
- };
- LanguageServiceShimHostAdapter.prototype.getCurrentDirectory = function () {
- return this.shimHost.getCurrentDirectory();
- };
- LanguageServiceShimHostAdapter.prototype.getDirectories = function (path) {
- return JSON.parse(this.shimHost.getDirectories(path));
- };
- LanguageServiceShimHostAdapter.prototype.getDefaultLibFileName = function (options) {
- return this.shimHost.getDefaultLibFileName(JSON.stringify(options));
- };
- LanguageServiceShimHostAdapter.prototype.readDirectory = function (path, extensions, exclude, include, depth) {
- var pattern = ts.getFileMatcherPatterns(path, extensions, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory());
- return JSON.parse(this.shimHost.readDirectory(path, JSON.stringify(extensions), JSON.stringify(pattern.basePaths), pattern.excludePattern, pattern.includeFilePattern, pattern.includeDirectoryPattern, depth));
- };
- LanguageServiceShimHostAdapter.prototype.readFile = function (path, encoding) {
- return this.shimHost.readFile(path, encoding);
- };
- LanguageServiceShimHostAdapter.prototype.fileExists = function (path) {
- return this.shimHost.fileExists(path);
- };
- return LanguageServiceShimHostAdapter;
- }());
- ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter;
- var ThrottledCancellationToken = (function () {
- function ThrottledCancellationToken(hostCancellationToken) {
- this.hostCancellationToken = hostCancellationToken;
- this.lastCancellationCheckTime = 0;
- }
- ThrottledCancellationToken.prototype.isCancellationRequested = function () {
- var time = ts.timestamp();
- var duration = Math.abs(time - this.lastCancellationCheckTime);
- if (duration > 10) {
- this.lastCancellationCheckTime = time;
- return this.hostCancellationToken.isCancellationRequested();
- }
- return false;
- };
- return ThrottledCancellationToken;
- }());
- var CoreServicesShimHostAdapter = (function () {
- function CoreServicesShimHostAdapter(shimHost) {
- var _this = this;
- this.shimHost = shimHost;
- this.useCaseSensitiveFileNames = this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false;
- if ("directoryExists" in this.shimHost) {
- this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); };
- }
- if ("realpath" in this.shimHost) {
- this.realpath = function (path) { return _this.shimHost.realpath(path); };
- }
- }
- CoreServicesShimHostAdapter.prototype.readDirectory = function (rootDir, extensions, exclude, include, depth) {
- try {
- var pattern = ts.getFileMatcherPatterns(rootDir, extensions, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory());
- return JSON.parse(this.shimHost.readDirectory(rootDir, JSON.stringify(extensions), JSON.stringify(pattern.basePaths), pattern.excludePattern, pattern.includeFilePattern, pattern.includeDirectoryPattern, depth));
- }
- catch (e) {
- var results = [];
- for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) {
- var extension = extensions_2[_i];
- for (var _a = 0, _b = this.readDirectoryFallback(rootDir, extension, exclude); _a < _b.length; _a++) {
- var file = _b[_a];
- if (!ts.contains(results, file)) {
- results.push(file);
- }
- }
- }
- return results;
- }
- };
- CoreServicesShimHostAdapter.prototype.fileExists = function (fileName) {
- return this.shimHost.fileExists(fileName);
- };
- CoreServicesShimHostAdapter.prototype.readFile = function (fileName) {
- return this.shimHost.readFile(fileName);
- };
- CoreServicesShimHostAdapter.prototype.readDirectoryFallback = function (rootDir, extension, exclude) {
- return JSON.parse(this.shimHost.readDirectory(rootDir, extension, JSON.stringify(exclude)));
- };
- CoreServicesShimHostAdapter.prototype.getDirectories = function (path) {
- return JSON.parse(this.shimHost.getDirectories(path));
- };
- return CoreServicesShimHostAdapter;
- }());
- ts.CoreServicesShimHostAdapter = CoreServicesShimHostAdapter;
- function simpleForwardCall(logger, actionDescription, action, logPerformance) {
- var start;
- if (logPerformance) {
- logger.log(actionDescription);
- start = ts.timestamp();
- }
- var result = action();
- if (logPerformance) {
- var end = ts.timestamp();
- logger.log(actionDescription + " completed in " + (end - start) + " msec");
- if (typeof result === "string") {
- var str = result;
- if (str.length > 128) {
- str = str.substring(0, 128) + "...";
- }
- logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'");
- }
- }
- return result;
- }
- function forwardJSONCall(logger, actionDescription, action, logPerformance) {
- return forwardCall(logger, actionDescription, true, action, logPerformance);
- }
- function forwardCall(logger, actionDescription, returnJson, action, logPerformance) {
- try {
- var result = simpleForwardCall(logger, actionDescription, action, logPerformance);
- return returnJson ? JSON.stringify({ result: result }) : result;
- }
- catch (err) {
- if (err instanceof ts.OperationCanceledException) {
- return JSON.stringify({ canceled: true });
- }
- logInternalError(logger, err);
- err.description = actionDescription;
- return JSON.stringify({ error: err });
- }
- }
- var ShimBase = (function () {
- function ShimBase(factory) {
- this.factory = factory;
- factory.registerShim(this);
- }
- ShimBase.prototype.dispose = function (dummy) {
- this.factory.unregisterShim(this);
- };
- return ShimBase;
- }());
- function realizeDiagnostics(diagnostics, newLine) {
- return diagnostics.map(function (d) { return realizeDiagnostic(d, newLine); });
- }
- ts.realizeDiagnostics = realizeDiagnostics;
- function realizeDiagnostic(diagnostic, newLine) {
- return {
- message: ts.flattenDiagnosticMessageText(diagnostic.messageText, newLine),
- start: diagnostic.start,
- length: diagnostic.length,
- category: ts.DiagnosticCategory[diagnostic.category].toLowerCase(),
- code: diagnostic.code
- };
- }
- var LanguageServiceShimObject = (function (_super) {
- __extends(LanguageServiceShimObject, _super);
- function LanguageServiceShimObject(factory, host, languageService) {
- var _this = _super.call(this, factory) || this;
- _this.host = host;
- _this.languageService = languageService;
- _this.logPerformance = false;
- _this.logger = _this.host;
- return _this;
- }
- LanguageServiceShimObject.prototype.forwardJSONCall = function (actionDescription, action) {
- return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance);
- };
- LanguageServiceShimObject.prototype.dispose = function (dummy) {
- this.logger.log("dispose()");
- this.languageService.dispose();
- this.languageService = null;
- if (debugObjectHost && debugObjectHost.CollectGarbage) {
- debugObjectHost.CollectGarbage();
- this.logger.log("CollectGarbage()");
- }
- this.logger = null;
- _super.prototype.dispose.call(this, dummy);
- };
- LanguageServiceShimObject.prototype.refresh = function (throwOnError) {
- this.forwardJSONCall("refresh(" + throwOnError + ")", function () { return null; });
- };
- LanguageServiceShimObject.prototype.cleanupSemanticCache = function () {
- var _this = this;
- this.forwardJSONCall("cleanupSemanticCache()", function () {
- _this.languageService.cleanupSemanticCache();
- return null;
- });
- };
- LanguageServiceShimObject.prototype.realizeDiagnostics = function (diagnostics) {
- var newLine = ts.getNewLineOrDefaultFromHost(this.host);
- return ts.realizeDiagnostics(diagnostics, newLine);
- };
- LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) {
- var _this = this;
- return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); });
- };
- LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) {
- var _this = this;
- return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); });
- };
- LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) {
- var _this = this;
- return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); });
- };
- LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) {
- var _this = this;
- return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); });
- };
- LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) {
- var _this = this;
- return this.forwardJSONCall("getSyntacticDiagnostics('" + fileName + "')", function () {
- var diagnostics = _this.languageService.getSyntacticDiagnostics(fileName);
- return _this.realizeDiagnostics(diagnostics);
- });
- };
- LanguageServiceShimObject.prototype.getSemanticDiagnostics = function (fileName) {
- var _this = this;
- return this.forwardJSONCall("getSemanticDiagnostics('" + fileName + "')", function () {
- var diagnostics = _this.languageService.getSemanticDiagnostics(fileName);
- return _this.realizeDiagnostics(diagnostics);
- });
- };
- LanguageServiceShimObject.prototype.getCompilerOptionsDiagnostics = function () {
- var _this = this;
- return this.forwardJSONCall("getCompilerOptionsDiagnostics()", function () {
- var diagnostics = _this.languageService.getCompilerOptionsDiagnostics();
- return _this.realizeDiagnostics(diagnostics);
- });
- };
- LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) {
- var _this = this;
- return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); });
- };
- LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { return _this.languageService.getSignatureHelpItems(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getImplementationAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getImplementationAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getImplementationAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position); });
- };
- LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments) {
- var _this = this;
- return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); });
- };
- LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.isValidBraceCompletionAtPosition = function (fileName, position, openingBrace) {
- var _this = this;
- return this.forwardJSONCall("isValidBraceCompletionAtPosition('" + fileName + "', " + position + ", " + openingBrace + ")", function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); });
- };
- LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options) {
- var _this = this;
- return this.forwardJSONCall("getIndentationAtPosition('" + fileName + "', " + position + ")", function () {
- var localOptions = JSON.parse(options);
- return _this.languageService.getIndentationAtPosition(fileName, position, localOptions);
- });
- };
- LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getReferencesAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.findReferences = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { return _this.languageService.findReferences(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) {
- var _this = this;
- return this.forwardJSONCall("getDocumentHighlights('" + fileName + "', " + position + ")", function () {
- var results = _this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
- var normalizedName = ts.normalizeSlashes(fileName).toLowerCase();
- return ts.filter(results, function (r) { return ts.normalizeSlashes(r.fileName).toLowerCase() === normalizedName; });
- });
- };
- LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName) {
- var _this = this;
- return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () { return _this.languageService.getCompletionEntryDetails(fileName, position, entryName); });
- };
- LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options) {
- var _this = this;
- return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () {
- var localOptions = JSON.parse(options);
- return _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions);
- });
- };
- LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options) {
- var _this = this;
- return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () {
- var localOptions = JSON.parse(options);
- return _this.languageService.getFormattingEditsForDocument(fileName, localOptions);
- });
- };
- LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options) {
- var _this = this;
- return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () {
- var localOptions = JSON.parse(options);
- return _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions);
- });
- };
- LanguageServiceShimObject.prototype.getDocCommentTemplateAtPosition = function (fileName, position) {
- var _this = this;
- return this.forwardJSONCall("getDocCommentTemplateAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDocCommentTemplateAtPosition(fileName, position); });
- };
- LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount, fileName) {
- var _this = this;
- return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ", " + fileName + ")", function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); });
- };
- LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) {
- var _this = this;
- return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { return _this.languageService.getNavigationBarItems(fileName); });
- };
- LanguageServiceShimObject.prototype.getNavigationTree = function (fileName) {
- var _this = this;
- return this.forwardJSONCall("getNavigationTree('" + fileName + "')", function () { return _this.languageService.getNavigationTree(fileName); });
- };
- LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) {
- var _this = this;
- return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { return _this.languageService.getOutliningSpans(fileName); });
- };
- LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) {
- var _this = this;
- return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); });
- };
- LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) {
- var _this = this;
- return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () { return _this.languageService.getEmitOutput(fileName); });
- };
- LanguageServiceShimObject.prototype.getEmitOutputObject = function (fileName) {
- var _this = this;
- return forwardCall(this.logger, "getEmitOutput('" + fileName + "')", false, function () { return _this.languageService.getEmitOutput(fileName); }, this.logPerformance);
- };
- return LanguageServiceShimObject;
- }(ShimBase));
- function convertClassifications(classifications) {
- return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState };
- }
- var ClassifierShimObject = (function (_super) {
- __extends(ClassifierShimObject, _super);
- function ClassifierShimObject(factory, logger) {
- var _this = _super.call(this, factory) || this;
- _this.logger = logger;
- _this.logPerformance = false;
- _this.classifier = ts.createClassifier();
- return _this;
- }
- ClassifierShimObject.prototype.getEncodedLexicalClassifications = function (text, lexState, syntacticClassifierAbsent) {
- var _this = this;
- return forwardJSONCall(this.logger, "getEncodedLexicalClassifications", function () { return convertClassifications(_this.classifier.getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent)); }, this.logPerformance);
- };
- ClassifierShimObject.prototype.getClassificationsForLine = function (text, lexState, classifyKeywordsInGenerics) {
- var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics);
- var result = "";
- for (var _i = 0, _a = classification.entries; _i < _a.length; _i++) {
- var item = _a[_i];
- result += item.length + "\n";
- result += item.classification + "\n";
- }
- result += classification.finalLexState;
- return result;
- };
- return ClassifierShimObject;
- }(ShimBase));
- var CoreServicesShimObject = (function (_super) {
- __extends(CoreServicesShimObject, _super);
- function CoreServicesShimObject(factory, logger, host) {
- var _this = _super.call(this, factory) || this;
- _this.logger = logger;
- _this.host = host;
- _this.logPerformance = false;
- return _this;
- }
- CoreServicesShimObject.prototype.forwardJSONCall = function (actionDescription, action) {
- return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance);
- };
- CoreServicesShimObject.prototype.resolveModuleName = function (fileName, moduleName, compilerOptionsJson) {
- var _this = this;
- return this.forwardJSONCall("resolveModuleName('" + fileName + "')", function () {
- var compilerOptions = JSON.parse(compilerOptionsJson);
- var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
- return {
- resolvedFileName: result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined,
- failedLookupLocations: result.failedLookupLocations
- };
- });
- };
- CoreServicesShimObject.prototype.resolveTypeReferenceDirective = function (fileName, typeReferenceDirective, compilerOptionsJson) {
- var _this = this;
- return this.forwardJSONCall("resolveTypeReferenceDirective(" + fileName + ")", function () {
- var compilerOptions = JSON.parse(compilerOptionsJson);
- var result = ts.resolveTypeReferenceDirective(typeReferenceDirective, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
- return {
- resolvedFileName: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.resolvedFileName : undefined,
- primary: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.primary : true,
- failedLookupLocations: result.failedLookupLocations
- };
- });
- };
- CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) {
- var _this = this;
- return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () {
- var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()), true, true);
- return {
- referencedFiles: _this.convertFileReferences(result.referencedFiles),
- importedFiles: _this.convertFileReferences(result.importedFiles),
- ambientExternalModules: result.ambientExternalModules,
- isLibFile: result.isLibFile,
- typeReferenceDirectives: _this.convertFileReferences(result.typeReferenceDirectives)
- };
- });
- };
- CoreServicesShimObject.prototype.getAutomaticTypeDirectiveNames = function (compilerOptionsJson) {
- var _this = this;
- return this.forwardJSONCall("getAutomaticTypeDirectiveNames('" + compilerOptionsJson + "')", function () {
- var compilerOptions = JSON.parse(compilerOptionsJson);
- return ts.getAutomaticTypeDirectiveNames(compilerOptions, _this.host);
- });
- };
- CoreServicesShimObject.prototype.convertFileReferences = function (refs) {
- if (!refs) {
- return undefined;
- }
- var result = [];
- for (var _i = 0, refs_2 = refs; _i < refs_2.length; _i++) {
- var ref = refs_2[_i];
- result.push({
- path: ts.normalizeSlashes(ref.fileName),
- position: ref.pos,
- length: ref.end - ref.pos
- });
- }
- return result;
- };
- CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) {
- var _this = this;
- return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () {
- var text = sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength());
- var result = ts.parseConfigFileTextToJson(fileName, text);
- if (result.error) {
- return {
- options: {},
- typingOptions: {},
- files: [],
- raw: {},
- errors: [realizeDiagnostic(result.error, "\r\n")]
- };
- }
- var normalizedFileName = ts.normalizeSlashes(fileName);
- var configFile = ts.parseJsonConfigFileContent(result.config, _this.host, ts.getDirectoryPath(normalizedFileName), {}, normalizedFileName);
- return {
- options: configFile.options,
- typingOptions: configFile.typingOptions,
- files: configFile.fileNames,
- raw: configFile.raw,
- errors: realizeDiagnostics(configFile.errors, "\r\n")
- };
- });
- };
- CoreServicesShimObject.prototype.getDefaultCompilationSettings = function () {
- return this.forwardJSONCall("getDefaultCompilationSettings()", function () { return ts.getDefaultCompilerOptions(); });
- };
- CoreServicesShimObject.prototype.discoverTypings = function (discoverTypingsJson) {
- var _this = this;
- var getCanonicalFileName = ts.createGetCanonicalFileName(false);
- return this.forwardJSONCall("discoverTypings()", function () {
- var info = JSON.parse(discoverTypingsJson);
- return ts.JsTyping.discoverTypings(_this.host, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), ts.toPath(info.safeListPath, info.safeListPath, getCanonicalFileName), info.packageNameToTypingLocation, info.typingOptions, info.compilerOptions);
- });
- };
- return CoreServicesShimObject;
- }(ShimBase));
- var TypeScriptServicesFactory = (function () {
- function TypeScriptServicesFactory() {
- this._shims = [];
- }
- TypeScriptServicesFactory.prototype.getServicesVersion = function () {
- return ts.servicesVersion;
- };
- TypeScriptServicesFactory.prototype.createLanguageServiceShim = function (host) {
- try {
- if (this.documentRegistry === undefined) {
- this.documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory());
- }
- var hostAdapter = new LanguageServiceShimHostAdapter(host);
- var languageService = ts.createLanguageService(hostAdapter, this.documentRegistry);
- return new LanguageServiceShimObject(this, host, languageService);
- }
- catch (err) {
- logInternalError(host, err);
- throw err;
- }
- };
- TypeScriptServicesFactory.prototype.createClassifierShim = function (logger) {
- try {
- return new ClassifierShimObject(this, logger);
- }
- catch (err) {
- logInternalError(logger, err);
- throw err;
- }
- };
- TypeScriptServicesFactory.prototype.createCoreServicesShim = function (host) {
- try {
- var adapter = new CoreServicesShimHostAdapter(host);
- return new CoreServicesShimObject(this, host, adapter);
- }
- catch (err) {
- logInternalError(host, err);
- throw err;
- }
- };
- TypeScriptServicesFactory.prototype.close = function () {
- this._shims = [];
- this.documentRegistry = undefined;
- };
- TypeScriptServicesFactory.prototype.registerShim = function (shim) {
- this._shims.push(shim);
- };
- TypeScriptServicesFactory.prototype.unregisterShim = function (shim) {
- for (var i = 0, n = this._shims.length; i < n; i++) {
- if (this._shims[i] === shim) {
- delete this._shims[i];
- return;
- }
- }
- throw new Error("Invalid operation");
- };
- return TypeScriptServicesFactory;
- }());
- ts.TypeScriptServicesFactory = TypeScriptServicesFactory;
- if (typeof module !== "undefined" && module.exports) {
- module.exports = ts;
- }
-})(ts || (ts = {}));
-var TypeScript;
-(function (TypeScript) {
- var Services;
- (function (Services) {
- Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory;
- })(Services = TypeScript.Services || (TypeScript.Services = {}));
-})(TypeScript || (TypeScript = {}));
-var toolsVersion = "2.1";
+
+//# sourceMappingURL=tsserverlibrary.js.map
diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts
index c915bd9efc8..ba46bcf1540 100644
--- a/lib/typescript.d.ts
+++ b/lib/typescript.d.ts
@@ -47,241 +47,241 @@ declare namespace ts {
ConflictMarkerTrivia = 7,
NumericLiteral = 8,
StringLiteral = 9,
- RegularExpressionLiteral = 10,
- NoSubstitutionTemplateLiteral = 11,
- TemplateHead = 12,
- TemplateMiddle = 13,
- TemplateTail = 14,
- OpenBraceToken = 15,
- CloseBraceToken = 16,
- OpenParenToken = 17,
- CloseParenToken = 18,
- OpenBracketToken = 19,
- CloseBracketToken = 20,
- DotToken = 21,
- DotDotDotToken = 22,
- SemicolonToken = 23,
- CommaToken = 24,
- LessThanToken = 25,
- LessThanSlashToken = 26,
- GreaterThanToken = 27,
- LessThanEqualsToken = 28,
- GreaterThanEqualsToken = 29,
- EqualsEqualsToken = 30,
- ExclamationEqualsToken = 31,
- EqualsEqualsEqualsToken = 32,
- ExclamationEqualsEqualsToken = 33,
- EqualsGreaterThanToken = 34,
- PlusToken = 35,
- MinusToken = 36,
- AsteriskToken = 37,
- AsteriskAsteriskToken = 38,
- SlashToken = 39,
- PercentToken = 40,
- PlusPlusToken = 41,
- MinusMinusToken = 42,
- LessThanLessThanToken = 43,
- GreaterThanGreaterThanToken = 44,
- GreaterThanGreaterThanGreaterThanToken = 45,
- AmpersandToken = 46,
- BarToken = 47,
- CaretToken = 48,
- ExclamationToken = 49,
- TildeToken = 50,
- AmpersandAmpersandToken = 51,
- BarBarToken = 52,
- QuestionToken = 53,
- ColonToken = 54,
- AtToken = 55,
- EqualsToken = 56,
- PlusEqualsToken = 57,
- MinusEqualsToken = 58,
- AsteriskEqualsToken = 59,
- AsteriskAsteriskEqualsToken = 60,
- SlashEqualsToken = 61,
- PercentEqualsToken = 62,
- LessThanLessThanEqualsToken = 63,
- GreaterThanGreaterThanEqualsToken = 64,
- GreaterThanGreaterThanGreaterThanEqualsToken = 65,
- AmpersandEqualsToken = 66,
- BarEqualsToken = 67,
- CaretEqualsToken = 68,
- Identifier = 69,
- BreakKeyword = 70,
- CaseKeyword = 71,
- CatchKeyword = 72,
- ClassKeyword = 73,
- ConstKeyword = 74,
- ContinueKeyword = 75,
- DebuggerKeyword = 76,
- DefaultKeyword = 77,
- DeleteKeyword = 78,
- DoKeyword = 79,
- ElseKeyword = 80,
- EnumKeyword = 81,
- ExportKeyword = 82,
- ExtendsKeyword = 83,
- FalseKeyword = 84,
- FinallyKeyword = 85,
- ForKeyword = 86,
- FunctionKeyword = 87,
- IfKeyword = 88,
- ImportKeyword = 89,
- InKeyword = 90,
- InstanceOfKeyword = 91,
- NewKeyword = 92,
- NullKeyword = 93,
- ReturnKeyword = 94,
- SuperKeyword = 95,
- SwitchKeyword = 96,
- ThisKeyword = 97,
- ThrowKeyword = 98,
- TrueKeyword = 99,
- TryKeyword = 100,
- TypeOfKeyword = 101,
- VarKeyword = 102,
- VoidKeyword = 103,
- WhileKeyword = 104,
- WithKeyword = 105,
- ImplementsKeyword = 106,
- InterfaceKeyword = 107,
- LetKeyword = 108,
- PackageKeyword = 109,
- PrivateKeyword = 110,
- ProtectedKeyword = 111,
- PublicKeyword = 112,
- StaticKeyword = 113,
- YieldKeyword = 114,
- AbstractKeyword = 115,
- AsKeyword = 116,
- AnyKeyword = 117,
- AsyncKeyword = 118,
- AwaitKeyword = 119,
- BooleanKeyword = 120,
- ConstructorKeyword = 121,
- DeclareKeyword = 122,
- GetKeyword = 123,
- IsKeyword = 124,
- ModuleKeyword = 125,
- NamespaceKeyword = 126,
- NeverKeyword = 127,
- ReadonlyKeyword = 128,
- RequireKeyword = 129,
- NumberKeyword = 130,
- SetKeyword = 131,
- StringKeyword = 132,
- SymbolKeyword = 133,
- TypeKeyword = 134,
- UndefinedKeyword = 135,
- FromKeyword = 136,
- GlobalKeyword = 137,
- OfKeyword = 138,
- QualifiedName = 139,
- ComputedPropertyName = 140,
- TypeParameter = 141,
- Parameter = 142,
- Decorator = 143,
- PropertySignature = 144,
- PropertyDeclaration = 145,
- MethodSignature = 146,
- MethodDeclaration = 147,
- Constructor = 148,
- GetAccessor = 149,
- SetAccessor = 150,
- CallSignature = 151,
- ConstructSignature = 152,
- IndexSignature = 153,
- TypePredicate = 154,
- TypeReference = 155,
- FunctionType = 156,
- ConstructorType = 157,
- TypeQuery = 158,
- TypeLiteral = 159,
- ArrayType = 160,
- TupleType = 161,
- UnionType = 162,
- IntersectionType = 163,
- ParenthesizedType = 164,
- ThisType = 165,
- LiteralType = 166,
- ObjectBindingPattern = 167,
- ArrayBindingPattern = 168,
- BindingElement = 169,
- ArrayLiteralExpression = 170,
- ObjectLiteralExpression = 171,
- PropertyAccessExpression = 172,
- ElementAccessExpression = 173,
- CallExpression = 174,
- NewExpression = 175,
- TaggedTemplateExpression = 176,
- TypeAssertionExpression = 177,
- ParenthesizedExpression = 178,
- FunctionExpression = 179,
- ArrowFunction = 180,
- DeleteExpression = 181,
- TypeOfExpression = 182,
- VoidExpression = 183,
- AwaitExpression = 184,
- PrefixUnaryExpression = 185,
- PostfixUnaryExpression = 186,
- BinaryExpression = 187,
- ConditionalExpression = 188,
- TemplateExpression = 189,
- YieldExpression = 190,
- SpreadElementExpression = 191,
- ClassExpression = 192,
- OmittedExpression = 193,
- ExpressionWithTypeArguments = 194,
- AsExpression = 195,
- NonNullExpression = 196,
- TemplateSpan = 197,
- SemicolonClassElement = 198,
- Block = 199,
- VariableStatement = 200,
- EmptyStatement = 201,
- ExpressionStatement = 202,
- IfStatement = 203,
- DoStatement = 204,
- WhileStatement = 205,
- ForStatement = 206,
- ForInStatement = 207,
- ForOfStatement = 208,
- ContinueStatement = 209,
- BreakStatement = 210,
- ReturnStatement = 211,
- WithStatement = 212,
- SwitchStatement = 213,
- LabeledStatement = 214,
- ThrowStatement = 215,
- TryStatement = 216,
- DebuggerStatement = 217,
- VariableDeclaration = 218,
- VariableDeclarationList = 219,
- FunctionDeclaration = 220,
- ClassDeclaration = 221,
- InterfaceDeclaration = 222,
- TypeAliasDeclaration = 223,
- EnumDeclaration = 224,
- ModuleDeclaration = 225,
- ModuleBlock = 226,
- CaseBlock = 227,
- NamespaceExportDeclaration = 228,
- ImportEqualsDeclaration = 229,
- ImportDeclaration = 230,
- ImportClause = 231,
- NamespaceImport = 232,
- NamedImports = 233,
- ImportSpecifier = 234,
- ExportAssignment = 235,
- ExportDeclaration = 236,
- NamedExports = 237,
- ExportSpecifier = 238,
- MissingDeclaration = 239,
- ExternalModuleReference = 240,
- JsxElement = 241,
- JsxSelfClosingElement = 242,
- JsxOpeningElement = 243,
- JsxText = 244,
+ JsxText = 10,
+ RegularExpressionLiteral = 11,
+ NoSubstitutionTemplateLiteral = 12,
+ TemplateHead = 13,
+ TemplateMiddle = 14,
+ TemplateTail = 15,
+ OpenBraceToken = 16,
+ CloseBraceToken = 17,
+ OpenParenToken = 18,
+ CloseParenToken = 19,
+ OpenBracketToken = 20,
+ CloseBracketToken = 21,
+ DotToken = 22,
+ DotDotDotToken = 23,
+ SemicolonToken = 24,
+ CommaToken = 25,
+ LessThanToken = 26,
+ LessThanSlashToken = 27,
+ GreaterThanToken = 28,
+ LessThanEqualsToken = 29,
+ GreaterThanEqualsToken = 30,
+ EqualsEqualsToken = 31,
+ ExclamationEqualsToken = 32,
+ EqualsEqualsEqualsToken = 33,
+ ExclamationEqualsEqualsToken = 34,
+ EqualsGreaterThanToken = 35,
+ PlusToken = 36,
+ MinusToken = 37,
+ AsteriskToken = 38,
+ AsteriskAsteriskToken = 39,
+ SlashToken = 40,
+ PercentToken = 41,
+ PlusPlusToken = 42,
+ MinusMinusToken = 43,
+ LessThanLessThanToken = 44,
+ GreaterThanGreaterThanToken = 45,
+ GreaterThanGreaterThanGreaterThanToken = 46,
+ AmpersandToken = 47,
+ BarToken = 48,
+ CaretToken = 49,
+ ExclamationToken = 50,
+ TildeToken = 51,
+ AmpersandAmpersandToken = 52,
+ BarBarToken = 53,
+ QuestionToken = 54,
+ ColonToken = 55,
+ AtToken = 56,
+ EqualsToken = 57,
+ PlusEqualsToken = 58,
+ MinusEqualsToken = 59,
+ AsteriskEqualsToken = 60,
+ AsteriskAsteriskEqualsToken = 61,
+ SlashEqualsToken = 62,
+ PercentEqualsToken = 63,
+ LessThanLessThanEqualsToken = 64,
+ GreaterThanGreaterThanEqualsToken = 65,
+ GreaterThanGreaterThanGreaterThanEqualsToken = 66,
+ AmpersandEqualsToken = 67,
+ BarEqualsToken = 68,
+ CaretEqualsToken = 69,
+ Identifier = 70,
+ BreakKeyword = 71,
+ CaseKeyword = 72,
+ CatchKeyword = 73,
+ ClassKeyword = 74,
+ ConstKeyword = 75,
+ ContinueKeyword = 76,
+ DebuggerKeyword = 77,
+ DefaultKeyword = 78,
+ DeleteKeyword = 79,
+ DoKeyword = 80,
+ ElseKeyword = 81,
+ EnumKeyword = 82,
+ ExportKeyword = 83,
+ ExtendsKeyword = 84,
+ FalseKeyword = 85,
+ FinallyKeyword = 86,
+ ForKeyword = 87,
+ FunctionKeyword = 88,
+ IfKeyword = 89,
+ ImportKeyword = 90,
+ InKeyword = 91,
+ InstanceOfKeyword = 92,
+ NewKeyword = 93,
+ NullKeyword = 94,
+ ReturnKeyword = 95,
+ SuperKeyword = 96,
+ SwitchKeyword = 97,
+ ThisKeyword = 98,
+ ThrowKeyword = 99,
+ TrueKeyword = 100,
+ TryKeyword = 101,
+ TypeOfKeyword = 102,
+ VarKeyword = 103,
+ VoidKeyword = 104,
+ WhileKeyword = 105,
+ WithKeyword = 106,
+ ImplementsKeyword = 107,
+ InterfaceKeyword = 108,
+ LetKeyword = 109,
+ PackageKeyword = 110,
+ PrivateKeyword = 111,
+ ProtectedKeyword = 112,
+ PublicKeyword = 113,
+ StaticKeyword = 114,
+ YieldKeyword = 115,
+ AbstractKeyword = 116,
+ AsKeyword = 117,
+ AnyKeyword = 118,
+ AsyncKeyword = 119,
+ AwaitKeyword = 120,
+ BooleanKeyword = 121,
+ ConstructorKeyword = 122,
+ DeclareKeyword = 123,
+ GetKeyword = 124,
+ IsKeyword = 125,
+ ModuleKeyword = 126,
+ NamespaceKeyword = 127,
+ NeverKeyword = 128,
+ ReadonlyKeyword = 129,
+ RequireKeyword = 130,
+ NumberKeyword = 131,
+ SetKeyword = 132,
+ StringKeyword = 133,
+ SymbolKeyword = 134,
+ TypeKeyword = 135,
+ UndefinedKeyword = 136,
+ FromKeyword = 137,
+ GlobalKeyword = 138,
+ OfKeyword = 139,
+ QualifiedName = 140,
+ ComputedPropertyName = 141,
+ TypeParameter = 142,
+ Parameter = 143,
+ Decorator = 144,
+ PropertySignature = 145,
+ PropertyDeclaration = 146,
+ MethodSignature = 147,
+ MethodDeclaration = 148,
+ Constructor = 149,
+ GetAccessor = 150,
+ SetAccessor = 151,
+ CallSignature = 152,
+ ConstructSignature = 153,
+ IndexSignature = 154,
+ TypePredicate = 155,
+ TypeReference = 156,
+ FunctionType = 157,
+ ConstructorType = 158,
+ TypeQuery = 159,
+ TypeLiteral = 160,
+ ArrayType = 161,
+ TupleType = 162,
+ UnionType = 163,
+ IntersectionType = 164,
+ ParenthesizedType = 165,
+ ThisType = 166,
+ LiteralType = 167,
+ ObjectBindingPattern = 168,
+ ArrayBindingPattern = 169,
+ BindingElement = 170,
+ ArrayLiteralExpression = 171,
+ ObjectLiteralExpression = 172,
+ PropertyAccessExpression = 173,
+ ElementAccessExpression = 174,
+ CallExpression = 175,
+ NewExpression = 176,
+ TaggedTemplateExpression = 177,
+ TypeAssertionExpression = 178,
+ ParenthesizedExpression = 179,
+ FunctionExpression = 180,
+ ArrowFunction = 181,
+ DeleteExpression = 182,
+ TypeOfExpression = 183,
+ VoidExpression = 184,
+ AwaitExpression = 185,
+ PrefixUnaryExpression = 186,
+ PostfixUnaryExpression = 187,
+ BinaryExpression = 188,
+ ConditionalExpression = 189,
+ TemplateExpression = 190,
+ YieldExpression = 191,
+ SpreadElementExpression = 192,
+ ClassExpression = 193,
+ OmittedExpression = 194,
+ ExpressionWithTypeArguments = 195,
+ AsExpression = 196,
+ NonNullExpression = 197,
+ TemplateSpan = 198,
+ SemicolonClassElement = 199,
+ Block = 200,
+ VariableStatement = 201,
+ EmptyStatement = 202,
+ ExpressionStatement = 203,
+ IfStatement = 204,
+ DoStatement = 205,
+ WhileStatement = 206,
+ ForStatement = 207,
+ ForInStatement = 208,
+ ForOfStatement = 209,
+ ContinueStatement = 210,
+ BreakStatement = 211,
+ ReturnStatement = 212,
+ WithStatement = 213,
+ SwitchStatement = 214,
+ LabeledStatement = 215,
+ ThrowStatement = 216,
+ TryStatement = 217,
+ DebuggerStatement = 218,
+ VariableDeclaration = 219,
+ VariableDeclarationList = 220,
+ FunctionDeclaration = 221,
+ ClassDeclaration = 222,
+ InterfaceDeclaration = 223,
+ TypeAliasDeclaration = 224,
+ EnumDeclaration = 225,
+ ModuleDeclaration = 226,
+ ModuleBlock = 227,
+ CaseBlock = 228,
+ NamespaceExportDeclaration = 229,
+ ImportEqualsDeclaration = 230,
+ ImportDeclaration = 231,
+ ImportClause = 232,
+ NamespaceImport = 233,
+ NamedImports = 234,
+ ImportSpecifier = 235,
+ ExportAssignment = 236,
+ ExportDeclaration = 237,
+ NamedExports = 238,
+ ExportSpecifier = 239,
+ MissingDeclaration = 240,
+ ExternalModuleReference = 241,
+ JsxElement = 242,
+ JsxSelfClosingElement = 243,
+ JsxOpeningElement = 244,
JsxClosingElement = 245,
JsxAttribute = 246,
JsxSpreadAttribute = 247,
@@ -327,31 +327,31 @@ declare namespace ts {
NotEmittedStatement = 287,
PartiallyEmittedExpression = 288,
Count = 289,
- FirstAssignment = 56,
- LastAssignment = 68,
- FirstCompoundAssignment = 57,
- LastCompoundAssignment = 68,
- FirstReservedWord = 70,
- LastReservedWord = 105,
- FirstKeyword = 70,
- LastKeyword = 138,
- FirstFutureReservedWord = 106,
- LastFutureReservedWord = 114,
- FirstTypeNode = 154,
- LastTypeNode = 166,
- FirstPunctuation = 15,
- LastPunctuation = 68,
+ FirstAssignment = 57,
+ LastAssignment = 69,
+ FirstCompoundAssignment = 58,
+ LastCompoundAssignment = 69,
+ FirstReservedWord = 71,
+ LastReservedWord = 106,
+ FirstKeyword = 71,
+ LastKeyword = 139,
+ FirstFutureReservedWord = 107,
+ LastFutureReservedWord = 115,
+ FirstTypeNode = 155,
+ LastTypeNode = 167,
+ FirstPunctuation = 16,
+ LastPunctuation = 69,
FirstToken = 0,
- LastToken = 138,
+ LastToken = 139,
FirstTriviaToken = 2,
LastTriviaToken = 7,
FirstLiteralToken = 8,
- LastLiteralToken = 11,
- FirstTemplateToken = 11,
- LastTemplateToken = 14,
- FirstBinaryOperator = 25,
- LastBinaryOperator = 68,
- FirstNode = 139,
+ LastLiteralToken = 12,
+ FirstTemplateToken = 12,
+ LastTemplateToken = 15,
+ FirstBinaryOperator = 26,
+ LastBinaryOperator = 69,
+ FirstNode = 140,
FirstJSDocNode = 257,
LastJSDocNode = 282,
FirstJSDocTagNode = 273,
@@ -406,6 +406,7 @@ declare namespace ts {
AccessibilityModifier = 28,
ParameterPropertyModifier = 92,
NonPublicAccessibilityModifier = 24,
+ TypeScriptModifier = 2270,
}
enum JsxFlags {
None = 0,
@@ -1351,8 +1352,9 @@ declare namespace ts {
TrueCondition = 32,
FalseCondition = 64,
SwitchClause = 128,
- Referenced = 256,
- Shared = 512,
+ ArrayMutation = 256,
+ Referenced = 512,
+ Shared = 1024,
Label = 12,
Condition = 96,
}
@@ -1380,6 +1382,10 @@ declare namespace ts {
clauseEnd: number;
antecedent: FlowNode;
}
+ interface FlowArrayMutation extends FlowNode {
+ node: CallExpression | BinaryExpression;
+ antecedent: FlowNode;
+ }
type FlowType = Type | IncompleteType;
interface IncompleteType {
flags: TypeFlags;
@@ -1913,7 +1919,6 @@ declare namespace ts {
AMD = 2,
UMD = 3,
System = 4,
- ES6 = 5,
ES2015 = 5,
}
enum JsxEmit {
@@ -1939,9 +1944,10 @@ declare namespace ts {
enum ScriptTarget {
ES3 = 0,
ES5 = 1,
- ES6 = 2,
ES2015 = 2,
- Latest = 2,
+ ES2016 = 3,
+ ES2017 = 4,
+ Latest = 4,
}
enum LanguageVariant {
Standard = 0,
diff --git a/lib/typescript.js b/lib/typescript.js
index c534a725901..dad603b624a 100644
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -37,259 +37,259 @@ var ts;
// Literals
SyntaxKind[SyntaxKind["NumericLiteral"] = 8] = "NumericLiteral";
SyntaxKind[SyntaxKind["StringLiteral"] = 9] = "StringLiteral";
- SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 10] = "RegularExpressionLiteral";
- SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 11] = "NoSubstitutionTemplateLiteral";
+ SyntaxKind[SyntaxKind["JsxText"] = 10] = "JsxText";
+ SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 11] = "RegularExpressionLiteral";
+ SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 12] = "NoSubstitutionTemplateLiteral";
// Pseudo-literals
- SyntaxKind[SyntaxKind["TemplateHead"] = 12] = "TemplateHead";
- SyntaxKind[SyntaxKind["TemplateMiddle"] = 13] = "TemplateMiddle";
- SyntaxKind[SyntaxKind["TemplateTail"] = 14] = "TemplateTail";
+ SyntaxKind[SyntaxKind["TemplateHead"] = 13] = "TemplateHead";
+ SyntaxKind[SyntaxKind["TemplateMiddle"] = 14] = "TemplateMiddle";
+ SyntaxKind[SyntaxKind["TemplateTail"] = 15] = "TemplateTail";
// Punctuation
- SyntaxKind[SyntaxKind["OpenBraceToken"] = 15] = "OpenBraceToken";
- SyntaxKind[SyntaxKind["CloseBraceToken"] = 16] = "CloseBraceToken";
- SyntaxKind[SyntaxKind["OpenParenToken"] = 17] = "OpenParenToken";
- SyntaxKind[SyntaxKind["CloseParenToken"] = 18] = "CloseParenToken";
- SyntaxKind[SyntaxKind["OpenBracketToken"] = 19] = "OpenBracketToken";
- SyntaxKind[SyntaxKind["CloseBracketToken"] = 20] = "CloseBracketToken";
- SyntaxKind[SyntaxKind["DotToken"] = 21] = "DotToken";
- SyntaxKind[SyntaxKind["DotDotDotToken"] = 22] = "DotDotDotToken";
- SyntaxKind[SyntaxKind["SemicolonToken"] = 23] = "SemicolonToken";
- SyntaxKind[SyntaxKind["CommaToken"] = 24] = "CommaToken";
- SyntaxKind[SyntaxKind["LessThanToken"] = 25] = "LessThanToken";
- SyntaxKind[SyntaxKind["LessThanSlashToken"] = 26] = "LessThanSlashToken";
- SyntaxKind[SyntaxKind["GreaterThanToken"] = 27] = "GreaterThanToken";
- SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 28] = "LessThanEqualsToken";
- SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 29] = "GreaterThanEqualsToken";
- SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 30] = "EqualsEqualsToken";
- SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 31] = "ExclamationEqualsToken";
- SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 32] = "EqualsEqualsEqualsToken";
- SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 33] = "ExclamationEqualsEqualsToken";
- SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 34] = "EqualsGreaterThanToken";
- SyntaxKind[SyntaxKind["PlusToken"] = 35] = "PlusToken";
- SyntaxKind[SyntaxKind["MinusToken"] = 36] = "MinusToken";
- SyntaxKind[SyntaxKind["AsteriskToken"] = 37] = "AsteriskToken";
- SyntaxKind[SyntaxKind["AsteriskAsteriskToken"] = 38] = "AsteriskAsteriskToken";
- SyntaxKind[SyntaxKind["SlashToken"] = 39] = "SlashToken";
- SyntaxKind[SyntaxKind["PercentToken"] = 40] = "PercentToken";
- SyntaxKind[SyntaxKind["PlusPlusToken"] = 41] = "PlusPlusToken";
- SyntaxKind[SyntaxKind["MinusMinusToken"] = 42] = "MinusMinusToken";
- SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 43] = "LessThanLessThanToken";
- SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 44] = "GreaterThanGreaterThanToken";
- SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 45] = "GreaterThanGreaterThanGreaterThanToken";
- SyntaxKind[SyntaxKind["AmpersandToken"] = 46] = "AmpersandToken";
- SyntaxKind[SyntaxKind["BarToken"] = 47] = "BarToken";
- SyntaxKind[SyntaxKind["CaretToken"] = 48] = "CaretToken";
- SyntaxKind[SyntaxKind["ExclamationToken"] = 49] = "ExclamationToken";
- SyntaxKind[SyntaxKind["TildeToken"] = 50] = "TildeToken";
- SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 51] = "AmpersandAmpersandToken";
- SyntaxKind[SyntaxKind["BarBarToken"] = 52] = "BarBarToken";
- SyntaxKind[SyntaxKind["QuestionToken"] = 53] = "QuestionToken";
- SyntaxKind[SyntaxKind["ColonToken"] = 54] = "ColonToken";
- SyntaxKind[SyntaxKind["AtToken"] = 55] = "AtToken";
+ SyntaxKind[SyntaxKind["OpenBraceToken"] = 16] = "OpenBraceToken";
+ SyntaxKind[SyntaxKind["CloseBraceToken"] = 17] = "CloseBraceToken";
+ SyntaxKind[SyntaxKind["OpenParenToken"] = 18] = "OpenParenToken";
+ SyntaxKind[SyntaxKind["CloseParenToken"] = 19] = "CloseParenToken";
+ SyntaxKind[SyntaxKind["OpenBracketToken"] = 20] = "OpenBracketToken";
+ SyntaxKind[SyntaxKind["CloseBracketToken"] = 21] = "CloseBracketToken";
+ SyntaxKind[SyntaxKind["DotToken"] = 22] = "DotToken";
+ SyntaxKind[SyntaxKind["DotDotDotToken"] = 23] = "DotDotDotToken";
+ SyntaxKind[SyntaxKind["SemicolonToken"] = 24] = "SemicolonToken";
+ SyntaxKind[SyntaxKind["CommaToken"] = 25] = "CommaToken";
+ SyntaxKind[SyntaxKind["LessThanToken"] = 26] = "LessThanToken";
+ SyntaxKind[SyntaxKind["LessThanSlashToken"] = 27] = "LessThanSlashToken";
+ SyntaxKind[SyntaxKind["GreaterThanToken"] = 28] = "GreaterThanToken";
+ SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 29] = "LessThanEqualsToken";
+ SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 30] = "GreaterThanEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 31] = "EqualsEqualsToken";
+ SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 32] = "ExclamationEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 33] = "EqualsEqualsEqualsToken";
+ SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 34] = "ExclamationEqualsEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 35] = "EqualsGreaterThanToken";
+ SyntaxKind[SyntaxKind["PlusToken"] = 36] = "PlusToken";
+ SyntaxKind[SyntaxKind["MinusToken"] = 37] = "MinusToken";
+ SyntaxKind[SyntaxKind["AsteriskToken"] = 38] = "AsteriskToken";
+ SyntaxKind[SyntaxKind["AsteriskAsteriskToken"] = 39] = "AsteriskAsteriskToken";
+ SyntaxKind[SyntaxKind["SlashToken"] = 40] = "SlashToken";
+ SyntaxKind[SyntaxKind["PercentToken"] = 41] = "PercentToken";
+ SyntaxKind[SyntaxKind["PlusPlusToken"] = 42] = "PlusPlusToken";
+ SyntaxKind[SyntaxKind["MinusMinusToken"] = 43] = "MinusMinusToken";
+ SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 44] = "LessThanLessThanToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 45] = "GreaterThanGreaterThanToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 46] = "GreaterThanGreaterThanGreaterThanToken";
+ SyntaxKind[SyntaxKind["AmpersandToken"] = 47] = "AmpersandToken";
+ SyntaxKind[SyntaxKind["BarToken"] = 48] = "BarToken";
+ SyntaxKind[SyntaxKind["CaretToken"] = 49] = "CaretToken";
+ SyntaxKind[SyntaxKind["ExclamationToken"] = 50] = "ExclamationToken";
+ SyntaxKind[SyntaxKind["TildeToken"] = 51] = "TildeToken";
+ SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 52] = "AmpersandAmpersandToken";
+ SyntaxKind[SyntaxKind["BarBarToken"] = 53] = "BarBarToken";
+ SyntaxKind[SyntaxKind["QuestionToken"] = 54] = "QuestionToken";
+ SyntaxKind[SyntaxKind["ColonToken"] = 55] = "ColonToken";
+ SyntaxKind[SyntaxKind["AtToken"] = 56] = "AtToken";
// Assignments
- SyntaxKind[SyntaxKind["EqualsToken"] = 56] = "EqualsToken";
- SyntaxKind[SyntaxKind["PlusEqualsToken"] = 57] = "PlusEqualsToken";
- SyntaxKind[SyntaxKind["MinusEqualsToken"] = 58] = "MinusEqualsToken";
- SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 59] = "AsteriskEqualsToken";
- SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 60] = "AsteriskAsteriskEqualsToken";
- SyntaxKind[SyntaxKind["SlashEqualsToken"] = 61] = "SlashEqualsToken";
- SyntaxKind[SyntaxKind["PercentEqualsToken"] = 62] = "PercentEqualsToken";
- SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 63] = "LessThanLessThanEqualsToken";
- SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 64] = "GreaterThanGreaterThanEqualsToken";
- SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 65] = "GreaterThanGreaterThanGreaterThanEqualsToken";
- SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 66] = "AmpersandEqualsToken";
- SyntaxKind[SyntaxKind["BarEqualsToken"] = 67] = "BarEqualsToken";
- SyntaxKind[SyntaxKind["CaretEqualsToken"] = 68] = "CaretEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsToken"] = 57] = "EqualsToken";
+ SyntaxKind[SyntaxKind["PlusEqualsToken"] = 58] = "PlusEqualsToken";
+ SyntaxKind[SyntaxKind["MinusEqualsToken"] = 59] = "MinusEqualsToken";
+ SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 60] = "AsteriskEqualsToken";
+ SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 61] = "AsteriskAsteriskEqualsToken";
+ SyntaxKind[SyntaxKind["SlashEqualsToken"] = 62] = "SlashEqualsToken";
+ SyntaxKind[SyntaxKind["PercentEqualsToken"] = 63] = "PercentEqualsToken";
+ SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 64] = "LessThanLessThanEqualsToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 65] = "GreaterThanGreaterThanEqualsToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 66] = "GreaterThanGreaterThanGreaterThanEqualsToken";
+ SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 67] = "AmpersandEqualsToken";
+ SyntaxKind[SyntaxKind["BarEqualsToken"] = 68] = "BarEqualsToken";
+ SyntaxKind[SyntaxKind["CaretEqualsToken"] = 69] = "CaretEqualsToken";
// Identifiers
- SyntaxKind[SyntaxKind["Identifier"] = 69] = "Identifier";
+ SyntaxKind[SyntaxKind["Identifier"] = 70] = "Identifier";
// Reserved words
- SyntaxKind[SyntaxKind["BreakKeyword"] = 70] = "BreakKeyword";
- SyntaxKind[SyntaxKind["CaseKeyword"] = 71] = "CaseKeyword";
- SyntaxKind[SyntaxKind["CatchKeyword"] = 72] = "CatchKeyword";
- SyntaxKind[SyntaxKind["ClassKeyword"] = 73] = "ClassKeyword";
- SyntaxKind[SyntaxKind["ConstKeyword"] = 74] = "ConstKeyword";
- SyntaxKind[SyntaxKind["ContinueKeyword"] = 75] = "ContinueKeyword";
- SyntaxKind[SyntaxKind["DebuggerKeyword"] = 76] = "DebuggerKeyword";
- SyntaxKind[SyntaxKind["DefaultKeyword"] = 77] = "DefaultKeyword";
- SyntaxKind[SyntaxKind["DeleteKeyword"] = 78] = "DeleteKeyword";
- SyntaxKind[SyntaxKind["DoKeyword"] = 79] = "DoKeyword";
- SyntaxKind[SyntaxKind["ElseKeyword"] = 80] = "ElseKeyword";
- SyntaxKind[SyntaxKind["EnumKeyword"] = 81] = "EnumKeyword";
- SyntaxKind[SyntaxKind["ExportKeyword"] = 82] = "ExportKeyword";
- SyntaxKind[SyntaxKind["ExtendsKeyword"] = 83] = "ExtendsKeyword";
- SyntaxKind[SyntaxKind["FalseKeyword"] = 84] = "FalseKeyword";
- SyntaxKind[SyntaxKind["FinallyKeyword"] = 85] = "FinallyKeyword";
- SyntaxKind[SyntaxKind["ForKeyword"] = 86] = "ForKeyword";
- SyntaxKind[SyntaxKind["FunctionKeyword"] = 87] = "FunctionKeyword";
- SyntaxKind[SyntaxKind["IfKeyword"] = 88] = "IfKeyword";
- SyntaxKind[SyntaxKind["ImportKeyword"] = 89] = "ImportKeyword";
- SyntaxKind[SyntaxKind["InKeyword"] = 90] = "InKeyword";
- SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 91] = "InstanceOfKeyword";
- SyntaxKind[SyntaxKind["NewKeyword"] = 92] = "NewKeyword";
- SyntaxKind[SyntaxKind["NullKeyword"] = 93] = "NullKeyword";
- SyntaxKind[SyntaxKind["ReturnKeyword"] = 94] = "ReturnKeyword";
- SyntaxKind[SyntaxKind["SuperKeyword"] = 95] = "SuperKeyword";
- SyntaxKind[SyntaxKind["SwitchKeyword"] = 96] = "SwitchKeyword";
- SyntaxKind[SyntaxKind["ThisKeyword"] = 97] = "ThisKeyword";
- SyntaxKind[SyntaxKind["ThrowKeyword"] = 98] = "ThrowKeyword";
- SyntaxKind[SyntaxKind["TrueKeyword"] = 99] = "TrueKeyword";
- SyntaxKind[SyntaxKind["TryKeyword"] = 100] = "TryKeyword";
- SyntaxKind[SyntaxKind["TypeOfKeyword"] = 101] = "TypeOfKeyword";
- SyntaxKind[SyntaxKind["VarKeyword"] = 102] = "VarKeyword";
- SyntaxKind[SyntaxKind["VoidKeyword"] = 103] = "VoidKeyword";
- SyntaxKind[SyntaxKind["WhileKeyword"] = 104] = "WhileKeyword";
- SyntaxKind[SyntaxKind["WithKeyword"] = 105] = "WithKeyword";
+ SyntaxKind[SyntaxKind["BreakKeyword"] = 71] = "BreakKeyword";
+ SyntaxKind[SyntaxKind["CaseKeyword"] = 72] = "CaseKeyword";
+ SyntaxKind[SyntaxKind["CatchKeyword"] = 73] = "CatchKeyword";
+ SyntaxKind[SyntaxKind["ClassKeyword"] = 74] = "ClassKeyword";
+ SyntaxKind[SyntaxKind["ConstKeyword"] = 75] = "ConstKeyword";
+ SyntaxKind[SyntaxKind["ContinueKeyword"] = 76] = "ContinueKeyword";
+ SyntaxKind[SyntaxKind["DebuggerKeyword"] = 77] = "DebuggerKeyword";
+ SyntaxKind[SyntaxKind["DefaultKeyword"] = 78] = "DefaultKeyword";
+ SyntaxKind[SyntaxKind["DeleteKeyword"] = 79] = "DeleteKeyword";
+ SyntaxKind[SyntaxKind["DoKeyword"] = 80] = "DoKeyword";
+ SyntaxKind[SyntaxKind["ElseKeyword"] = 81] = "ElseKeyword";
+ SyntaxKind[SyntaxKind["EnumKeyword"] = 82] = "EnumKeyword";
+ SyntaxKind[SyntaxKind["ExportKeyword"] = 83] = "ExportKeyword";
+ SyntaxKind[SyntaxKind["ExtendsKeyword"] = 84] = "ExtendsKeyword";
+ SyntaxKind[SyntaxKind["FalseKeyword"] = 85] = "FalseKeyword";
+ SyntaxKind[SyntaxKind["FinallyKeyword"] = 86] = "FinallyKeyword";
+ SyntaxKind[SyntaxKind["ForKeyword"] = 87] = "ForKeyword";
+ SyntaxKind[SyntaxKind["FunctionKeyword"] = 88] = "FunctionKeyword";
+ SyntaxKind[SyntaxKind["IfKeyword"] = 89] = "IfKeyword";
+ SyntaxKind[SyntaxKind["ImportKeyword"] = 90] = "ImportKeyword";
+ SyntaxKind[SyntaxKind["InKeyword"] = 91] = "InKeyword";
+ SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 92] = "InstanceOfKeyword";
+ SyntaxKind[SyntaxKind["NewKeyword"] = 93] = "NewKeyword";
+ SyntaxKind[SyntaxKind["NullKeyword"] = 94] = "NullKeyword";
+ SyntaxKind[SyntaxKind["ReturnKeyword"] = 95] = "ReturnKeyword";
+ SyntaxKind[SyntaxKind["SuperKeyword"] = 96] = "SuperKeyword";
+ SyntaxKind[SyntaxKind["SwitchKeyword"] = 97] = "SwitchKeyword";
+ SyntaxKind[SyntaxKind["ThisKeyword"] = 98] = "ThisKeyword";
+ SyntaxKind[SyntaxKind["ThrowKeyword"] = 99] = "ThrowKeyword";
+ SyntaxKind[SyntaxKind["TrueKeyword"] = 100] = "TrueKeyword";
+ SyntaxKind[SyntaxKind["TryKeyword"] = 101] = "TryKeyword";
+ SyntaxKind[SyntaxKind["TypeOfKeyword"] = 102] = "TypeOfKeyword";
+ SyntaxKind[SyntaxKind["VarKeyword"] = 103] = "VarKeyword";
+ SyntaxKind[SyntaxKind["VoidKeyword"] = 104] = "VoidKeyword";
+ SyntaxKind[SyntaxKind["WhileKeyword"] = 105] = "WhileKeyword";
+ SyntaxKind[SyntaxKind["WithKeyword"] = 106] = "WithKeyword";
// Strict mode reserved words
- SyntaxKind[SyntaxKind["ImplementsKeyword"] = 106] = "ImplementsKeyword";
- SyntaxKind[SyntaxKind["InterfaceKeyword"] = 107] = "InterfaceKeyword";
- SyntaxKind[SyntaxKind["LetKeyword"] = 108] = "LetKeyword";
- SyntaxKind[SyntaxKind["PackageKeyword"] = 109] = "PackageKeyword";
- SyntaxKind[SyntaxKind["PrivateKeyword"] = 110] = "PrivateKeyword";
- SyntaxKind[SyntaxKind["ProtectedKeyword"] = 111] = "ProtectedKeyword";
- SyntaxKind[SyntaxKind["PublicKeyword"] = 112] = "PublicKeyword";
- SyntaxKind[SyntaxKind["StaticKeyword"] = 113] = "StaticKeyword";
- SyntaxKind[SyntaxKind["YieldKeyword"] = 114] = "YieldKeyword";
+ SyntaxKind[SyntaxKind["ImplementsKeyword"] = 107] = "ImplementsKeyword";
+ SyntaxKind[SyntaxKind["InterfaceKeyword"] = 108] = "InterfaceKeyword";
+ SyntaxKind[SyntaxKind["LetKeyword"] = 109] = "LetKeyword";
+ SyntaxKind[SyntaxKind["PackageKeyword"] = 110] = "PackageKeyword";
+ SyntaxKind[SyntaxKind["PrivateKeyword"] = 111] = "PrivateKeyword";
+ SyntaxKind[SyntaxKind["ProtectedKeyword"] = 112] = "ProtectedKeyword";
+ SyntaxKind[SyntaxKind["PublicKeyword"] = 113] = "PublicKeyword";
+ SyntaxKind[SyntaxKind["StaticKeyword"] = 114] = "StaticKeyword";
+ SyntaxKind[SyntaxKind["YieldKeyword"] = 115] = "YieldKeyword";
// Contextual keywords
- SyntaxKind[SyntaxKind["AbstractKeyword"] = 115] = "AbstractKeyword";
- SyntaxKind[SyntaxKind["AsKeyword"] = 116] = "AsKeyword";
- SyntaxKind[SyntaxKind["AnyKeyword"] = 117] = "AnyKeyword";
- SyntaxKind[SyntaxKind["AsyncKeyword"] = 118] = "AsyncKeyword";
- SyntaxKind[SyntaxKind["AwaitKeyword"] = 119] = "AwaitKeyword";
- SyntaxKind[SyntaxKind["BooleanKeyword"] = 120] = "BooleanKeyword";
- SyntaxKind[SyntaxKind["ConstructorKeyword"] = 121] = "ConstructorKeyword";
- SyntaxKind[SyntaxKind["DeclareKeyword"] = 122] = "DeclareKeyword";
- SyntaxKind[SyntaxKind["GetKeyword"] = 123] = "GetKeyword";
- SyntaxKind[SyntaxKind["IsKeyword"] = 124] = "IsKeyword";
- SyntaxKind[SyntaxKind["ModuleKeyword"] = 125] = "ModuleKeyword";
- SyntaxKind[SyntaxKind["NamespaceKeyword"] = 126] = "NamespaceKeyword";
- SyntaxKind[SyntaxKind["NeverKeyword"] = 127] = "NeverKeyword";
- SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 128] = "ReadonlyKeyword";
- SyntaxKind[SyntaxKind["RequireKeyword"] = 129] = "RequireKeyword";
- SyntaxKind[SyntaxKind["NumberKeyword"] = 130] = "NumberKeyword";
- SyntaxKind[SyntaxKind["SetKeyword"] = 131] = "SetKeyword";
- SyntaxKind[SyntaxKind["StringKeyword"] = 132] = "StringKeyword";
- SyntaxKind[SyntaxKind["SymbolKeyword"] = 133] = "SymbolKeyword";
- SyntaxKind[SyntaxKind["TypeKeyword"] = 134] = "TypeKeyword";
- SyntaxKind[SyntaxKind["UndefinedKeyword"] = 135] = "UndefinedKeyword";
- SyntaxKind[SyntaxKind["FromKeyword"] = 136] = "FromKeyword";
- SyntaxKind[SyntaxKind["GlobalKeyword"] = 137] = "GlobalKeyword";
- SyntaxKind[SyntaxKind["OfKeyword"] = 138] = "OfKeyword";
+ SyntaxKind[SyntaxKind["AbstractKeyword"] = 116] = "AbstractKeyword";
+ SyntaxKind[SyntaxKind["AsKeyword"] = 117] = "AsKeyword";
+ SyntaxKind[SyntaxKind["AnyKeyword"] = 118] = "AnyKeyword";
+ SyntaxKind[SyntaxKind["AsyncKeyword"] = 119] = "AsyncKeyword";
+ SyntaxKind[SyntaxKind["AwaitKeyword"] = 120] = "AwaitKeyword";
+ SyntaxKind[SyntaxKind["BooleanKeyword"] = 121] = "BooleanKeyword";
+ SyntaxKind[SyntaxKind["ConstructorKeyword"] = 122] = "ConstructorKeyword";
+ SyntaxKind[SyntaxKind["DeclareKeyword"] = 123] = "DeclareKeyword";
+ SyntaxKind[SyntaxKind["GetKeyword"] = 124] = "GetKeyword";
+ SyntaxKind[SyntaxKind["IsKeyword"] = 125] = "IsKeyword";
+ SyntaxKind[SyntaxKind["ModuleKeyword"] = 126] = "ModuleKeyword";
+ SyntaxKind[SyntaxKind["NamespaceKeyword"] = 127] = "NamespaceKeyword";
+ SyntaxKind[SyntaxKind["NeverKeyword"] = 128] = "NeverKeyword";
+ SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 129] = "ReadonlyKeyword";
+ SyntaxKind[SyntaxKind["RequireKeyword"] = 130] = "RequireKeyword";
+ SyntaxKind[SyntaxKind["NumberKeyword"] = 131] = "NumberKeyword";
+ SyntaxKind[SyntaxKind["SetKeyword"] = 132] = "SetKeyword";
+ SyntaxKind[SyntaxKind["StringKeyword"] = 133] = "StringKeyword";
+ SyntaxKind[SyntaxKind["SymbolKeyword"] = 134] = "SymbolKeyword";
+ SyntaxKind[SyntaxKind["TypeKeyword"] = 135] = "TypeKeyword";
+ SyntaxKind[SyntaxKind["UndefinedKeyword"] = 136] = "UndefinedKeyword";
+ SyntaxKind[SyntaxKind["FromKeyword"] = 137] = "FromKeyword";
+ SyntaxKind[SyntaxKind["GlobalKeyword"] = 138] = "GlobalKeyword";
+ SyntaxKind[SyntaxKind["OfKeyword"] = 139] = "OfKeyword";
// Parse tree nodes
// Names
- SyntaxKind[SyntaxKind["QualifiedName"] = 139] = "QualifiedName";
- SyntaxKind[SyntaxKind["ComputedPropertyName"] = 140] = "ComputedPropertyName";
+ SyntaxKind[SyntaxKind["QualifiedName"] = 140] = "QualifiedName";
+ SyntaxKind[SyntaxKind["ComputedPropertyName"] = 141] = "ComputedPropertyName";
// Signature elements
- SyntaxKind[SyntaxKind["TypeParameter"] = 141] = "TypeParameter";
- SyntaxKind[SyntaxKind["Parameter"] = 142] = "Parameter";
- SyntaxKind[SyntaxKind["Decorator"] = 143] = "Decorator";
+ SyntaxKind[SyntaxKind["TypeParameter"] = 142] = "TypeParameter";
+ SyntaxKind[SyntaxKind["Parameter"] = 143] = "Parameter";
+ SyntaxKind[SyntaxKind["Decorator"] = 144] = "Decorator";
// TypeMember
- SyntaxKind[SyntaxKind["PropertySignature"] = 144] = "PropertySignature";
- SyntaxKind[SyntaxKind["PropertyDeclaration"] = 145] = "PropertyDeclaration";
- SyntaxKind[SyntaxKind["MethodSignature"] = 146] = "MethodSignature";
- SyntaxKind[SyntaxKind["MethodDeclaration"] = 147] = "MethodDeclaration";
- SyntaxKind[SyntaxKind["Constructor"] = 148] = "Constructor";
- SyntaxKind[SyntaxKind["GetAccessor"] = 149] = "GetAccessor";
- SyntaxKind[SyntaxKind["SetAccessor"] = 150] = "SetAccessor";
- SyntaxKind[SyntaxKind["CallSignature"] = 151] = "CallSignature";
- SyntaxKind[SyntaxKind["ConstructSignature"] = 152] = "ConstructSignature";
- SyntaxKind[SyntaxKind["IndexSignature"] = 153] = "IndexSignature";
+ SyntaxKind[SyntaxKind["PropertySignature"] = 145] = "PropertySignature";
+ SyntaxKind[SyntaxKind["PropertyDeclaration"] = 146] = "PropertyDeclaration";
+ SyntaxKind[SyntaxKind["MethodSignature"] = 147] = "MethodSignature";
+ SyntaxKind[SyntaxKind["MethodDeclaration"] = 148] = "MethodDeclaration";
+ SyntaxKind[SyntaxKind["Constructor"] = 149] = "Constructor";
+ SyntaxKind[SyntaxKind["GetAccessor"] = 150] = "GetAccessor";
+ SyntaxKind[SyntaxKind["SetAccessor"] = 151] = "SetAccessor";
+ SyntaxKind[SyntaxKind["CallSignature"] = 152] = "CallSignature";
+ SyntaxKind[SyntaxKind["ConstructSignature"] = 153] = "ConstructSignature";
+ SyntaxKind[SyntaxKind["IndexSignature"] = 154] = "IndexSignature";
// Type
- SyntaxKind[SyntaxKind["TypePredicate"] = 154] = "TypePredicate";
- SyntaxKind[SyntaxKind["TypeReference"] = 155] = "TypeReference";
- SyntaxKind[SyntaxKind["FunctionType"] = 156] = "FunctionType";
- SyntaxKind[SyntaxKind["ConstructorType"] = 157] = "ConstructorType";
- SyntaxKind[SyntaxKind["TypeQuery"] = 158] = "TypeQuery";
- SyntaxKind[SyntaxKind["TypeLiteral"] = 159] = "TypeLiteral";
- SyntaxKind[SyntaxKind["ArrayType"] = 160] = "ArrayType";
- SyntaxKind[SyntaxKind["TupleType"] = 161] = "TupleType";
- SyntaxKind[SyntaxKind["UnionType"] = 162] = "UnionType";
- SyntaxKind[SyntaxKind["IntersectionType"] = 163] = "IntersectionType";
- SyntaxKind[SyntaxKind["ParenthesizedType"] = 164] = "ParenthesizedType";
- SyntaxKind[SyntaxKind["ThisType"] = 165] = "ThisType";
- SyntaxKind[SyntaxKind["LiteralType"] = 166] = "LiteralType";
+ SyntaxKind[SyntaxKind["TypePredicate"] = 155] = "TypePredicate";
+ SyntaxKind[SyntaxKind["TypeReference"] = 156] = "TypeReference";
+ SyntaxKind[SyntaxKind["FunctionType"] = 157] = "FunctionType";
+ SyntaxKind[SyntaxKind["ConstructorType"] = 158] = "ConstructorType";
+ SyntaxKind[SyntaxKind["TypeQuery"] = 159] = "TypeQuery";
+ SyntaxKind[SyntaxKind["TypeLiteral"] = 160] = "TypeLiteral";
+ SyntaxKind[SyntaxKind["ArrayType"] = 161] = "ArrayType";
+ SyntaxKind[SyntaxKind["TupleType"] = 162] = "TupleType";
+ SyntaxKind[SyntaxKind["UnionType"] = 163] = "UnionType";
+ SyntaxKind[SyntaxKind["IntersectionType"] = 164] = "IntersectionType";
+ SyntaxKind[SyntaxKind["ParenthesizedType"] = 165] = "ParenthesizedType";
+ SyntaxKind[SyntaxKind["ThisType"] = 166] = "ThisType";
+ SyntaxKind[SyntaxKind["LiteralType"] = 167] = "LiteralType";
// Binding patterns
- SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 167] = "ObjectBindingPattern";
- SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 168] = "ArrayBindingPattern";
- SyntaxKind[SyntaxKind["BindingElement"] = 169] = "BindingElement";
+ SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 168] = "ObjectBindingPattern";
+ SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 169] = "ArrayBindingPattern";
+ SyntaxKind[SyntaxKind["BindingElement"] = 170] = "BindingElement";
// Expression
- SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 170] = "ArrayLiteralExpression";
- SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 171] = "ObjectLiteralExpression";
- SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 172] = "PropertyAccessExpression";
- SyntaxKind[SyntaxKind["ElementAccessExpression"] = 173] = "ElementAccessExpression";
- SyntaxKind[SyntaxKind["CallExpression"] = 174] = "CallExpression";
- SyntaxKind[SyntaxKind["NewExpression"] = 175] = "NewExpression";
- SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 176] = "TaggedTemplateExpression";
- SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 177] = "TypeAssertionExpression";
- SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 178] = "ParenthesizedExpression";
- SyntaxKind[SyntaxKind["FunctionExpression"] = 179] = "FunctionExpression";
- SyntaxKind[SyntaxKind["ArrowFunction"] = 180] = "ArrowFunction";
- SyntaxKind[SyntaxKind["DeleteExpression"] = 181] = "DeleteExpression";
- SyntaxKind[SyntaxKind["TypeOfExpression"] = 182] = "TypeOfExpression";
- SyntaxKind[SyntaxKind["VoidExpression"] = 183] = "VoidExpression";
- SyntaxKind[SyntaxKind["AwaitExpression"] = 184] = "AwaitExpression";
- SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 185] = "PrefixUnaryExpression";
- SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 186] = "PostfixUnaryExpression";
- SyntaxKind[SyntaxKind["BinaryExpression"] = 187] = "BinaryExpression";
- SyntaxKind[SyntaxKind["ConditionalExpression"] = 188] = "ConditionalExpression";
- SyntaxKind[SyntaxKind["TemplateExpression"] = 189] = "TemplateExpression";
- SyntaxKind[SyntaxKind["YieldExpression"] = 190] = "YieldExpression";
- SyntaxKind[SyntaxKind["SpreadElementExpression"] = 191] = "SpreadElementExpression";
- SyntaxKind[SyntaxKind["ClassExpression"] = 192] = "ClassExpression";
- SyntaxKind[SyntaxKind["OmittedExpression"] = 193] = "OmittedExpression";
- SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 194] = "ExpressionWithTypeArguments";
- SyntaxKind[SyntaxKind["AsExpression"] = 195] = "AsExpression";
- SyntaxKind[SyntaxKind["NonNullExpression"] = 196] = "NonNullExpression";
+ SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 171] = "ArrayLiteralExpression";
+ SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 172] = "ObjectLiteralExpression";
+ SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 173] = "PropertyAccessExpression";
+ SyntaxKind[SyntaxKind["ElementAccessExpression"] = 174] = "ElementAccessExpression";
+ SyntaxKind[SyntaxKind["CallExpression"] = 175] = "CallExpression";
+ SyntaxKind[SyntaxKind["NewExpression"] = 176] = "NewExpression";
+ SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 177] = "TaggedTemplateExpression";
+ SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 178] = "TypeAssertionExpression";
+ SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 179] = "ParenthesizedExpression";
+ SyntaxKind[SyntaxKind["FunctionExpression"] = 180] = "FunctionExpression";
+ SyntaxKind[SyntaxKind["ArrowFunction"] = 181] = "ArrowFunction";
+ SyntaxKind[SyntaxKind["DeleteExpression"] = 182] = "DeleteExpression";
+ SyntaxKind[SyntaxKind["TypeOfExpression"] = 183] = "TypeOfExpression";
+ SyntaxKind[SyntaxKind["VoidExpression"] = 184] = "VoidExpression";
+ SyntaxKind[SyntaxKind["AwaitExpression"] = 185] = "AwaitExpression";
+ SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 186] = "PrefixUnaryExpression";
+ SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 187] = "PostfixUnaryExpression";
+ SyntaxKind[SyntaxKind["BinaryExpression"] = 188] = "BinaryExpression";
+ SyntaxKind[SyntaxKind["ConditionalExpression"] = 189] = "ConditionalExpression";
+ SyntaxKind[SyntaxKind["TemplateExpression"] = 190] = "TemplateExpression";
+ SyntaxKind[SyntaxKind["YieldExpression"] = 191] = "YieldExpression";
+ SyntaxKind[SyntaxKind["SpreadElementExpression"] = 192] = "SpreadElementExpression";
+ SyntaxKind[SyntaxKind["ClassExpression"] = 193] = "ClassExpression";
+ SyntaxKind[SyntaxKind["OmittedExpression"] = 194] = "OmittedExpression";
+ SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 195] = "ExpressionWithTypeArguments";
+ SyntaxKind[SyntaxKind["AsExpression"] = 196] = "AsExpression";
+ SyntaxKind[SyntaxKind["NonNullExpression"] = 197] = "NonNullExpression";
// Misc
- SyntaxKind[SyntaxKind["TemplateSpan"] = 197] = "TemplateSpan";
- SyntaxKind[SyntaxKind["SemicolonClassElement"] = 198] = "SemicolonClassElement";
+ SyntaxKind[SyntaxKind["TemplateSpan"] = 198] = "TemplateSpan";
+ SyntaxKind[SyntaxKind["SemicolonClassElement"] = 199] = "SemicolonClassElement";
// Element
- SyntaxKind[SyntaxKind["Block"] = 199] = "Block";
- SyntaxKind[SyntaxKind["VariableStatement"] = 200] = "VariableStatement";
- SyntaxKind[SyntaxKind["EmptyStatement"] = 201] = "EmptyStatement";
- SyntaxKind[SyntaxKind["ExpressionStatement"] = 202] = "ExpressionStatement";
- SyntaxKind[SyntaxKind["IfStatement"] = 203] = "IfStatement";
- SyntaxKind[SyntaxKind["DoStatement"] = 204] = "DoStatement";
- SyntaxKind[SyntaxKind["WhileStatement"] = 205] = "WhileStatement";
- SyntaxKind[SyntaxKind["ForStatement"] = 206] = "ForStatement";
- SyntaxKind[SyntaxKind["ForInStatement"] = 207] = "ForInStatement";
- SyntaxKind[SyntaxKind["ForOfStatement"] = 208] = "ForOfStatement";
- SyntaxKind[SyntaxKind["ContinueStatement"] = 209] = "ContinueStatement";
- SyntaxKind[SyntaxKind["BreakStatement"] = 210] = "BreakStatement";
- SyntaxKind[SyntaxKind["ReturnStatement"] = 211] = "ReturnStatement";
- SyntaxKind[SyntaxKind["WithStatement"] = 212] = "WithStatement";
- SyntaxKind[SyntaxKind["SwitchStatement"] = 213] = "SwitchStatement";
- SyntaxKind[SyntaxKind["LabeledStatement"] = 214] = "LabeledStatement";
- SyntaxKind[SyntaxKind["ThrowStatement"] = 215] = "ThrowStatement";
- SyntaxKind[SyntaxKind["TryStatement"] = 216] = "TryStatement";
- SyntaxKind[SyntaxKind["DebuggerStatement"] = 217] = "DebuggerStatement";
- SyntaxKind[SyntaxKind["VariableDeclaration"] = 218] = "VariableDeclaration";
- SyntaxKind[SyntaxKind["VariableDeclarationList"] = 219] = "VariableDeclarationList";
- SyntaxKind[SyntaxKind["FunctionDeclaration"] = 220] = "FunctionDeclaration";
- SyntaxKind[SyntaxKind["ClassDeclaration"] = 221] = "ClassDeclaration";
- SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 222] = "InterfaceDeclaration";
- SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 223] = "TypeAliasDeclaration";
- SyntaxKind[SyntaxKind["EnumDeclaration"] = 224] = "EnumDeclaration";
- SyntaxKind[SyntaxKind["ModuleDeclaration"] = 225] = "ModuleDeclaration";
- SyntaxKind[SyntaxKind["ModuleBlock"] = 226] = "ModuleBlock";
- SyntaxKind[SyntaxKind["CaseBlock"] = 227] = "CaseBlock";
- SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 228] = "NamespaceExportDeclaration";
- SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 229] = "ImportEqualsDeclaration";
- SyntaxKind[SyntaxKind["ImportDeclaration"] = 230] = "ImportDeclaration";
- SyntaxKind[SyntaxKind["ImportClause"] = 231] = "ImportClause";
- SyntaxKind[SyntaxKind["NamespaceImport"] = 232] = "NamespaceImport";
- SyntaxKind[SyntaxKind["NamedImports"] = 233] = "NamedImports";
- SyntaxKind[SyntaxKind["ImportSpecifier"] = 234] = "ImportSpecifier";
- SyntaxKind[SyntaxKind["ExportAssignment"] = 235] = "ExportAssignment";
- SyntaxKind[SyntaxKind["ExportDeclaration"] = 236] = "ExportDeclaration";
- SyntaxKind[SyntaxKind["NamedExports"] = 237] = "NamedExports";
- SyntaxKind[SyntaxKind["ExportSpecifier"] = 238] = "ExportSpecifier";
- SyntaxKind[SyntaxKind["MissingDeclaration"] = 239] = "MissingDeclaration";
+ SyntaxKind[SyntaxKind["Block"] = 200] = "Block";
+ SyntaxKind[SyntaxKind["VariableStatement"] = 201] = "VariableStatement";
+ SyntaxKind[SyntaxKind["EmptyStatement"] = 202] = "EmptyStatement";
+ SyntaxKind[SyntaxKind["ExpressionStatement"] = 203] = "ExpressionStatement";
+ SyntaxKind[SyntaxKind["IfStatement"] = 204] = "IfStatement";
+ SyntaxKind[SyntaxKind["DoStatement"] = 205] = "DoStatement";
+ SyntaxKind[SyntaxKind["WhileStatement"] = 206] = "WhileStatement";
+ SyntaxKind[SyntaxKind["ForStatement"] = 207] = "ForStatement";
+ SyntaxKind[SyntaxKind["ForInStatement"] = 208] = "ForInStatement";
+ SyntaxKind[SyntaxKind["ForOfStatement"] = 209] = "ForOfStatement";
+ SyntaxKind[SyntaxKind["ContinueStatement"] = 210] = "ContinueStatement";
+ SyntaxKind[SyntaxKind["BreakStatement"] = 211] = "BreakStatement";
+ SyntaxKind[SyntaxKind["ReturnStatement"] = 212] = "ReturnStatement";
+ SyntaxKind[SyntaxKind["WithStatement"] = 213] = "WithStatement";
+ SyntaxKind[SyntaxKind["SwitchStatement"] = 214] = "SwitchStatement";
+ SyntaxKind[SyntaxKind["LabeledStatement"] = 215] = "LabeledStatement";
+ SyntaxKind[SyntaxKind["ThrowStatement"] = 216] = "ThrowStatement";
+ SyntaxKind[SyntaxKind["TryStatement"] = 217] = "TryStatement";
+ SyntaxKind[SyntaxKind["DebuggerStatement"] = 218] = "DebuggerStatement";
+ SyntaxKind[SyntaxKind["VariableDeclaration"] = 219] = "VariableDeclaration";
+ SyntaxKind[SyntaxKind["VariableDeclarationList"] = 220] = "VariableDeclarationList";
+ SyntaxKind[SyntaxKind["FunctionDeclaration"] = 221] = "FunctionDeclaration";
+ SyntaxKind[SyntaxKind["ClassDeclaration"] = 222] = "ClassDeclaration";
+ SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 223] = "InterfaceDeclaration";
+ SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 224] = "TypeAliasDeclaration";
+ SyntaxKind[SyntaxKind["EnumDeclaration"] = 225] = "EnumDeclaration";
+ SyntaxKind[SyntaxKind["ModuleDeclaration"] = 226] = "ModuleDeclaration";
+ SyntaxKind[SyntaxKind["ModuleBlock"] = 227] = "ModuleBlock";
+ SyntaxKind[SyntaxKind["CaseBlock"] = 228] = "CaseBlock";
+ SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 229] = "NamespaceExportDeclaration";
+ SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 230] = "ImportEqualsDeclaration";
+ SyntaxKind[SyntaxKind["ImportDeclaration"] = 231] = "ImportDeclaration";
+ SyntaxKind[SyntaxKind["ImportClause"] = 232] = "ImportClause";
+ SyntaxKind[SyntaxKind["NamespaceImport"] = 233] = "NamespaceImport";
+ SyntaxKind[SyntaxKind["NamedImports"] = 234] = "NamedImports";
+ SyntaxKind[SyntaxKind["ImportSpecifier"] = 235] = "ImportSpecifier";
+ SyntaxKind[SyntaxKind["ExportAssignment"] = 236] = "ExportAssignment";
+ SyntaxKind[SyntaxKind["ExportDeclaration"] = 237] = "ExportDeclaration";
+ SyntaxKind[SyntaxKind["NamedExports"] = 238] = "NamedExports";
+ SyntaxKind[SyntaxKind["ExportSpecifier"] = 239] = "ExportSpecifier";
+ SyntaxKind[SyntaxKind["MissingDeclaration"] = 240] = "MissingDeclaration";
// Module references
- SyntaxKind[SyntaxKind["ExternalModuleReference"] = 240] = "ExternalModuleReference";
+ SyntaxKind[SyntaxKind["ExternalModuleReference"] = 241] = "ExternalModuleReference";
// JSX
- SyntaxKind[SyntaxKind["JsxElement"] = 241] = "JsxElement";
- SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 242] = "JsxSelfClosingElement";
- SyntaxKind[SyntaxKind["JsxOpeningElement"] = 243] = "JsxOpeningElement";
- SyntaxKind[SyntaxKind["JsxText"] = 244] = "JsxText";
+ SyntaxKind[SyntaxKind["JsxElement"] = 242] = "JsxElement";
+ SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 243] = "JsxSelfClosingElement";
+ SyntaxKind[SyntaxKind["JsxOpeningElement"] = 244] = "JsxOpeningElement";
SyntaxKind[SyntaxKind["JsxClosingElement"] = 245] = "JsxClosingElement";
SyntaxKind[SyntaxKind["JsxAttribute"] = 246] = "JsxAttribute";
SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 247] = "JsxSpreadAttribute";
@@ -346,31 +346,31 @@ var ts;
// Enum value count
SyntaxKind[SyntaxKind["Count"] = 289] = "Count";
// Markers
- SyntaxKind[SyntaxKind["FirstAssignment"] = 56] = "FirstAssignment";
- SyntaxKind[SyntaxKind["LastAssignment"] = 68] = "LastAssignment";
- SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 57] = "FirstCompoundAssignment";
- SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 68] = "LastCompoundAssignment";
- SyntaxKind[SyntaxKind["FirstReservedWord"] = 70] = "FirstReservedWord";
- SyntaxKind[SyntaxKind["LastReservedWord"] = 105] = "LastReservedWord";
- SyntaxKind[SyntaxKind["FirstKeyword"] = 70] = "FirstKeyword";
- SyntaxKind[SyntaxKind["LastKeyword"] = 138] = "LastKeyword";
- SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 106] = "FirstFutureReservedWord";
- SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 114] = "LastFutureReservedWord";
- SyntaxKind[SyntaxKind["FirstTypeNode"] = 154] = "FirstTypeNode";
- SyntaxKind[SyntaxKind["LastTypeNode"] = 166] = "LastTypeNode";
- SyntaxKind[SyntaxKind["FirstPunctuation"] = 15] = "FirstPunctuation";
- SyntaxKind[SyntaxKind["LastPunctuation"] = 68] = "LastPunctuation";
+ SyntaxKind[SyntaxKind["FirstAssignment"] = 57] = "FirstAssignment";
+ SyntaxKind[SyntaxKind["LastAssignment"] = 69] = "LastAssignment";
+ SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 58] = "FirstCompoundAssignment";
+ SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 69] = "LastCompoundAssignment";
+ SyntaxKind[SyntaxKind["FirstReservedWord"] = 71] = "FirstReservedWord";
+ SyntaxKind[SyntaxKind["LastReservedWord"] = 106] = "LastReservedWord";
+ SyntaxKind[SyntaxKind["FirstKeyword"] = 71] = "FirstKeyword";
+ SyntaxKind[SyntaxKind["LastKeyword"] = 139] = "LastKeyword";
+ SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 107] = "FirstFutureReservedWord";
+ SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 115] = "LastFutureReservedWord";
+ SyntaxKind[SyntaxKind["FirstTypeNode"] = 155] = "FirstTypeNode";
+ SyntaxKind[SyntaxKind["LastTypeNode"] = 167] = "LastTypeNode";
+ SyntaxKind[SyntaxKind["FirstPunctuation"] = 16] = "FirstPunctuation";
+ SyntaxKind[SyntaxKind["LastPunctuation"] = 69] = "LastPunctuation";
SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken";
- SyntaxKind[SyntaxKind["LastToken"] = 138] = "LastToken";
+ SyntaxKind[SyntaxKind["LastToken"] = 139] = "LastToken";
SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken";
SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken";
SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken";
- SyntaxKind[SyntaxKind["LastLiteralToken"] = 11] = "LastLiteralToken";
- SyntaxKind[SyntaxKind["FirstTemplateToken"] = 11] = "FirstTemplateToken";
- SyntaxKind[SyntaxKind["LastTemplateToken"] = 14] = "LastTemplateToken";
- SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 25] = "FirstBinaryOperator";
- SyntaxKind[SyntaxKind["LastBinaryOperator"] = 68] = "LastBinaryOperator";
- SyntaxKind[SyntaxKind["FirstNode"] = 139] = "FirstNode";
+ SyntaxKind[SyntaxKind["LastLiteralToken"] = 12] = "LastLiteralToken";
+ SyntaxKind[SyntaxKind["FirstTemplateToken"] = 12] = "FirstTemplateToken";
+ SyntaxKind[SyntaxKind["LastTemplateToken"] = 15] = "LastTemplateToken";
+ SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 26] = "FirstBinaryOperator";
+ SyntaxKind[SyntaxKind["LastBinaryOperator"] = 69] = "LastBinaryOperator";
+ SyntaxKind[SyntaxKind["FirstNode"] = 140] = "FirstNode";
SyntaxKind[SyntaxKind["FirstJSDocNode"] = 257] = "FirstJSDocNode";
SyntaxKind[SyntaxKind["LastJSDocNode"] = 282] = "LastJSDocNode";
SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 273] = "FirstJSDocTagNode";
@@ -430,6 +430,7 @@ var ts;
// Accessibility modifiers and 'readonly' can be attached to a parameter in a constructor to make it a property.
ModifierFlags[ModifierFlags["ParameterPropertyModifier"] = 92] = "ParameterPropertyModifier";
ModifierFlags[ModifierFlags["NonPublicAccessibilityModifier"] = 24] = "NonPublicAccessibilityModifier";
+ ModifierFlags[ModifierFlags["TypeScriptModifier"] = 2270] = "TypeScriptModifier";
})(ts.ModifierFlags || (ts.ModifierFlags = {}));
var ModifierFlags = ts.ModifierFlags;
(function (JsxFlags) {
@@ -466,8 +467,9 @@ var ts;
FlowFlags[FlowFlags["TrueCondition"] = 32] = "TrueCondition";
FlowFlags[FlowFlags["FalseCondition"] = 64] = "FalseCondition";
FlowFlags[FlowFlags["SwitchClause"] = 128] = "SwitchClause";
- FlowFlags[FlowFlags["Referenced"] = 256] = "Referenced";
- FlowFlags[FlowFlags["Shared"] = 512] = "Shared";
+ FlowFlags[FlowFlags["ArrayMutation"] = 256] = "ArrayMutation";
+ FlowFlags[FlowFlags["Referenced"] = 512] = "Referenced";
+ FlowFlags[FlowFlags["Shared"] = 1024] = "Shared";
FlowFlags[FlowFlags["Label"] = 12] = "Label";
FlowFlags[FlowFlags["Condition"] = 96] = "Condition";
})(ts.FlowFlags || (ts.FlowFlags = {}));
@@ -755,7 +757,6 @@ var ts;
ModuleKind[ModuleKind["AMD"] = 2] = "AMD";
ModuleKind[ModuleKind["UMD"] = 3] = "UMD";
ModuleKind[ModuleKind["System"] = 4] = "System";
- ModuleKind[ModuleKind["ES6"] = 5] = "ES6";
ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015";
})(ts.ModuleKind || (ts.ModuleKind = {}));
var ModuleKind = ts.ModuleKind;
@@ -781,9 +782,10 @@ var ts;
(function (ScriptTarget) {
ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3";
ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5";
- ScriptTarget[ScriptTarget["ES6"] = 2] = "ES6";
ScriptTarget[ScriptTarget["ES2015"] = 2] = "ES2015";
- ScriptTarget[ScriptTarget["Latest"] = 2] = "Latest";
+ ScriptTarget[ScriptTarget["ES2016"] = 3] = "ES2016";
+ ScriptTarget[ScriptTarget["ES2017"] = 4] = "ES2017";
+ ScriptTarget[ScriptTarget["Latest"] = 4] = "Latest";
})(ts.ScriptTarget || (ts.ScriptTarget = {}));
var ScriptTarget = ts.ScriptTarget;
(function (LanguageVariant) {
@@ -940,55 +942,58 @@ var ts;
TransformFlags[TransformFlags["ContainsTypeScript"] = 2] = "ContainsTypeScript";
TransformFlags[TransformFlags["Jsx"] = 4] = "Jsx";
TransformFlags[TransformFlags["ContainsJsx"] = 8] = "ContainsJsx";
- TransformFlags[TransformFlags["ES7"] = 16] = "ES7";
- TransformFlags[TransformFlags["ContainsES7"] = 32] = "ContainsES7";
- TransformFlags[TransformFlags["ES6"] = 64] = "ES6";
- TransformFlags[TransformFlags["ContainsES6"] = 128] = "ContainsES6";
- TransformFlags[TransformFlags["DestructuringAssignment"] = 256] = "DestructuringAssignment";
- TransformFlags[TransformFlags["Generator"] = 512] = "Generator";
- TransformFlags[TransformFlags["ContainsGenerator"] = 1024] = "ContainsGenerator";
+ TransformFlags[TransformFlags["ES2017"] = 16] = "ES2017";
+ TransformFlags[TransformFlags["ContainsES2017"] = 32] = "ContainsES2017";
+ TransformFlags[TransformFlags["ES2016"] = 64] = "ES2016";
+ TransformFlags[TransformFlags["ContainsES2016"] = 128] = "ContainsES2016";
+ TransformFlags[TransformFlags["ES2015"] = 256] = "ES2015";
+ TransformFlags[TransformFlags["ContainsES2015"] = 512] = "ContainsES2015";
+ TransformFlags[TransformFlags["DestructuringAssignment"] = 1024] = "DestructuringAssignment";
+ TransformFlags[TransformFlags["Generator"] = 2048] = "Generator";
+ TransformFlags[TransformFlags["ContainsGenerator"] = 4096] = "ContainsGenerator";
// Markers
// - Flags used to indicate that a subtree contains a specific transformation.
- TransformFlags[TransformFlags["ContainsDecorators"] = 2048] = "ContainsDecorators";
- TransformFlags[TransformFlags["ContainsPropertyInitializer"] = 4096] = "ContainsPropertyInitializer";
- TransformFlags[TransformFlags["ContainsLexicalThis"] = 8192] = "ContainsLexicalThis";
- TransformFlags[TransformFlags["ContainsCapturedLexicalThis"] = 16384] = "ContainsCapturedLexicalThis";
- TransformFlags[TransformFlags["ContainsLexicalThisInComputedPropertyName"] = 32768] = "ContainsLexicalThisInComputedPropertyName";
- TransformFlags[TransformFlags["ContainsDefaultValueAssignments"] = 65536] = "ContainsDefaultValueAssignments";
- TransformFlags[TransformFlags["ContainsParameterPropertyAssignments"] = 131072] = "ContainsParameterPropertyAssignments";
- TransformFlags[TransformFlags["ContainsSpreadElementExpression"] = 262144] = "ContainsSpreadElementExpression";
- TransformFlags[TransformFlags["ContainsComputedPropertyName"] = 524288] = "ContainsComputedPropertyName";
- TransformFlags[TransformFlags["ContainsBlockScopedBinding"] = 1048576] = "ContainsBlockScopedBinding";
- TransformFlags[TransformFlags["ContainsBindingPattern"] = 2097152] = "ContainsBindingPattern";
- TransformFlags[TransformFlags["ContainsYield"] = 4194304] = "ContainsYield";
- TransformFlags[TransformFlags["ContainsHoistedDeclarationOrCompletion"] = 8388608] = "ContainsHoistedDeclarationOrCompletion";
+ TransformFlags[TransformFlags["ContainsDecorators"] = 8192] = "ContainsDecorators";
+ TransformFlags[TransformFlags["ContainsPropertyInitializer"] = 16384] = "ContainsPropertyInitializer";
+ TransformFlags[TransformFlags["ContainsLexicalThis"] = 32768] = "ContainsLexicalThis";
+ TransformFlags[TransformFlags["ContainsCapturedLexicalThis"] = 65536] = "ContainsCapturedLexicalThis";
+ TransformFlags[TransformFlags["ContainsLexicalThisInComputedPropertyName"] = 131072] = "ContainsLexicalThisInComputedPropertyName";
+ TransformFlags[TransformFlags["ContainsDefaultValueAssignments"] = 262144] = "ContainsDefaultValueAssignments";
+ TransformFlags[TransformFlags["ContainsParameterPropertyAssignments"] = 524288] = "ContainsParameterPropertyAssignments";
+ TransformFlags[TransformFlags["ContainsSpreadElementExpression"] = 1048576] = "ContainsSpreadElementExpression";
+ TransformFlags[TransformFlags["ContainsComputedPropertyName"] = 2097152] = "ContainsComputedPropertyName";
+ TransformFlags[TransformFlags["ContainsBlockScopedBinding"] = 4194304] = "ContainsBlockScopedBinding";
+ TransformFlags[TransformFlags["ContainsBindingPattern"] = 8388608] = "ContainsBindingPattern";
+ TransformFlags[TransformFlags["ContainsYield"] = 16777216] = "ContainsYield";
+ TransformFlags[TransformFlags["ContainsHoistedDeclarationOrCompletion"] = 33554432] = "ContainsHoistedDeclarationOrCompletion";
TransformFlags[TransformFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags";
// Assertions
// - Bitmasks that are used to assert facts about the syntax of a node and its subtree.
TransformFlags[TransformFlags["AssertTypeScript"] = 3] = "AssertTypeScript";
TransformFlags[TransformFlags["AssertJsx"] = 12] = "AssertJsx";
- TransformFlags[TransformFlags["AssertES7"] = 48] = "AssertES7";
- TransformFlags[TransformFlags["AssertES6"] = 192] = "AssertES6";
- TransformFlags[TransformFlags["AssertGenerator"] = 1536] = "AssertGenerator";
+ TransformFlags[TransformFlags["AssertES2017"] = 48] = "AssertES2017";
+ TransformFlags[TransformFlags["AssertES2016"] = 192] = "AssertES2016";
+ TransformFlags[TransformFlags["AssertES2015"] = 768] = "AssertES2015";
+ TransformFlags[TransformFlags["AssertGenerator"] = 6144] = "AssertGenerator";
// Scope Exclusions
// - Bitmasks that exclude flags from propagating out of a specific context
// into the subtree flags of their container.
- TransformFlags[TransformFlags["NodeExcludes"] = 536871765] = "NodeExcludes";
- TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 550710101] = "ArrowFunctionExcludes";
- TransformFlags[TransformFlags["FunctionExcludes"] = 550726485] = "FunctionExcludes";
- TransformFlags[TransformFlags["ConstructorExcludes"] = 550593365] = "ConstructorExcludes";
- TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 550593365] = "MethodOrAccessorExcludes";
- TransformFlags[TransformFlags["ClassExcludes"] = 537590613] = "ClassExcludes";
- TransformFlags[TransformFlags["ModuleExcludes"] = 546335573] = "ModuleExcludes";
+ TransformFlags[TransformFlags["NodeExcludes"] = 536874325] = "NodeExcludes";
+ TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 592227669] = "ArrowFunctionExcludes";
+ TransformFlags[TransformFlags["FunctionExcludes"] = 592293205] = "FunctionExcludes";
+ TransformFlags[TransformFlags["ConstructorExcludes"] = 591760725] = "ConstructorExcludes";
+ TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 591760725] = "MethodOrAccessorExcludes";
+ TransformFlags[TransformFlags["ClassExcludes"] = 539749717] = "ClassExcludes";
+ TransformFlags[TransformFlags["ModuleExcludes"] = 574729557] = "ModuleExcludes";
TransformFlags[TransformFlags["TypeExcludes"] = -3] = "TypeExcludes";
- TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 537430869] = "ObjectLiteralExcludes";
- TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 537133909] = "ArrayLiteralOrCallOrNewExcludes";
- TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 538968917] = "VariableDeclarationListExcludes";
- TransformFlags[TransformFlags["ParameterExcludes"] = 538968917] = "ParameterExcludes";
+ TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 539110741] = "ObjectLiteralExcludes";
+ TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 537922901] = "ArrayLiteralOrCallOrNewExcludes";
+ TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 545262933] = "VariableDeclarationListExcludes";
+ TransformFlags[TransformFlags["ParameterExcludes"] = 545262933] = "ParameterExcludes";
// Masks
// - Additional bitmasks
- TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 137216] = "TypeScriptClassSyntaxMask";
- TransformFlags[TransformFlags["ES6FunctionSyntaxMask"] = 81920] = "ES6FunctionSyntaxMask";
+ TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 548864] = "TypeScriptClassSyntaxMask";
+ TransformFlags[TransformFlags["ES2015FunctionSyntaxMask"] = 327680] = "ES2015FunctionSyntaxMask";
})(ts.TransformFlags || (ts.TransformFlags = {}));
var TransformFlags = ts.TransformFlags;
/* @internal */
@@ -1044,7 +1049,7 @@ var ts;
(function (performance) {
var profilerEvent = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true
? onProfilerEvent
- : function (markName) { };
+ : function (_markName) { };
var enabled = false;
var profilerStart = 0;
var counts;
@@ -1146,6 +1151,8 @@ var ts;
})(ts.Ternary || (ts.Ternary = {}));
var Ternary = ts.Ternary;
var createObject = Object.create;
+ // More efficient to create a collator once and use its `compare` than to call `a.localeCompare(b)` many times.
+ ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined;
function createMap(template) {
var map = createObject(null); // tslint:disable-line:no-null-keyword
// Using 'delete' on an object causes V8 to put the object in dictionary mode.
@@ -1171,7 +1178,7 @@ var ts;
remove: remove,
forEachValue: forEachValueInMap,
getKeys: getKeys,
- clear: clear
+ clear: clear,
};
function forEachValueInMap(f) {
for (var key in files) {
@@ -1378,13 +1385,33 @@ var ts;
if (array) {
result = [];
for (var i = 0; i < array.length; i++) {
- var v = array[i];
- result.push(f(v, i));
+ result.push(f(array[i], i));
}
}
return result;
}
ts.map = map;
+ // Maps from T to T and avoids allocation if all elements map to themselves
+ function sameMap(array, f) {
+ var result;
+ if (array) {
+ for (var i = 0; i < array.length; i++) {
+ if (result) {
+ result.push(f(array[i], i));
+ }
+ else {
+ var item = array[i];
+ var mapped = f(item, i);
+ if (item !== mapped) {
+ result = array.slice(0, i);
+ result.push(mapped);
+ }
+ }
+ }
+ }
+ return result || array;
+ }
+ ts.sameMap = sameMap;
/**
* Flattens an array containing a mix of array or non-array elements.
*
@@ -1507,6 +1534,18 @@ var ts;
return result;
}
ts.mapObject = mapObject;
+ function some(array, predicate) {
+ if (array) {
+ for (var _i = 0, array_5 = array; _i < array_5.length; _i++) {
+ var v = array_5[_i];
+ if (!predicate || predicate(v)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ ts.some = some;
function concatenate(array1, array2) {
if (!array2 || !array2.length)
return array1;
@@ -1520,8 +1559,8 @@ var ts;
var result;
if (array) {
result = [];
- loop: for (var _i = 0, array_5 = array; _i < array_5.length; _i++) {
- var item = array_5[_i];
+ loop: for (var _i = 0, array_6 = array; _i < array_6.length; _i++) {
+ var item = array_6[_i];
for (var _a = 0, result_1 = result; _a < result_1.length; _a++) {
var res = result_1[_a];
if (areEqual ? areEqual(res, item) : res === item) {
@@ -1557,8 +1596,8 @@ var ts;
ts.compact = compact;
function sum(array, prop) {
var result = 0;
- for (var _i = 0, array_6 = array; _i < array_6.length; _i++) {
- var v = array_6[_i];
+ for (var _i = 0, array_7 = array; _i < array_7.length; _i++) {
+ var v = array_7[_i];
result += v[prop];
}
return result;
@@ -1857,8 +1896,8 @@ var ts;
ts.equalOwnProperties = equalOwnProperties;
function arrayToMap(array, makeKey, makeValue) {
var result = createMap();
- for (var _i = 0, array_7 = array; _i < array_7.length; _i++) {
- var value = array_7[_i];
+ for (var _i = 0, array_8 = array; _i < array_8.length; _i++) {
+ var value = array_8[_i];
result[makeKey(value)] = makeValue ? makeValue(value) : value;
}
return result;
@@ -1971,7 +2010,7 @@ var ts;
return function (t) { return compose(a(t)); };
}
else {
- return function (t) { return function (u) { return u; }; };
+ return function (_) { return function (u) { return u; }; };
}
}
ts.chain = chain;
@@ -2002,7 +2041,7 @@ var ts;
ts.compose = compose;
function formatStringFromArgs(text, args, baseIndex) {
baseIndex = baseIndex || 0;
- return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; });
+ return text.replace(/{(\d+)}/g, function (_match, index) { return args[+index + baseIndex]; });
}
ts.localizedDiagnosticMessages = undefined;
function getLocaleSpecificMessage(message) {
@@ -2027,12 +2066,12 @@ var ts;
length: length,
messageText: text,
category: message.category,
- code: message.code
+ code: message.code,
};
}
ts.createFileDiagnostic = createFileDiagnostic;
/* internal */
- function formatMessage(dummy, message) {
+ function formatMessage(_dummy, message) {
var text = getLocaleSpecificMessage(message);
if (arguments.length > 2) {
text = formatStringFromArgs(text, arguments, 2);
@@ -2095,7 +2134,8 @@ var ts;
if (b === undefined)
return 1 /* GreaterThan */;
if (ignoreCase) {
- if (String.prototype.localeCompare) {
+ if (ts.collator && String.prototype.localeCompare) {
+ // accent means a ≠ b, a ≠ á, a = A
var result = a.localeCompare(b, /*locales*/ undefined, { usage: "sort", sensitivity: "accent" });
return result < 0 ? -1 /* LessThan */ : result > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */;
}
@@ -2269,7 +2309,7 @@ var ts;
function getEmitModuleKind(compilerOptions) {
return typeof compilerOptions.module === "number" ?
compilerOptions.module :
- getEmitScriptTarget(compilerOptions) === 2 /* ES6 */ ? ts.ModuleKind.ES6 : ts.ModuleKind.CommonJS;
+ getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? ts.ModuleKind.ES2015 : ts.ModuleKind.CommonJS;
}
ts.getEmitModuleKind = getEmitModuleKind;
/* @internal */
@@ -2617,7 +2657,7 @@ var ts;
function replaceWildcardCharacter(match, singleAsteriskRegexFragment) {
return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match;
}
- function getFileMatcherPatterns(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {
+ function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {
path = normalizePath(path);
currentDirectory = normalizePath(currentDirectory);
var absolutePath = combinePaths(currentDirectory, path);
@@ -2632,7 +2672,7 @@ var ts;
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, getFileSystemEntries) {
path = normalizePath(path);
currentDirectory = normalizePath(currentDirectory);
- var patterns = getFileMatcherPatterns(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
+ var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
var regexFlag = useCaseSensitiveFileNames ? "" : "i";
var includeFileRegex = patterns.includeFilePattern && new RegExp(patterns.includeFilePattern, regexFlag);
var includeDirectoryRegex = patterns.includeDirectoryPattern && new RegExp(patterns.includeDirectoryPattern, regexFlag);
@@ -2847,10 +2887,10 @@ var ts;
this.name = name;
this.declarations = undefined;
}
- function Type(checker, flags) {
+ function Type(_checker, flags) {
this.flags = flags;
}
- function Signature(checker) {
+ function Signature() {
}
function Node(kind, pos, end) {
this.id = 0;
@@ -3230,7 +3270,7 @@ var ts;
}
var platform = _os.platform();
var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
- function readFile(fileName, encoding) {
+ function readFile(fileName, _encoding) {
if (!fileExists(fileName)) {
return undefined;
}
@@ -3462,7 +3502,7 @@ var ts;
args: ChakraHost.args,
useCaseSensitiveFileNames: !!ChakraHost.useCaseSensitiveFileNames,
write: ChakraHost.echo,
- readFile: function (path, encoding) {
+ readFile: function (path, _encoding) {
// encoding is automatically handled by the implementation in ChakraHost
return ChakraHost.readFile(path);
},
@@ -3480,9 +3520,9 @@ var ts;
getExecutingFilePath: function () { return ChakraHost.executingFile; },
getCurrentDirectory: function () { return ChakraHost.currentDirectory; },
getDirectories: ChakraHost.getDirectories,
- getEnvironmentVariable: ChakraHost.getEnvironmentVariable || (function (name) { return ""; }),
+ getEnvironmentVariable: ChakraHost.getEnvironmentVariable || (function () { return ""; }),
readDirectory: function (path, extensions, excludes, includes) {
- var pattern = ts.getFileMatcherPatterns(path, extensions, excludes, includes, !!ChakraHost.useCaseSensitiveFileNames, ChakraHost.currentDirectory);
+ var pattern = ts.getFileMatcherPatterns(path, excludes, includes, !!ChakraHost.useCaseSensitiveFileNames, ChakraHost.currentDirectory);
return ChakraHost.readDirectory(path, extensions, pattern.basePaths, pattern.excludePattern, pattern.includeFilePattern, pattern.includeDirectoryPattern);
},
exit: ChakraHost.quit,
@@ -4276,7 +4316,7 @@ var ts;
Binding_element_0_implicitly_has_an_1_type: { code: 7031, category: ts.DiagnosticCategory.Error, key: "Binding_element_0_implicitly_has_an_1_type_7031", message: "Binding element '{0}' implicitly has an '{1}' type." },
Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: { code: 7032, category: ts.DiagnosticCategory.Error, key: "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032", message: "Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation." },
Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: { code: 7033, category: ts.DiagnosticCategory.Error, key: "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033", message: "Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation." },
- Variable_0_implicitly_has_type_any_in_some_locations_where_its_type_cannot_be_determined: { code: 7034, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_type_any_in_some_locations_where_its_type_cannot_be_determined_7034", message: "Variable '{0}' implicitly has type 'any' in some locations where its type cannot be determined." },
+ Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: { code: 7034, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", message: "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined." },
You_cannot_rename_this_element: { code: 8000, category: ts.DiagnosticCategory.Error, key: "You_cannot_rename_this_element_8000", message: "You cannot rename this element." },
You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: ts.DiagnosticCategory.Error, key: "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", message: "You cannot rename elements that are defined in the standard TypeScript library." },
import_can_only_be_used_in_a_ts_file: { code: 8002, category: ts.DiagnosticCategory.Error, key: "import_can_only_be_used_in_a_ts_file_8002", message: "'import ... =' can only be used in a .ts file." },
@@ -4313,7 +4353,7 @@ var ts;
Remove_unused_identifiers: { code: 90004, category: ts.DiagnosticCategory.Message, key: "Remove_unused_identifiers_90004", message: "Remove unused identifiers" },
Implement_interface_on_reference: { code: 90005, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_reference_90005", message: "Implement interface on reference" },
Implement_interface_on_class: { code: 90006, category: ts.DiagnosticCategory.Message, key: "Implement_interface_on_class_90006", message: "Implement interface on class" },
- Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" }
+ Implement_inherited_abstract_class: { code: 90007, category: ts.DiagnosticCategory.Message, key: "Implement_inherited_abstract_class_90007", message: "Implement inherited abstract class" },
};
})(ts || (ts = {}));
///
@@ -4322,133 +4362,133 @@ var ts;
(function (ts) {
/* @internal */
function tokenIsIdentifierOrKeyword(token) {
- return token >= 69 /* Identifier */;
+ return token >= 70 /* Identifier */;
}
ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword;
var textToToken = ts.createMap({
- "abstract": 115 /* AbstractKeyword */,
- "any": 117 /* AnyKeyword */,
- "as": 116 /* AsKeyword */,
- "boolean": 120 /* BooleanKeyword */,
- "break": 70 /* BreakKeyword */,
- "case": 71 /* CaseKeyword */,
- "catch": 72 /* CatchKeyword */,
- "class": 73 /* ClassKeyword */,
- "continue": 75 /* ContinueKeyword */,
- "const": 74 /* ConstKeyword */,
- "constructor": 121 /* ConstructorKeyword */,
- "debugger": 76 /* DebuggerKeyword */,
- "declare": 122 /* DeclareKeyword */,
- "default": 77 /* DefaultKeyword */,
- "delete": 78 /* DeleteKeyword */,
- "do": 79 /* DoKeyword */,
- "else": 80 /* ElseKeyword */,
- "enum": 81 /* EnumKeyword */,
- "export": 82 /* ExportKeyword */,
- "extends": 83 /* ExtendsKeyword */,
- "false": 84 /* FalseKeyword */,
- "finally": 85 /* FinallyKeyword */,
- "for": 86 /* ForKeyword */,
- "from": 136 /* FromKeyword */,
- "function": 87 /* FunctionKeyword */,
- "get": 123 /* GetKeyword */,
- "if": 88 /* IfKeyword */,
- "implements": 106 /* ImplementsKeyword */,
- "import": 89 /* ImportKeyword */,
- "in": 90 /* InKeyword */,
- "instanceof": 91 /* InstanceOfKeyword */,
- "interface": 107 /* InterfaceKeyword */,
- "is": 124 /* IsKeyword */,
- "let": 108 /* LetKeyword */,
- "module": 125 /* ModuleKeyword */,
- "namespace": 126 /* NamespaceKeyword */,
- "never": 127 /* NeverKeyword */,
- "new": 92 /* NewKeyword */,
- "null": 93 /* NullKeyword */,
- "number": 130 /* NumberKeyword */,
- "package": 109 /* PackageKeyword */,
- "private": 110 /* PrivateKeyword */,
- "protected": 111 /* ProtectedKeyword */,
- "public": 112 /* PublicKeyword */,
- "readonly": 128 /* ReadonlyKeyword */,
- "require": 129 /* RequireKeyword */,
- "global": 137 /* GlobalKeyword */,
- "return": 94 /* ReturnKeyword */,
- "set": 131 /* SetKeyword */,
- "static": 113 /* StaticKeyword */,
- "string": 132 /* StringKeyword */,
- "super": 95 /* SuperKeyword */,
- "switch": 96 /* SwitchKeyword */,
- "symbol": 133 /* SymbolKeyword */,
- "this": 97 /* ThisKeyword */,
- "throw": 98 /* ThrowKeyword */,
- "true": 99 /* TrueKeyword */,
- "try": 100 /* TryKeyword */,
- "type": 134 /* TypeKeyword */,
- "typeof": 101 /* TypeOfKeyword */,
- "undefined": 135 /* UndefinedKeyword */,
- "var": 102 /* VarKeyword */,
- "void": 103 /* VoidKeyword */,
- "while": 104 /* WhileKeyword */,
- "with": 105 /* WithKeyword */,
- "yield": 114 /* YieldKeyword */,
- "async": 118 /* AsyncKeyword */,
- "await": 119 /* AwaitKeyword */,
- "of": 138 /* OfKeyword */,
- "{": 15 /* OpenBraceToken */,
- "}": 16 /* CloseBraceToken */,
- "(": 17 /* OpenParenToken */,
- ")": 18 /* CloseParenToken */,
- "[": 19 /* OpenBracketToken */,
- "]": 20 /* CloseBracketToken */,
- ".": 21 /* DotToken */,
- "...": 22 /* DotDotDotToken */,
- ";": 23 /* SemicolonToken */,
- ",": 24 /* CommaToken */,
- "<": 25 /* LessThanToken */,
- ">": 27 /* GreaterThanToken */,
- "<=": 28 /* LessThanEqualsToken */,
- ">=": 29 /* GreaterThanEqualsToken */,
- "==": 30 /* EqualsEqualsToken */,
- "!=": 31 /* ExclamationEqualsToken */,
- "===": 32 /* EqualsEqualsEqualsToken */,
- "!==": 33 /* ExclamationEqualsEqualsToken */,
- "=>": 34 /* EqualsGreaterThanToken */,
- "+": 35 /* PlusToken */,
- "-": 36 /* MinusToken */,
- "**": 38 /* AsteriskAsteriskToken */,
- "*": 37 /* AsteriskToken */,
- "/": 39 /* SlashToken */,
- "%": 40 /* PercentToken */,
- "++": 41 /* PlusPlusToken */,
- "--": 42 /* MinusMinusToken */,
- "<<": 43 /* LessThanLessThanToken */,
- "": 26 /* LessThanSlashToken */,
- ">>": 44 /* GreaterThanGreaterThanToken */,
- ">>>": 45 /* GreaterThanGreaterThanGreaterThanToken */,
- "&": 46 /* AmpersandToken */,
- "|": 47 /* BarToken */,
- "^": 48 /* CaretToken */,
- "!": 49 /* ExclamationToken */,
- "~": 50 /* TildeToken */,
- "&&": 51 /* AmpersandAmpersandToken */,
- "||": 52 /* BarBarToken */,
- "?": 53 /* QuestionToken */,
- ":": 54 /* ColonToken */,
- "=": 56 /* EqualsToken */,
- "+=": 57 /* PlusEqualsToken */,
- "-=": 58 /* MinusEqualsToken */,
- "*=": 59 /* AsteriskEqualsToken */,
- "**=": 60 /* AsteriskAsteriskEqualsToken */,
- "/=": 61 /* SlashEqualsToken */,
- "%=": 62 /* PercentEqualsToken */,
- "<<=": 63 /* LessThanLessThanEqualsToken */,
- ">>=": 64 /* GreaterThanGreaterThanEqualsToken */,
- ">>>=": 65 /* GreaterThanGreaterThanGreaterThanEqualsToken */,
- "&=": 66 /* AmpersandEqualsToken */,
- "|=": 67 /* BarEqualsToken */,
- "^=": 68 /* CaretEqualsToken */,
- "@": 55 /* AtToken */
+ "abstract": 116 /* AbstractKeyword */,
+ "any": 118 /* AnyKeyword */,
+ "as": 117 /* AsKeyword */,
+ "boolean": 121 /* BooleanKeyword */,
+ "break": 71 /* BreakKeyword */,
+ "case": 72 /* CaseKeyword */,
+ "catch": 73 /* CatchKeyword */,
+ "class": 74 /* ClassKeyword */,
+ "continue": 76 /* ContinueKeyword */,
+ "const": 75 /* ConstKeyword */,
+ "constructor": 122 /* ConstructorKeyword */,
+ "debugger": 77 /* DebuggerKeyword */,
+ "declare": 123 /* DeclareKeyword */,
+ "default": 78 /* DefaultKeyword */,
+ "delete": 79 /* DeleteKeyword */,
+ "do": 80 /* DoKeyword */,
+ "else": 81 /* ElseKeyword */,
+ "enum": 82 /* EnumKeyword */,
+ "export": 83 /* ExportKeyword */,
+ "extends": 84 /* ExtendsKeyword */,
+ "false": 85 /* FalseKeyword */,
+ "finally": 86 /* FinallyKeyword */,
+ "for": 87 /* ForKeyword */,
+ "from": 137 /* FromKeyword */,
+ "function": 88 /* FunctionKeyword */,
+ "get": 124 /* GetKeyword */,
+ "if": 89 /* IfKeyword */,
+ "implements": 107 /* ImplementsKeyword */,
+ "import": 90 /* ImportKeyword */,
+ "in": 91 /* InKeyword */,
+ "instanceof": 92 /* InstanceOfKeyword */,
+ "interface": 108 /* InterfaceKeyword */,
+ "is": 125 /* IsKeyword */,
+ "let": 109 /* LetKeyword */,
+ "module": 126 /* ModuleKeyword */,
+ "namespace": 127 /* NamespaceKeyword */,
+ "never": 128 /* NeverKeyword */,
+ "new": 93 /* NewKeyword */,
+ "null": 94 /* NullKeyword */,
+ "number": 131 /* NumberKeyword */,
+ "package": 110 /* PackageKeyword */,
+ "private": 111 /* PrivateKeyword */,
+ "protected": 112 /* ProtectedKeyword */,
+ "public": 113 /* PublicKeyword */,
+ "readonly": 129 /* ReadonlyKeyword */,
+ "require": 130 /* RequireKeyword */,
+ "global": 138 /* GlobalKeyword */,
+ "return": 95 /* ReturnKeyword */,
+ "set": 132 /* SetKeyword */,
+ "static": 114 /* StaticKeyword */,
+ "string": 133 /* StringKeyword */,
+ "super": 96 /* SuperKeyword */,
+ "switch": 97 /* SwitchKeyword */,
+ "symbol": 134 /* SymbolKeyword */,
+ "this": 98 /* ThisKeyword */,
+ "throw": 99 /* ThrowKeyword */,
+ "true": 100 /* TrueKeyword */,
+ "try": 101 /* TryKeyword */,
+ "type": 135 /* TypeKeyword */,
+ "typeof": 102 /* TypeOfKeyword */,
+ "undefined": 136 /* UndefinedKeyword */,
+ "var": 103 /* VarKeyword */,
+ "void": 104 /* VoidKeyword */,
+ "while": 105 /* WhileKeyword */,
+ "with": 106 /* WithKeyword */,
+ "yield": 115 /* YieldKeyword */,
+ "async": 119 /* AsyncKeyword */,
+ "await": 120 /* AwaitKeyword */,
+ "of": 139 /* OfKeyword */,
+ "{": 16 /* OpenBraceToken */,
+ "}": 17 /* CloseBraceToken */,
+ "(": 18 /* OpenParenToken */,
+ ")": 19 /* CloseParenToken */,
+ "[": 20 /* OpenBracketToken */,
+ "]": 21 /* CloseBracketToken */,
+ ".": 22 /* DotToken */,
+ "...": 23 /* DotDotDotToken */,
+ ";": 24 /* SemicolonToken */,
+ ",": 25 /* CommaToken */,
+ "<": 26 /* LessThanToken */,
+ ">": 28 /* GreaterThanToken */,
+ "<=": 29 /* LessThanEqualsToken */,
+ ">=": 30 /* GreaterThanEqualsToken */,
+ "==": 31 /* EqualsEqualsToken */,
+ "!=": 32 /* ExclamationEqualsToken */,
+ "===": 33 /* EqualsEqualsEqualsToken */,
+ "!==": 34 /* ExclamationEqualsEqualsToken */,
+ "=>": 35 /* EqualsGreaterThanToken */,
+ "+": 36 /* PlusToken */,
+ "-": 37 /* MinusToken */,
+ "**": 39 /* AsteriskAsteriskToken */,
+ "*": 38 /* AsteriskToken */,
+ "/": 40 /* SlashToken */,
+ "%": 41 /* PercentToken */,
+ "++": 42 /* PlusPlusToken */,
+ "--": 43 /* MinusMinusToken */,
+ "<<": 44 /* LessThanLessThanToken */,
+ "": 27 /* LessThanSlashToken */,
+ ">>": 45 /* GreaterThanGreaterThanToken */,
+ ">>>": 46 /* GreaterThanGreaterThanGreaterThanToken */,
+ "&": 47 /* AmpersandToken */,
+ "|": 48 /* BarToken */,
+ "^": 49 /* CaretToken */,
+ "!": 50 /* ExclamationToken */,
+ "~": 51 /* TildeToken */,
+ "&&": 52 /* AmpersandAmpersandToken */,
+ "||": 53 /* BarBarToken */,
+ "?": 54 /* QuestionToken */,
+ ":": 55 /* ColonToken */,
+ "=": 57 /* EqualsToken */,
+ "+=": 58 /* PlusEqualsToken */,
+ "-=": 59 /* MinusEqualsToken */,
+ "*=": 60 /* AsteriskEqualsToken */,
+ "**=": 61 /* AsteriskAsteriskEqualsToken */,
+ "/=": 62 /* SlashEqualsToken */,
+ "%=": 63 /* PercentEqualsToken */,
+ "<<=": 64 /* LessThanLessThanEqualsToken */,
+ ">>=": 65 /* GreaterThanGreaterThanEqualsToken */,
+ ">>>=": 66 /* GreaterThanGreaterThanGreaterThanEqualsToken */,
+ "&=": 67 /* AmpersandEqualsToken */,
+ "|=": 68 /* BarEqualsToken */,
+ "^=": 69 /* CaretEqualsToken */,
+ "@": 56 /* AtToken */,
});
/*
As per ECMAScript Language Specification 3th Edition, Section 7.6: Identifiers
@@ -4952,7 +4992,7 @@ var ts;
return iterateCommentRanges(/*reduce*/ true, text, pos, /*trailing*/ true, cb, state, initial);
}
ts.reduceEachTrailingCommentRange = reduceEachTrailingCommentRange;
- function appendCommentRange(pos, end, kind, hasTrailingNewLine, state, comments) {
+ function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments) {
if (!comments) {
comments = [];
}
@@ -5025,8 +5065,8 @@ var ts;
getTokenValue: function () { return tokenValue; },
hasExtendedUnicodeEscape: function () { return hasExtendedUnicodeEscape; },
hasPrecedingLineBreak: function () { return precedingLineBreak; },
- isIdentifier: function () { return token === 69 /* Identifier */ || token > 105 /* LastReservedWord */; },
- isReservedWord: function () { return token >= 70 /* FirstReservedWord */ && token <= 105 /* LastReservedWord */; },
+ isIdentifier: function () { return token === 70 /* Identifier */ || token > 106 /* LastReservedWord */; },
+ isReservedWord: function () { return token >= 71 /* FirstReservedWord */ && token <= 106 /* LastReservedWord */; },
isUnterminated: function () { return tokenIsUnterminated; },
reScanGreaterToken: reScanGreaterToken,
reScanSlashToken: reScanSlashToken,
@@ -5045,7 +5085,7 @@ var ts;
setTextPos: setTextPos,
tryScan: tryScan,
lookAhead: lookAhead,
- scanRange: scanRange
+ scanRange: scanRange,
};
function error(message, length) {
if (onError) {
@@ -5174,7 +5214,7 @@ var ts;
contents += text.substring(start, pos);
tokenIsUnterminated = true;
error(ts.Diagnostics.Unterminated_template_literal);
- resultingToken = startedWithBacktick ? 11 /* NoSubstitutionTemplateLiteral */ : 14 /* TemplateTail */;
+ resultingToken = startedWithBacktick ? 12 /* NoSubstitutionTemplateLiteral */ : 15 /* TemplateTail */;
break;
}
var currChar = text.charCodeAt(pos);
@@ -5182,14 +5222,14 @@ var ts;
if (currChar === 96 /* backtick */) {
contents += text.substring(start, pos);
pos++;
- resultingToken = startedWithBacktick ? 11 /* NoSubstitutionTemplateLiteral */ : 14 /* TemplateTail */;
+ resultingToken = startedWithBacktick ? 12 /* NoSubstitutionTemplateLiteral */ : 15 /* TemplateTail */;
break;
}
// '${'
if (currChar === 36 /* $ */ && pos + 1 < end && text.charCodeAt(pos + 1) === 123 /* openBrace */) {
contents += text.substring(start, pos);
pos += 2;
- resultingToken = startedWithBacktick ? 12 /* TemplateHead */ : 13 /* TemplateMiddle */;
+ resultingToken = startedWithBacktick ? 13 /* TemplateHead */ : 14 /* TemplateMiddle */;
break;
}
// Escape character
@@ -5367,7 +5407,7 @@ var ts;
return token = textToToken[tokenValue];
}
}
- return token = 69 /* Identifier */;
+ return token = 70 /* Identifier */;
}
function scanBinaryOrOctalDigits(base) {
ts.Debug.assert(base === 2 || base === 8, "Expected either base 2 or base 8");
@@ -5447,12 +5487,12 @@ var ts;
case 33 /* exclamation */:
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
if (text.charCodeAt(pos + 2) === 61 /* equals */) {
- return pos += 3, token = 33 /* ExclamationEqualsEqualsToken */;
+ return pos += 3, token = 34 /* ExclamationEqualsEqualsToken */;
}
- return pos += 2, token = 31 /* ExclamationEqualsToken */;
+ return pos += 2, token = 32 /* ExclamationEqualsToken */;
}
pos++;
- return token = 49 /* ExclamationToken */;
+ return token = 50 /* ExclamationToken */;
case 34 /* doubleQuote */:
case 39 /* singleQuote */:
tokenValue = scanString();
@@ -5461,68 +5501,68 @@ var ts;
return token = scanTemplateAndSetTokenValue();
case 37 /* percent */:
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 62 /* PercentEqualsToken */;
+ return pos += 2, token = 63 /* PercentEqualsToken */;
}
pos++;
- return token = 40 /* PercentToken */;
+ return token = 41 /* PercentToken */;
case 38 /* ampersand */:
if (text.charCodeAt(pos + 1) === 38 /* ampersand */) {
- return pos += 2, token = 51 /* AmpersandAmpersandToken */;
+ return pos += 2, token = 52 /* AmpersandAmpersandToken */;
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 66 /* AmpersandEqualsToken */;
+ return pos += 2, token = 67 /* AmpersandEqualsToken */;
}
pos++;
- return token = 46 /* AmpersandToken */;
+ return token = 47 /* AmpersandToken */;
case 40 /* openParen */:
pos++;
- return token = 17 /* OpenParenToken */;
+ return token = 18 /* OpenParenToken */;
case 41 /* closeParen */:
pos++;
- return token = 18 /* CloseParenToken */;
+ return token = 19 /* CloseParenToken */;
case 42 /* asterisk */:
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 59 /* AsteriskEqualsToken */;
+ return pos += 2, token = 60 /* AsteriskEqualsToken */;
}
if (text.charCodeAt(pos + 1) === 42 /* asterisk */) {
if (text.charCodeAt(pos + 2) === 61 /* equals */) {
- return pos += 3, token = 60 /* AsteriskAsteriskEqualsToken */;
+ return pos += 3, token = 61 /* AsteriskAsteriskEqualsToken */;
}
- return pos += 2, token = 38 /* AsteriskAsteriskToken */;
+ return pos += 2, token = 39 /* AsteriskAsteriskToken */;
}
pos++;
- return token = 37 /* AsteriskToken */;
+ return token = 38 /* AsteriskToken */;
case 43 /* plus */:
if (text.charCodeAt(pos + 1) === 43 /* plus */) {
- return pos += 2, token = 41 /* PlusPlusToken */;
+ return pos += 2, token = 42 /* PlusPlusToken */;
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 57 /* PlusEqualsToken */;
+ return pos += 2, token = 58 /* PlusEqualsToken */;
}
pos++;
- return token = 35 /* PlusToken */;
+ return token = 36 /* PlusToken */;
case 44 /* comma */:
pos++;
- return token = 24 /* CommaToken */;
+ return token = 25 /* CommaToken */;
case 45 /* minus */:
if (text.charCodeAt(pos + 1) === 45 /* minus */) {
- return pos += 2, token = 42 /* MinusMinusToken */;
+ return pos += 2, token = 43 /* MinusMinusToken */;
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 58 /* MinusEqualsToken */;
+ return pos += 2, token = 59 /* MinusEqualsToken */;
}
pos++;
- return token = 36 /* MinusToken */;
+ return token = 37 /* MinusToken */;
case 46 /* dot */:
if (isDigit(text.charCodeAt(pos + 1))) {
tokenValue = scanNumber();
return token = 8 /* NumericLiteral */;
}
if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) {
- return pos += 3, token = 22 /* DotDotDotToken */;
+ return pos += 3, token = 23 /* DotDotDotToken */;
}
pos++;
- return token = 21 /* DotToken */;
+ return token = 22 /* DotToken */;
case 47 /* slash */:
// Single-line comment
if (text.charCodeAt(pos + 1) === 47 /* slash */) {
@@ -5568,10 +5608,10 @@ var ts;
}
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 61 /* SlashEqualsToken */;
+ return pos += 2, token = 62 /* SlashEqualsToken */;
}
pos++;
- return token = 39 /* SlashToken */;
+ return token = 40 /* SlashToken */;
case 48 /* _0 */:
if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) {
pos += 2;
@@ -5624,10 +5664,10 @@ var ts;
return token = 8 /* NumericLiteral */;
case 58 /* colon */:
pos++;
- return token = 54 /* ColonToken */;
+ return token = 55 /* ColonToken */;
case 59 /* semicolon */:
pos++;
- return token = 23 /* SemicolonToken */;
+ return token = 24 /* SemicolonToken */;
case 60 /* lessThan */:
if (isConflictMarkerTrivia(text, pos)) {
pos = scanConflictMarkerTrivia(text, pos, error);
@@ -5640,20 +5680,20 @@ var ts;
}
if (text.charCodeAt(pos + 1) === 60 /* lessThan */) {
if (text.charCodeAt(pos + 2) === 61 /* equals */) {
- return pos += 3, token = 63 /* LessThanLessThanEqualsToken */;
+ return pos += 3, token = 64 /* LessThanLessThanEqualsToken */;
}
- return pos += 2, token = 43 /* LessThanLessThanToken */;
+ return pos += 2, token = 44 /* LessThanLessThanToken */;
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 28 /* LessThanEqualsToken */;
+ return pos += 2, token = 29 /* LessThanEqualsToken */;
}
if (languageVariant === 1 /* JSX */ &&
text.charCodeAt(pos + 1) === 47 /* slash */ &&
text.charCodeAt(pos + 2) !== 42 /* asterisk */) {
- return pos += 2, token = 26 /* LessThanSlashToken */;
+ return pos += 2, token = 27 /* LessThanSlashToken */;
}
pos++;
- return token = 25 /* LessThanToken */;
+ return token = 26 /* LessThanToken */;
case 61 /* equals */:
if (isConflictMarkerTrivia(text, pos)) {
pos = scanConflictMarkerTrivia(text, pos, error);
@@ -5666,15 +5706,15 @@ var ts;
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
if (text.charCodeAt(pos + 2) === 61 /* equals */) {
- return pos += 3, token = 32 /* EqualsEqualsEqualsToken */;
+ return pos += 3, token = 33 /* EqualsEqualsEqualsToken */;
}
- return pos += 2, token = 30 /* EqualsEqualsToken */;
+ return pos += 2, token = 31 /* EqualsEqualsToken */;
}
if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) {
- return pos += 2, token = 34 /* EqualsGreaterThanToken */;
+ return pos += 2, token = 35 /* EqualsGreaterThanToken */;
}
pos++;
- return token = 56 /* EqualsToken */;
+ return token = 57 /* EqualsToken */;
case 62 /* greaterThan */:
if (isConflictMarkerTrivia(text, pos)) {
pos = scanConflictMarkerTrivia(text, pos, error);
@@ -5686,43 +5726,43 @@ var ts;
}
}
pos++;
- return token = 27 /* GreaterThanToken */;
+ return token = 28 /* GreaterThanToken */;
case 63 /* question */:
pos++;
- return token = 53 /* QuestionToken */;
+ return token = 54 /* QuestionToken */;
case 91 /* openBracket */:
pos++;
- return token = 19 /* OpenBracketToken */;
+ return token = 20 /* OpenBracketToken */;
case 93 /* closeBracket */:
pos++;
- return token = 20 /* CloseBracketToken */;
+ return token = 21 /* CloseBracketToken */;
case 94 /* caret */:
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 68 /* CaretEqualsToken */;
+ return pos += 2, token = 69 /* CaretEqualsToken */;
}
pos++;
- return token = 48 /* CaretToken */;
+ return token = 49 /* CaretToken */;
case 123 /* openBrace */:
pos++;
- return token = 15 /* OpenBraceToken */;
+ return token = 16 /* OpenBraceToken */;
case 124 /* bar */:
if (text.charCodeAt(pos + 1) === 124 /* bar */) {
- return pos += 2, token = 52 /* BarBarToken */;
+ return pos += 2, token = 53 /* BarBarToken */;
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 67 /* BarEqualsToken */;
+ return pos += 2, token = 68 /* BarEqualsToken */;
}
pos++;
- return token = 47 /* BarToken */;
+ return token = 48 /* BarToken */;
case 125 /* closeBrace */:
pos++;
- return token = 16 /* CloseBraceToken */;
+ return token = 17 /* CloseBraceToken */;
case 126 /* tilde */:
pos++;
- return token = 50 /* TildeToken */;
+ return token = 51 /* TildeToken */;
case 64 /* at */:
pos++;
- return token = 55 /* AtToken */;
+ return token = 56 /* AtToken */;
case 92 /* backslash */:
var cookedChar = peekUnicodeEscape();
if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) {
@@ -5760,29 +5800,29 @@ var ts;
}
}
function reScanGreaterToken() {
- if (token === 27 /* GreaterThanToken */) {
+ if (token === 28 /* GreaterThanToken */) {
if (text.charCodeAt(pos) === 62 /* greaterThan */) {
if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) {
if (text.charCodeAt(pos + 2) === 61 /* equals */) {
- return pos += 3, token = 65 /* GreaterThanGreaterThanGreaterThanEqualsToken */;
+ return pos += 3, token = 66 /* GreaterThanGreaterThanGreaterThanEqualsToken */;
}
- return pos += 2, token = 45 /* GreaterThanGreaterThanGreaterThanToken */;
+ return pos += 2, token = 46 /* GreaterThanGreaterThanGreaterThanToken */;
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 64 /* GreaterThanGreaterThanEqualsToken */;
+ return pos += 2, token = 65 /* GreaterThanGreaterThanEqualsToken */;
}
pos++;
- return token = 44 /* GreaterThanGreaterThanToken */;
+ return token = 45 /* GreaterThanGreaterThanToken */;
}
if (text.charCodeAt(pos) === 61 /* equals */) {
pos++;
- return token = 29 /* GreaterThanEqualsToken */;
+ return token = 30 /* GreaterThanEqualsToken */;
}
}
return token;
}
function reScanSlashToken() {
- if (token === 39 /* SlashToken */ || token === 61 /* SlashEqualsToken */) {
+ if (token === 40 /* SlashToken */ || token === 62 /* SlashEqualsToken */) {
var p = tokenPos + 1;
var inEscape = false;
var inCharacterClass = false;
@@ -5827,7 +5867,7 @@ var ts;
}
pos = p;
tokenValue = text.substring(tokenPos, pos);
- token = 10 /* RegularExpressionLiteral */;
+ token = 11 /* RegularExpressionLiteral */;
}
return token;
}
@@ -5835,7 +5875,7 @@ var ts;
* Unconditionally back up and scan a template expression portion.
*/
function reScanTemplateToken() {
- ts.Debug.assert(token === 16 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'");
+ ts.Debug.assert(token === 17 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'");
pos = tokenPos;
return token = scanTemplateAndSetTokenValue();
}
@@ -5852,14 +5892,14 @@ var ts;
if (char === 60 /* lessThan */) {
if (text.charCodeAt(pos + 1) === 47 /* slash */) {
pos += 2;
- return token = 26 /* LessThanSlashToken */;
+ return token = 27 /* LessThanSlashToken */;
}
pos++;
- return token = 25 /* LessThanToken */;
+ return token = 26 /* LessThanToken */;
}
if (char === 123 /* openBrace */) {
pos++;
- return token = 15 /* OpenBraceToken */;
+ return token = 16 /* OpenBraceToken */;
}
while (pos < end) {
pos++;
@@ -5868,7 +5908,7 @@ var ts;
break;
}
}
- return token = 244 /* JsxText */;
+ return token = 10 /* JsxText */;
}
// Scans a JSX identifier; these differ from normal identifiers in that
// they allow dashes
@@ -5918,39 +5958,39 @@ var ts;
return token = 5 /* WhitespaceTrivia */;
case 64 /* at */:
pos++;
- return token = 55 /* AtToken */;
+ return token = 56 /* AtToken */;
case 10 /* lineFeed */:
case 13 /* carriageReturn */:
pos++;
return token = 4 /* NewLineTrivia */;
case 42 /* asterisk */:
pos++;
- return token = 37 /* AsteriskToken */;
+ return token = 38 /* AsteriskToken */;
case 123 /* openBrace */:
pos++;
- return token = 15 /* OpenBraceToken */;
+ return token = 16 /* OpenBraceToken */;
case 125 /* closeBrace */:
pos++;
- return token = 16 /* CloseBraceToken */;
+ return token = 17 /* CloseBraceToken */;
case 91 /* openBracket */:
pos++;
- return token = 19 /* OpenBracketToken */;
+ return token = 20 /* OpenBracketToken */;
case 93 /* closeBracket */:
pos++;
- return token = 20 /* CloseBracketToken */;
+ return token = 21 /* CloseBracketToken */;
case 61 /* equals */:
pos++;
- return token = 56 /* EqualsToken */;
+ return token = 57 /* EqualsToken */;
case 44 /* comma */:
pos++;
- return token = 24 /* CommaToken */;
+ return token = 25 /* CommaToken */;
}
- if (isIdentifierStart(ch, 2 /* Latest */)) {
+ if (isIdentifierStart(ch, 4 /* Latest */)) {
pos++;
- while (isIdentifierPart(text.charCodeAt(pos), 2 /* Latest */) && pos < end) {
+ while (isIdentifierPart(text.charCodeAt(pos), 4 /* Latest */) && pos < end) {
pos++;
}
- return token = 69 /* Identifier */;
+ return token = 70 /* Identifier */;
}
else {
return pos += 1, token = 0 /* Unknown */;
@@ -6189,11 +6229,11 @@ var ts;
ts.getSourceFileOfNode = getSourceFileOfNode;
function isStatementWithLocals(node) {
switch (node.kind) {
- case 199 /* Block */:
- case 227 /* CaseBlock */:
- case 206 /* ForStatement */:
- case 207 /* ForInStatement */:
- case 208 /* ForOfStatement */:
+ case 200 /* Block */:
+ case 228 /* CaseBlock */:
+ case 207 /* ForStatement */:
+ case 208 /* ForInStatement */:
+ case 209 /* ForOfStatement */:
return true;
}
return false;
@@ -6329,14 +6369,14 @@ var ts;
function getLiteralText(node, sourceFile, languageVersion) {
// Any template literal or string literal with an extended escape
// (e.g. "\u{0067}") will need to be downleveled as a escaped string literal.
- if (languageVersion < 2 /* ES6 */ && (isTemplateLiteralKind(node.kind) || node.hasExtendedUnicodeEscape)) {
+ if (languageVersion < 2 /* ES2015 */ && (isTemplateLiteralKind(node.kind) || node.hasExtendedUnicodeEscape)) {
return getQuotedEscapedLiteralText('"', node.text, '"');
}
// If we don't need to downlevel and we can reach the original source text using
// the node's parent reference, then simply get the text as it was originally written.
if (!nodeIsSynthesized(node) && node.parent) {
var text = getSourceTextOfNodeFromSourceFile(sourceFile, node);
- if (languageVersion < 2 /* ES6 */ && isBinaryOrOctalIntegerLiteral(node, text)) {
+ if (languageVersion < 2 /* ES2015 */ && isBinaryOrOctalIntegerLiteral(node, text)) {
return node.text;
}
return text;
@@ -6346,13 +6386,13 @@ var ts;
switch (node.kind) {
case 9 /* StringLiteral */:
return getQuotedEscapedLiteralText('"', node.text, '"');
- case 11 /* NoSubstitutionTemplateLiteral */:
+ case 12 /* NoSubstitutionTemplateLiteral */:
return getQuotedEscapedLiteralText("`", node.text, "`");
- case 12 /* TemplateHead */:
+ case 13 /* TemplateHead */:
return getQuotedEscapedLiteralText("`", node.text, "${");
- case 13 /* TemplateMiddle */:
+ case 14 /* TemplateMiddle */:
return getQuotedEscapedLiteralText("}", node.text, "${");
- case 14 /* TemplateTail */:
+ case 15 /* TemplateTail */:
return getQuotedEscapedLiteralText("}", node.text, "`");
case 8 /* NumericLiteral */:
return node.text;
@@ -6398,7 +6438,7 @@ var ts;
}
ts.isBlockOrCatchScoped = isBlockOrCatchScoped;
function isAmbientModule(node) {
- return node && node.kind === 225 /* ModuleDeclaration */ &&
+ return node && node.kind === 226 /* ModuleDeclaration */ &&
(node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node));
}
ts.isAmbientModule = isAmbientModule;
@@ -6408,11 +6448,11 @@ var ts;
ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;
function isShorthandAmbientModule(node) {
// The only kind of module that can be missing a body is a shorthand ambient module.
- return node.kind === 225 /* ModuleDeclaration */ && (!node.body);
+ return node.kind === 226 /* ModuleDeclaration */ && (!node.body);
}
function isBlockScopedContainerTopLevel(node) {
return node.kind === 256 /* SourceFile */ ||
- node.kind === 225 /* ModuleDeclaration */ ||
+ node.kind === 226 /* ModuleDeclaration */ ||
isFunctionLike(node);
}
ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel;
@@ -6430,7 +6470,7 @@ var ts;
switch (node.parent.kind) {
case 256 /* SourceFile */:
return ts.isExternalModule(node.parent);
- case 226 /* ModuleBlock */:
+ case 227 /* ModuleBlock */:
return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent);
}
return false;
@@ -6439,21 +6479,21 @@ var ts;
function isBlockScope(node, parentNode) {
switch (node.kind) {
case 256 /* SourceFile */:
- case 227 /* CaseBlock */:
+ case 228 /* CaseBlock */:
case 252 /* CatchClause */:
- case 225 /* ModuleDeclaration */:
- case 206 /* ForStatement */:
- case 207 /* ForInStatement */:
- case 208 /* ForOfStatement */:
- case 148 /* Constructor */:
- case 147 /* MethodDeclaration */:
- case 149 /* GetAccessor */:
- case 150 /* SetAccessor */:
- case 220 /* FunctionDeclaration */:
- case 179 /* FunctionExpression */:
- case 180 /* ArrowFunction */:
+ case 226 /* ModuleDeclaration */:
+ case 207 /* ForStatement */:
+ case 208 /* ForInStatement */:
+ case 209 /* ForOfStatement */:
+ case 149 /* Constructor */:
+ case 148 /* MethodDeclaration */:
+ case 150 /* GetAccessor */:
+ case 151 /* SetAccessor */:
+ case 221 /* FunctionDeclaration */:
+ case 180 /* FunctionExpression */:
+ case 181 /* ArrowFunction */:
return true;
- case 199 /* Block */:
+ case 200 /* Block */:
// function block is not considered block-scope container
// see comment in binder.ts: bind(...), case for SyntaxKind.Block
return parentNode && !isFunctionLike(parentNode);
@@ -6475,7 +6515,7 @@ var ts;
ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer;
function isCatchClauseVariableDeclaration(declaration) {
return declaration &&
- declaration.kind === 218 /* VariableDeclaration */ &&
+ declaration.kind === 219 /* VariableDeclaration */ &&
declaration.parent &&
declaration.parent.kind === 252 /* CatchClause */;
}
@@ -6515,7 +6555,7 @@ var ts;
ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition;
function getErrorSpanForArrowFunction(sourceFile, node) {
var pos = ts.skipTrivia(sourceFile.text, node.pos);
- if (node.body && node.body.kind === 199 /* Block */) {
+ if (node.body && node.body.kind === 200 /* Block */) {
var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line;
var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line;
if (startLine < endLine) {
@@ -6538,23 +6578,23 @@ var ts;
return getSpanOfTokenAtPosition(sourceFile, pos_1);
// This list is a work in progress. Add missing node kinds to improve their error
// spans.
- case 218 /* VariableDeclaration */:
- case 169 /* BindingElement */:
- case 221 /* ClassDeclaration */:
- case 192 /* ClassExpression */:
- case 222 /* InterfaceDeclaration */:
- case 225 /* ModuleDeclaration */:
- case 224 /* EnumDeclaration */:
+ case 219 /* VariableDeclaration */:
+ case 170 /* BindingElement */:
+ case 222 /* ClassDeclaration */:
+ case 193 /* ClassExpression */:
+ case 223 /* InterfaceDeclaration */:
+ case 226 /* ModuleDeclaration */:
+ case 225 /* EnumDeclaration */:
case 255 /* EnumMember */:
- case 220 /* FunctionDeclaration */:
- case 179 /* FunctionExpression */:
- case 147 /* MethodDeclaration */:
- case 149 /* GetAccessor */:
- case 150 /* SetAccessor */:
- case 223 /* TypeAliasDeclaration */:
+ case 221 /* FunctionDeclaration */:
+ case 180 /* FunctionExpression */:
+ case 148 /* MethodDeclaration */:
+ case 150 /* GetAccessor */:
+ case 151 /* SetAccessor */:
+ case 224 /* TypeAliasDeclaration */:
errorNode = node.name;
break;
- case 180 /* ArrowFunction */:
+ case 181 /* ArrowFunction */:
return getErrorSpanForArrowFunction(sourceFile, node);
}
if (errorNode === undefined) {
@@ -6577,7 +6617,7 @@ var ts;
}
ts.isDeclarationFile = isDeclarationFile;
function isConstEnumDeclaration(node) {
- return node.kind === 224 /* EnumDeclaration */ && isConst(node);
+ return node.kind === 225 /* EnumDeclaration */ && isConst(node);
}
ts.isConstEnumDeclaration = isConstEnumDeclaration;
function isConst(node) {
@@ -6590,11 +6630,11 @@ var ts;
}
ts.isLet = isLet;
function isSuperCall(n) {
- return n.kind === 174 /* CallExpression */ && n.expression.kind === 95 /* SuperKeyword */;
+ return n.kind === 175 /* CallExpression */ && n.expression.kind === 96 /* SuperKeyword */;
}
ts.isSuperCall = isSuperCall;
function isPrologueDirective(node) {
- return node.kind === 202 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */;
+ return node.kind === 203 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */;
}
ts.isPrologueDirective = isPrologueDirective;
function getLeadingCommentRangesOfNode(node, sourceFileOfNode) {
@@ -6610,10 +6650,10 @@ var ts;
}
ts.getJsDocComments = getJsDocComments;
function getJsDocCommentsFromText(node, text) {
- var commentRanges = (node.kind === 142 /* Parameter */ ||
- node.kind === 141 /* TypeParameter */ ||
- node.kind === 179 /* FunctionExpression */ ||
- node.kind === 180 /* ArrowFunction */) ?
+ var commentRanges = (node.kind === 143 /* Parameter */ ||
+ node.kind === 142 /* TypeParameter */ ||
+ node.kind === 180 /* FunctionExpression */ ||
+ node.kind === 181 /* ArrowFunction */) ?
ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
getLeadingCommentRangesOfNodeFromText(node, text);
return ts.filter(commentRanges, isJsDocComment);
@@ -6629,39 +6669,39 @@ var ts;
ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/;
ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/;
function isPartOfTypeNode(node) {
- if (154 /* FirstTypeNode */ <= node.kind && node.kind <= 166 /* LastTypeNode */) {
+ if (155 /* FirstTypeNode */ <= node.kind && node.kind <= 167 /* LastTypeNode */) {
return true;
}
switch (node.kind) {
- case 117 /* AnyKeyword */:
- case 130 /* NumberKeyword */:
- case 132 /* StringKeyword */:
- case 120 /* BooleanKeyword */:
- case 133 /* SymbolKeyword */:
- case 135 /* UndefinedKeyword */:
- case 127 /* NeverKeyword */:
+ case 118 /* AnyKeyword */:
+ case 131 /* NumberKeyword */:
+ case 133 /* StringKeyword */:
+ case 121 /* BooleanKeyword */:
+ case 134 /* SymbolKeyword */:
+ case 136 /* UndefinedKeyword */:
+ case 128 /* NeverKeyword */:
return true;
- case 103 /* VoidKeyword */:
- return node.parent.kind !== 183 /* VoidExpression */;
- case 194 /* ExpressionWithTypeArguments */:
+ case 104 /* VoidKeyword */:
+ return node.parent.kind !== 184 /* VoidExpression */;
+ case 195 /* ExpressionWithTypeArguments */:
return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
// Identifiers and qualified names may be type nodes, depending on their context. Climb
// above them to find the lowest container
- case 69 /* Identifier */:
+ case 70 /* Identifier */:
// If the identifier is the RHS of a qualified name, then it's a type iff its parent is.
- if (node.parent.kind === 139 /* QualifiedName */ && node.parent.right === node) {
+ if (node.parent.kind === 140 /* QualifiedName */ && node.parent.right === node) {
node = node.parent;
}
- else if (node.parent.kind === 172 /* PropertyAccessExpression */ && node.parent.name === node) {
+ else if (node.parent.kind === 173 /* PropertyAccessExpression */ && node.parent.name === node) {
node = node.parent;
}
// At this point, node is either a qualified name or an identifier
- ts.Debug.assert(node.kind === 69 /* Identifier */ || node.kind === 139 /* QualifiedName */ || node.kind === 172 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
- case 139 /* QualifiedName */:
- case 172 /* PropertyAccessExpression */:
- case 97 /* ThisKeyword */:
+ ts.Debug.assert(node.kind === 70 /* Identifier */ || node.kind === 140 /* QualifiedName */ || node.kind === 173 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
+ case 140 /* QualifiedName */:
+ case 173 /* PropertyAccessExpression */:
+ case 98 /* ThisKeyword */:
var parent_1 = node.parent;
- if (parent_1.kind === 158 /* TypeQuery */) {
+ if (parent_1.kind === 159 /* TypeQuery */) {
return false;
}
// Do not recursively call isPartOfTypeNode on the parent. In the example:
@@ -6670,38 +6710,38 @@ var ts;
//
// Calling isPartOfTypeNode would consider the qualified name A.B a type node. Only C or
// A.B.C is a type node.
- if (154 /* FirstTypeNode */ <= parent_1.kind && parent_1.kind <= 166 /* LastTypeNode */) {
+ if (155 /* FirstTypeNode */ <= parent_1.kind && parent_1.kind <= 167 /* LastTypeNode */) {
return true;
}
switch (parent_1.kind) {
- case 194 /* ExpressionWithTypeArguments */:
+ case 195 /* ExpressionWithTypeArguments */:
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1);
- case 141 /* TypeParameter */:
+ case 142 /* TypeParameter */:
return node === parent_1.constraint;
- case 145 /* PropertyDeclaration */:
- case 144 /* PropertySignature */:
- case 142 /* Parameter */:
- case 218 /* VariableDeclaration */:
+ case 146 /* PropertyDeclaration */:
+ case 145 /* PropertySignature */:
+ case 143 /* Parameter */:
+ case 219 /* VariableDeclaration */:
return node === parent_1.type;
- case 220 /* FunctionDeclaration */:
- case 179 /* FunctionExpression */:
- case 180 /* ArrowFunction */:
- case 148 /* Constructor */:
- case 147 /* MethodDeclaration */:
- case 146 /* MethodSignature */:
- case 149 /* GetAccessor */:
- case 150 /* SetAccessor */:
+ case 221 /* FunctionDeclaration */:
+ case 180 /* FunctionExpression */:
+ case 181 /* ArrowFunction */:
+ case 149 /* Constructor */:
+ case 148 /* MethodDeclaration */:
+ case 147 /* MethodSignature */:
+ case 150 /* GetAccessor */:
+ case 151 /* SetAccessor */:
return node === parent_1.type;
- case 151 /* CallSignature */:
- case 152 /* ConstructSignature */:
- case 153 /* IndexSignature */:
+ case 152 /* CallSignature */:
+ case 153 /* ConstructSignature */:
+ case 154 /* IndexSignature */:
return node === parent_1.type;
- case 177 /* TypeAssertionExpression */:
+ case 178 /* TypeAssertionExpression */:
return node === parent_1.type;
- case 174 /* CallExpression */:
- case 175 /* NewExpression */:
+ case 175 /* CallExpression */:
+ case 176 /* NewExpression */:
return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0;
- case 176 /* TaggedTemplateExpression */:
+ case 177 /* TaggedTemplateExpression */:
// TODO (drosen): TaggedTemplateExpressions may eventually support type arguments.
return false;
}
@@ -6715,22 +6755,22 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 211 /* ReturnStatement */:
+ case 212 /* ReturnStatement */:
return visitor(node);
- case 227 /* CaseBlock */:
- case 199 /* Block */:
- case 203 /* IfStatement */:
- case 204 /* DoStatement */:
- case 205 /* WhileStatement */:
- case 206 /* ForStatement */:
- case 207 /* ForInStatement */:
- case 208 /* ForOfStatement */:
- case 212 /* WithStatement */:
- case 213 /* SwitchStatement */:
+ case 228 /* CaseBlock */:
+ case 200 /* Block */:
+ case 204 /* IfStatement */:
+ case 205 /* DoStatement */:
+ case 206 /* WhileStatement */:
+ case 207 /* ForStatement */:
+ case 208 /* ForInStatement */:
+ case 209 /* ForOfStatement */:
+ case 213 /* WithStatement */:
+ case 214 /* SwitchStatement */:
case 249 /* CaseClause */:
case 250 /* DefaultClause */:
- case 214 /* LabeledStatement */:
- case 216 /* TryStatement */:
+ case 215 /* LabeledStatement */:
+ case 217 /* TryStatement */:
case 252 /* CatchClause */:
return ts.forEachChild(node, traverse);
}
@@ -6741,18 +6781,18 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 190 /* YieldExpression */:
+ case 191 /* YieldExpression */:
visitor(node);
var operand = node.expression;
if (operand) {
traverse(operand);
}
- case 224 /* EnumDeclaration */:
- case 222 /* InterfaceDeclaration */:
- case 225 /* ModuleDeclaration */:
- case 223 /* TypeAliasDeclaration */:
- case 221 /* ClassDeclaration */:
- case 192 /* ClassExpression */:
+ case 225 /* EnumDeclaration */:
+ case 223 /* InterfaceDeclaration */:
+ case 226 /* ModuleDeclaration */:
+ case 224 /* TypeAliasDeclaration */:
+ case 222 /* ClassDeclaration */:
+ case 193 /* ClassExpression */:
// These are not allowed inside a generator now, but eventually they may be allowed
// as local types. Regardless, any yield statements contained within them should be
// skipped in this traversal.
@@ -6760,7 +6800,7 @@ var ts;
default:
if (isFunctionLike(node)) {
var name_5 = node.name;
- if (name_5 && name_5.kind === 140 /* ComputedPropertyName */) {
+ if (name_5 && name_5.kind === 141 /* ComputedPropertyName */) {
// Note that we will not include methods/accessors of a class because they would require
// first descending into the class. This is by design.
traverse(name_5.expression);
@@ -6779,14 +6819,14 @@ var ts;
function isVariableLike(node) {
if (node) {
switch (node.kind) {
- case 169 /* BindingElement */:
+ case 170 /* BindingElement */:
case 255 /* EnumMember */:
- case 142 /* Parameter */:
+ case 143 /* Parameter */:
case 253 /* PropertyAssignment */:
- case 145 /* PropertyDeclaration */:
- case 144 /* PropertySignature */:
+ case 146 /* PropertyDeclaration */:
+ case 145 /* PropertySignature */:
case 254 /* ShorthandPropertyAssignment */:
- case 218 /* VariableDeclaration */:
+ case 219 /* VariableDeclaration */:
return true;
}
}
@@ -6794,11 +6834,11 @@ var ts;
}
ts.isVariableLike = isVariableLike;
function isAccessor(node) {
- return node && (node.kind === 149 /* GetAccessor */ || node.kind === 150 /* SetAccessor */);
+ return node && (node.kind === 150 /* GetAccessor */ || node.kind === 151 /* SetAccessor */);
}
ts.isAccessor = isAccessor;
function isClassLike(node) {
- return node && (node.kind === 221 /* ClassDeclaration */ || node.kind === 192 /* ClassExpression */);
+ return node && (node.kind === 222 /* ClassDeclaration */ || node.kind === 193 /* ClassExpression */);
}
ts.isClassLike = isClassLike;
function isFunctionLike(node) {
@@ -6807,19 +6847,19 @@ var ts;
ts.isFunctionLike = isFunctionLike;
function isFunctionLikeKind(kind) {
switch (kind) {
- case 148 /* Constructor */:
- case 179 /* FunctionExpression */:
- case 220 /* FunctionDeclaration */:
- case 180 /* ArrowFunction */:
- case 147 /* MethodDeclaration */:
- case 146 /* MethodSignature */:
- case 149 /* GetAccessor */:
- case 150 /* SetAccessor */:
- case 151 /* CallSignature */:
- case 152 /* ConstructSignature */:
- case 153 /* IndexSignature */:
- case 156 /* FunctionType */:
- case 157 /* ConstructorType */:
+ case 149 /* Constructor */:
+ case 180 /* FunctionExpression */:
+ case 221 /* FunctionDeclaration */:
+ case 181 /* ArrowFunction */:
+ case 148 /* MethodDeclaration */:
+ case 147 /* MethodSignature */:
+ case 150 /* GetAccessor */:
+ case 151 /* SetAccessor */:
+ case 152 /* CallSignature */:
+ case 153 /* ConstructSignature */:
+ case 154 /* IndexSignature */:
+ case 157 /* FunctionType */:
+ case 158 /* ConstructorType */:
return true;
}
return false;
@@ -6827,13 +6867,13 @@ var ts;
ts.isFunctionLikeKind = isFunctionLikeKind;
function introducesArgumentsExoticObject(node) {
switch (node.kind) {
- case 147 /* MethodDeclaration */:
- case 146 /* MethodSignature */:
- case 148 /* Constructor */:
- case 149 /* GetAccessor */:
- case 150 /* SetAccessor */:
- case 220 /* FunctionDeclaration */:
- case 179 /* FunctionExpression */:
+ case 148 /* MethodDeclaration */:
+ case 147 /* MethodSignature */:
+ case 149 /* Constructor */:
+ case 150 /* GetAccessor */:
+ case 151 /* SetAccessor */:
+ case 221 /* FunctionDeclaration */:
+ case 180 /* FunctionExpression */:
return true;
}
return false;
@@ -6841,30 +6881,30 @@ var ts;
ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject;
function isIterationStatement(node, lookInLabeledStatements) {
switch (node.kind) {
- case 206 /* ForStatement */:
- case 207 /* ForInStatement */:
- case 208 /* ForOfStatement */:
- case 204 /* DoStatement */:
- case 205 /* WhileStatement */:
+ case 207 /* ForStatement */:
+ case 208 /* ForInStatement */:
+ case 209 /* ForOfStatement */:
+ case 205 /* DoStatement */:
+ case 206 /* WhileStatement */:
return true;
- case 214 /* LabeledStatement */:
+ case 215 /* LabeledStatement */:
return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements);
}
return false;
}
ts.isIterationStatement = isIterationStatement;
function isFunctionBlock(node) {
- return node && node.kind === 199 /* Block */ && isFunctionLike(node.parent);
+ return node && node.kind === 200 /* Block */ && isFunctionLike(node.parent);
}
ts.isFunctionBlock = isFunctionBlock;
function isObjectLiteralMethod(node) {
- return node && node.kind === 147 /* MethodDeclaration */ && node.parent.kind === 171 /* ObjectLiteralExpression */;
+ return node && node.kind === 148 /* MethodDeclaration */ && node.parent.kind === 172 /* ObjectLiteralExpression */;
}
ts.isObjectLiteralMethod = isObjectLiteralMethod;
function isObjectLiteralOrClassExpressionMethod(node) {
- return node.kind === 147 /* MethodDeclaration */ &&
- (node.parent.kind === 171 /* ObjectLiteralExpression */ ||
- node.parent.kind === 192 /* ClassExpression */);
+ return node.kind === 148 /* MethodDeclaration */ &&
+ (node.parent.kind === 172 /* ObjectLiteralExpression */ ||
+ node.parent.kind === 193 /* ClassExpression */);
}
ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod;
function isIdentifierTypePredicate(predicate) {
@@ -6900,7 +6940,7 @@ var ts;
return undefined;
}
switch (node.kind) {
- case 140 /* ComputedPropertyName */:
+ case 141 /* ComputedPropertyName */:
// If the grandparent node is an object literal (as opposed to a class),
// then the computed property is not a 'this' container.
// A computed property name in a class needs to be a this container
@@ -6915,9 +6955,9 @@ var ts;
// the *body* of the container.
node = node.parent;
break;
- case 143 /* Decorator */:
+ case 144 /* Decorator */:
// Decorators are always applied outside of the body of a class or method.
- if (node.parent.kind === 142 /* Parameter */ && isClassElement(node.parent.parent)) {
+ if (node.parent.kind === 143 /* Parameter */ && isClassElement(node.parent.parent)) {
// If the decorator's parent is a Parameter, we resolve the this container from
// the grandparent class declaration.
node = node.parent.parent;
@@ -6928,25 +6968,25 @@ var ts;
node = node.parent;
}
break;
- case 180 /* ArrowFunction */:
+ case 181 /* ArrowFunction */:
if (!includeArrowFunctions) {
continue;
}
// Fall through
- case 220 /* FunctionDeclaration */:
- case 179 /* FunctionExpression */:
- case 225 /* ModuleDeclaration */:
- case 145 /* PropertyDeclaration */:
- case 144 /* PropertySignature */:
- case 147 /* MethodDeclaration */:
- case 146 /* MethodSignature */:
- case 148 /* Constructor */:
- case 149 /* GetAccessor */:
- case 150 /* SetAccessor */:
- case 151 /* CallSignature */:
- case 152 /* ConstructSignature */:
- case 153 /* IndexSignature */:
- case 224 /* EnumDeclaration */:
+ case 221 /* FunctionDeclaration */:
+ case 180 /* FunctionExpression */:
+ case 226 /* ModuleDeclaration */:
+ case 146 /* PropertyDeclaration */:
+ case 145 /* PropertySignature */:
+ case 148 /* MethodDeclaration */:
+ case 147 /* MethodSignature */:
+ case 149 /* Constructor */:
+ case 150 /* GetAccessor */:
+ case 151 /* SetAccessor */:
+ case 152 /* CallSignature */:
+ case 153 /* ConstructSignature */:
+ case 154 /* IndexSignature */:
+ case 225 /* EnumDeclaration */:
case 256 /* SourceFile */:
return node;
}
@@ -6968,26 +7008,26 @@ var ts;
return node;
}
switch (node.kind) {
- case 140 /* ComputedPropertyName */:
+ case 141 /* ComputedPropertyName */:
node = node.parent;
break;
- case 220 /* FunctionDeclaration */:
- case 179 /* FunctionExpression */:
- case 180 /* ArrowFunction */:
+ case 221 /* FunctionDeclaration */:
+ case 180 /* FunctionExpression */:
+ case 181 /* ArrowFunction */:
if (!stopOnFunctions) {
continue;
}
- case 145 /* PropertyDeclaration */:
- case 144 /* PropertySignature */:
- case 147 /* MethodDeclaration */:
- case 146 /* MethodSignature */:
- case 148 /* Constructor */:
- case 149 /* GetAccessor */:
- case 150 /* SetAccessor */:
+ case 146 /* PropertyDeclaration */:
+ case 145 /* PropertySignature */:
+ case 148 /* MethodDeclaration */:
+ case 147 /* MethodSignature */:
+ case 149 /* Constructor */:
+ case 150 /* GetAccessor */:
+ case 151 /* SetAccessor */:
return node;
- case 143 /* Decorator */:
+ case 144 /* Decorator */:
// Decorators are always applied outside of the body of a class or method.
- if (node.parent.kind === 142 /* Parameter */ && isClassElement(node.parent.parent)) {
+ if (node.parent.kind === 143 /* Parameter */ && isClassElement(node.parent.parent)) {
// If the decorator's parent is a Parameter, we resolve the this container from
// the grandparent class declaration.
node = node.parent.parent;
@@ -7003,14 +7043,14 @@ var ts;
}
ts.getSuperContainer = getSuperContainer;
function getImmediatelyInvokedFunctionExpression(func) {
- if (func.kind === 179 /* FunctionExpression */ || func.kind === 180 /* ArrowFunction */) {
+ if (func.kind === 180 /* FunctionExpression */ || func.kind === 181 /* ArrowFunction */) {
var prev = func;
var parent_2 = func.parent;
- while (parent_2.kind === 178 /* ParenthesizedExpression */) {
+ while (parent_2.kind === 179 /* ParenthesizedExpression */) {
prev = parent_2;
parent_2 = parent_2.parent;
}
- if (parent_2.kind === 174 /* CallExpression */ && parent_2.expression === prev) {
+ if (parent_2.kind === 175 /* CallExpression */ && parent_2.expression === prev) {
return parent_2;
}
}
@@ -7021,20 +7061,20 @@ var ts;
*/
function isSuperProperty(node) {
var kind = node.kind;
- return (kind === 172 /* PropertyAccessExpression */ || kind === 173 /* ElementAccessExpression */)
- && node.expression.kind === 95 /* SuperKeyword */;
+ return (kind === 173 /* PropertyAccessExpression */ || kind === 174 /* ElementAccessExpression */)
+ && node.expression.kind === 96 /* SuperKeyword */;
}
ts.isSuperProperty = isSuperProperty;
function getEntityNameFromTypeNode(node) {
if (node) {
switch (node.kind) {
- case 155 /* TypeReference */:
+ case 156 /* TypeReference */:
return node.typeName;
- case 194 /* ExpressionWithTypeArguments */:
+ case 195 /* ExpressionWithTypeArguments */:
ts.Debug.assert(isEntityNameExpression(node.expression));
return node.expression;
- case 69 /* Identifier */:
- case 139 /* QualifiedName */:
+ case 70 /* Identifier */:
+ case 140 /* QualifiedName */:
return node;
}
}
@@ -7043,10 +7083,10 @@ var ts;
ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode;
function isCallLikeExpression(node) {
switch (node.kind) {
- case 174 /* CallExpression */:
- case 175 /* NewExpression */:
- case 176 /* TaggedTemplateExpression */:
- case 143 /* Decorator */:
+ case 175 /* CallExpression */:
+ case 176 /* NewExpression */:
+ case 177 /* TaggedTemplateExpression */:
+ case 144 /* Decorator */:
return true;
default:
return false;
@@ -7054,7 +7094,7 @@ var ts;
}
ts.isCallLikeExpression = isCallLikeExpression;
function getInvokedExpression(node) {
- if (node.kind === 176 /* TaggedTemplateExpression */) {
+ if (node.kind === 177 /* TaggedTemplateExpression */) {
return node.tag;
}
// Will either be a CallExpression, NewExpression, or Decorator.
@@ -7063,25 +7103,25 @@ var ts;
ts.getInvokedExpression = getInvokedExpression;
function nodeCanBeDecorated(node) {
switch (node.kind) {
- case 221 /* ClassDeclaration */:
+ case 222 /* ClassDeclaration */:
// classes are valid targets
return true;
- case 145 /* PropertyDeclaration */:
+ case 146 /* PropertyDeclaration */:
// property declarations are valid if their parent is a class declaration.
- return node.parent.kind === 221 /* ClassDeclaration */;
- case 149 /* GetAccessor */:
- case 150 /* SetAccessor */:
- case 147 /* MethodDeclaration */:
+ return node.parent.kind === 222 /* ClassDeclaration */;
+ case 150 /* GetAccessor */:
+ case 151 /* SetAccessor */:
+ case 148 /* MethodDeclaration */:
// if this method has a body and its parent is a class declaration, this is a valid target.
return node.body !== undefined
- && node.parent.kind === 221 /* ClassDeclaration */;
- case 142 /* Parameter */:
+ && node.parent.kind === 222 /* ClassDeclaration */;
+ case 143 /* Parameter */:
// if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target;
return node.parent.body !== undefined
- && (node.parent.kind === 148 /* Constructor */
- || node.parent.kind === 147 /* MethodDeclaration */
- || node.parent.kind === 150 /* SetAccessor */)
- && node.parent.parent.kind === 221 /* ClassDeclaration */;
+ && (node.parent.kind === 149 /* Constructor */
+ || node.parent.kind === 148 /* MethodDeclaration */
+ || node.parent.kind === 151 /* SetAccessor */)
+ && node.parent.parent.kind === 222 /* ClassDeclaration */;
}
return false;
}
@@ -7097,18 +7137,18 @@ var ts;
ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated;
function childIsDecorated(node) {
switch (node.kind) {
- case 221 /* ClassDeclaration */:
+ case 222 /* ClassDeclaration */:
return ts.forEach(node.members, nodeOrChildIsDecorated);
- case 147 /* MethodDeclaration */:
- case 150 /* SetAccessor */:
+ case 148 /* MethodDeclaration */:
+ case 151 /* SetAccessor */:
return ts.forEach(node.parameters, nodeIsDecorated);
}
}
ts.childIsDecorated = childIsDecorated;
function isJSXTagName(node) {
var parent = node.parent;
- if (parent.kind === 243 /* JsxOpeningElement */ ||
- parent.kind === 242 /* JsxSelfClosingElement */ ||
+ if (parent.kind === 244 /* JsxOpeningElement */ ||
+ parent.kind === 243 /* JsxSelfClosingElement */ ||
parent.kind === 245 /* JsxClosingElement */) {
return parent.tagName === node;
}
@@ -7117,98 +7157,98 @@ var ts;
ts.isJSXTagName = isJSXTagName;
function isPartOfExpression(node) {
switch (node.kind) {
- case 97 /* ThisKeyword */:
- case 95 /* SuperKeyword */:
- case 93 /* NullKeyword */:
- case 99 /* TrueKeyword */:
- case 84 /* FalseKeyword */:
- case 10 /* RegularExpressionLiteral */:
- case 170 /* ArrayLiteralExpression */:
- case 171 /* ObjectLiteralExpression */:
- case 172 /* PropertyAccessExpression */:
- case 173 /* ElementAccessExpression */:
- case 174 /* CallExpression */:
- case 175 /* NewExpression */:
- case 176 /* TaggedTemplateExpression */:
- case 195 /* AsExpression */:
- case 177 /* TypeAssertionExpression */:
- case 196 /* NonNullExpression */:
- case 178 /* ParenthesizedExpression */:
- case 179 /* FunctionExpression */:
- case 192 /* ClassExpression */:
- case 180 /* ArrowFunction */:
- case 183 /* VoidExpression */:
- case 181 /* DeleteExpression */:
- case 182 /* TypeOfExpression */:
- case 185 /* PrefixUnaryExpression */:
- case 186 /* PostfixUnaryExpression */:
- case 187 /* BinaryExpression */:
- case 188 /* ConditionalExpression */:
- case 191 /* SpreadElementExpression */:
- case 189 /* TemplateExpression */:
- case 11 /* NoSubstitutionTemplateLiteral */:
- case 193 /* OmittedExpression */:
- case 241 /* JsxElement */:
- case 242 /* JsxSelfClosingElement */:
- case 190 /* YieldExpression */:
- case 184 /* AwaitExpression */:
+ case 98 /* ThisKeyword */:
+ case 96 /* SuperKeyword */:
+ case 94 /* NullKeyword */:
+ case 100 /* TrueKeyword */:
+ case 85 /* FalseKeyword */:
+ case 11 /* RegularExpressionLiteral */:
+ case 171 /* ArrayLiteralExpression */:
+ case 172 /* ObjectLiteralExpression */:
+ case 173 /* PropertyAccessExpression */:
+ case 174 /* ElementAccessExpression */:
+ case 175 /* CallExpression */:
+ case 176 /* NewExpression */:
+ case 177 /* TaggedTemplateExpression */:
+ case 196 /* AsExpression */:
+ case 178 /* TypeAssertionExpression */:
+ case 197 /* NonNullExpression */:
+ case 179 /* ParenthesizedExpression */:
+ case 180 /* FunctionExpression */:
+ case 193 /* ClassExpression */:
+ case 181 /* ArrowFunction */:
+ case 184 /* VoidExpression */:
+ case 182 /* DeleteExpression */:
+ case 183 /* TypeOfExpression */:
+ case 186 /* PrefixUnaryExpression */:
+ case 187 /* PostfixUnaryExpression */:
+ case 188 /* BinaryExpression */:
+ case 189 /* ConditionalExpression */:
+ case 192 /* SpreadElementExpression */:
+ case 190 /* TemplateExpression */:
+ case 12 /* NoSubstitutionTemplateLiteral */:
+ case 194 /* OmittedExpression */:
+ case 242 /* JsxElement */:
+ case 243 /* JsxSelfClosingElement */:
+ case 191 /* YieldExpression */:
+ case 185 /* AwaitExpression */:
return true;
- case 139 /* QualifiedName */:
- while (node.parent.kind === 139 /* QualifiedName */) {
+ case 140 /* QualifiedName */:
+ while (node.parent.kind === 140 /* QualifiedName */) {
node = node.parent;
}
- return node.parent.kind === 158 /* TypeQuery */ || isJSXTagName(node);
- case 69 /* Identifier */:
- if (node.parent.kind === 158 /* TypeQuery */ || isJSXTagName(node)) {
+ return node.parent.kind === 159 /* TypeQuery */ || isJSXTagName(node);
+ case 70 /* Identifier */:
+ if (node.parent.kind === 159 /* TypeQuery */ || isJSXTagName(node)) {
return true;
}
// fall through
case 8 /* NumericLiteral */:
case 9 /* StringLiteral */:
- case 97 /* ThisKeyword */:
+ case 98 /* ThisKeyword */:
var parent_3 = node.parent;
switch (parent_3.kind) {
- case 218 /* VariableDeclaration */:
- case 142 /* Parameter */:
- case 145 /* PropertyDeclaration */:
- case 144 /* PropertySignature */:
+ case 219 /* VariableDeclaration */:
+ case 143 /* Parameter */:
+ case 146 /* PropertyDeclaration */:
+ case 145 /* PropertySignature */:
case 255 /* EnumMember */:
case 253 /* PropertyAssignment */:
- case 169 /* BindingElement */:
+ case 170 /* BindingElement */:
return parent_3.initializer === node;
- case 202 /* ExpressionStatement */:
- case 203 /* IfStatement */:
- case 204 /* DoStatement */:
- case 205 /* WhileStatement */:
- case 211 /* ReturnStatement */:
- case 212 /* WithStatement */:
- case 213 /* SwitchStatement */:
+ case 203 /* ExpressionStatement */:
+ case 204 /* IfStatement */:
+ case 205 /* DoStatement */:
+ case 206 /* WhileStatement */:
+ case 212 /* ReturnStatement */:
+ case 213 /* WithStatement */:
+ case 214 /* SwitchStatement */:
case 249 /* CaseClause */:
- case 215 /* ThrowStatement */:
- case 213 /* SwitchStatement */:
+ case 216 /* ThrowStatement */:
+ case 214 /* SwitchStatement */:
return parent_3.expression === node;
- case 206 /* ForStatement */:
+ case 207 /* ForStatement */:
var forStatement = parent_3;
- return (forStatement.initializer === node && forStatement.initializer.kind !== 219 /* VariableDeclarationList */) ||
+ return (forStatement.initializer === node && forStatement.initializer.kind !== 220 /* VariableDeclarationList */) ||
forStatement.condition === node ||
forStatement.incrementor === node;
- case 207 /* ForInStatement */:
- case 208 /* ForOfStatement */:
+ case 208 /* ForInStatement */:
+ case 209 /* ForOfStatement */:
var forInStatement = parent_3;
- return (forInStatement.initializer === node && forInStatement.initializer.kind !== 219 /* VariableDeclarationList */) ||
+ return (forInStatement.initializer === node && forInStatement.initializer.kind !== 220 /* VariableDeclarationList */) ||
forInStatement.expression === node;
- case 177 /* TypeAssertionExpression */:
- case 195 /* AsExpression */:
+ case 178 /* TypeAssertionExpression */:
+ case 196 /* AsExpression */:
return node === parent_3.expression;
- case 197 /* TemplateSpan */:
+ case 198 /* TemplateSpan */:
return node === parent_3.expression;
- case 140 /* ComputedPropertyName */:
+ case 141 /* ComputedPropertyName */:
return node === parent_3.expression;
- case 143 /* Decorator */:
+ case 144 /* Decorator */:
case 248 /* JsxExpression */:
case 247 /* JsxSpreadAttribute */:
return true;
- case 194 /* ExpressionWithTypeArguments */:
+ case 195 /* ExpressionWithTypeArguments */:
return parent_3.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_3);
default:
if (isPartOfExpression(parent_3)) {
@@ -7226,7 +7266,7 @@ var ts;
}
ts.isInstantiatedModule = isInstantiatedModule;
function isExternalModuleImportEqualsDeclaration(node) {
- return node.kind === 229 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 240 /* ExternalModuleReference */;
+ return node.kind === 230 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 241 /* ExternalModuleReference */;
}
ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration;
function getExternalModuleImportEqualsDeclarationExpression(node) {
@@ -7235,7 +7275,7 @@ var ts;
}
ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
function isInternalModuleImportEqualsDeclaration(node) {
- return node.kind === 229 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 240 /* ExternalModuleReference */;
+ return node.kind === 230 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 241 /* ExternalModuleReference */;
}
ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration;
function isSourceFileJavaScript(file) {
@@ -7253,8 +7293,8 @@ var ts;
*/
function isRequireCall(expression, checkArgumentIsStringLiteral) {
// of the form 'require("name")'
- var isRequire = expression.kind === 174 /* CallExpression */ &&
- expression.expression.kind === 69 /* Identifier */ &&
+ var isRequire = expression.kind === 175 /* CallExpression */ &&
+ expression.expression.kind === 70 /* Identifier */ &&
expression.expression.text === "require" &&
expression.arguments.length === 1;
return isRequire && (!checkArgumentIsStringLiteral || expression.arguments[0].kind === 9 /* StringLiteral */);
@@ -7269,9 +7309,9 @@ var ts;
* This function does not test if the node is in a JavaScript file or not.
*/
function isDeclarationOfFunctionExpression(s) {
- if (s.valueDeclaration && s.valueDeclaration.kind === 218 /* VariableDeclaration */) {
+ if (s.valueDeclaration && s.valueDeclaration.kind === 219 /* VariableDeclaration */) {
var declaration = s.valueDeclaration;
- return declaration.initializer && declaration.initializer.kind === 179 /* FunctionExpression */;
+ return declaration.initializer && declaration.initializer.kind === 180 /* FunctionExpression */;
}
return false;
}
@@ -7282,15 +7322,15 @@ var ts;
if (!isInJavaScriptFile(expression)) {
return 0 /* None */;
}
- if (expression.kind !== 187 /* BinaryExpression */) {
+ if (expression.kind !== 188 /* BinaryExpression */) {
return 0 /* None */;
}
var expr = expression;
- if (expr.operatorToken.kind !== 56 /* EqualsToken */ || expr.left.kind !== 172 /* PropertyAccessExpression */) {
+ if (expr.operatorToken.kind !== 57 /* EqualsToken */ || expr.left.kind !== 173 /* PropertyAccessExpression */) {
return 0 /* None */;
}
var lhs = expr.left;
- if (lhs.expression.kind === 69 /* Identifier */) {
+ if (lhs.expression.kind === 70 /* Identifier */) {
var lhsId = lhs.expression;
if (lhsId.text === "exports") {
// exports.name = expr
@@ -7301,13 +7341,13 @@ var ts;
return 2 /* ModuleExports */;
}
}
- else if (lhs.expression.kind === 97 /* ThisKeyword */) {
+ else if (lhs.expression.kind === 98 /* ThisKeyword */) {
return 4 /* ThisProperty */;
}
- else if (lhs.expression.kind === 172 /* PropertyAccessExpression */) {
+ else if (lhs.expression.kind === 173 /* PropertyAccessExpression */) {
// chained dot, e.g. x.y.z = expr; this var is the 'x.y' part
var innerPropertyAccess = lhs.expression;
- if (innerPropertyAccess.expression.kind === 69 /* Identifier */) {
+ if (innerPropertyAccess.expression.kind === 70 /* Identifier */) {
// module.exports.name = expr
var innerPropertyAccessIdentifier = innerPropertyAccess.expression;
if (innerPropertyAccessIdentifier.text === "module" && innerPropertyAccess.name.text === "exports") {
@@ -7322,35 +7362,35 @@ var ts;
}
ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind;
function getExternalModuleName(node) {
- if (node.kind === 230 /* ImportDeclaration */) {
+ if (node.kind === 231 /* ImportDeclaration */) {
return node.moduleSpecifier;
}
- if (node.kind === 229 /* ImportEqualsDeclaration */) {
+ if (node.kind === 230 /* ImportEqualsDeclaration */) {
var reference = node.moduleReference;
- if (reference.kind === 240 /* ExternalModuleReference */) {
+ if (reference.kind === 241 /* ExternalModuleReference */) {
return reference.expression;
}
}
- if (node.kind === 236 /* ExportDeclaration */) {
+ if (node.kind === 237 /* ExportDeclaration */) {
return node.moduleSpecifier;
}
- if (node.kind === 225 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) {
+ if (node.kind === 226 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) {
return node.name;
}
}
ts.getExternalModuleName = getExternalModuleName;
function getNamespaceDeclarationNode(node) {
- if (node.kind === 229 /* ImportEqualsDeclaration */) {
+ if (node.kind === 230 /* ImportEqualsDeclaration */) {
return node;
}
var importClause = node.importClause;
- if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 232 /* NamespaceImport */) {
+ if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 233 /* NamespaceImport */) {
return importClause.namedBindings;
}
}
ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode;
function isDefaultImport(node) {
- return node.kind === 230 /* ImportDeclaration */
+ return node.kind === 231 /* ImportDeclaration */
&& node.importClause
&& !!node.importClause.name;
}
@@ -7358,13 +7398,13 @@ var ts;
function hasQuestionToken(node) {
if (node) {
switch (node.kind) {
- case 142 /* Parameter */:
- case 147 /* MethodDeclaration */:
- case 146 /* MethodSignature */:
+ case 143 /* Parameter */:
+ case 148 /* MethodDeclaration */:
+ case 147 /* MethodSignature */:
case 254 /* ShorthandPropertyAssignment */:
case 253 /* PropertyAssignment */:
- case 145 /* PropertyDeclaration */:
- case 144 /* PropertySignature */:
+ case 146 /* PropertyDeclaration */:
+ case 145 /* PropertySignature */:
return node.questionToken !== undefined;
}
}
@@ -7434,25 +7474,25 @@ var ts;
// var x = function(name) { return name.length; }
var isInitializerOfVariableDeclarationInStatement = isVariableLike(node.parent) &&
(node.parent).initializer === node &&
- node.parent.parent.parent.kind === 200 /* VariableStatement */;
+ node.parent.parent.parent.kind === 201 /* VariableStatement */;
var isVariableOfVariableDeclarationStatement = isVariableLike(node) &&
- node.parent.parent.kind === 200 /* VariableStatement */;
+ node.parent.parent.kind === 201 /* VariableStatement */;
var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? node.parent.parent.parent :
isVariableOfVariableDeclarationStatement ? node.parent.parent :
undefined;
if (variableStatementNode) {
result = append(result, getJSDocs(variableStatementNode, checkParentVariableStatement, getDocs, getTags));
}
- if (node.kind === 225 /* ModuleDeclaration */ &&
- node.parent && node.parent.kind === 225 /* ModuleDeclaration */) {
+ if (node.kind === 226 /* ModuleDeclaration */ &&
+ node.parent && node.parent.kind === 226 /* ModuleDeclaration */) {
result = append(result, getJSDocs(node.parent, checkParentVariableStatement, getDocs, getTags));
}
// Also recognize when the node is the RHS of an assignment expression
var parent_4 = node.parent;
var isSourceOfAssignmentExpressionStatement = parent_4 && parent_4.parent &&
- parent_4.kind === 187 /* BinaryExpression */ &&
- parent_4.operatorToken.kind === 56 /* EqualsToken */ &&
- parent_4.parent.kind === 202 /* ExpressionStatement */;
+ parent_4.kind === 188 /* BinaryExpression */ &&
+ parent_4.operatorToken.kind === 57 /* EqualsToken */ &&
+ parent_4.parent.kind === 203 /* ExpressionStatement */;
if (isSourceOfAssignmentExpressionStatement) {
result = append(result, getJSDocs(parent_4.parent, checkParentVariableStatement, getDocs, getTags));
}
@@ -7461,7 +7501,7 @@ var ts;
result = append(result, getJSDocs(parent_4, checkParentVariableStatement, getDocs, getTags));
}
// Pull parameter comments from declaring function as well
- if (node.kind === 142 /* Parameter */) {
+ if (node.kind === 143 /* Parameter */) {
var paramTags = getJSDocParameterTag(node, checkParentVariableStatement);
if (paramTags) {
result = append(result, getTags(paramTags));
@@ -7492,7 +7532,7 @@ var ts;
return [paramTags[i]];
}
}
- else if (param.name.kind === 69 /* Identifier */) {
+ else if (param.name.kind === 70 /* Identifier */) {
var name_6 = param.name.text;
var paramTags = ts.filter(tags, function (tag) { return tag.kind === 275 /* JSDocParameterTag */ && tag.parameterName.text === name_6; });
if (paramTags) {
@@ -7518,7 +7558,7 @@ var ts;
}
ts.getJSDocTemplateTag = getJSDocTemplateTag;
function getCorrespondingJSDocParameterTag(parameter) {
- if (parameter.name && parameter.name.kind === 69 /* Identifier */) {
+ if (parameter.name && parameter.name.kind === 70 /* Identifier */) {
// If it's a parameter, see if the parent has a jsdoc comment with an @param
// annotation.
var parameterName = parameter.name.text;
@@ -7568,12 +7608,12 @@ var ts;
// assignment in an object literal that is an assignment target, or if it is parented by an array literal that is
// an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ p: a}] = xxx'.
function isAssignmentTarget(node) {
- while (node.parent.kind === 178 /* ParenthesizedExpression */) {
+ while (node.parent.kind === 179 /* ParenthesizedExpression */) {
node = node.parent;
}
while (true) {
var parent_5 = node.parent;
- if (parent_5.kind === 170 /* ArrayLiteralExpression */ || parent_5.kind === 191 /* SpreadElementExpression */) {
+ if (parent_5.kind === 171 /* ArrayLiteralExpression */ || parent_5.kind === 192 /* SpreadElementExpression */) {
node = parent_5;
continue;
}
@@ -7581,10 +7621,10 @@ var ts;
node = parent_5.parent;
continue;
}
- return parent_5.kind === 187 /* BinaryExpression */ &&
+ return parent_5.kind === 188 /* BinaryExpression */ &&
isAssignmentOperator(parent_5.operatorToken.kind) &&
parent_5.left === node ||
- (parent_5.kind === 207 /* ForInStatement */ || parent_5.kind === 208 /* ForOfStatement */) &&
+ (parent_5.kind === 208 /* ForInStatement */ || parent_5.kind === 209 /* ForOfStatement */) &&
parent_5.initializer === node;
}
}
@@ -7610,11 +7650,11 @@ var ts;
ts.isInAmbientContext = isInAmbientContext;
// True if the given identifier, string literal, or number literal is the name of a declaration node
function isDeclarationName(name) {
- if (name.kind !== 69 /* Identifier */ && name.kind !== 9 /* StringLiteral */ && name.kind !== 8 /* NumericLiteral */) {
+ if (name.kind !== 70 /* Identifier */ && name.kind !== 9 /* StringLiteral */ && name.kind !== 8 /* NumericLiteral */) {
return false;
}
var parent = name.parent;
- if (parent.kind === 234 /* ImportSpecifier */ || parent.kind === 238 /* ExportSpecifier */) {
+ if (parent.kind === 235 /* ImportSpecifier */ || parent.kind === 239 /* ExportSpecifier */) {
if (parent.propertyName) {
return true;
}
@@ -7627,7 +7667,7 @@ var ts;
ts.isDeclarationName = isDeclarationName;
function isLiteralComputedPropertyDeclarationName(node) {
return (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) &&
- node.parent.kind === 140 /* ComputedPropertyName */ &&
+ node.parent.kind === 141 /* ComputedPropertyName */ &&
isDeclaration(node.parent.parent);
}
ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName;
@@ -7635,31 +7675,31 @@ var ts;
function isIdentifierName(node) {
var parent = node.parent;
switch (parent.kind) {
- case 145 /* PropertyDeclaration */:
- case 144 /* PropertySignature */:
- case 147 /* MethodDeclaration */:
- case 146 /* MethodSignature */:
- case 149 /* GetAccessor */:
- case 150 /* SetAccessor */:
+ case 146 /* PropertyDeclaration */:
+ case 145 /* PropertySignature */:
+ case 148 /* MethodDeclaration */:
+ case 147 /* MethodSignature */:
+ case 150 /* GetAccessor */:
+ case 151 /* SetAccessor */:
case 255 /* EnumMember */:
case 253 /* PropertyAssignment */:
- case 172 /* PropertyAccessExpression */:
+ case 173 /* PropertyAccessExpression */:
// Name in member declaration or property name in property access
return parent.name === node;
- case 139 /* QualifiedName */:
+ case 140 /* QualifiedName */:
// Name on right hand side of dot in a type query
if (parent.right === node) {
- while (parent.kind === 139 /* QualifiedName */) {
+ while (parent.kind === 140 /* QualifiedName */) {
parent = parent.parent;
}
- return parent.kind === 158 /* TypeQuery */;
+ return parent.kind === 159 /* TypeQuery */;
}
return false;
- case 169 /* BindingElement */:
- case 234 /* ImportSpecifier */:
+ case 170 /* BindingElement */:
+ case 235 /* ImportSpecifier */:
// Property name in binding element or import specifier
return parent.propertyName === node;
- case 238 /* ExportSpecifier */:
+ case 239 /* ExportSpecifier */:
// Any name in an export specifier
return true;
}
@@ -7675,13 +7715,13 @@ var ts;
// export =
// export default
function isAliasSymbolDeclaration(node) {
- return node.kind === 229 /* ImportEqualsDeclaration */ ||
- node.kind === 228 /* NamespaceExportDeclaration */ ||
- node.kind === 231 /* ImportClause */ && !!node.name ||
- node.kind === 232 /* NamespaceImport */ ||
- node.kind === 234 /* ImportSpecifier */ ||
- node.kind === 238 /* ExportSpecifier */ ||
- node.kind === 235 /* ExportAssignment */ && exportAssignmentIsAlias(node);
+ return node.kind === 230 /* ImportEqualsDeclaration */ ||
+ node.kind === 229 /* NamespaceExportDeclaration */ ||
+ node.kind === 232 /* ImportClause */ && !!node.name ||
+ node.kind === 233 /* NamespaceImport */ ||
+ node.kind === 235 /* ImportSpecifier */ ||
+ node.kind === 239 /* ExportSpecifier */ ||
+ node.kind === 236 /* ExportAssignment */ && exportAssignmentIsAlias(node);
}
ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration;
function exportAssignmentIsAlias(node) {
@@ -7689,17 +7729,17 @@ var ts;
}
ts.exportAssignmentIsAlias = exportAssignmentIsAlias;
function getClassExtendsHeritageClauseElement(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 83 /* ExtendsKeyword */);
+ var heritageClause = getHeritageClause(node.heritageClauses, 84 /* ExtendsKeyword */);
return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined;
}
ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement;
function getClassImplementsHeritageClauseElements(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 106 /* ImplementsKeyword */);
+ var heritageClause = getHeritageClause(node.heritageClauses, 107 /* ImplementsKeyword */);
return heritageClause ? heritageClause.types : undefined;
}
ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements;
function getInterfaceBaseTypeNodes(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 83 /* ExtendsKeyword */);
+ var heritageClause = getHeritageClause(node.heritageClauses, 84 /* ExtendsKeyword */);
return heritageClause ? heritageClause.types : undefined;
}
ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes;
@@ -7767,7 +7807,7 @@ var ts;
}
ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath;
function isKeyword(token) {
- return 70 /* FirstKeyword */ <= token && token <= 138 /* LastKeyword */;
+ return 71 /* FirstKeyword */ <= token && token <= 139 /* LastKeyword */;
}
ts.isKeyword = isKeyword;
function isTrivia(token) {
@@ -7794,7 +7834,7 @@ var ts;
}
ts.hasDynamicName = hasDynamicName;
function isDynamicName(name) {
- return name.kind === 140 /* ComputedPropertyName */ &&
+ return name.kind === 141 /* ComputedPropertyName */ &&
!isStringOrNumericLiteral(name.expression.kind) &&
!isWellKnownSymbolSyntactically(name.expression);
}
@@ -7809,10 +7849,10 @@ var ts;
}
ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically;
function getPropertyNameForPropertyNameNode(name) {
- if (name.kind === 69 /* Identifier */ || name.kind === 9 /* StringLiteral */ || name.kind === 8 /* NumericLiteral */ || name.kind === 142 /* Parameter */) {
+ if (name.kind === 70 /* Identifier */ || name.kind === 9 /* StringLiteral */ || name.kind === 8 /* NumericLiteral */ || name.kind === 143 /* Parameter */) {
return name.text;
}
- if (name.kind === 140 /* ComputedPropertyName */) {
+ if (name.kind === 141 /* ComputedPropertyName */) {
var nameExpression = name.expression;
if (isWellKnownSymbolSyntactically(nameExpression)) {
var rightHandSideName = nameExpression.name.text;
@@ -7833,22 +7873,26 @@ var ts;
* Includes the word "Symbol" with unicode escapes
*/
function isESSymbolIdentifier(node) {
- return node.kind === 69 /* Identifier */ && node.text === "Symbol";
+ return node.kind === 70 /* Identifier */ && node.text === "Symbol";
}
ts.isESSymbolIdentifier = isESSymbolIdentifier;
+ function isPushOrUnshiftIdentifier(node) {
+ return node.text === "push" || node.text === "unshift";
+ }
+ ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier;
function isModifierKind(token) {
switch (token) {
- case 115 /* AbstractKeyword */:
- case 118 /* AsyncKeyword */:
- case 74 /* ConstKeyword */:
- case 122 /* DeclareKeyword */:
- case 77 /* DefaultKeyword */:
- case 82 /* ExportKeyword */:
- case 112 /* PublicKeyword */:
- case 110 /* PrivateKeyword */:
- case 111 /* ProtectedKeyword */:
- case 128 /* ReadonlyKeyword */:
- case 113 /* StaticKeyword */:
+ case 116 /* AbstractKeyword */:
+ case 119 /* AsyncKeyword */:
+ case 75 /* ConstKeyword */:
+ case 123 /* DeclareKeyword */:
+ case 78 /* DefaultKeyword */:
+ case 83 /* ExportKeyword */:
+ case 113 /* PublicKeyword */:
+ case 111 /* PrivateKeyword */:
+ case 112 /* ProtectedKeyword */:
+ case 129 /* ReadonlyKeyword */:
+ case 114 /* StaticKeyword */:
return true;
}
return false;
@@ -7856,11 +7900,11 @@ var ts;
ts.isModifierKind = isModifierKind;
function isParameterDeclaration(node) {
var root = getRootDeclaration(node);
- return root.kind === 142 /* Parameter */;
+ return root.kind === 143 /* Parameter */;
}
ts.isParameterDeclaration = isParameterDeclaration;
function getRootDeclaration(node) {
- while (node.kind === 169 /* BindingElement */) {
+ while (node.kind === 170 /* BindingElement */) {
node = node.parent.parent;
}
return node;
@@ -7868,14 +7912,14 @@ var ts;
ts.getRootDeclaration = getRootDeclaration;
function nodeStartsNewLexicalEnvironment(node) {
var kind = node.kind;
- return kind === 148 /* Constructor */
- || kind === 179 /* FunctionExpression */
- || kind === 220 /* FunctionDeclaration */
- || kind === 180 /* ArrowFunction */
- || kind === 147 /* MethodDeclaration */
- || kind === 149 /* GetAccessor */
- || kind === 150 /* SetAccessor */
- || kind === 225 /* ModuleDeclaration */
+ return kind === 149 /* Constructor */
+ || kind === 180 /* FunctionExpression */
+ || kind === 221 /* FunctionDeclaration */
+ || kind === 181 /* ArrowFunction */
+ || kind === 148 /* MethodDeclaration */
+ || kind === 150 /* GetAccessor */
+ || kind === 151 /* SetAccessor */
+ || kind === 226 /* ModuleDeclaration */
|| kind === 256 /* SourceFile */;
}
ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment;
@@ -7937,38 +7981,38 @@ var ts;
var Associativity = ts.Associativity;
function getExpressionAssociativity(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 175 /* NewExpression */ && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 176 /* NewExpression */ && expression.arguments !== undefined;
return getOperatorAssociativity(expression.kind, operator, hasArguments);
}
ts.getExpressionAssociativity = getExpressionAssociativity;
function getOperatorAssociativity(kind, operator, hasArguments) {
switch (kind) {
- case 175 /* NewExpression */:
+ case 176 /* NewExpression */:
return hasArguments ? 0 /* Left */ : 1 /* Right */;
- case 185 /* PrefixUnaryExpression */:
- case 182 /* TypeOfExpression */:
- case 183 /* VoidExpression */:
- case 181 /* DeleteExpression */:
- case 184 /* AwaitExpression */:
- case 188 /* ConditionalExpression */:
- case 190 /* YieldExpression */:
+ case 186 /* PrefixUnaryExpression */:
+ case 183 /* TypeOfExpression */:
+ case 184 /* VoidExpression */:
+ case 182 /* DeleteExpression */:
+ case 185 /* AwaitExpression */:
+ case 189 /* ConditionalExpression */:
+ case 191 /* YieldExpression */:
return 1 /* Right */;
- case 187 /* BinaryExpression */:
+ case 188 /* BinaryExpression */:
switch (operator) {
- case 38 /* AsteriskAsteriskToken */:
- case 56 /* EqualsToken */:
- case 57 /* PlusEqualsToken */:
- case 58 /* MinusEqualsToken */:
- case 60 /* AsteriskAsteriskEqualsToken */:
- case 59 /* AsteriskEqualsToken */:
- case 61 /* SlashEqualsToken */:
- case 62 /* PercentEqualsToken */:
- case 63 /* LessThanLessThanEqualsToken */:
- case 64 /* GreaterThanGreaterThanEqualsToken */:
- case 65 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
- case 66 /* AmpersandEqualsToken */:
- case 68 /* CaretEqualsToken */:
- case 67 /* BarEqualsToken */:
+ case 39 /* AsteriskAsteriskToken */:
+ case 57 /* EqualsToken */:
+ case 58 /* PlusEqualsToken */:
+ case 59 /* MinusEqualsToken */:
+ case 61 /* AsteriskAsteriskEqualsToken */:
+ case 60 /* AsteriskEqualsToken */:
+ case 62 /* SlashEqualsToken */:
+ case 63 /* PercentEqualsToken */:
+ case 64 /* LessThanLessThanEqualsToken */:
+ case 65 /* GreaterThanGreaterThanEqualsToken */:
+ case 66 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
+ case 67 /* AmpersandEqualsToken */:
+ case 69 /* CaretEqualsToken */:
+ case 68 /* BarEqualsToken */:
return 1 /* Right */;
}
}
@@ -7977,15 +8021,15 @@ var ts;
ts.getOperatorAssociativity = getOperatorAssociativity;
function getExpressionPrecedence(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 175 /* NewExpression */ && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 176 /* NewExpression */ && expression.arguments !== undefined;
return getOperatorPrecedence(expression.kind, operator, hasArguments);
}
ts.getExpressionPrecedence = getExpressionPrecedence;
function getOperator(expression) {
- if (expression.kind === 187 /* BinaryExpression */) {
+ if (expression.kind === 188 /* BinaryExpression */) {
return expression.operatorToken.kind;
}
- else if (expression.kind === 185 /* PrefixUnaryExpression */ || expression.kind === 186 /* PostfixUnaryExpression */) {
+ else if (expression.kind === 186 /* PrefixUnaryExpression */ || expression.kind === 187 /* PostfixUnaryExpression */) {
return expression.operator;
}
else {
@@ -7995,106 +8039,106 @@ var ts;
ts.getOperator = getOperator;
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
switch (nodeKind) {
- case 97 /* ThisKeyword */:
- case 95 /* SuperKeyword */:
- case 69 /* Identifier */:
- case 93 /* NullKeyword */:
- case 99 /* TrueKeyword */:
- case 84 /* FalseKeyword */:
+ case 98 /* ThisKeyword */:
+ case 96 /* SuperKeyword */:
+ case 70 /* Identifier */:
+ case 94 /* NullKeyword */:
+ case 100 /* TrueKeyword */:
+ case 85 /* FalseKeyword */:
case 8 /* NumericLiteral */:
case 9 /* StringLiteral */:
- case 170 /* ArrayLiteralExpression */:
- case 171 /* ObjectLiteralExpression */:
- case 179 /* FunctionExpression */:
- case 180 /* ArrowFunction */:
- case 192 /* ClassExpression */:
- case 241 /* JsxElement */:
- case 242 /* JsxSelfClosingElement */:
- case 10 /* RegularExpressionLiteral */:
- case 11 /* NoSubstitutionTemplateLiteral */:
- case 189 /* TemplateExpression */:
- case 178 /* ParenthesizedExpression */:
- case 193 /* OmittedExpression */:
+ case 171 /* ArrayLiteralExpression */:
+ case 172 /* ObjectLiteralExpression */:
+ case 180 /* FunctionExpression */:
+ case 181 /* ArrowFunction */:
+ case 193 /* ClassExpression */:
+ case 242 /* JsxElement */:
+ case 243 /* JsxSelfClosingElement */:
+ case 11 /* RegularExpressionLiteral */:
+ case 12 /* NoSubstitutionTemplateLiteral */:
+ case 190 /* TemplateExpression */:
+ case 179 /* ParenthesizedExpression */:
+ case 194 /* OmittedExpression */:
return 19;
- case 176 /* TaggedTemplateExpression */:
- case 172 /* PropertyAccessExpression */:
- case 173 /* ElementAccessExpression */:
+ case 177 /* TaggedTemplateExpression */:
+ case 173 /* PropertyAccessExpression */:
+ case 174 /* ElementAccessExpression */:
return 18;
- case 175 /* NewExpression */:
+ case 176 /* NewExpression */:
return hasArguments ? 18 : 17;
- case 174 /* CallExpression */:
+ case 175 /* CallExpression */:
return 17;
- case 186 /* PostfixUnaryExpression */:
+ case 187 /* PostfixUnaryExpression */:
return 16;
- case 185 /* PrefixUnaryExpression */:
- case 182 /* TypeOfExpression */:
- case 183 /* VoidExpression */:
- case 181 /* DeleteExpression */:
- case 184 /* AwaitExpression */:
+ case 186 /* PrefixUnaryExpression */:
+ case 183 /* TypeOfExpression */:
+ case 184 /* VoidExpression */:
+ case 182 /* DeleteExpression */:
+ case 185 /* AwaitExpression */:
return 15;
- case 187 /* BinaryExpression */:
+ case 188 /* BinaryExpression */:
switch (operatorKind) {
- case 49 /* ExclamationToken */:
- case 50 /* TildeToken */:
+ case 50 /* ExclamationToken */:
+ case 51 /* TildeToken */:
return 15;
- case 38 /* AsteriskAsteriskToken */:
- case 37 /* AsteriskToken */:
- case 39 /* SlashToken */:
- case 40 /* PercentToken */:
+ case 39 /* AsteriskAsteriskToken */:
+ case 38 /* AsteriskToken */:
+ case 40 /* SlashToken */:
+ case 41 /* PercentToken */:
return 14;
- case 35 /* PlusToken */:
- case 36 /* MinusToken */:
+ case 36 /* PlusToken */:
+ case 37 /* MinusToken */:
return 13;
- case 43 /* LessThanLessThanToken */:
- case 44 /* GreaterThanGreaterThanToken */:
- case 45 /* GreaterThanGreaterThanGreaterThanToken */:
+ case 44 /* LessThanLessThanToken */:
+ case 45 /* GreaterThanGreaterThanToken */:
+ case 46 /* GreaterThanGreaterThanGreaterThanToken */:
return 12;
- case 25 /* LessThanToken */:
- case 28 /* LessThanEqualsToken */:
- case 27 /* GreaterThanToken */:
- case 29 /* GreaterThanEqualsToken */:
- case 90 /* InKeyword */:
- case 91 /* InstanceOfKeyword */:
+ case 26 /* LessThanToken */:
+ case 29 /* LessThanEqualsToken */:
+ case 28 /* GreaterThanToken */:
+ case 30 /* GreaterThanEqualsToken */:
+ case 91 /* InKeyword */:
+ case 92 /* InstanceOfKeyword */:
return 11;
- case 30 /* EqualsEqualsToken */:
- case 32 /* EqualsEqualsEqualsToken */:
- case 31 /* ExclamationEqualsToken */:
- case 33 /* ExclamationEqualsEqualsToken */:
+ case 31 /* EqualsEqualsToken */:
+ case 33 /* EqualsEqualsEqualsToken */:
+ case 32 /* ExclamationEqualsToken */:
+ case 34 /* ExclamationEqualsEqualsToken */:
return 10;
- case 46 /* AmpersandToken */:
+ case 47 /* AmpersandToken */:
return 9;
- case 48 /* CaretToken */:
+ case 49 /* CaretToken */:
return 8;
- case 47 /* BarToken */:
+ case 48 /* BarToken */:
return 7;
- case 51 /* AmpersandAmpersandToken */:
+ case 52 /* AmpersandAmpersandToken */:
return 6;
- case 52 /* BarBarToken */:
+ case 53 /* BarBarToken */:
return 5;
- case 56 /* EqualsToken */:
- case 57 /* PlusEqualsToken */:
- case 58 /* MinusEqualsToken */:
- case 60 /* AsteriskAsteriskEqualsToken */:
- case 59 /* AsteriskEqualsToken */:
- case 61 /* SlashEqualsToken */:
- case 62 /* PercentEqualsToken */:
- case 63 /* LessThanLessThanEqualsToken */:
- case 64 /* GreaterThanGreaterThanEqualsToken */:
- case 65 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
- case 66 /* AmpersandEqualsToken */:
- case 68 /* CaretEqualsToken */:
- case 67 /* BarEqualsToken */:
+ case 57 /* EqualsToken */:
+ case 58 /* PlusEqualsToken */:
+ case 59 /* MinusEqualsToken */:
+ case 61 /* AsteriskAsteriskEqualsToken */:
+ case 60 /* AsteriskEqualsToken */:
+ case 62 /* SlashEqualsToken */:
+ case 63 /* PercentEqualsToken */:
+ case 64 /* LessThanLessThanEqualsToken */:
+ case 65 /* GreaterThanGreaterThanEqualsToken */:
+ case 66 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
+ case 67 /* AmpersandEqualsToken */:
+ case 69 /* CaretEqualsToken */:
+ case 68 /* BarEqualsToken */:
return 3;
- case 24 /* CommaToken */:
+ case 25 /* CommaToken */:
return 0;
default:
return -1;
}
- case 188 /* ConditionalExpression */:
+ case 189 /* ConditionalExpression */:
return 4;
- case 190 /* YieldExpression */:
+ case 191 /* YieldExpression */:
return 2;
- case 191 /* SpreadElementExpression */:
+ case 192 /* SpreadElementExpression */:
return 1;
default:
return -1;
@@ -8395,7 +8439,7 @@ var ts;
var options = host.getCompilerOptions();
// Emit on each source file
if (options.outFile || options.out) {
- onBundledEmit(host, sourceFiles);
+ onBundledEmit(sourceFiles);
}
else {
for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) {
@@ -8427,7 +8471,7 @@ var ts;
var declarationFilePath = !isSourceFileJavaScript(sourceFile) && (options.declaration || emitOnlyDtsFiles) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined;
action(jsFilePath, sourceMapFilePath, declarationFilePath, [sourceFile], /*isBundledEmit*/ false);
}
- function onBundledEmit(host, sourceFiles) {
+ function onBundledEmit(sourceFiles) {
if (sourceFiles.length) {
var jsFilePath = options.outFile || options.out;
var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options);
@@ -8533,7 +8577,7 @@ var ts;
ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap;
function getFirstConstructorWithBody(node) {
return ts.forEach(node.members, function (member) {
- if (member.kind === 148 /* Constructor */ && nodeIsPresent(member.body)) {
+ if (member.kind === 149 /* Constructor */ && nodeIsPresent(member.body)) {
return member;
}
});
@@ -8561,11 +8605,11 @@ var ts;
}
ts.parameterIsThisKeyword = parameterIsThisKeyword;
function isThisIdentifier(node) {
- return node && node.kind === 69 /* Identifier */ && identifierIsThisKeyword(node);
+ return node && node.kind === 70 /* Identifier */ && identifierIsThisKeyword(node);
}
ts.isThisIdentifier = isThisIdentifier;
function identifierIsThisKeyword(id) {
- return id.originalKeywordKind === 97 /* ThisKeyword */;
+ return id.originalKeywordKind === 98 /* ThisKeyword */;
}
ts.identifierIsThisKeyword = identifierIsThisKeyword;
function getAllAccessorDeclarations(declarations, accessor) {
@@ -8575,10 +8619,10 @@ var ts;
var setAccessor;
if (hasDynamicName(accessor)) {
firstAccessor = accessor;
- if (accessor.kind === 149 /* GetAccessor */) {
+ if (accessor.kind === 150 /* GetAccessor */) {
getAccessor = accessor;
}
- else if (accessor.kind === 150 /* SetAccessor */) {
+ else if (accessor.kind === 151 /* SetAccessor */) {
setAccessor = accessor;
}
else {
@@ -8587,7 +8631,7 @@ var ts;
}
else {
ts.forEach(declarations, function (member) {
- if ((member.kind === 149 /* GetAccessor */ || member.kind === 150 /* SetAccessor */)
+ if ((member.kind === 150 /* GetAccessor */ || member.kind === 151 /* SetAccessor */)
&& hasModifier(member, 32 /* Static */) === hasModifier(accessor, 32 /* Static */)) {
var memberName = getPropertyNameForPropertyNameNode(member.name);
var accessorName = getPropertyNameForPropertyNameNode(accessor.name);
@@ -8598,10 +8642,10 @@ var ts;
else if (!secondAccessor) {
secondAccessor = member;
}
- if (member.kind === 149 /* GetAccessor */ && !getAccessor) {
+ if (member.kind === 150 /* GetAccessor */ && !getAccessor) {
getAccessor = member;
}
- if (member.kind === 150 /* SetAccessor */ && !setAccessor) {
+ if (member.kind === 151 /* SetAccessor */ && !setAccessor) {
setAccessor = member;
}
}
@@ -8837,35 +8881,35 @@ var ts;
ts.getModifierFlags = getModifierFlags;
function modifierToFlag(token) {
switch (token) {
- case 113 /* StaticKeyword */: return 32 /* Static */;
- case 112 /* PublicKeyword */: return 4 /* Public */;
- case 111 /* ProtectedKeyword */: return 16 /* Protected */;
- case 110 /* PrivateKeyword */: return 8 /* Private */;
- case 115 /* AbstractKeyword */: return 128 /* Abstract */;
- case 82 /* ExportKeyword */: return 1 /* Export */;
- case 122 /* DeclareKeyword */: return 2 /* Ambient */;
- case 74 /* ConstKeyword */: return 2048 /* Const */;
- case 77 /* DefaultKeyword */: return 512 /* Default */;
- case 118 /* AsyncKeyword */: return 256 /* Async */;
- case 128 /* ReadonlyKeyword */: return 64 /* Readonly */;
+ case 114 /* StaticKeyword */: return 32 /* Static */;
+ case 113 /* PublicKeyword */: return 4 /* Public */;
+ case 112 /* ProtectedKeyword */: return 16 /* Protected */;
+ case 111 /* PrivateKeyword */: return 8 /* Private */;
+ case 116 /* AbstractKeyword */: return 128 /* Abstract */;
+ case 83 /* ExportKeyword */: return 1 /* Export */;
+ case 123 /* DeclareKeyword */: return 2 /* Ambient */;
+ case 75 /* ConstKeyword */: return 2048 /* Const */;
+ case 78 /* DefaultKeyword */: return 512 /* Default */;
+ case 119 /* AsyncKeyword */: return 256 /* Async */;
+ case 129 /* ReadonlyKeyword */: return 64 /* Readonly */;
}
return 0 /* None */;
}
ts.modifierToFlag = modifierToFlag;
function isLogicalOperator(token) {
- return token === 52 /* BarBarToken */
- || token === 51 /* AmpersandAmpersandToken */
- || token === 49 /* ExclamationToken */;
+ return token === 53 /* BarBarToken */
+ || token === 52 /* AmpersandAmpersandToken */
+ || token === 50 /* ExclamationToken */;
}
ts.isLogicalOperator = isLogicalOperator;
function isAssignmentOperator(token) {
- return token >= 56 /* FirstAssignment */ && token <= 68 /* LastAssignment */;
+ return token >= 57 /* FirstAssignment */ && token <= 69 /* LastAssignment */;
}
ts.isAssignmentOperator = isAssignmentOperator;
/** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */
function tryGetClassExtendingExpressionWithTypeArguments(node) {
- if (node.kind === 194 /* ExpressionWithTypeArguments */ &&
- node.parent.token === 83 /* ExtendsKeyword */ &&
+ if (node.kind === 195 /* ExpressionWithTypeArguments */ &&
+ node.parent.token === 84 /* ExtendsKeyword */ &&
isClassLike(node.parent.parent)) {
return node.parent.parent;
}
@@ -8873,10 +8917,10 @@ var ts;
ts.tryGetClassExtendingExpressionWithTypeArguments = tryGetClassExtendingExpressionWithTypeArguments;
function isDestructuringAssignment(node) {
if (isBinaryExpression(node)) {
- if (node.operatorToken.kind === 56 /* EqualsToken */) {
+ if (node.operatorToken.kind === 57 /* EqualsToken */) {
var kind = node.left.kind;
- return kind === 171 /* ObjectLiteralExpression */
- || kind === 170 /* ArrayLiteralExpression */;
+ return kind === 172 /* ObjectLiteralExpression */
+ || kind === 171 /* ArrayLiteralExpression */;
}
}
return false;
@@ -8889,7 +8933,7 @@ var ts;
}
ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments;
function isSupportedExpressionWithTypeArgumentsRest(node) {
- if (node.kind === 69 /* Identifier */) {
+ if (node.kind === 70 /* Identifier */) {
return true;
}
else if (isPropertyAccessExpression(node)) {
@@ -8904,21 +8948,21 @@ var ts;
}
ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause;
function isEntityNameExpression(node) {
- return node.kind === 69 /* Identifier */ ||
- node.kind === 172 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression);
+ return node.kind === 70 /* Identifier */ ||
+ node.kind === 173 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression);
}
ts.isEntityNameExpression = isEntityNameExpression;
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
- return (node.parent.kind === 139 /* QualifiedName */ && node.parent.right === node) ||
- (node.parent.kind === 172 /* PropertyAccessExpression */ && node.parent.name === node);
+ return (node.parent.kind === 140 /* QualifiedName */ && node.parent.right === node) ||
+ (node.parent.kind === 173 /* PropertyAccessExpression */ && node.parent.name === node);
}
ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess;
function isEmptyObjectLiteralOrArrayLiteral(expression) {
var kind = expression.kind;
- if (kind === 171 /* ObjectLiteralExpression */) {
+ if (kind === 172 /* ObjectLiteralExpression */) {
return expression.properties.length === 0;
}
- if (kind === 170 /* ArrayLiteralExpression */) {
+ if (kind === 171 /* ArrayLiteralExpression */) {
return expression.elements.length === 0;
}
return false;
@@ -9070,49 +9114,49 @@ var ts;
var kind = node.kind;
if (kind === 9 /* StringLiteral */
|| kind === 8 /* NumericLiteral */
- || kind === 10 /* RegularExpressionLiteral */
- || kind === 11 /* NoSubstitutionTemplateLiteral */
- || kind === 69 /* Identifier */
- || kind === 97 /* ThisKeyword */
- || kind === 95 /* SuperKeyword */
- || kind === 99 /* TrueKeyword */
- || kind === 84 /* FalseKeyword */
- || kind === 93 /* NullKeyword */) {
+ || kind === 11 /* RegularExpressionLiteral */
+ || kind === 12 /* NoSubstitutionTemplateLiteral */
+ || kind === 70 /* Identifier */
+ || kind === 98 /* ThisKeyword */
+ || kind === 96 /* SuperKeyword */
+ || kind === 100 /* TrueKeyword */
+ || kind === 85 /* FalseKeyword */
+ || kind === 94 /* NullKeyword */) {
return true;
}
- else if (kind === 172 /* PropertyAccessExpression */) {
+ else if (kind === 173 /* PropertyAccessExpression */) {
return isSimpleExpressionWorker(node.expression, depth + 1);
}
- else if (kind === 173 /* ElementAccessExpression */) {
+ else if (kind === 174 /* ElementAccessExpression */) {
return isSimpleExpressionWorker(node.expression, depth + 1)
&& isSimpleExpressionWorker(node.argumentExpression, depth + 1);
}
- else if (kind === 185 /* PrefixUnaryExpression */
- || kind === 186 /* PostfixUnaryExpression */) {
+ else if (kind === 186 /* PrefixUnaryExpression */
+ || kind === 187 /* PostfixUnaryExpression */) {
return isSimpleExpressionWorker(node.operand, depth + 1);
}
- else if (kind === 187 /* BinaryExpression */) {
- return node.operatorToken.kind !== 38 /* AsteriskAsteriskToken */
+ else if (kind === 188 /* BinaryExpression */) {
+ return node.operatorToken.kind !== 39 /* AsteriskAsteriskToken */
&& isSimpleExpressionWorker(node.left, depth + 1)
&& isSimpleExpressionWorker(node.right, depth + 1);
}
- else if (kind === 188 /* ConditionalExpression */) {
+ else if (kind === 189 /* ConditionalExpression */) {
return isSimpleExpressionWorker(node.condition, depth + 1)
&& isSimpleExpressionWorker(node.whenTrue, depth + 1)
&& isSimpleExpressionWorker(node.whenFalse, depth + 1);
}
- else if (kind === 183 /* VoidExpression */
- || kind === 182 /* TypeOfExpression */
- || kind === 181 /* DeleteExpression */) {
+ else if (kind === 184 /* VoidExpression */
+ || kind === 183 /* TypeOfExpression */
+ || kind === 182 /* DeleteExpression */) {
return isSimpleExpressionWorker(node.expression, depth + 1);
}
- else if (kind === 170 /* ArrayLiteralExpression */) {
+ else if (kind === 171 /* ArrayLiteralExpression */) {
return node.elements.length === 0;
}
- else if (kind === 171 /* ObjectLiteralExpression */) {
+ else if (kind === 172 /* ObjectLiteralExpression */) {
return node.properties.length === 0;
}
- else if (kind === 174 /* CallExpression */) {
+ else if (kind === 175 /* CallExpression */) {
if (!isSimpleExpressionWorker(node.expression, depth + 1)) {
return false;
}
@@ -9271,7 +9315,7 @@ var ts;
return ts.positionIsSynthesized(range.pos) ? -1 : ts.skipTrivia(sourceFile.text, range.pos);
}
ts.getStartPositionOfRange = getStartPositionOfRange;
- function collectExternalModuleInfo(sourceFile, resolver) {
+ function collectExternalModuleInfo(sourceFile) {
var externalImports = [];
var exportSpecifiers = ts.createMap();
var exportEquals = undefined;
@@ -9279,33 +9323,28 @@ var ts;
for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
var node = _a[_i];
switch (node.kind) {
- case 230 /* ImportDeclaration */:
- if (!node.importClause ||
- resolver.isReferencedAliasDeclaration(node.importClause, /*checkChildren*/ true)) {
- // import "mod"
- // import x from "mod" where x is referenced
- // import * as x from "mod" where x is referenced
- // import { x, y } from "mod" where at least one import is referenced
+ case 231 /* ImportDeclaration */:
+ // import "mod"
+ // import x from "mod"
+ // import * as x from "mod"
+ // import { x, y } from "mod"
+ externalImports.push(node);
+ break;
+ case 230 /* ImportEqualsDeclaration */:
+ if (node.moduleReference.kind === 241 /* ExternalModuleReference */) {
+ // import x = require("mod")
externalImports.push(node);
}
break;
- case 229 /* ImportEqualsDeclaration */:
- if (node.moduleReference.kind === 240 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) {
- // import x = require("mod") where x is referenced
- externalImports.push(node);
- }
- break;
- case 236 /* ExportDeclaration */:
+ case 237 /* ExportDeclaration */:
if (node.moduleSpecifier) {
if (!node.exportClause) {
// export * from "mod"
- if (resolver.moduleExportsSomeValue(node.moduleSpecifier)) {
- externalImports.push(node);
- hasExportStarsToExportValues = true;
- }
+ externalImports.push(node);
+ hasExportStarsToExportValues = true;
}
- else if (resolver.isValueAliasDeclaration(node)) {
- // export { x, y } from "mod" where at least one export is a value symbol
+ else {
+ // export { x, y } from "mod"
externalImports.push(node);
}
}
@@ -9318,7 +9357,7 @@ var ts;
}
}
break;
- case 235 /* ExportAssignment */:
+ case 236 /* ExportAssignment */:
if (node.isExportEquals && !exportEquals) {
// export = x
exportEquals = node;
@@ -9343,7 +9382,7 @@ var ts;
if (node.symbol) {
for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 221 /* ClassDeclaration */ && declaration !== node) {
+ if (declaration.kind === 222 /* ClassDeclaration */ && declaration !== node) {
return true;
}
}
@@ -9373,15 +9412,15 @@ var ts;
ts.isNodeArray = isNodeArray;
// Literals
function isNoSubstitutionTemplateLiteral(node) {
- return node.kind === 11 /* NoSubstitutionTemplateLiteral */;
+ return node.kind === 12 /* NoSubstitutionTemplateLiteral */;
}
ts.isNoSubstitutionTemplateLiteral = isNoSubstitutionTemplateLiteral;
function isLiteralKind(kind) {
- return 8 /* FirstLiteralToken */ <= kind && kind <= 11 /* LastLiteralToken */;
+ return 8 /* FirstLiteralToken */ <= kind && kind <= 12 /* LastLiteralToken */;
}
ts.isLiteralKind = isLiteralKind;
function isTextualLiteralKind(kind) {
- return kind === 9 /* StringLiteral */ || kind === 11 /* NoSubstitutionTemplateLiteral */;
+ return kind === 9 /* StringLiteral */ || kind === 12 /* NoSubstitutionTemplateLiteral */;
}
ts.isTextualLiteralKind = isTextualLiteralKind;
function isLiteralExpression(node) {
@@ -9390,22 +9429,22 @@ var ts;
ts.isLiteralExpression = isLiteralExpression;
// Pseudo-literals
function isTemplateLiteralKind(kind) {
- return 11 /* FirstTemplateToken */ <= kind && kind <= 14 /* LastTemplateToken */;
+ return 12 /* FirstTemplateToken */ <= kind && kind <= 15 /* LastTemplateToken */;
}
ts.isTemplateLiteralKind = isTemplateLiteralKind;
function isTemplateHead(node) {
- return node.kind === 12 /* TemplateHead */;
+ return node.kind === 13 /* TemplateHead */;
}
ts.isTemplateHead = isTemplateHead;
function isTemplateMiddleOrTemplateTail(node) {
var kind = node.kind;
- return kind === 13 /* TemplateMiddle */
- || kind === 14 /* TemplateTail */;
+ return kind === 14 /* TemplateMiddle */
+ || kind === 15 /* TemplateTail */;
}
ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail;
// Identifiers
function isIdentifier(node) {
- return node.kind === 69 /* Identifier */;
+ return node.kind === 70 /* Identifier */;
}
ts.isIdentifier = isIdentifier;
function isGeneratedIdentifier(node) {
@@ -9420,90 +9459,90 @@ var ts;
ts.isModifier = isModifier;
// Names
function isQualifiedName(node) {
- return node.kind === 139 /* QualifiedName */;
+ return node.kind === 140 /* QualifiedName */;
}
ts.isQualifiedName = isQualifiedName;
function isComputedPropertyName(node) {
- return node.kind === 140 /* ComputedPropertyName */;
+ return node.kind === 141 /* ComputedPropertyName */;
}
ts.isComputedPropertyName = isComputedPropertyName;
function isEntityName(node) {
var kind = node.kind;
- return kind === 139 /* QualifiedName */
- || kind === 69 /* Identifier */;
+ return kind === 140 /* QualifiedName */
+ || kind === 70 /* Identifier */;
}
ts.isEntityName = isEntityName;
function isPropertyName(node) {
var kind = node.kind;
- return kind === 69 /* Identifier */
+ return kind === 70 /* Identifier */
|| kind === 9 /* StringLiteral */
|| kind === 8 /* NumericLiteral */
- || kind === 140 /* ComputedPropertyName */;
+ || kind === 141 /* ComputedPropertyName */;
}
ts.isPropertyName = isPropertyName;
function isModuleName(node) {
var kind = node.kind;
- return kind === 69 /* Identifier */
+ return kind === 70 /* Identifier */
|| kind === 9 /* StringLiteral */;
}
ts.isModuleName = isModuleName;
function isBindingName(node) {
var kind = node.kind;
- return kind === 69 /* Identifier */
- || kind === 167 /* ObjectBindingPattern */
- || kind === 168 /* ArrayBindingPattern */;
+ return kind === 70 /* Identifier */
+ || kind === 168 /* ObjectBindingPattern */
+ || kind === 169 /* ArrayBindingPattern */;
}
ts.isBindingName = isBindingName;
// Signature elements
function isTypeParameter(node) {
- return node.kind === 141 /* TypeParameter */;
+ return node.kind === 142 /* TypeParameter */;
}
ts.isTypeParameter = isTypeParameter;
function isParameter(node) {
- return node.kind === 142 /* Parameter */;
+ return node.kind === 143 /* Parameter */;
}
ts.isParameter = isParameter;
function isDecorator(node) {
- return node.kind === 143 /* Decorator */;
+ return node.kind === 144 /* Decorator */;
}
ts.isDecorator = isDecorator;
// Type members
function isMethodDeclaration(node) {
- return node.kind === 147 /* MethodDeclaration */;
+ return node.kind === 148 /* MethodDeclaration */;
}
ts.isMethodDeclaration = isMethodDeclaration;
function isClassElement(node) {
var kind = node.kind;
- return kind === 148 /* Constructor */
- || kind === 145 /* PropertyDeclaration */
- || kind === 147 /* MethodDeclaration */
- || kind === 149 /* GetAccessor */
- || kind === 150 /* SetAccessor */
- || kind === 153 /* IndexSignature */
- || kind === 198 /* SemicolonClassElement */;
+ return kind === 149 /* Constructor */
+ || kind === 146 /* PropertyDeclaration */
+ || kind === 148 /* MethodDeclaration */
+ || kind === 150 /* GetAccessor */
+ || kind === 151 /* SetAccessor */
+ || kind === 154 /* IndexSignature */
+ || kind === 199 /* SemicolonClassElement */;
}
ts.isClassElement = isClassElement;
function isObjectLiteralElementLike(node) {
var kind = node.kind;
return kind === 253 /* PropertyAssignment */
|| kind === 254 /* ShorthandPropertyAssignment */
- || kind === 147 /* MethodDeclaration */
- || kind === 149 /* GetAccessor */
- || kind === 150 /* SetAccessor */
- || kind === 239 /* MissingDeclaration */;
+ || kind === 148 /* MethodDeclaration */
+ || kind === 150 /* GetAccessor */
+ || kind === 151 /* SetAccessor */
+ || kind === 240 /* MissingDeclaration */;
}
ts.isObjectLiteralElementLike = isObjectLiteralElementLike;
// Type
function isTypeNodeKind(kind) {
- return (kind >= 154 /* FirstTypeNode */ && kind <= 166 /* LastTypeNode */)
- || kind === 117 /* AnyKeyword */
- || kind === 130 /* NumberKeyword */
- || kind === 120 /* BooleanKeyword */
- || kind === 132 /* StringKeyword */
- || kind === 133 /* SymbolKeyword */
- || kind === 103 /* VoidKeyword */
- || kind === 127 /* NeverKeyword */
- || kind === 194 /* ExpressionWithTypeArguments */;
+ return (kind >= 155 /* FirstTypeNode */ && kind <= 167 /* LastTypeNode */)
+ || kind === 118 /* AnyKeyword */
+ || kind === 131 /* NumberKeyword */
+ || kind === 121 /* BooleanKeyword */
+ || kind === 133 /* StringKeyword */
+ || kind === 134 /* SymbolKeyword */
+ || kind === 104 /* VoidKeyword */
+ || kind === 128 /* NeverKeyword */
+ || kind === 195 /* ExpressionWithTypeArguments */;
}
/**
* Node test that determines whether a node is a valid type node.
@@ -9518,95 +9557,95 @@ var ts;
function isBindingPattern(node) {
if (node) {
var kind = node.kind;
- return kind === 168 /* ArrayBindingPattern */
- || kind === 167 /* ObjectBindingPattern */;
+ return kind === 169 /* ArrayBindingPattern */
+ || kind === 168 /* ObjectBindingPattern */;
}
return false;
}
ts.isBindingPattern = isBindingPattern;
function isBindingElement(node) {
- return node.kind === 169 /* BindingElement */;
+ return node.kind === 170 /* BindingElement */;
}
ts.isBindingElement = isBindingElement;
function isArrayBindingElement(node) {
var kind = node.kind;
- return kind === 169 /* BindingElement */
- || kind === 193 /* OmittedExpression */;
+ return kind === 170 /* BindingElement */
+ || kind === 194 /* OmittedExpression */;
}
ts.isArrayBindingElement = isArrayBindingElement;
// Expression
function isPropertyAccessExpression(node) {
- return node.kind === 172 /* PropertyAccessExpression */;
+ return node.kind === 173 /* PropertyAccessExpression */;
}
ts.isPropertyAccessExpression = isPropertyAccessExpression;
function isElementAccessExpression(node) {
- return node.kind === 173 /* ElementAccessExpression */;
+ return node.kind === 174 /* ElementAccessExpression */;
}
ts.isElementAccessExpression = isElementAccessExpression;
function isBinaryExpression(node) {
- return node.kind === 187 /* BinaryExpression */;
+ return node.kind === 188 /* BinaryExpression */;
}
ts.isBinaryExpression = isBinaryExpression;
function isConditionalExpression(node) {
- return node.kind === 188 /* ConditionalExpression */;
+ return node.kind === 189 /* ConditionalExpression */;
}
ts.isConditionalExpression = isConditionalExpression;
function isCallExpression(node) {
- return node.kind === 174 /* CallExpression */;
+ return node.kind === 175 /* CallExpression */;
}
ts.isCallExpression = isCallExpression;
function isTemplateLiteral(node) {
var kind = node.kind;
- return kind === 189 /* TemplateExpression */
- || kind === 11 /* NoSubstitutionTemplateLiteral */;
+ return kind === 190 /* TemplateExpression */
+ || kind === 12 /* NoSubstitutionTemplateLiteral */;
}
ts.isTemplateLiteral = isTemplateLiteral;
function isSpreadElementExpression(node) {
- return node.kind === 191 /* SpreadElementExpression */;
+ return node.kind === 192 /* SpreadElementExpression */;
}
ts.isSpreadElementExpression = isSpreadElementExpression;
function isExpressionWithTypeArguments(node) {
- return node.kind === 194 /* ExpressionWithTypeArguments */;
+ return node.kind === 195 /* ExpressionWithTypeArguments */;
}
ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments;
function isLeftHandSideExpressionKind(kind) {
- return kind === 172 /* PropertyAccessExpression */
- || kind === 173 /* ElementAccessExpression */
- || kind === 175 /* NewExpression */
- || kind === 174 /* CallExpression */
- || kind === 241 /* JsxElement */
- || kind === 242 /* JsxSelfClosingElement */
- || kind === 176 /* TaggedTemplateExpression */
- || kind === 170 /* ArrayLiteralExpression */
- || kind === 178 /* ParenthesizedExpression */
- || kind === 171 /* ObjectLiteralExpression */
- || kind === 192 /* ClassExpression */
- || kind === 179 /* FunctionExpression */
- || kind === 69 /* Identifier */
- || kind === 10 /* RegularExpressionLiteral */
+ return kind === 173 /* PropertyAccessExpression */
+ || kind === 174 /* ElementAccessExpression */
+ || kind === 176 /* NewExpression */
+ || kind === 175 /* CallExpression */
+ || kind === 242 /* JsxElement */
+ || kind === 243 /* JsxSelfClosingElement */
+ || kind === 177 /* TaggedTemplateExpression */
+ || kind === 171 /* ArrayLiteralExpression */
+ || kind === 179 /* ParenthesizedExpression */
+ || kind === 172 /* ObjectLiteralExpression */
+ || kind === 193 /* ClassExpression */
+ || kind === 180 /* FunctionExpression */
+ || kind === 70 /* Identifier */
+ || kind === 11 /* RegularExpressionLiteral */
|| kind === 8 /* NumericLiteral */
|| kind === 9 /* StringLiteral */
- || kind === 11 /* NoSubstitutionTemplateLiteral */
- || kind === 189 /* TemplateExpression */
- || kind === 84 /* FalseKeyword */
- || kind === 93 /* NullKeyword */
- || kind === 97 /* ThisKeyword */
- || kind === 99 /* TrueKeyword */
- || kind === 95 /* SuperKeyword */
- || kind === 196 /* NonNullExpression */;
+ || kind === 12 /* NoSubstitutionTemplateLiteral */
+ || kind === 190 /* TemplateExpression */
+ || kind === 85 /* FalseKeyword */
+ || kind === 94 /* NullKeyword */
+ || kind === 98 /* ThisKeyword */
+ || kind === 100 /* TrueKeyword */
+ || kind === 96 /* SuperKeyword */
+ || kind === 197 /* NonNullExpression */;
}
function isLeftHandSideExpression(node) {
return isLeftHandSideExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind);
}
ts.isLeftHandSideExpression = isLeftHandSideExpression;
function isUnaryExpressionKind(kind) {
- return kind === 185 /* PrefixUnaryExpression */
- || kind === 186 /* PostfixUnaryExpression */
- || kind === 181 /* DeleteExpression */
- || kind === 182 /* TypeOfExpression */
- || kind === 183 /* VoidExpression */
- || kind === 184 /* AwaitExpression */
- || kind === 177 /* TypeAssertionExpression */
+ return kind === 186 /* PrefixUnaryExpression */
+ || kind === 187 /* PostfixUnaryExpression */
+ || kind === 182 /* DeleteExpression */
+ || kind === 183 /* TypeOfExpression */
+ || kind === 184 /* VoidExpression */
+ || kind === 185 /* AwaitExpression */
+ || kind === 178 /* TypeAssertionExpression */
|| isLeftHandSideExpressionKind(kind);
}
function isUnaryExpression(node) {
@@ -9614,13 +9653,13 @@ var ts;
}
ts.isUnaryExpression = isUnaryExpression;
function isExpressionKind(kind) {
- return kind === 188 /* ConditionalExpression */
- || kind === 190 /* YieldExpression */
- || kind === 180 /* ArrowFunction */
- || kind === 187 /* BinaryExpression */
- || kind === 191 /* SpreadElementExpression */
- || kind === 195 /* AsExpression */
- || kind === 193 /* OmittedExpression */
+ return kind === 189 /* ConditionalExpression */
+ || kind === 191 /* YieldExpression */
+ || kind === 181 /* ArrowFunction */
+ || kind === 188 /* BinaryExpression */
+ || kind === 192 /* SpreadElementExpression */
+ || kind === 196 /* AsExpression */
+ || kind === 194 /* OmittedExpression */
|| isUnaryExpressionKind(kind);
}
function isExpression(node) {
@@ -9629,8 +9668,8 @@ var ts;
ts.isExpression = isExpression;
function isAssertionExpression(node) {
var kind = node.kind;
- return kind === 177 /* TypeAssertionExpression */
- || kind === 195 /* AsExpression */;
+ return kind === 178 /* TypeAssertionExpression */
+ || kind === 196 /* AsExpression */;
}
ts.isAssertionExpression = isAssertionExpression;
function isPartiallyEmittedExpression(node) {
@@ -9647,17 +9686,17 @@ var ts;
}
ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode;
function isOmittedExpression(node) {
- return node.kind === 193 /* OmittedExpression */;
+ return node.kind === 194 /* OmittedExpression */;
}
ts.isOmittedExpression = isOmittedExpression;
// Misc
function isTemplateSpan(node) {
- return node.kind === 197 /* TemplateSpan */;
+ return node.kind === 198 /* TemplateSpan */;
}
ts.isTemplateSpan = isTemplateSpan;
// Element
function isBlock(node) {
- return node.kind === 199 /* Block */;
+ return node.kind === 200 /* Block */;
}
ts.isBlock = isBlock;
function isConciseBody(node) {
@@ -9675,118 +9714,118 @@ var ts;
}
ts.isForInitializer = isForInitializer;
function isVariableDeclaration(node) {
- return node.kind === 218 /* VariableDeclaration */;
+ return node.kind === 219 /* VariableDeclaration */;
}
ts.isVariableDeclaration = isVariableDeclaration;
function isVariableDeclarationList(node) {
- return node.kind === 219 /* VariableDeclarationList */;
+ return node.kind === 220 /* VariableDeclarationList */;
}
ts.isVariableDeclarationList = isVariableDeclarationList;
function isCaseBlock(node) {
- return node.kind === 227 /* CaseBlock */;
+ return node.kind === 228 /* CaseBlock */;
}
ts.isCaseBlock = isCaseBlock;
function isModuleBody(node) {
var kind = node.kind;
- return kind === 226 /* ModuleBlock */
- || kind === 225 /* ModuleDeclaration */;
+ return kind === 227 /* ModuleBlock */
+ || kind === 226 /* ModuleDeclaration */;
}
ts.isModuleBody = isModuleBody;
function isImportEqualsDeclaration(node) {
- return node.kind === 229 /* ImportEqualsDeclaration */;
+ return node.kind === 230 /* ImportEqualsDeclaration */;
}
ts.isImportEqualsDeclaration = isImportEqualsDeclaration;
function isImportClause(node) {
- return node.kind === 231 /* ImportClause */;
+ return node.kind === 232 /* ImportClause */;
}
ts.isImportClause = isImportClause;
function isNamedImportBindings(node) {
var kind = node.kind;
- return kind === 233 /* NamedImports */
- || kind === 232 /* NamespaceImport */;
+ return kind === 234 /* NamedImports */
+ || kind === 233 /* NamespaceImport */;
}
ts.isNamedImportBindings = isNamedImportBindings;
function isImportSpecifier(node) {
- return node.kind === 234 /* ImportSpecifier */;
+ return node.kind === 235 /* ImportSpecifier */;
}
ts.isImportSpecifier = isImportSpecifier;
function isNamedExports(node) {
- return node.kind === 237 /* NamedExports */;
+ return node.kind === 238 /* NamedExports */;
}
ts.isNamedExports = isNamedExports;
function isExportSpecifier(node) {
- return node.kind === 238 /* ExportSpecifier */;
+ return node.kind === 239 /* ExportSpecifier */;
}
ts.isExportSpecifier = isExportSpecifier;
function isModuleOrEnumDeclaration(node) {
- return node.kind === 225 /* ModuleDeclaration */ || node.kind === 224 /* EnumDeclaration */;
+ return node.kind === 226 /* ModuleDeclaration */ || node.kind === 225 /* EnumDeclaration */;
}
ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration;
function isDeclarationKind(kind) {
- return kind === 180 /* ArrowFunction */
- || kind === 169 /* BindingElement */
- || kind === 221 /* ClassDeclaration */
- || kind === 192 /* ClassExpression */
- || kind === 148 /* Constructor */
- || kind === 224 /* EnumDeclaration */
+ return kind === 181 /* ArrowFunction */
+ || kind === 170 /* BindingElement */
+ || kind === 222 /* ClassDeclaration */
+ || kind === 193 /* ClassExpression */
+ || kind === 149 /* Constructor */
+ || kind === 225 /* EnumDeclaration */
|| kind === 255 /* EnumMember */
- || kind === 238 /* ExportSpecifier */
- || kind === 220 /* FunctionDeclaration */
- || kind === 179 /* FunctionExpression */
- || kind === 149 /* GetAccessor */
- || kind === 231 /* ImportClause */
- || kind === 229 /* ImportEqualsDeclaration */
- || kind === 234 /* ImportSpecifier */
- || kind === 222 /* InterfaceDeclaration */
- || kind === 147 /* MethodDeclaration */
- || kind === 146 /* MethodSignature */
- || kind === 225 /* ModuleDeclaration */
- || kind === 228 /* NamespaceExportDeclaration */
- || kind === 232 /* NamespaceImport */
- || kind === 142 /* Parameter */
+ || kind === 239 /* ExportSpecifier */
+ || kind === 221 /* FunctionDeclaration */
+ || kind === 180 /* FunctionExpression */
+ || kind === 150 /* GetAccessor */
+ || kind === 232 /* ImportClause */
+ || kind === 230 /* ImportEqualsDeclaration */
+ || kind === 235 /* ImportSpecifier */
+ || kind === 223 /* InterfaceDeclaration */
+ || kind === 148 /* MethodDeclaration */
+ || kind === 147 /* MethodSignature */
+ || kind === 226 /* ModuleDeclaration */
+ || kind === 229 /* NamespaceExportDeclaration */
+ || kind === 233 /* NamespaceImport */
+ || kind === 143 /* Parameter */
|| kind === 253 /* PropertyAssignment */
- || kind === 145 /* PropertyDeclaration */
- || kind === 144 /* PropertySignature */
- || kind === 150 /* SetAccessor */
+ || kind === 146 /* PropertyDeclaration */
+ || kind === 145 /* PropertySignature */
+ || kind === 151 /* SetAccessor */
|| kind === 254 /* ShorthandPropertyAssignment */
- || kind === 223 /* TypeAliasDeclaration */
- || kind === 141 /* TypeParameter */
- || kind === 218 /* VariableDeclaration */
+ || kind === 224 /* TypeAliasDeclaration */
+ || kind === 142 /* TypeParameter */
+ || kind === 219 /* VariableDeclaration */
|| kind === 279 /* JSDocTypedefTag */;
}
function isDeclarationStatementKind(kind) {
- return kind === 220 /* FunctionDeclaration */
- || kind === 239 /* MissingDeclaration */
- || kind === 221 /* ClassDeclaration */
- || kind === 222 /* InterfaceDeclaration */
- || kind === 223 /* TypeAliasDeclaration */
- || kind === 224 /* EnumDeclaration */
- || kind === 225 /* ModuleDeclaration */
- || kind === 230 /* ImportDeclaration */
- || kind === 229 /* ImportEqualsDeclaration */
- || kind === 236 /* ExportDeclaration */
- || kind === 235 /* ExportAssignment */
- || kind === 228 /* NamespaceExportDeclaration */;
+ return kind === 221 /* FunctionDeclaration */
+ || kind === 240 /* MissingDeclaration */
+ || kind === 222 /* ClassDeclaration */
+ || kind === 223 /* InterfaceDeclaration */
+ || kind === 224 /* TypeAliasDeclaration */
+ || kind === 225 /* EnumDeclaration */
+ || kind === 226 /* ModuleDeclaration */
+ || kind === 231 /* ImportDeclaration */
+ || kind === 230 /* ImportEqualsDeclaration */
+ || kind === 237 /* ExportDeclaration */
+ || kind === 236 /* ExportAssignment */
+ || kind === 229 /* NamespaceExportDeclaration */;
}
function isStatementKindButNotDeclarationKind(kind) {
- return kind === 210 /* BreakStatement */
- || kind === 209 /* ContinueStatement */
- || kind === 217 /* DebuggerStatement */
- || kind === 204 /* DoStatement */
- || kind === 202 /* ExpressionStatement */
- || kind === 201 /* EmptyStatement */
- || kind === 207 /* ForInStatement */
- || kind === 208 /* ForOfStatement */
- || kind === 206 /* ForStatement */
- || kind === 203 /* IfStatement */
- || kind === 214 /* LabeledStatement */
- || kind === 211 /* ReturnStatement */
- || kind === 213 /* SwitchStatement */
- || kind === 215 /* ThrowStatement */
- || kind === 216 /* TryStatement */
- || kind === 200 /* VariableStatement */
- || kind === 205 /* WhileStatement */
- || kind === 212 /* WithStatement */
+ return kind === 211 /* BreakStatement */
+ || kind === 210 /* ContinueStatement */
+ || kind === 218 /* DebuggerStatement */
+ || kind === 205 /* DoStatement */
+ || kind === 203 /* ExpressionStatement */
+ || kind === 202 /* EmptyStatement */
+ || kind === 208 /* ForInStatement */
+ || kind === 209 /* ForOfStatement */
+ || kind === 207 /* ForStatement */
+ || kind === 204 /* IfStatement */
+ || kind === 215 /* LabeledStatement */
+ || kind === 212 /* ReturnStatement */
+ || kind === 214 /* SwitchStatement */
+ || kind === 216 /* ThrowStatement */
+ || kind === 217 /* TryStatement */
+ || kind === 201 /* VariableStatement */
+ || kind === 206 /* WhileStatement */
+ || kind === 213 /* WithStatement */
|| kind === 287 /* NotEmittedStatement */;
}
function isDeclaration(node) {
@@ -9808,20 +9847,20 @@ var ts;
var kind = node.kind;
return isStatementKindButNotDeclarationKind(kind)
|| isDeclarationStatementKind(kind)
- || kind === 199 /* Block */;
+ || kind === 200 /* Block */;
}
ts.isStatement = isStatement;
// Module references
function isModuleReference(node) {
var kind = node.kind;
- return kind === 240 /* ExternalModuleReference */
- || kind === 139 /* QualifiedName */
- || kind === 69 /* Identifier */;
+ return kind === 241 /* ExternalModuleReference */
+ || kind === 140 /* QualifiedName */
+ || kind === 70 /* Identifier */;
}
ts.isModuleReference = isModuleReference;
// JSX
function isJsxOpeningElement(node) {
- return node.kind === 243 /* JsxOpeningElement */;
+ return node.kind === 244 /* JsxOpeningElement */;
}
ts.isJsxOpeningElement = isJsxOpeningElement;
function isJsxClosingElement(node) {
@@ -9830,17 +9869,17 @@ var ts;
ts.isJsxClosingElement = isJsxClosingElement;
function isJsxTagNameExpression(node) {
var kind = node.kind;
- return kind === 97 /* ThisKeyword */
- || kind === 69 /* Identifier */
- || kind === 172 /* PropertyAccessExpression */;
+ return kind === 98 /* ThisKeyword */
+ || kind === 70 /* Identifier */
+ || kind === 173 /* PropertyAccessExpression */;
}
ts.isJsxTagNameExpression = isJsxTagNameExpression;
function isJsxChild(node) {
var kind = node.kind;
- return kind === 241 /* JsxElement */
+ return kind === 242 /* JsxElement */
|| kind === 248 /* JsxExpression */
- || kind === 242 /* JsxSelfClosingElement */
- || kind === 244 /* JsxText */;
+ || kind === 243 /* JsxSelfClosingElement */
+ || kind === 10 /* JsxText */;
}
ts.isJsxChild = isJsxChild;
function isJsxAttributeLike(node) {
@@ -9905,7 +9944,16 @@ var ts;
})(ts || (ts = {}));
(function (ts) {
function getDefaultLibFileName(options) {
- return options.target === 2 /* ES6 */ ? "lib.es6.d.ts" : "lib.d.ts";
+ switch (options.target) {
+ case 4 /* ES2017 */:
+ return "lib.es2017.d.ts";
+ case 3 /* ES2016 */:
+ return "lib.es2016.d.ts";
+ case 2 /* ES2015 */:
+ return "lib.es6.d.ts";
+ default:
+ return "lib.d.ts";
+ }
}
ts.getDefaultLibFileName = getDefaultLibFileName;
function textSpanEnd(span) {
@@ -10114,9 +10162,9 @@ var ts;
}
ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
function getTypeParameterOwner(d) {
- if (d && d.kind === 141 /* TypeParameter */) {
+ if (d && d.kind === 142 /* TypeParameter */) {
for (var current = d; current; current = current.parent) {
- if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 222 /* InterfaceDeclaration */) {
+ if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 223 /* InterfaceDeclaration */) {
return current;
}
}
@@ -10124,11 +10172,11 @@ var ts;
}
ts.getTypeParameterOwner = getTypeParameterOwner;
function isParameterPropertyDeclaration(node) {
- return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 148 /* Constructor */ && ts.isClassLike(node.parent.parent);
+ return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 149 /* Constructor */ && ts.isClassLike(node.parent.parent);
}
ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration;
function walkUpBindingElementsAndPatterns(node) {
- while (node && (node.kind === 169 /* BindingElement */ || ts.isBindingPattern(node))) {
+ while (node && (node.kind === 170 /* BindingElement */ || ts.isBindingPattern(node))) {
node = node.parent;
}
return node;
@@ -10136,14 +10184,14 @@ var ts;
function getCombinedModifierFlags(node) {
node = walkUpBindingElementsAndPatterns(node);
var flags = ts.getModifierFlags(node);
- if (node.kind === 218 /* VariableDeclaration */) {
+ if (node.kind === 219 /* VariableDeclaration */) {
node = node.parent;
}
- if (node && node.kind === 219 /* VariableDeclarationList */) {
+ if (node && node.kind === 220 /* VariableDeclarationList */) {
flags |= ts.getModifierFlags(node);
node = node.parent;
}
- if (node && node.kind === 200 /* VariableStatement */) {
+ if (node && node.kind === 201 /* VariableStatement */) {
flags |= ts.getModifierFlags(node);
}
return flags;
@@ -10159,14 +10207,14 @@ var ts;
function getCombinedNodeFlags(node) {
node = walkUpBindingElementsAndPatterns(node);
var flags = node.flags;
- if (node.kind === 218 /* VariableDeclaration */) {
+ if (node.kind === 219 /* VariableDeclaration */) {
node = node.parent;
}
- if (node && node.kind === 219 /* VariableDeclarationList */) {
+ if (node && node.kind === 220 /* VariableDeclarationList */) {
flags |= node.flags;
node = node.parent;
}
- if (node && node.kind === 200 /* VariableStatement */) {
+ if (node && node.kind === 201 /* VariableStatement */) {
flags |= node.flags;
}
return flags;
@@ -10271,7 +10319,7 @@ var ts;
return node;
}
else if (typeof value === "boolean") {
- return createNode(value ? 99 /* TrueKeyword */ : 84 /* FalseKeyword */, location, /*flags*/ undefined);
+ return createNode(value ? 100 /* TrueKeyword */ : 85 /* FalseKeyword */, location, /*flags*/ undefined);
}
else if (typeof value === "string") {
var node = createNode(9 /* StringLiteral */, location, /*flags*/ undefined);
@@ -10289,7 +10337,7 @@ var ts;
// Identifiers
var nextAutoGenerateId = 0;
function createIdentifier(text, location) {
- var node = createNode(69 /* Identifier */, location);
+ var node = createNode(70 /* Identifier */, location);
node.text = ts.escapeIdentifier(text);
node.originalKeywordKind = ts.stringToToken(text);
node.autoGenerateKind = 0 /* None */;
@@ -10298,7 +10346,7 @@ var ts;
}
ts.createIdentifier = createIdentifier;
function createTempVariable(recordTempVariable, location) {
- var name = createNode(69 /* Identifier */, location);
+ var name = createNode(70 /* Identifier */, location);
name.text = "";
name.originalKeywordKind = 0 /* Unknown */;
name.autoGenerateKind = 1 /* Auto */;
@@ -10311,7 +10359,7 @@ var ts;
}
ts.createTempVariable = createTempVariable;
function createLoopVariable(location) {
- var name = createNode(69 /* Identifier */, location);
+ var name = createNode(70 /* Identifier */, location);
name.text = "";
name.originalKeywordKind = 0 /* Unknown */;
name.autoGenerateKind = 2 /* Loop */;
@@ -10321,7 +10369,7 @@ var ts;
}
ts.createLoopVariable = createLoopVariable;
function createUniqueName(text, location) {
- var name = createNode(69 /* Identifier */, location);
+ var name = createNode(70 /* Identifier */, location);
name.text = text;
name.originalKeywordKind = 0 /* Unknown */;
name.autoGenerateKind = 3 /* Unique */;
@@ -10331,7 +10379,7 @@ var ts;
}
ts.createUniqueName = createUniqueName;
function getGeneratedNameForNode(node, location) {
- var name = createNode(69 /* Identifier */, location);
+ var name = createNode(70 /* Identifier */, location);
name.original = node;
name.text = "";
name.originalKeywordKind = 0 /* Unknown */;
@@ -10348,23 +10396,23 @@ var ts;
ts.createToken = createToken;
// Reserved words
function createSuper() {
- var node = createNode(95 /* SuperKeyword */);
+ var node = createNode(96 /* SuperKeyword */);
return node;
}
ts.createSuper = createSuper;
function createThis(location) {
- var node = createNode(97 /* ThisKeyword */, location);
+ var node = createNode(98 /* ThisKeyword */, location);
return node;
}
ts.createThis = createThis;
function createNull() {
- var node = createNode(93 /* NullKeyword */);
+ var node = createNode(94 /* NullKeyword */);
return node;
}
ts.createNull = createNull;
// Names
function createComputedPropertyName(expression, location) {
- var node = createNode(140 /* ComputedPropertyName */, location);
+ var node = createNode(141 /* ComputedPropertyName */, location);
node.expression = expression;
return node;
}
@@ -10387,7 +10435,7 @@ var ts;
}
ts.createParameter = createParameter;
function createParameterDeclaration(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer, location, flags) {
- var node = createNode(142 /* Parameter */, location, flags);
+ var node = createNode(143 /* Parameter */, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.dotDotDotToken = dotDotDotToken;
@@ -10407,7 +10455,7 @@ var ts;
ts.updateParameterDeclaration = updateParameterDeclaration;
// Type members
function createProperty(decorators, modifiers, name, questionToken, type, initializer, location) {
- var node = createNode(145 /* PropertyDeclaration */, location);
+ var node = createNode(146 /* PropertyDeclaration */, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -10425,7 +10473,7 @@ var ts;
}
ts.updateProperty = updateProperty;
function createMethod(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
- var node = createNode(147 /* MethodDeclaration */, location, flags);
+ var node = createNode(148 /* MethodDeclaration */, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.asteriskToken = asteriskToken;
@@ -10445,7 +10493,7 @@ var ts;
}
ts.updateMethod = updateMethod;
function createConstructor(decorators, modifiers, parameters, body, location, flags) {
- var node = createNode(148 /* Constructor */, location, flags);
+ var node = createNode(149 /* Constructor */, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.typeParameters = undefined;
@@ -10463,7 +10511,7 @@ var ts;
}
ts.updateConstructor = updateConstructor;
function createGetAccessor(decorators, modifiers, name, parameters, type, body, location, flags) {
- var node = createNode(149 /* GetAccessor */, location, flags);
+ var node = createNode(150 /* GetAccessor */, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -10482,7 +10530,7 @@ var ts;
}
ts.updateGetAccessor = updateGetAccessor;
function createSetAccessor(decorators, modifiers, name, parameters, body, location, flags) {
- var node = createNode(150 /* SetAccessor */, location, flags);
+ var node = createNode(151 /* SetAccessor */, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -10501,7 +10549,7 @@ var ts;
ts.updateSetAccessor = updateSetAccessor;
// Binding Patterns
function createObjectBindingPattern(elements, location) {
- var node = createNode(167 /* ObjectBindingPattern */, location);
+ var node = createNode(168 /* ObjectBindingPattern */, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -10514,7 +10562,7 @@ var ts;
}
ts.updateObjectBindingPattern = updateObjectBindingPattern;
function createArrayBindingPattern(elements, location) {
- var node = createNode(168 /* ArrayBindingPattern */, location);
+ var node = createNode(169 /* ArrayBindingPattern */, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -10527,7 +10575,7 @@ var ts;
}
ts.updateArrayBindingPattern = updateArrayBindingPattern;
function createBindingElement(propertyName, dotDotDotToken, name, initializer, location) {
- var node = createNode(169 /* BindingElement */, location);
+ var node = createNode(170 /* BindingElement */, location);
node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName;
node.dotDotDotToken = dotDotDotToken;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -10544,7 +10592,7 @@ var ts;
ts.updateBindingElement = updateBindingElement;
// Expression
function createArrayLiteral(elements, location, multiLine) {
- var node = createNode(170 /* ArrayLiteralExpression */, location);
+ var node = createNode(171 /* ArrayLiteralExpression */, location);
node.elements = parenthesizeListElements(createNodeArray(elements));
if (multiLine) {
node.multiLine = true;
@@ -10560,7 +10608,7 @@ var ts;
}
ts.updateArrayLiteral = updateArrayLiteral;
function createObjectLiteral(properties, location, multiLine) {
- var node = createNode(171 /* ObjectLiteralExpression */, location);
+ var node = createNode(172 /* ObjectLiteralExpression */, location);
node.properties = createNodeArray(properties);
if (multiLine) {
node.multiLine = true;
@@ -10576,7 +10624,7 @@ var ts;
}
ts.updateObjectLiteral = updateObjectLiteral;
function createPropertyAccess(expression, name, location, flags) {
- var node = createNode(172 /* PropertyAccessExpression */, location, flags);
+ var node = createNode(173 /* PropertyAccessExpression */, location, flags);
node.expression = parenthesizeForAccess(expression);
(node.emitNode || (node.emitNode = {})).flags |= 1048576 /* NoIndentation */;
node.name = typeof name === "string" ? createIdentifier(name) : name;
@@ -10594,7 +10642,7 @@ var ts;
}
ts.updatePropertyAccess = updatePropertyAccess;
function createElementAccess(expression, index, location) {
- var node = createNode(173 /* ElementAccessExpression */, location);
+ var node = createNode(174 /* ElementAccessExpression */, location);
node.expression = parenthesizeForAccess(expression);
node.argumentExpression = typeof index === "number" ? createLiteral(index) : index;
return node;
@@ -10608,7 +10656,7 @@ var ts;
}
ts.updateElementAccess = updateElementAccess;
function createCall(expression, typeArguments, argumentsArray, location, flags) {
- var node = createNode(174 /* CallExpression */, location, flags);
+ var node = createNode(175 /* CallExpression */, location, flags);
node.expression = parenthesizeForAccess(expression);
if (typeArguments) {
node.typeArguments = createNodeArray(typeArguments);
@@ -10625,7 +10673,7 @@ var ts;
}
ts.updateCall = updateCall;
function createNew(expression, typeArguments, argumentsArray, location, flags) {
- var node = createNode(175 /* NewExpression */, location, flags);
+ var node = createNode(176 /* NewExpression */, location, flags);
node.expression = parenthesizeForNew(expression);
node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined;
node.arguments = argumentsArray ? parenthesizeListElements(createNodeArray(argumentsArray)) : undefined;
@@ -10640,7 +10688,7 @@ var ts;
}
ts.updateNew = updateNew;
function createTaggedTemplate(tag, template, location) {
- var node = createNode(176 /* TaggedTemplateExpression */, location);
+ var node = createNode(177 /* TaggedTemplateExpression */, location);
node.tag = parenthesizeForAccess(tag);
node.template = template;
return node;
@@ -10654,7 +10702,7 @@ var ts;
}
ts.updateTaggedTemplate = updateTaggedTemplate;
function createParen(expression, location) {
- var node = createNode(178 /* ParenthesizedExpression */, location);
+ var node = createNode(179 /* ParenthesizedExpression */, location);
node.expression = expression;
return node;
}
@@ -10666,9 +10714,9 @@ var ts;
return node;
}
ts.updateParen = updateParen;
- function createFunctionExpression(asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
- var node = createNode(179 /* FunctionExpression */, location, flags);
- node.modifiers = undefined;
+ function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
+ var node = createNode(180 /* FunctionExpression */, location, flags);
+ node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.asteriskToken = asteriskToken;
node.name = typeof name === "string" ? createIdentifier(name) : name;
node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined;
@@ -10678,20 +10726,20 @@ var ts;
return node;
}
ts.createFunctionExpression = createFunctionExpression;
- function updateFunctionExpression(node, name, typeParameters, parameters, type, body) {
- if (node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) {
- return updateNode(createFunctionExpression(node.asteriskToken, name, typeParameters, parameters, type, body, /*location*/ node, node.flags), node);
+ function updateFunctionExpression(node, modifiers, name, typeParameters, parameters, type, body) {
+ if (node.name !== name || node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body) {
+ return updateNode(createFunctionExpression(modifiers, node.asteriskToken, name, typeParameters, parameters, type, body, /*location*/ node, node.flags), node);
}
return node;
}
ts.updateFunctionExpression = updateFunctionExpression;
function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body, location, flags) {
- var node = createNode(180 /* ArrowFunction */, location, flags);
+ var node = createNode(181 /* ArrowFunction */, location, flags);
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.typeParameters = typeParameters ? createNodeArray(typeParameters) : undefined;
node.parameters = createNodeArray(parameters);
node.type = type;
- node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(34 /* EqualsGreaterThanToken */);
+ node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(35 /* EqualsGreaterThanToken */);
node.body = parenthesizeConciseBody(body);
return node;
}
@@ -10704,7 +10752,7 @@ var ts;
}
ts.updateArrowFunction = updateArrowFunction;
function createDelete(expression, location) {
- var node = createNode(181 /* DeleteExpression */, location);
+ var node = createNode(182 /* DeleteExpression */, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -10717,7 +10765,7 @@ var ts;
}
ts.updateDelete = updateDelete;
function createTypeOf(expression, location) {
- var node = createNode(182 /* TypeOfExpression */, location);
+ var node = createNode(183 /* TypeOfExpression */, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -10730,7 +10778,7 @@ var ts;
}
ts.updateTypeOf = updateTypeOf;
function createVoid(expression, location) {
- var node = createNode(183 /* VoidExpression */, location);
+ var node = createNode(184 /* VoidExpression */, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -10743,7 +10791,7 @@ var ts;
}
ts.updateVoid = updateVoid;
function createAwait(expression, location) {
- var node = createNode(184 /* AwaitExpression */, location);
+ var node = createNode(185 /* AwaitExpression */, location);
node.expression = parenthesizePrefixOperand(expression);
return node;
}
@@ -10756,7 +10804,7 @@ var ts;
}
ts.updateAwait = updateAwait;
function createPrefix(operator, operand, location) {
- var node = createNode(185 /* PrefixUnaryExpression */, location);
+ var node = createNode(186 /* PrefixUnaryExpression */, location);
node.operator = operator;
node.operand = parenthesizePrefixOperand(operand);
return node;
@@ -10770,7 +10818,7 @@ var ts;
}
ts.updatePrefix = updatePrefix;
function createPostfix(operand, operator, location) {
- var node = createNode(186 /* PostfixUnaryExpression */, location);
+ var node = createNode(187 /* PostfixUnaryExpression */, location);
node.operand = parenthesizePostfixOperand(operand);
node.operator = operator;
return node;
@@ -10786,7 +10834,7 @@ var ts;
function createBinary(left, operator, right, location) {
var operatorToken = typeof operator === "number" ? createToken(operator) : operator;
var operatorKind = operatorToken.kind;
- var node = createNode(187 /* BinaryExpression */, location);
+ var node = createNode(188 /* BinaryExpression */, location);
node.left = parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined);
node.operatorToken = operatorToken;
node.right = parenthesizeBinaryOperand(operatorKind, right, /*isLeftSideOfBinary*/ false, node.left);
@@ -10801,7 +10849,7 @@ var ts;
}
ts.updateBinary = updateBinary;
function createConditional(condition, questionToken, whenTrue, colonToken, whenFalse, location) {
- var node = createNode(188 /* ConditionalExpression */, location);
+ var node = createNode(189 /* ConditionalExpression */, location);
node.condition = condition;
node.questionToken = questionToken;
node.whenTrue = whenTrue;
@@ -10818,7 +10866,7 @@ var ts;
}
ts.updateConditional = updateConditional;
function createTemplateExpression(head, templateSpans, location) {
- var node = createNode(189 /* TemplateExpression */, location);
+ var node = createNode(190 /* TemplateExpression */, location);
node.head = head;
node.templateSpans = createNodeArray(templateSpans);
return node;
@@ -10832,7 +10880,7 @@ var ts;
}
ts.updateTemplateExpression = updateTemplateExpression;
function createYield(asteriskToken, expression, location) {
- var node = createNode(190 /* YieldExpression */, location);
+ var node = createNode(191 /* YieldExpression */, location);
node.asteriskToken = asteriskToken;
node.expression = expression;
return node;
@@ -10846,7 +10894,7 @@ var ts;
}
ts.updateYield = updateYield;
function createSpread(expression, location) {
- var node = createNode(191 /* SpreadElementExpression */, location);
+ var node = createNode(192 /* SpreadElementExpression */, location);
node.expression = parenthesizeExpressionForList(expression);
return node;
}
@@ -10859,7 +10907,7 @@ var ts;
}
ts.updateSpread = updateSpread;
function createClassExpression(modifiers, name, typeParameters, heritageClauses, members, location) {
- var node = createNode(192 /* ClassExpression */, location);
+ var node = createNode(193 /* ClassExpression */, location);
node.decorators = undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = name;
@@ -10877,12 +10925,12 @@ var ts;
}
ts.updateClassExpression = updateClassExpression;
function createOmittedExpression(location) {
- var node = createNode(193 /* OmittedExpression */, location);
+ var node = createNode(194 /* OmittedExpression */, location);
return node;
}
ts.createOmittedExpression = createOmittedExpression;
function createExpressionWithTypeArguments(typeArguments, expression, location) {
- var node = createNode(194 /* ExpressionWithTypeArguments */, location);
+ var node = createNode(195 /* ExpressionWithTypeArguments */, location);
node.typeArguments = typeArguments ? createNodeArray(typeArguments) : undefined;
node.expression = parenthesizeForAccess(expression);
return node;
@@ -10897,7 +10945,7 @@ var ts;
ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments;
// Misc
function createTemplateSpan(expression, literal, location) {
- var node = createNode(197 /* TemplateSpan */, location);
+ var node = createNode(198 /* TemplateSpan */, location);
node.expression = expression;
node.literal = literal;
return node;
@@ -10912,7 +10960,7 @@ var ts;
ts.updateTemplateSpan = updateTemplateSpan;
// Element
function createBlock(statements, location, multiLine, flags) {
- var block = createNode(199 /* Block */, location, flags);
+ var block = createNode(200 /* Block */, location, flags);
block.statements = createNodeArray(statements);
if (multiLine) {
block.multiLine = true;
@@ -10928,7 +10976,7 @@ var ts;
}
ts.updateBlock = updateBlock;
function createVariableStatement(modifiers, declarationList, location, flags) {
- var node = createNode(200 /* VariableStatement */, location, flags);
+ var node = createNode(201 /* VariableStatement */, location, flags);
node.decorators = undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
@@ -10943,7 +10991,7 @@ var ts;
}
ts.updateVariableStatement = updateVariableStatement;
function createVariableDeclarationList(declarations, location, flags) {
- var node = createNode(219 /* VariableDeclarationList */, location, flags);
+ var node = createNode(220 /* VariableDeclarationList */, location, flags);
node.declarations = createNodeArray(declarations);
return node;
}
@@ -10956,7 +11004,7 @@ var ts;
}
ts.updateVariableDeclarationList = updateVariableDeclarationList;
function createVariableDeclaration(name, type, initializer, location, flags) {
- var node = createNode(218 /* VariableDeclaration */, location, flags);
+ var node = createNode(219 /* VariableDeclaration */, location, flags);
node.name = typeof name === "string" ? createIdentifier(name) : name;
node.type = type;
node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined;
@@ -10971,11 +11019,11 @@ var ts;
}
ts.updateVariableDeclaration = updateVariableDeclaration;
function createEmptyStatement(location) {
- return createNode(201 /* EmptyStatement */, location);
+ return createNode(202 /* EmptyStatement */, location);
}
ts.createEmptyStatement = createEmptyStatement;
function createStatement(expression, location, flags) {
- var node = createNode(202 /* ExpressionStatement */, location, flags);
+ var node = createNode(203 /* ExpressionStatement */, location, flags);
node.expression = parenthesizeExpressionForExpressionStatement(expression);
return node;
}
@@ -10988,7 +11036,7 @@ var ts;
}
ts.updateStatement = updateStatement;
function createIf(expression, thenStatement, elseStatement, location) {
- var node = createNode(203 /* IfStatement */, location);
+ var node = createNode(204 /* IfStatement */, location);
node.expression = expression;
node.thenStatement = thenStatement;
node.elseStatement = elseStatement;
@@ -11003,7 +11051,7 @@ var ts;
}
ts.updateIf = updateIf;
function createDo(statement, expression, location) {
- var node = createNode(204 /* DoStatement */, location);
+ var node = createNode(205 /* DoStatement */, location);
node.statement = statement;
node.expression = expression;
return node;
@@ -11017,7 +11065,7 @@ var ts;
}
ts.updateDo = updateDo;
function createWhile(expression, statement, location) {
- var node = createNode(205 /* WhileStatement */, location);
+ var node = createNode(206 /* WhileStatement */, location);
node.expression = expression;
node.statement = statement;
return node;
@@ -11031,7 +11079,7 @@ var ts;
}
ts.updateWhile = updateWhile;
function createFor(initializer, condition, incrementor, statement, location) {
- var node = createNode(206 /* ForStatement */, location, /*flags*/ undefined);
+ var node = createNode(207 /* ForStatement */, location, /*flags*/ undefined);
node.initializer = initializer;
node.condition = condition;
node.incrementor = incrementor;
@@ -11047,7 +11095,7 @@ var ts;
}
ts.updateFor = updateFor;
function createForIn(initializer, expression, statement, location) {
- var node = createNode(207 /* ForInStatement */, location);
+ var node = createNode(208 /* ForInStatement */, location);
node.initializer = initializer;
node.expression = expression;
node.statement = statement;
@@ -11062,7 +11110,7 @@ var ts;
}
ts.updateForIn = updateForIn;
function createForOf(initializer, expression, statement, location) {
- var node = createNode(208 /* ForOfStatement */, location);
+ var node = createNode(209 /* ForOfStatement */, location);
node.initializer = initializer;
node.expression = expression;
node.statement = statement;
@@ -11077,7 +11125,7 @@ var ts;
}
ts.updateForOf = updateForOf;
function createContinue(label, location) {
- var node = createNode(209 /* ContinueStatement */, location);
+ var node = createNode(210 /* ContinueStatement */, location);
if (label) {
node.label = label;
}
@@ -11092,7 +11140,7 @@ var ts;
}
ts.updateContinue = updateContinue;
function createBreak(label, location) {
- var node = createNode(210 /* BreakStatement */, location);
+ var node = createNode(211 /* BreakStatement */, location);
if (label) {
node.label = label;
}
@@ -11107,7 +11155,7 @@ var ts;
}
ts.updateBreak = updateBreak;
function createReturn(expression, location) {
- var node = createNode(211 /* ReturnStatement */, location);
+ var node = createNode(212 /* ReturnStatement */, location);
node.expression = expression;
return node;
}
@@ -11120,7 +11168,7 @@ var ts;
}
ts.updateReturn = updateReturn;
function createWith(expression, statement, location) {
- var node = createNode(212 /* WithStatement */, location);
+ var node = createNode(213 /* WithStatement */, location);
node.expression = expression;
node.statement = statement;
return node;
@@ -11134,7 +11182,7 @@ var ts;
}
ts.updateWith = updateWith;
function createSwitch(expression, caseBlock, location) {
- var node = createNode(213 /* SwitchStatement */, location);
+ var node = createNode(214 /* SwitchStatement */, location);
node.expression = parenthesizeExpressionForList(expression);
node.caseBlock = caseBlock;
return node;
@@ -11148,7 +11196,7 @@ var ts;
}
ts.updateSwitch = updateSwitch;
function createLabel(label, statement, location) {
- var node = createNode(214 /* LabeledStatement */, location);
+ var node = createNode(215 /* LabeledStatement */, location);
node.label = typeof label === "string" ? createIdentifier(label) : label;
node.statement = statement;
return node;
@@ -11162,7 +11210,7 @@ var ts;
}
ts.updateLabel = updateLabel;
function createThrow(expression, location) {
- var node = createNode(215 /* ThrowStatement */, location);
+ var node = createNode(216 /* ThrowStatement */, location);
node.expression = expression;
return node;
}
@@ -11175,7 +11223,7 @@ var ts;
}
ts.updateThrow = updateThrow;
function createTry(tryBlock, catchClause, finallyBlock, location) {
- var node = createNode(216 /* TryStatement */, location);
+ var node = createNode(217 /* TryStatement */, location);
node.tryBlock = tryBlock;
node.catchClause = catchClause;
node.finallyBlock = finallyBlock;
@@ -11190,7 +11238,7 @@ var ts;
}
ts.updateTry = updateTry;
function createCaseBlock(clauses, location) {
- var node = createNode(227 /* CaseBlock */, location);
+ var node = createNode(228 /* CaseBlock */, location);
node.clauses = createNodeArray(clauses);
return node;
}
@@ -11203,7 +11251,7 @@ var ts;
}
ts.updateCaseBlock = updateCaseBlock;
function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body, location, flags) {
- var node = createNode(220 /* FunctionDeclaration */, location, flags);
+ var node = createNode(221 /* FunctionDeclaration */, location, flags);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.asteriskToken = asteriskToken;
@@ -11223,7 +11271,7 @@ var ts;
}
ts.updateFunctionDeclaration = updateFunctionDeclaration;
function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members, location) {
- var node = createNode(221 /* ClassDeclaration */, location);
+ var node = createNode(222 /* ClassDeclaration */, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.name = name;
@@ -11241,7 +11289,7 @@ var ts;
}
ts.updateClassDeclaration = updateClassDeclaration;
function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier, location) {
- var node = createNode(230 /* ImportDeclaration */, location);
+ var node = createNode(231 /* ImportDeclaration */, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.importClause = importClause;
@@ -11257,7 +11305,7 @@ var ts;
}
ts.updateImportDeclaration = updateImportDeclaration;
function createImportClause(name, namedBindings, location) {
- var node = createNode(231 /* ImportClause */, location);
+ var node = createNode(232 /* ImportClause */, location);
node.name = name;
node.namedBindings = namedBindings;
return node;
@@ -11271,7 +11319,7 @@ var ts;
}
ts.updateImportClause = updateImportClause;
function createNamespaceImport(name, location) {
- var node = createNode(232 /* NamespaceImport */, location);
+ var node = createNode(233 /* NamespaceImport */, location);
node.name = name;
return node;
}
@@ -11284,7 +11332,7 @@ var ts;
}
ts.updateNamespaceImport = updateNamespaceImport;
function createNamedImports(elements, location) {
- var node = createNode(233 /* NamedImports */, location);
+ var node = createNode(234 /* NamedImports */, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -11297,7 +11345,7 @@ var ts;
}
ts.updateNamedImports = updateNamedImports;
function createImportSpecifier(propertyName, name, location) {
- var node = createNode(234 /* ImportSpecifier */, location);
+ var node = createNode(235 /* ImportSpecifier */, location);
node.propertyName = propertyName;
node.name = name;
return node;
@@ -11311,7 +11359,7 @@ var ts;
}
ts.updateImportSpecifier = updateImportSpecifier;
function createExportAssignment(decorators, modifiers, isExportEquals, expression, location) {
- var node = createNode(235 /* ExportAssignment */, location);
+ var node = createNode(236 /* ExportAssignment */, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.isExportEquals = isExportEquals;
@@ -11327,7 +11375,7 @@ var ts;
}
ts.updateExportAssignment = updateExportAssignment;
function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, location) {
- var node = createNode(236 /* ExportDeclaration */, location);
+ var node = createNode(237 /* ExportDeclaration */, location);
node.decorators = decorators ? createNodeArray(decorators) : undefined;
node.modifiers = modifiers ? createNodeArray(modifiers) : undefined;
node.exportClause = exportClause;
@@ -11343,7 +11391,7 @@ var ts;
}
ts.updateExportDeclaration = updateExportDeclaration;
function createNamedExports(elements, location) {
- var node = createNode(237 /* NamedExports */, location);
+ var node = createNode(238 /* NamedExports */, location);
node.elements = createNodeArray(elements);
return node;
}
@@ -11356,7 +11404,7 @@ var ts;
}
ts.updateNamedExports = updateNamedExports;
function createExportSpecifier(name, propertyName, location) {
- var node = createNode(238 /* ExportSpecifier */, location);
+ var node = createNode(239 /* ExportSpecifier */, location);
node.name = typeof name === "string" ? createIdentifier(name) : name;
node.propertyName = typeof propertyName === "string" ? createIdentifier(propertyName) : propertyName;
return node;
@@ -11371,7 +11419,7 @@ var ts;
ts.updateExportSpecifier = updateExportSpecifier;
// JSX
function createJsxElement(openingElement, children, closingElement, location) {
- var node = createNode(241 /* JsxElement */, location);
+ var node = createNode(242 /* JsxElement */, location);
node.openingElement = openingElement;
node.children = createNodeArray(children);
node.closingElement = closingElement;
@@ -11386,7 +11434,7 @@ var ts;
}
ts.updateJsxElement = updateJsxElement;
function createJsxSelfClosingElement(tagName, attributes, location) {
- var node = createNode(242 /* JsxSelfClosingElement */, location);
+ var node = createNode(243 /* JsxSelfClosingElement */, location);
node.tagName = tagName;
node.attributes = createNodeArray(attributes);
return node;
@@ -11400,7 +11448,7 @@ var ts;
}
ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement;
function createJsxOpeningElement(tagName, attributes, location) {
- var node = createNode(243 /* JsxOpeningElement */, location);
+ var node = createNode(244 /* JsxOpeningElement */, location);
node.tagName = tagName;
node.attributes = createNodeArray(attributes);
return node;
@@ -11653,47 +11701,47 @@ var ts;
ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression;
// Compound nodes
function createComma(left, right) {
- return createBinary(left, 24 /* CommaToken */, right);
+ return createBinary(left, 25 /* CommaToken */, right);
}
ts.createComma = createComma;
function createLessThan(left, right, location) {
- return createBinary(left, 25 /* LessThanToken */, right, location);
+ return createBinary(left, 26 /* LessThanToken */, right, location);
}
ts.createLessThan = createLessThan;
function createAssignment(left, right, location) {
- return createBinary(left, 56 /* EqualsToken */, right, location);
+ return createBinary(left, 57 /* EqualsToken */, right, location);
}
ts.createAssignment = createAssignment;
function createStrictEquality(left, right) {
- return createBinary(left, 32 /* EqualsEqualsEqualsToken */, right);
+ return createBinary(left, 33 /* EqualsEqualsEqualsToken */, right);
}
ts.createStrictEquality = createStrictEquality;
function createStrictInequality(left, right) {
- return createBinary(left, 33 /* ExclamationEqualsEqualsToken */, right);
+ return createBinary(left, 34 /* ExclamationEqualsEqualsToken */, right);
}
ts.createStrictInequality = createStrictInequality;
function createAdd(left, right) {
- return createBinary(left, 35 /* PlusToken */, right);
+ return createBinary(left, 36 /* PlusToken */, right);
}
ts.createAdd = createAdd;
function createSubtract(left, right) {
- return createBinary(left, 36 /* MinusToken */, right);
+ return createBinary(left, 37 /* MinusToken */, right);
}
ts.createSubtract = createSubtract;
function createPostfixIncrement(operand, location) {
- return createPostfix(operand, 41 /* PlusPlusToken */, location);
+ return createPostfix(operand, 42 /* PlusPlusToken */, location);
}
ts.createPostfixIncrement = createPostfixIncrement;
function createLogicalAnd(left, right) {
- return createBinary(left, 51 /* AmpersandAmpersandToken */, right);
+ return createBinary(left, 52 /* AmpersandAmpersandToken */, right);
}
ts.createLogicalAnd = createLogicalAnd;
function createLogicalOr(left, right) {
- return createBinary(left, 52 /* BarBarToken */, right);
+ return createBinary(left, 53 /* BarBarToken */, right);
}
ts.createLogicalOr = createLogicalOr;
function createLogicalNot(operand) {
- return createPrefix(49 /* ExclamationToken */, operand);
+ return createPrefix(50 /* ExclamationToken */, operand);
}
ts.createLogicalNot = createLogicalNot;
function createVoidZero() {
@@ -11714,7 +11762,7 @@ var ts;
function createRestParameter(name) {
return createParameterDeclaration(
/*decorators*/ undefined,
- /*modifiers*/ undefined, createToken(22 /* DotDotDotToken */), name,
+ /*modifiers*/ undefined, createToken(23 /* DotDotDotToken */), name,
/*questionToken*/ undefined,
/*type*/ undefined,
/*initializer*/ undefined);
@@ -11844,7 +11892,8 @@ var ts;
}
ts.createDecorateHelper = createDecorateHelper;
function createAwaiterHelper(externalHelpersModuleName, hasLexicalArguments, promiseConstructor, body) {
- var generatorFunc = createFunctionExpression(createToken(37 /* AsteriskToken */),
+ var generatorFunc = createFunctionExpression(
+ /*modifiers*/ undefined, createToken(38 /* AsteriskToken */),
/*name*/ undefined,
/*typeParameters*/ undefined,
/*parameters*/ [],
@@ -11935,6 +11984,7 @@ var ts;
/*modifiers*/ undefined, createConstDeclarationList([
createVariableDeclaration("_super",
/*type*/ undefined, createCall(createParen(createFunctionExpression(
+ /*modifiers*/ undefined,
/*asteriskToken*/ undefined,
/*name*/ undefined,
/*typeParameters*/ undefined, [
@@ -11963,19 +12013,19 @@ var ts;
function shouldBeCapturedInTempVariable(node, cacheIdentifiers) {
var target = skipParentheses(node);
switch (target.kind) {
- case 69 /* Identifier */:
+ case 70 /* Identifier */:
return cacheIdentifiers;
- case 97 /* ThisKeyword */:
+ case 98 /* ThisKeyword */:
case 8 /* NumericLiteral */:
case 9 /* StringLiteral */:
return false;
- case 170 /* ArrayLiteralExpression */:
+ case 171 /* ArrayLiteralExpression */:
var elements = target.elements;
if (elements.length === 0) {
return false;
}
return true;
- case 171 /* ObjectLiteralExpression */:
+ case 172 /* ObjectLiteralExpression */:
return target.properties.length > 0;
default:
return true;
@@ -11989,13 +12039,13 @@ var ts;
thisArg = createThis();
target = callee;
}
- else if (callee.kind === 95 /* SuperKeyword */) {
+ else if (callee.kind === 96 /* SuperKeyword */) {
thisArg = createThis();
- target = languageVersion < 2 /* ES6 */ ? createIdentifier("_super", /*location*/ callee) : callee;
+ target = languageVersion < 2 /* ES2015 */ ? createIdentifier("_super", /*location*/ callee) : callee;
}
else {
switch (callee.kind) {
- case 172 /* PropertyAccessExpression */: {
+ case 173 /* PropertyAccessExpression */: {
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
// for `a.b()` target is `(_a = a).b` and thisArg is `_a`
thisArg = createTempVariable(recordTempVariable);
@@ -12009,7 +12059,7 @@ var ts;
}
break;
}
- case 173 /* ElementAccessExpression */: {
+ case 174 /* ElementAccessExpression */: {
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
// for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a`
thisArg = createTempVariable(recordTempVariable);
@@ -12063,14 +12113,14 @@ var ts;
ts.createExpressionForPropertyName = createExpressionForPropertyName;
function createExpressionForObjectLiteralElementLike(node, property, receiver) {
switch (property.kind) {
- case 149 /* GetAccessor */:
- case 150 /* SetAccessor */:
+ case 150 /* GetAccessor */:
+ case 151 /* SetAccessor */:
return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine);
case 253 /* PropertyAssignment */:
return createExpressionForPropertyAssignment(property, receiver);
case 254 /* ShorthandPropertyAssignment */:
return createExpressionForShorthandPropertyAssignment(property, receiver);
- case 147 /* MethodDeclaration */:
+ case 148 /* MethodDeclaration */:
return createExpressionForMethodDeclaration(property, receiver);
}
}
@@ -12080,7 +12130,7 @@ var ts;
if (property === firstAccessor) {
var properties_1 = [];
if (getAccessor) {
- var getterFunction = createFunctionExpression(
+ var getterFunction = createFunctionExpression(getAccessor.modifiers,
/*asteriskToken*/ undefined,
/*name*/ undefined,
/*typeParameters*/ undefined, getAccessor.parameters,
@@ -12091,7 +12141,7 @@ var ts;
properties_1.push(getter);
}
if (setAccessor) {
- var setterFunction = createFunctionExpression(
+ var setterFunction = createFunctionExpression(setAccessor.modifiers,
/*asteriskToken*/ undefined,
/*name*/ undefined,
/*typeParameters*/ undefined, setAccessor.parameters,
@@ -12125,7 +12175,7 @@ var ts;
/*original*/ property));
}
function createExpressionForMethodDeclaration(method, receiver) {
- return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, method.name, /*location*/ method.name), setOriginalNode(createFunctionExpression(method.asteriskToken,
+ return ts.aggregateTransformFlags(setOriginalNode(createAssignment(createMemberAccessForPropertyName(receiver, method.name, /*location*/ method.name), setOriginalNode(createFunctionExpression(method.modifiers, method.asteriskToken,
/*name*/ undefined,
/*typeParameters*/ undefined, method.parameters,
/*type*/ undefined, method.body,
@@ -12150,7 +12200,7 @@ var ts;
* @param visitor: Optional callback used to visit any custom prologue directives.
*/
function addPrologueDirectives(target, source, ensureUseStrict, visitor) {
- ts.Debug.assert(target.length === 0, "PrologueDirectives should be at the first statement in the target statements array");
+ ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array");
var foundUseStrict = false;
var statementOffset = 0;
var numStatements = source.length;
@@ -12163,16 +12213,20 @@ var ts;
target.push(statement);
}
else {
- if (ensureUseStrict && !foundUseStrict) {
- target.push(startOnNewLine(createStatement(createLiteral("use strict"))));
- foundUseStrict = true;
- }
- if (getEmitFlags(statement) & 8388608 /* CustomPrologue */) {
- target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement);
- }
- else {
- break;
- }
+ break;
+ }
+ statementOffset++;
+ }
+ if (ensureUseStrict && !foundUseStrict) {
+ target.push(startOnNewLine(createStatement(createLiteral("use strict"))));
+ }
+ while (statementOffset < numStatements) {
+ var statement = source[statementOffset];
+ if (getEmitFlags(statement) & 8388608 /* CustomPrologue */) {
+ target.push(visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement);
+ }
+ else {
+ break;
}
statementOffset++;
}
@@ -12219,7 +12273,7 @@ var ts;
function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
var skipped = skipPartiallyEmittedExpressions(operand);
// If the resulting expression is already parenthesized, we do not need to do any further processing.
- if (skipped.kind === 178 /* ParenthesizedExpression */) {
+ if (skipped.kind === 179 /* ParenthesizedExpression */) {
return operand;
}
return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand)
@@ -12253,8 +12307,8 @@ var ts;
//
// If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve
// the intended order of operations: `(a ** b) ** c`
- var binaryOperatorPrecedence = ts.getOperatorPrecedence(187 /* BinaryExpression */, binaryOperator);
- var binaryOperatorAssociativity = ts.getOperatorAssociativity(187 /* BinaryExpression */, binaryOperator);
+ var binaryOperatorPrecedence = ts.getOperatorPrecedence(188 /* BinaryExpression */, binaryOperator);
+ var binaryOperatorAssociativity = ts.getOperatorAssociativity(188 /* BinaryExpression */, binaryOperator);
var emittedOperand = skipPartiallyEmittedExpressions(operand);
var operandPrecedence = ts.getExpressionPrecedence(emittedOperand);
switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) {
@@ -12263,7 +12317,7 @@ var ts;
// and is a yield expression, then we do not need parentheses.
if (!isLeftSideOfBinary
&& binaryOperatorAssociativity === 1 /* Right */
- && operand.kind === 190 /* YieldExpression */) {
+ && operand.kind === 191 /* YieldExpression */) {
return false;
}
return true;
@@ -12300,7 +12354,7 @@ var ts;
// the same kind (recursively).
// "a"+(1+2) => "a"+(1+2)
// "a"+("b"+"c") => "a"+"b"+"c"
- if (binaryOperator === 35 /* PlusToken */) {
+ if (binaryOperator === 36 /* PlusToken */) {
var leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0 /* Unknown */;
if (ts.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) {
return false;
@@ -12335,10 +12389,10 @@ var ts;
//
// While addition is associative in mathematics, JavaScript's `+` is not
// guaranteed to be associative as it is overloaded with string concatenation.
- return binaryOperator === 37 /* AsteriskToken */
- || binaryOperator === 47 /* BarToken */
- || binaryOperator === 46 /* AmpersandToken */
- || binaryOperator === 48 /* CaretToken */;
+ return binaryOperator === 38 /* AsteriskToken */
+ || binaryOperator === 48 /* BarToken */
+ || binaryOperator === 47 /* AmpersandToken */
+ || binaryOperator === 49 /* CaretToken */;
}
/**
* This function determines whether an expression consists of a homogeneous set of
@@ -12351,7 +12405,7 @@ var ts;
if (ts.isLiteralKind(node.kind)) {
return node.kind;
}
- if (node.kind === 187 /* BinaryExpression */ && node.operatorToken.kind === 35 /* PlusToken */) {
+ if (node.kind === 188 /* BinaryExpression */ && node.operatorToken.kind === 36 /* PlusToken */) {
if (node.cachedLiteralKind !== undefined) {
return node.cachedLiteralKind;
}
@@ -12374,9 +12428,9 @@ var ts;
function parenthesizeForNew(expression) {
var emittedExpression = skipPartiallyEmittedExpressions(expression);
switch (emittedExpression.kind) {
- case 174 /* CallExpression */:
+ case 175 /* CallExpression */:
return createParen(expression);
- case 175 /* NewExpression */:
+ case 176 /* NewExpression */:
return emittedExpression.arguments
? expression
: createParen(expression);
@@ -12401,7 +12455,7 @@ var ts;
//
var emittedExpression = skipPartiallyEmittedExpressions(expression);
if (ts.isLeftHandSideExpression(emittedExpression)
- && (emittedExpression.kind !== 175 /* NewExpression */ || emittedExpression.arguments)
+ && (emittedExpression.kind !== 176 /* NewExpression */ || emittedExpression.arguments)
&& emittedExpression.kind !== 8 /* NumericLiteral */) {
return expression;
}
@@ -12439,7 +12493,7 @@ var ts;
function parenthesizeExpressionForList(expression) {
var emittedExpression = skipPartiallyEmittedExpressions(expression);
var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression);
- var commaPrecedence = ts.getOperatorPrecedence(187 /* BinaryExpression */, 24 /* CommaToken */);
+ var commaPrecedence = ts.getOperatorPrecedence(188 /* BinaryExpression */, 25 /* CommaToken */);
return expressionPrecedence > commaPrecedence
? expression
: createParen(expression, /*location*/ expression);
@@ -12450,7 +12504,7 @@ var ts;
if (ts.isCallExpression(emittedExpression)) {
var callee = emittedExpression.expression;
var kind = skipPartiallyEmittedExpressions(callee).kind;
- if (kind === 179 /* FunctionExpression */ || kind === 180 /* ArrowFunction */) {
+ if (kind === 180 /* FunctionExpression */ || kind === 181 /* ArrowFunction */) {
var mutableCall = getMutableClone(emittedExpression);
mutableCall.expression = createParen(callee, /*location*/ callee);
return recreatePartiallyEmittedExpressions(expression, mutableCall);
@@ -12458,7 +12512,7 @@ var ts;
}
else {
var leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind;
- if (leftmostExpressionKind === 171 /* ObjectLiteralExpression */ || leftmostExpressionKind === 179 /* FunctionExpression */) {
+ if (leftmostExpressionKind === 172 /* ObjectLiteralExpression */ || leftmostExpressionKind === 180 /* FunctionExpression */) {
return createParen(expression, /*location*/ expression);
}
}
@@ -12482,18 +12536,18 @@ var ts;
function getLeftmostExpression(node) {
while (true) {
switch (node.kind) {
- case 186 /* PostfixUnaryExpression */:
+ case 187 /* PostfixUnaryExpression */:
node = node.operand;
continue;
- case 187 /* BinaryExpression */:
+ case 188 /* BinaryExpression */:
node = node.left;
continue;
- case 188 /* ConditionalExpression */:
+ case 189 /* ConditionalExpression */:
node = node.condition;
continue;
- case 174 /* CallExpression */:
- case 173 /* ElementAccessExpression */:
- case 172 /* PropertyAccessExpression */:
+ case 175 /* CallExpression */:
+ case 174 /* ElementAccessExpression */:
+ case 173 /* PropertyAccessExpression */:
node = node.expression;
continue;
case 288 /* PartiallyEmittedExpression */:
@@ -12505,7 +12559,7 @@ var ts;
}
function parenthesizeConciseBody(body) {
var emittedBody = skipPartiallyEmittedExpressions(body);
- if (emittedBody.kind === 171 /* ObjectLiteralExpression */) {
+ if (emittedBody.kind === 172 /* ObjectLiteralExpression */) {
return createParen(body, /*location*/ body);
}
return body;
@@ -12537,7 +12591,7 @@ var ts;
}
ts.skipOuterExpressions = skipOuterExpressions;
function skipParentheses(node) {
- while (node.kind === 178 /* ParenthesizedExpression */) {
+ while (node.kind === 179 /* ParenthesizedExpression */) {
node = node.expression;
}
return node;
@@ -12771,10 +12825,10 @@ var ts;
var name_9 = namespaceDeclaration.name;
return ts.isGeneratedIdentifier(name_9) ? name_9 : createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name));
}
- if (node.kind === 230 /* ImportDeclaration */ && node.importClause) {
+ if (node.kind === 231 /* ImportDeclaration */ && node.importClause) {
return getGeneratedNameForNode(node);
}
- if (node.kind === 236 /* ExportDeclaration */ && node.moduleSpecifier) {
+ if (node.kind === 237 /* ExportDeclaration */ && node.moduleSpecifier) {
return getGeneratedNameForNode(node);
}
return undefined;
@@ -12845,10 +12899,10 @@ var ts;
if (kind === 256 /* SourceFile */) {
return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end);
}
- else if (kind === 69 /* Identifier */) {
+ else if (kind === 70 /* Identifier */) {
return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, pos, end);
}
- else if (kind < 139 /* FirstNode */) {
+ else if (kind < 140 /* FirstNode */) {
return new (TokenConstructor || (TokenConstructor = ts.objectAllocator.getTokenConstructor()))(kind, pos, end);
}
else {
@@ -12891,10 +12945,10 @@ var ts;
var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode;
var cbNodes = cbNodeArray || cbNode;
switch (node.kind) {
- case 139 /* QualifiedName */:
+ case 140 /* QualifiedName */:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.right);
- case 141 /* TypeParameter */:
+ case 142 /* TypeParameter */:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.constraint) ||
visitNode(cbNode, node.expression);
@@ -12905,12 +12959,12 @@ var ts;
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.equalsToken) ||
visitNode(cbNode, node.objectAssignmentInitializer);
- case 142 /* Parameter */:
- case 145 /* PropertyDeclaration */:
- case 144 /* PropertySignature */:
+ case 143 /* Parameter */:
+ case 146 /* PropertyDeclaration */:
+ case 145 /* PropertySignature */:
case 253 /* PropertyAssignment */:
- case 218 /* VariableDeclaration */:
- case 169 /* BindingElement */:
+ case 219 /* VariableDeclaration */:
+ case 170 /* BindingElement */:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.propertyName) ||
@@ -12919,24 +12973,24 @@ var ts;
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
- case 156 /* FunctionType */:
- case 157 /* ConstructorType */:
- case 151 /* CallSignature */:
- case 152 /* ConstructSignature */:
- case 153 /* IndexSignature */:
+ case 157 /* FunctionType */:
+ case 158 /* ConstructorType */:
+ case 152 /* CallSignature */:
+ case 153 /* ConstructSignature */:
+ case 154 /* IndexSignature */:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNodes(cbNodes, node.typeParameters) ||
visitNodes(cbNodes, node.parameters) ||
visitNode(cbNode, node.type);
- case 147 /* MethodDeclaration */:
- case 146 /* MethodSignature */:
- case 148 /* Constructor */:
- case 149 /* GetAccessor */:
- case 150 /* SetAccessor */:
- case 179 /* FunctionExpression */:
- case 220 /* FunctionDeclaration */:
- case 180 /* ArrowFunction */:
+ case 148 /* MethodDeclaration */:
+ case 147 /* MethodSignature */:
+ case 149 /* Constructor */:
+ case 150 /* GetAccessor */:
+ case 151 /* SetAccessor */:
+ case 180 /* FunctionExpression */:
+ case 221 /* FunctionDeclaration */:
+ case 181 /* ArrowFunction */:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.asteriskToken) ||
@@ -12947,176 +13001,176 @@ var ts;
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.equalsGreaterThanToken) ||
visitNode(cbNode, node.body);
- case 155 /* TypeReference */:
+ case 156 /* TypeReference */:
return visitNode(cbNode, node.typeName) ||
visitNodes(cbNodes, node.typeArguments);
- case 154 /* TypePredicate */:
+ case 155 /* TypePredicate */:
return visitNode(cbNode, node.parameterName) ||
visitNode(cbNode, node.type);
- case 158 /* TypeQuery */:
+ case 159 /* TypeQuery */:
return visitNode(cbNode, node.exprName);
- case 159 /* TypeLiteral */:
+ case 160 /* TypeLiteral */:
return visitNodes(cbNodes, node.members);
- case 160 /* ArrayType */:
+ case 161 /* ArrayType */:
return visitNode(cbNode, node.elementType);
- case 161 /* TupleType */:
+ case 162 /* TupleType */:
return visitNodes(cbNodes, node.elementTypes);
- case 162 /* UnionType */:
- case 163 /* IntersectionType */:
+ case 163 /* UnionType */:
+ case 164 /* IntersectionType */:
return visitNodes(cbNodes, node.types);
- case 164 /* ParenthesizedType */:
+ case 165 /* ParenthesizedType */:
return visitNode(cbNode, node.type);
- case 166 /* LiteralType */:
+ case 167 /* LiteralType */:
return visitNode(cbNode, node.literal);
- case 167 /* ObjectBindingPattern */:
- case 168 /* ArrayBindingPattern */:
+ case 168 /* ObjectBindingPattern */:
+ case 169 /* ArrayBindingPattern */:
return visitNodes(cbNodes, node.elements);
- case 170 /* ArrayLiteralExpression */:
+ case 171 /* ArrayLiteralExpression */:
return visitNodes(cbNodes, node.elements);
- case 171 /* ObjectLiteralExpression */:
+ case 172 /* ObjectLiteralExpression */:
return visitNodes(cbNodes, node.properties);
- case 172 /* PropertyAccessExpression */:
+ case 173 /* PropertyAccessExpression */:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.name);
- case 173 /* ElementAccessExpression */:
+ case 174 /* ElementAccessExpression */:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.argumentExpression);
- case 174 /* CallExpression */:
- case 175 /* NewExpression */:
+ case 175 /* CallExpression */:
+ case 176 /* NewExpression */:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNodes, node.typeArguments) ||
visitNodes(cbNodes, node.arguments);
- case 176 /* TaggedTemplateExpression */:
+ case 177 /* TaggedTemplateExpression */:
return visitNode(cbNode, node.tag) ||
visitNode(cbNode, node.template);
- case 177 /* TypeAssertionExpression */:
+ case 178 /* TypeAssertionExpression */:
return visitNode(cbNode, node.type) ||
visitNode(cbNode, node.expression);
- case 178 /* ParenthesizedExpression */:
+ case 179 /* ParenthesizedExpression */:
return visitNode(cbNode, node.expression);
- case 181 /* DeleteExpression */:
+ case 182 /* DeleteExpression */:
return visitNode(cbNode, node.expression);
- case 182 /* TypeOfExpression */:
+ case 183 /* TypeOfExpression */:
return visitNode(cbNode, node.expression);
- case 183 /* VoidExpression */:
+ case 184 /* VoidExpression */:
return visitNode(cbNode, node.expression);
- case 185 /* PrefixUnaryExpression */:
+ case 186 /* PrefixUnaryExpression */:
return visitNode(cbNode, node.operand);
- case 190 /* YieldExpression */:
+ case 191 /* YieldExpression */:
return visitNode(cbNode, node.asteriskToken) ||
visitNode(cbNode, node.expression);
- case 184 /* AwaitExpression */:
+ case 185 /* AwaitExpression */:
return visitNode(cbNode, node.expression);
- case 186 /* PostfixUnaryExpression */:
+ case 187 /* PostfixUnaryExpression */:
return visitNode(cbNode, node.operand);
- case 187 /* BinaryExpression */:
+ case 188 /* BinaryExpression */:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.operatorToken) ||
visitNode(cbNode, node.right);
- case 195 /* AsExpression */:
+ case 196 /* AsExpression */:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.type);
- case 196 /* NonNullExpression */:
+ case 197 /* NonNullExpression */:
return visitNode(cbNode, node.expression);
- case 188 /* ConditionalExpression */:
+ case 189 /* ConditionalExpression */:
return visitNode(cbNode, node.condition) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.whenTrue) ||
visitNode(cbNode, node.colonToken) ||
visitNode(cbNode, node.whenFalse);
- case 191 /* SpreadElementExpression */:
+ case 192 /* SpreadElementExpression */:
return visitNode(cbNode, node.expression);
- case 199 /* Block */:
- case 226 /* ModuleBlock */:
+ case 200 /* Block */:
+ case 227 /* ModuleBlock */:
return visitNodes(cbNodes, node.statements);
case 256 /* SourceFile */:
return visitNodes(cbNodes, node.statements) ||
visitNode(cbNode, node.endOfFileToken);
- case 200 /* VariableStatement */:
+ case 201 /* VariableStatement */:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.declarationList);
- case 219 /* VariableDeclarationList */:
+ case 220 /* VariableDeclarationList */:
return visitNodes(cbNodes, node.declarations);
- case 202 /* ExpressionStatement */:
+ case 203 /* ExpressionStatement */:
return visitNode(cbNode, node.expression);
- case 203 /* IfStatement */:
+ case 204 /* IfStatement */:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.thenStatement) ||
visitNode(cbNode, node.elseStatement);
- case 204 /* DoStatement */:
+ case 205 /* DoStatement */:
return visitNode(cbNode, node.statement) ||
visitNode(cbNode, node.expression);
- case 205 /* WhileStatement */:
+ case 206 /* WhileStatement */:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 206 /* ForStatement */:
+ case 207 /* ForStatement */:
return visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.condition) ||
visitNode(cbNode, node.incrementor) ||
visitNode(cbNode, node.statement);
- case 207 /* ForInStatement */:
+ case 208 /* ForInStatement */:
return visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 208 /* ForOfStatement */:
+ case 209 /* ForOfStatement */:
return visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 209 /* ContinueStatement */:
- case 210 /* BreakStatement */:
+ case 210 /* ContinueStatement */:
+ case 211 /* BreakStatement */:
return visitNode(cbNode, node.label);
- case 211 /* ReturnStatement */:
+ case 212 /* ReturnStatement */:
return visitNode(cbNode, node.expression);
- case 212 /* WithStatement */:
+ case 213 /* WithStatement */:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 213 /* SwitchStatement */:
+ case 214 /* SwitchStatement */:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.caseBlock);
- case 227 /* CaseBlock */:
+ case 228 /* CaseBlock */:
return visitNodes(cbNodes, node.clauses);
case 249 /* CaseClause */:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNodes, node.statements);
case 250 /* DefaultClause */:
return visitNodes(cbNodes, node.statements);
- case 214 /* LabeledStatement */:
+ case 215 /* LabeledStatement */:
return visitNode(cbNode, node.label) ||
visitNode(cbNode, node.statement);
- case 215 /* ThrowStatement */:
+ case 216 /* ThrowStatement */:
return visitNode(cbNode, node.expression);
- case 216 /* TryStatement */:
+ case 217 /* TryStatement */:
return visitNode(cbNode, node.tryBlock) ||
visitNode(cbNode, node.catchClause) ||
visitNode(cbNode, node.finallyBlock);
case 252 /* CatchClause */:
return visitNode(cbNode, node.variableDeclaration) ||
visitNode(cbNode, node.block);
- case 143 /* Decorator */:
+ case 144 /* Decorator */:
return visitNode(cbNode, node.expression);
- case 221 /* ClassDeclaration */:
- case 192 /* ClassExpression */:
+ case 222 /* ClassDeclaration */:
+ case 193 /* ClassExpression */:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNodes(cbNodes, node.typeParameters) ||
visitNodes(cbNodes, node.heritageClauses) ||
visitNodes(cbNodes, node.members);
- case 222 /* InterfaceDeclaration */:
+ case 223 /* InterfaceDeclaration */:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNodes(cbNodes, node.typeParameters) ||
visitNodes(cbNodes, node.heritageClauses) ||
visitNodes(cbNodes, node.members);
- case 223 /* TypeAliasDeclaration */:
+ case 224 /* TypeAliasDeclaration */:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNodes(cbNodes, node.typeParameters) ||
visitNode(cbNode, node.type);
- case 224 /* EnumDeclaration */:
+ case 225 /* EnumDeclaration */:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
@@ -13124,65 +13178,65 @@ var ts;
case 255 /* EnumMember */:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.initializer);
- case 225 /* ModuleDeclaration */:
+ case 226 /* ModuleDeclaration */:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.body);
- case 229 /* ImportEqualsDeclaration */:
+ case 230 /* ImportEqualsDeclaration */:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.moduleReference);
- case 230 /* ImportDeclaration */:
+ case 231 /* ImportDeclaration */:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.importClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 231 /* ImportClause */:
+ case 232 /* ImportClause */:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.namedBindings);
- case 228 /* NamespaceExportDeclaration */:
+ case 229 /* NamespaceExportDeclaration */:
return visitNode(cbNode, node.name);
- case 232 /* NamespaceImport */:
+ case 233 /* NamespaceImport */:
return visitNode(cbNode, node.name);
- case 233 /* NamedImports */:
- case 237 /* NamedExports */:
+ case 234 /* NamedImports */:
+ case 238 /* NamedExports */:
return visitNodes(cbNodes, node.elements);
- case 236 /* ExportDeclaration */:
+ case 237 /* ExportDeclaration */:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.exportClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 234 /* ImportSpecifier */:
- case 238 /* ExportSpecifier */:
+ case 235 /* ImportSpecifier */:
+ case 239 /* ExportSpecifier */:
return visitNode(cbNode, node.propertyName) ||
visitNode(cbNode, node.name);
- case 235 /* ExportAssignment */:
+ case 236 /* ExportAssignment */:
return visitNodes(cbNodes, node.decorators) ||
visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, node.expression);
- case 189 /* TemplateExpression */:
+ case 190 /* TemplateExpression */:
return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans);
- case 197 /* TemplateSpan */:
+ case 198 /* TemplateSpan */:
return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal);
- case 140 /* ComputedPropertyName */:
+ case 141 /* ComputedPropertyName */:
return visitNode(cbNode, node.expression);
case 251 /* HeritageClause */:
return visitNodes(cbNodes, node.types);
- case 194 /* ExpressionWithTypeArguments */:
+ case 195 /* ExpressionWithTypeArguments */:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNodes, node.typeArguments);
- case 240 /* ExternalModuleReference */:
+ case 241 /* ExternalModuleReference */:
return visitNode(cbNode, node.expression);
- case 239 /* MissingDeclaration */:
+ case 240 /* MissingDeclaration */:
return visitNodes(cbNodes, node.decorators);
- case 241 /* JsxElement */:
+ case 242 /* JsxElement */:
return visitNode(cbNode, node.openingElement) ||
visitNodes(cbNodes, node.children) ||
visitNode(cbNode, node.closingElement);
- case 242 /* JsxSelfClosingElement */:
- case 243 /* JsxOpeningElement */:
+ case 243 /* JsxSelfClosingElement */:
+ case 244 /* JsxOpeningElement */:
return visitNode(cbNode, node.tagName) ||
visitNodes(cbNodes, node.attributes);
case 246 /* JsxAttribute */:
@@ -13303,7 +13357,7 @@ var ts;
(function (Parser) {
// Share a single scanner across all calls to parse a source file. This helps speed things
// up by avoiding the cost of creating/compiling scanners over and over again.
- var scanner = ts.createScanner(2 /* Latest */, /*skipTrivia*/ true);
+ var scanner = ts.createScanner(4 /* Latest */, /*skipTrivia*/ true);
var disallowInAndDecoratorContext = 32768 /* DisallowInContext */ | 131072 /* DecoratorContext */;
// capture constructors in 'initializeState' to avoid null checks
var NodeConstructor;
@@ -13394,9 +13448,9 @@ var ts;
// Note: any errors at the end of the file that do not precede a regular node, should get
// attached to the EOF token.
var parseErrorBeforeNextFinishedNode = false;
- function parseSourceFile(fileName, _sourceText, languageVersion, _syntaxCursor, setParentNodes, scriptKind) {
+ function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind) {
scriptKind = ts.ensureScriptKind(fileName, scriptKind);
- initializeState(fileName, _sourceText, languageVersion, _syntaxCursor, scriptKind);
+ initializeState(sourceText, languageVersion, syntaxCursor, scriptKind);
var result = parseSourceFileWorker(fileName, languageVersion, setParentNodes, scriptKind);
clearState();
return result;
@@ -13406,7 +13460,7 @@ var ts;
// .tsx and .jsx files are treated as jsx language variant.
return scriptKind === 4 /* TSX */ || scriptKind === 2 /* JSX */ || scriptKind === 1 /* JS */ ? 1 /* JSX */ : 0 /* Standard */;
}
- function initializeState(fileName, _sourceText, languageVersion, _syntaxCursor, scriptKind) {
+ function initializeState(_sourceText, languageVersion, _syntaxCursor, scriptKind) {
NodeConstructor = ts.objectAllocator.getNodeConstructor();
TokenConstructor = ts.objectAllocator.getTokenConstructor();
IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor();
@@ -13710,20 +13764,20 @@ var ts;
}
// Ignore strict mode flag because we will report an error in type checker instead.
function isIdentifier() {
- if (token() === 69 /* Identifier */) {
+ if (token() === 70 /* Identifier */) {
return true;
}
// If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is
// considered a keyword and is not an identifier.
- if (token() === 114 /* YieldKeyword */ && inYieldContext()) {
+ if (token() === 115 /* YieldKeyword */ && inYieldContext()) {
return false;
}
// If we have a 'await' keyword, and we're in the [Await] context, then 'await' is
// considered a keyword and is not an identifier.
- if (token() === 119 /* AwaitKeyword */ && inAwaitContext()) {
+ if (token() === 120 /* AwaitKeyword */ && inAwaitContext()) {
return false;
}
- return token() > 105 /* LastReservedWord */;
+ return token() > 106 /* LastReservedWord */;
}
function parseExpected(kind, diagnosticMessage, shouldAdvance) {
if (shouldAdvance === void 0) { shouldAdvance = true; }
@@ -13766,22 +13820,22 @@ var ts;
}
function canParseSemicolon() {
// If there's a real semicolon, then we can always parse it out.
- if (token() === 23 /* SemicolonToken */) {
+ if (token() === 24 /* SemicolonToken */) {
return true;
}
// We can parse out an optional semicolon in ASI cases in the following cases.
- return token() === 16 /* CloseBraceToken */ || token() === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak();
+ return token() === 17 /* CloseBraceToken */ || token() === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak();
}
function parseSemicolon() {
if (canParseSemicolon()) {
- if (token() === 23 /* SemicolonToken */) {
+ if (token() === 24 /* SemicolonToken */) {
// consume the semicolon if it was explicitly provided.
nextToken();
}
return true;
}
else {
- return parseExpected(23 /* SemicolonToken */);
+ return parseExpected(24 /* SemicolonToken */);
}
}
// note: this function creates only node
@@ -13790,8 +13844,8 @@ var ts;
if (!(pos >= 0)) {
pos = scanner.getStartPos();
}
- return kind >= 139 /* FirstNode */ ? new NodeConstructor(kind, pos, pos) :
- kind === 69 /* Identifier */ ? new IdentifierConstructor(kind, pos, pos) :
+ return kind >= 140 /* FirstNode */ ? new NodeConstructor(kind, pos, pos) :
+ kind === 70 /* Identifier */ ? new IdentifierConstructor(kind, pos, pos) :
new TokenConstructor(kind, pos, pos);
}
function createNodeArray(elements, pos) {
@@ -13838,16 +13892,16 @@ var ts;
function createIdentifier(isIdentifier, diagnosticMessage) {
identifierCount++;
if (isIdentifier) {
- var node = createNode(69 /* Identifier */);
+ var node = createNode(70 /* Identifier */);
// Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker
- if (token() !== 69 /* Identifier */) {
+ if (token() !== 70 /* Identifier */) {
node.originalKeywordKind = token();
}
node.text = internIdentifier(scanner.getTokenValue());
nextToken();
return finishNode(node);
}
- return createMissingNode(69 /* Identifier */, /*reportAtCurrentPosition*/ false, diagnosticMessage || ts.Diagnostics.Identifier_expected);
+ return createMissingNode(70 /* Identifier */, /*reportAtCurrentPosition*/ false, diagnosticMessage || ts.Diagnostics.Identifier_expected);
}
function parseIdentifier(diagnosticMessage) {
return createIdentifier(isIdentifier(), diagnosticMessage);
@@ -13864,7 +13918,7 @@ var ts;
if (token() === 9 /* StringLiteral */ || token() === 8 /* NumericLiteral */) {
return parseLiteralNode(/*internName*/ true);
}
- if (allowComputedPropertyNames && token() === 19 /* OpenBracketToken */) {
+ if (allowComputedPropertyNames && token() === 20 /* OpenBracketToken */) {
return parseComputedPropertyName();
}
return parseIdentifierName();
@@ -13882,13 +13936,13 @@ var ts;
// PropertyName [Yield]:
// LiteralPropertyName
// ComputedPropertyName[?Yield]
- var node = createNode(140 /* ComputedPropertyName */);
- parseExpected(19 /* OpenBracketToken */);
+ var node = createNode(141 /* ComputedPropertyName */);
+ parseExpected(20 /* OpenBracketToken */);
// We parse any expression (including a comma expression). But the grammar
// says that only an assignment expression is allowed, so the grammar checker
// will error if it sees a comma expression.
node.expression = allowInAnd(parseExpression);
- parseExpected(20 /* CloseBracketToken */);
+ parseExpected(21 /* CloseBracketToken */);
return finishNode(node);
}
function parseContextualModifier(t) {
@@ -13902,21 +13956,21 @@ var ts;
return canFollowModifier();
}
function nextTokenCanFollowModifier() {
- if (token() === 74 /* ConstKeyword */) {
+ if (token() === 75 /* ConstKeyword */) {
// 'const' is only a modifier if followed by 'enum'.
- return nextToken() === 81 /* EnumKeyword */;
+ return nextToken() === 82 /* EnumKeyword */;
}
- if (token() === 82 /* ExportKeyword */) {
+ if (token() === 83 /* ExportKeyword */) {
nextToken();
- if (token() === 77 /* DefaultKeyword */) {
+ if (token() === 78 /* DefaultKeyword */) {
return lookAhead(nextTokenIsClassOrFunctionOrAsync);
}
- return token() !== 37 /* AsteriskToken */ && token() !== 116 /* AsKeyword */ && token() !== 15 /* OpenBraceToken */ && canFollowModifier();
+ return token() !== 38 /* AsteriskToken */ && token() !== 117 /* AsKeyword */ && token() !== 16 /* OpenBraceToken */ && canFollowModifier();
}
- if (token() === 77 /* DefaultKeyword */) {
+ if (token() === 78 /* DefaultKeyword */) {
return nextTokenIsClassOrFunctionOrAsync();
}
- if (token() === 113 /* StaticKeyword */) {
+ if (token() === 114 /* StaticKeyword */) {
nextToken();
return canFollowModifier();
}
@@ -13926,16 +13980,16 @@ var ts;
return ts.isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 19 /* OpenBracketToken */
- || token() === 15 /* OpenBraceToken */
- || token() === 37 /* AsteriskToken */
- || token() === 22 /* DotDotDotToken */
+ return token() === 20 /* OpenBracketToken */
+ || token() === 16 /* OpenBraceToken */
+ || token() === 38 /* AsteriskToken */
+ || token() === 23 /* DotDotDotToken */
|| isLiteralPropertyName();
}
function nextTokenIsClassOrFunctionOrAsync() {
nextToken();
- return token() === 73 /* ClassKeyword */ || token() === 87 /* FunctionKeyword */ ||
- (token() === 118 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
+ return token() === 74 /* ClassKeyword */ || token() === 88 /* FunctionKeyword */ ||
+ (token() === 119 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
}
// True if positioned at the start of a list element
function isListElement(parsingContext, inErrorRecovery) {
@@ -13953,9 +14007,9 @@ var ts;
// we're parsing. For example, if we have a semicolon in the middle of a class, then
// we really don't want to assume the class is over and we're on a statement in the
// outer module. We just want to consume and move on.
- return !(token() === 23 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement();
+ return !(token() === 24 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement();
case 2 /* SwitchClauses */:
- return token() === 71 /* CaseKeyword */ || token() === 77 /* DefaultKeyword */;
+ return token() === 72 /* CaseKeyword */ || token() === 78 /* DefaultKeyword */;
case 4 /* TypeMembers */:
return lookAhead(isTypeMemberStart);
case 5 /* ClassMembers */:
@@ -13963,19 +14017,19 @@ var ts;
// not in error recovery. If we're in error recovery, we don't want an errant
// semicolon to be treated as a class member (since they're almost always used
// for statements.
- return lookAhead(isClassMemberStart) || (token() === 23 /* SemicolonToken */ && !inErrorRecovery);
+ return lookAhead(isClassMemberStart) || (token() === 24 /* SemicolonToken */ && !inErrorRecovery);
case 6 /* EnumMembers */:
// Include open bracket computed properties. This technically also lets in indexers,
// which would be a candidate for improved error reporting.
- return token() === 19 /* OpenBracketToken */ || isLiteralPropertyName();
+ return token() === 20 /* OpenBracketToken */ || isLiteralPropertyName();
case 12 /* ObjectLiteralMembers */:
- return token() === 19 /* OpenBracketToken */ || token() === 37 /* AsteriskToken */ || isLiteralPropertyName();
+ return token() === 20 /* OpenBracketToken */ || token() === 38 /* AsteriskToken */ || isLiteralPropertyName();
case 9 /* ObjectBindingElements */:
- return token() === 19 /* OpenBracketToken */ || isLiteralPropertyName();
+ return token() === 20 /* OpenBracketToken */ || isLiteralPropertyName();
case 7 /* HeritageClauseElement */:
// If we see { } then only consume it as an expression if it is followed by , or {
// That way we won't consume the body of a class in its heritage clause.
- if (token() === 15 /* OpenBraceToken */) {
+ if (token() === 16 /* OpenBraceToken */) {
return lookAhead(isValidHeritageClauseObjectLiteral);
}
if (!inErrorRecovery) {
@@ -13990,23 +14044,23 @@ var ts;
case 8 /* VariableDeclarations */:
return isIdentifierOrPattern();
case 10 /* ArrayBindingElements */:
- return token() === 24 /* CommaToken */ || token() === 22 /* DotDotDotToken */ || isIdentifierOrPattern();
+ return token() === 25 /* CommaToken */ || token() === 23 /* DotDotDotToken */ || isIdentifierOrPattern();
case 17 /* TypeParameters */:
return isIdentifier();
case 11 /* ArgumentExpressions */:
case 15 /* ArrayLiteralMembers */:
- return token() === 24 /* CommaToken */ || token() === 22 /* DotDotDotToken */ || isStartOfExpression();
+ return token() === 25 /* CommaToken */ || token() === 23 /* DotDotDotToken */ || isStartOfExpression();
case 16 /* Parameters */:
return isStartOfParameter();
case 18 /* TypeArguments */:
case 19 /* TupleElementTypes */:
- return token() === 24 /* CommaToken */ || isStartOfType();
+ return token() === 25 /* CommaToken */ || isStartOfType();
case 20 /* HeritageClauses */:
return isHeritageClause();
case 21 /* ImportOrExportSpecifiers */:
return ts.tokenIsIdentifierOrKeyword(token());
case 13 /* JsxAttributes */:
- return ts.tokenIsIdentifierOrKeyword(token()) || token() === 15 /* OpenBraceToken */;
+ return ts.tokenIsIdentifierOrKeyword(token()) || token() === 16 /* OpenBraceToken */;
case 14 /* JsxChildren */:
return true;
case 22 /* JSDocFunctionParameters */:
@@ -14019,8 +14073,8 @@ var ts;
ts.Debug.fail("Non-exhaustive case in 'isListElement'.");
}
function isValidHeritageClauseObjectLiteral() {
- ts.Debug.assert(token() === 15 /* OpenBraceToken */);
- if (nextToken() === 16 /* CloseBraceToken */) {
+ ts.Debug.assert(token() === 16 /* OpenBraceToken */);
+ if (nextToken() === 17 /* CloseBraceToken */) {
// if we see "extends {}" then only treat the {} as what we're extending (and not
// the class body) if we have:
//
@@ -14029,7 +14083,7 @@ var ts;
// extends {} extends
// extends {} implements
var next = nextToken();
- return next === 24 /* CommaToken */ || next === 15 /* OpenBraceToken */ || next === 83 /* ExtendsKeyword */ || next === 106 /* ImplementsKeyword */;
+ return next === 25 /* CommaToken */ || next === 16 /* OpenBraceToken */ || next === 84 /* ExtendsKeyword */ || next === 107 /* ImplementsKeyword */;
}
return true;
}
@@ -14042,8 +14096,8 @@ var ts;
return ts.tokenIsIdentifierOrKeyword(token());
}
function isHeritageClauseExtendsOrImplementsKeyword() {
- if (token() === 106 /* ImplementsKeyword */ ||
- token() === 83 /* ExtendsKeyword */) {
+ if (token() === 107 /* ImplementsKeyword */ ||
+ token() === 84 /* ExtendsKeyword */) {
return lookAhead(nextTokenIsStartOfExpression);
}
return false;
@@ -14067,43 +14121,43 @@ var ts;
case 12 /* ObjectLiteralMembers */:
case 9 /* ObjectBindingElements */:
case 21 /* ImportOrExportSpecifiers */:
- return token() === 16 /* CloseBraceToken */;
+ return token() === 17 /* CloseBraceToken */;
case 3 /* SwitchClauseStatements */:
- return token() === 16 /* CloseBraceToken */ || token() === 71 /* CaseKeyword */ || token() === 77 /* DefaultKeyword */;
+ return token() === 17 /* CloseBraceToken */ || token() === 72 /* CaseKeyword */ || token() === 78 /* DefaultKeyword */;
case 7 /* HeritageClauseElement */:
- return token() === 15 /* OpenBraceToken */ || token() === 83 /* ExtendsKeyword */ || token() === 106 /* ImplementsKeyword */;
+ return token() === 16 /* OpenBraceToken */ || token() === 84 /* ExtendsKeyword */ || token() === 107 /* ImplementsKeyword */;
case 8 /* VariableDeclarations */:
return isVariableDeclaratorListTerminator();
case 17 /* TypeParameters */:
// Tokens other than '>' are here for better error recovery
- return token() === 27 /* GreaterThanToken */ || token() === 17 /* OpenParenToken */ || token() === 15 /* OpenBraceToken */ || token() === 83 /* ExtendsKeyword */ || token() === 106 /* ImplementsKeyword */;
+ return token() === 28 /* GreaterThanToken */ || token() === 18 /* OpenParenToken */ || token() === 16 /* OpenBraceToken */ || token() === 84 /* ExtendsKeyword */ || token() === 107 /* ImplementsKeyword */;
case 11 /* ArgumentExpressions */:
// Tokens other than ')' are here for better error recovery
- return token() === 18 /* CloseParenToken */ || token() === 23 /* SemicolonToken */;
+ return token() === 19 /* CloseParenToken */ || token() === 24 /* SemicolonToken */;
case 15 /* ArrayLiteralMembers */:
case 19 /* TupleElementTypes */:
case 10 /* ArrayBindingElements */:
- return token() === 20 /* CloseBracketToken */;
+ return token() === 21 /* CloseBracketToken */;
case 16 /* Parameters */:
// Tokens other than ')' and ']' (the latter for index signatures) are here for better error recovery
- return token() === 18 /* CloseParenToken */ || token() === 20 /* CloseBracketToken */ /*|| token === SyntaxKind.OpenBraceToken*/;
+ return token() === 19 /* CloseParenToken */ || token() === 21 /* CloseBracketToken */ /*|| token === SyntaxKind.OpenBraceToken*/;
case 18 /* TypeArguments */:
// All other tokens should cause the type-argument to terminate except comma token
- return token() !== 24 /* CommaToken */;
+ return token() !== 25 /* CommaToken */;
case 20 /* HeritageClauses */:
- return token() === 15 /* OpenBraceToken */ || token() === 16 /* CloseBraceToken */;
+ return token() === 16 /* OpenBraceToken */ || token() === 17 /* CloseBraceToken */;
case 13 /* JsxAttributes */:
- return token() === 27 /* GreaterThanToken */ || token() === 39 /* SlashToken */;
+ return token() === 28 /* GreaterThanToken */ || token() === 40 /* SlashToken */;
case 14 /* JsxChildren */:
- return token() === 25 /* LessThanToken */ && lookAhead(nextTokenIsSlash);
+ return token() === 26 /* LessThanToken */ && lookAhead(nextTokenIsSlash);
case 22 /* JSDocFunctionParameters */:
- return token() === 18 /* CloseParenToken */ || token() === 54 /* ColonToken */ || token() === 16 /* CloseBraceToken */;
+ return token() === 19 /* CloseParenToken */ || token() === 55 /* ColonToken */ || token() === 17 /* CloseBraceToken */;
case 23 /* JSDocTypeArguments */:
- return token() === 27 /* GreaterThanToken */ || token() === 16 /* CloseBraceToken */;
+ return token() === 28 /* GreaterThanToken */ || token() === 17 /* CloseBraceToken */;
case 25 /* JSDocTupleTypes */:
- return token() === 20 /* CloseBracketToken */ || token() === 16 /* CloseBraceToken */;
+ return token() === 21 /* CloseBracketToken */ || token() === 17 /* CloseBraceToken */;
case 24 /* JSDocRecordMembers */:
- return token() === 16 /* CloseBraceToken */;
+ return token() === 17 /* CloseBraceToken */;
}
}
function isVariableDeclaratorListTerminator() {
@@ -14121,7 +14175,7 @@ var ts;
// For better error recovery, if we see an '=>' then we just stop immediately. We've got an
// arrow function here and it's going to be very unlikely that we'll resynchronize and get
// another variable declaration.
- if (token() === 34 /* EqualsGreaterThanToken */) {
+ if (token() === 35 /* EqualsGreaterThanToken */) {
return true;
}
// Keep trying to parse out variable declarators.
@@ -14284,20 +14338,20 @@ var ts;
function isReusableClassMember(node) {
if (node) {
switch (node.kind) {
- case 148 /* Constructor */:
- case 153 /* IndexSignature */:
- case 149 /* GetAccessor */:
- case 150 /* SetAccessor */:
- case 145 /* PropertyDeclaration */:
- case 198 /* SemicolonClassElement */:
+ case 149 /* Constructor */:
+ case 154 /* IndexSignature */:
+ case 150 /* GetAccessor */:
+ case 151 /* SetAccessor */:
+ case 146 /* PropertyDeclaration */:
+ case 199 /* SemicolonClassElement */:
return true;
- case 147 /* MethodDeclaration */:
+ case 148 /* MethodDeclaration */:
// Method declarations are not necessarily reusable. An object-literal
// may have a method calls "constructor(...)" and we must reparse that
// into an actual .ConstructorDeclaration.
var methodDeclaration = node;
- var nameIsConstructor = methodDeclaration.name.kind === 69 /* Identifier */ &&
- methodDeclaration.name.originalKeywordKind === 121 /* ConstructorKeyword */;
+ var nameIsConstructor = methodDeclaration.name.kind === 70 /* Identifier */ &&
+ methodDeclaration.name.originalKeywordKind === 122 /* ConstructorKeyword */;
return !nameIsConstructor;
}
}
@@ -14316,35 +14370,35 @@ var ts;
function isReusableStatement(node) {
if (node) {
switch (node.kind) {
- case 220 /* FunctionDeclaration */:
- case 200 /* VariableStatement */:
- case 199 /* Block */:
- case 203 /* IfStatement */:
- case 202 /* ExpressionStatement */:
- case 215 /* ThrowStatement */:
- case 211 /* ReturnStatement */:
- case 213 /* SwitchStatement */:
- case 210 /* BreakStatement */:
- case 209 /* ContinueStatement */:
- case 207 /* ForInStatement */:
- case 208 /* ForOfStatement */:
- case 206 /* ForStatement */:
- case 205 /* WhileStatement */:
- case 212 /* WithStatement */:
- case 201 /* EmptyStatement */:
- case 216 /* TryStatement */:
- case 214 /* LabeledStatement */:
- case 204 /* DoStatement */:
- case 217 /* DebuggerStatement */:
- case 230 /* ImportDeclaration */:
- case 229 /* ImportEqualsDeclaration */:
- case 236 /* ExportDeclaration */:
- case 235 /* ExportAssignment */:
- case 225 /* ModuleDeclaration */:
- case 221 /* ClassDeclaration */:
- case 222 /* InterfaceDeclaration */:
- case 224 /* EnumDeclaration */:
- case 223 /* TypeAliasDeclaration */:
+ case 221 /* FunctionDeclaration */:
+ case 201 /* VariableStatement */:
+ case 200 /* Block */:
+ case 204 /* IfStatement */:
+ case 203 /* ExpressionStatement */:
+ case 216 /* ThrowStatement */:
+ case 212 /* ReturnStatement */:
+ case 214 /* SwitchStatement */:
+ case 211 /* BreakStatement */:
+ case 210 /* ContinueStatement */:
+ case 208 /* ForInStatement */:
+ case 209 /* ForOfStatement */:
+ case 207 /* ForStatement */:
+ case 206 /* WhileStatement */:
+ case 213 /* WithStatement */:
+ case 202 /* EmptyStatement */:
+ case 217 /* TryStatement */:
+ case 215 /* LabeledStatement */:
+ case 205 /* DoStatement */:
+ case 218 /* DebuggerStatement */:
+ case 231 /* ImportDeclaration */:
+ case 230 /* ImportEqualsDeclaration */:
+ case 237 /* ExportDeclaration */:
+ case 236 /* ExportAssignment */:
+ case 226 /* ModuleDeclaration */:
+ case 222 /* ClassDeclaration */:
+ case 223 /* InterfaceDeclaration */:
+ case 225 /* EnumDeclaration */:
+ case 224 /* TypeAliasDeclaration */:
return true;
}
}
@@ -14356,18 +14410,18 @@ var ts;
function isReusableTypeMember(node) {
if (node) {
switch (node.kind) {
- case 152 /* ConstructSignature */:
- case 146 /* MethodSignature */:
- case 153 /* IndexSignature */:
- case 144 /* PropertySignature */:
- case 151 /* CallSignature */:
+ case 153 /* ConstructSignature */:
+ case 147 /* MethodSignature */:
+ case 154 /* IndexSignature */:
+ case 145 /* PropertySignature */:
+ case 152 /* CallSignature */:
return true;
}
}
return false;
}
function isReusableVariableDeclaration(node) {
- if (node.kind !== 218 /* VariableDeclaration */) {
+ if (node.kind !== 219 /* VariableDeclaration */) {
return false;
}
// Very subtle incremental parsing bug. Consider the following code:
@@ -14388,7 +14442,7 @@ var ts;
return variableDeclarator.initializer === undefined;
}
function isReusableParameter(node) {
- if (node.kind !== 142 /* Parameter */) {
+ if (node.kind !== 143 /* Parameter */) {
return false;
}
// See the comment in isReusableVariableDeclaration for why we do this.
@@ -14445,7 +14499,7 @@ var ts;
if (isListElement(kind, /*inErrorRecovery*/ false)) {
result.push(parseListElement(kind, parseElement));
commaStart = scanner.getTokenPos();
- if (parseOptional(24 /* CommaToken */)) {
+ if (parseOptional(25 /* CommaToken */)) {
continue;
}
commaStart = -1; // Back to the state where the last token was not a comma
@@ -14454,13 +14508,13 @@ var ts;
}
// We didn't get a comma, and the list wasn't terminated, explicitly parse
// out a comma so we give a good error message.
- parseExpected(24 /* CommaToken */);
+ parseExpected(25 /* CommaToken */);
// If the token was a semicolon, and the caller allows that, then skip it and
// continue. This ensures we get back on track and don't result in tons of
// parse errors. For example, this can happen when people do things like use
// a semicolon to delimit object literal members. Note: we'll have already
// reported an error when we called parseExpected above.
- if (considerSemicolonAsDelimiter && token() === 23 /* SemicolonToken */ && !scanner.hasPrecedingLineBreak()) {
+ if (considerSemicolonAsDelimiter && token() === 24 /* SemicolonToken */ && !scanner.hasPrecedingLineBreak()) {
nextToken();
}
continue;
@@ -14499,8 +14553,8 @@ var ts;
// The allowReservedWords parameter controls whether reserved words are permitted after the first dot
function parseEntityName(allowReservedWords, diagnosticMessage) {
var entity = parseIdentifier(diagnosticMessage);
- while (parseOptional(21 /* DotToken */)) {
- var node = createNode(139 /* QualifiedName */, entity.pos); // !!!
+ while (parseOptional(22 /* DotToken */)) {
+ var node = createNode(140 /* QualifiedName */, entity.pos); // !!!
node.left = entity;
node.right = parseRightSideOfDot(allowReservedWords);
entity = finishNode(node);
@@ -14533,33 +14587,33 @@ var ts;
// Report that we need an identifier. However, report it right after the dot,
// and not on the next token. This is because the next token might actually
// be an identifier and the error would be quite confusing.
- return createMissingNode(69 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected);
+ return createMissingNode(70 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected);
}
}
return allowIdentifierNames ? parseIdentifierName() : parseIdentifier();
}
function parseTemplateExpression() {
- var template = createNode(189 /* TemplateExpression */);
+ var template = createNode(190 /* TemplateExpression */);
template.head = parseTemplateHead();
- ts.Debug.assert(template.head.kind === 12 /* TemplateHead */, "Template head has wrong token kind");
+ ts.Debug.assert(template.head.kind === 13 /* TemplateHead */, "Template head has wrong token kind");
var templateSpans = createNodeArray();
do {
templateSpans.push(parseTemplateSpan());
- } while (ts.lastOrUndefined(templateSpans).literal.kind === 13 /* TemplateMiddle */);
+ } while (ts.lastOrUndefined(templateSpans).literal.kind === 14 /* TemplateMiddle */);
templateSpans.end = getNodeEnd();
template.templateSpans = templateSpans;
return finishNode(template);
}
function parseTemplateSpan() {
- var span = createNode(197 /* TemplateSpan */);
+ var span = createNode(198 /* TemplateSpan */);
span.expression = allowInAnd(parseExpression);
var literal;
- if (token() === 16 /* CloseBraceToken */) {
+ if (token() === 17 /* CloseBraceToken */) {
reScanTemplateToken();
literal = parseTemplateMiddleOrTemplateTail();
}
else {
- literal = parseExpectedToken(14 /* TemplateTail */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(16 /* CloseBraceToken */));
+ literal = parseExpectedToken(15 /* TemplateTail */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(17 /* CloseBraceToken */));
}
span.literal = literal;
return finishNode(span);
@@ -14569,12 +14623,12 @@ var ts;
}
function parseTemplateHead() {
var fragment = parseLiteralLikeNode(token(), /*internName*/ false);
- ts.Debug.assert(fragment.kind === 12 /* TemplateHead */, "Template head has wrong token kind");
+ ts.Debug.assert(fragment.kind === 13 /* TemplateHead */, "Template head has wrong token kind");
return fragment;
}
function parseTemplateMiddleOrTemplateTail() {
var fragment = parseLiteralLikeNode(token(), /*internName*/ false);
- ts.Debug.assert(fragment.kind === 13 /* TemplateMiddle */ || fragment.kind === 14 /* TemplateTail */, "Template fragment has wrong token kind");
+ ts.Debug.assert(fragment.kind === 14 /* TemplateMiddle */ || fragment.kind === 15 /* TemplateTail */, "Template fragment has wrong token kind");
return fragment;
}
function parseLiteralLikeNode(kind, internName) {
@@ -14606,35 +14660,35 @@ var ts;
// TYPES
function parseTypeReference() {
var typeName = parseEntityName(/*allowReservedWords*/ false, ts.Diagnostics.Type_expected);
- var node = createNode(155 /* TypeReference */, typeName.pos);
+ var node = createNode(156 /* TypeReference */, typeName.pos);
node.typeName = typeName;
- if (!scanner.hasPrecedingLineBreak() && token() === 25 /* LessThanToken */) {
- node.typeArguments = parseBracketedList(18 /* TypeArguments */, parseType, 25 /* LessThanToken */, 27 /* GreaterThanToken */);
+ if (!scanner.hasPrecedingLineBreak() && token() === 26 /* LessThanToken */) {
+ node.typeArguments = parseBracketedList(18 /* TypeArguments */, parseType, 26 /* LessThanToken */, 28 /* GreaterThanToken */);
}
return finishNode(node);
}
function parseThisTypePredicate(lhs) {
nextToken();
- var node = createNode(154 /* TypePredicate */, lhs.pos);
+ var node = createNode(155 /* TypePredicate */, lhs.pos);
node.parameterName = lhs;
node.type = parseType();
return finishNode(node);
}
function parseThisTypeNode() {
- var node = createNode(165 /* ThisType */);
+ var node = createNode(166 /* ThisType */);
nextToken();
return finishNode(node);
}
function parseTypeQuery() {
- var node = createNode(158 /* TypeQuery */);
- parseExpected(101 /* TypeOfKeyword */);
+ var node = createNode(159 /* TypeQuery */);
+ parseExpected(102 /* TypeOfKeyword */);
node.exprName = parseEntityName(/*allowReservedWords*/ true);
return finishNode(node);
}
function parseTypeParameter() {
- var node = createNode(141 /* TypeParameter */);
+ var node = createNode(142 /* TypeParameter */);
node.name = parseIdentifier();
- if (parseOptional(83 /* ExtendsKeyword */)) {
+ if (parseOptional(84 /* ExtendsKeyword */)) {
// It's not uncommon for people to write improper constraints to a generic. If the
// user writes a constraint that is an expression and not an actual type, then parse
// it out as an expression (so we can recover well), but report that a type is needed
@@ -14656,29 +14710,29 @@ var ts;
return finishNode(node);
}
function parseTypeParameters() {
- if (token() === 25 /* LessThanToken */) {
- return parseBracketedList(17 /* TypeParameters */, parseTypeParameter, 25 /* LessThanToken */, 27 /* GreaterThanToken */);
+ if (token() === 26 /* LessThanToken */) {
+ return parseBracketedList(17 /* TypeParameters */, parseTypeParameter, 26 /* LessThanToken */, 28 /* GreaterThanToken */);
}
}
function parseParameterType() {
- if (parseOptional(54 /* ColonToken */)) {
+ if (parseOptional(55 /* ColonToken */)) {
return parseType();
}
return undefined;
}
function isStartOfParameter() {
- return token() === 22 /* DotDotDotToken */ || isIdentifierOrPattern() || ts.isModifierKind(token()) || token() === 55 /* AtToken */ || token() === 97 /* ThisKeyword */;
+ return token() === 23 /* DotDotDotToken */ || isIdentifierOrPattern() || ts.isModifierKind(token()) || token() === 56 /* AtToken */ || token() === 98 /* ThisKeyword */;
}
function parseParameter() {
- var node = createNode(142 /* Parameter */);
- if (token() === 97 /* ThisKeyword */) {
+ var node = createNode(143 /* Parameter */);
+ if (token() === 98 /* ThisKeyword */) {
node.name = createIdentifier(/*isIdentifier*/ true, undefined);
node.type = parseParameterType();
return finishNode(node);
}
node.decorators = parseDecorators();
node.modifiers = parseModifiers();
- node.dotDotDotToken = parseOptionalToken(22 /* DotDotDotToken */);
+ node.dotDotDotToken = parseOptionalToken(23 /* DotDotDotToken */);
// FormalParameter [Yield,Await]:
// BindingElement[?Yield,?Await]
node.name = parseIdentifierOrPattern();
@@ -14693,7 +14747,7 @@ var ts;
// to avoid this we'll advance cursor to the next token.
nextToken();
}
- node.questionToken = parseOptionalToken(53 /* QuestionToken */);
+ node.questionToken = parseOptionalToken(54 /* QuestionToken */);
node.type = parseParameterType();
node.initializer = parseBindingElementInitializer(/*inParameter*/ true);
// Do not check for initializers in an ambient context for parameters. This is not
@@ -14713,7 +14767,7 @@ var ts;
return parseInitializer(/*inParameter*/ true);
}
function fillSignature(returnToken, yieldContext, awaitContext, requireCompleteParameterList, signature) {
- var returnTokenRequired = returnToken === 34 /* EqualsGreaterThanToken */;
+ var returnTokenRequired = returnToken === 35 /* EqualsGreaterThanToken */;
signature.typeParameters = parseTypeParameters();
signature.parameters = parseParameterList(yieldContext, awaitContext, requireCompleteParameterList);
if (returnTokenRequired) {
@@ -14738,7 +14792,7 @@ var ts;
//
// SingleNameBinding [Yield,Await]:
// BindingIdentifier[?Yield,?Await]Initializer [In, ?Yield,?Await] opt
- if (parseExpected(17 /* OpenParenToken */)) {
+ if (parseExpected(18 /* OpenParenToken */)) {
var savedYieldContext = inYieldContext();
var savedAwaitContext = inAwaitContext();
setYieldContext(yieldContext);
@@ -14746,7 +14800,7 @@ var ts;
var result = parseDelimitedList(16 /* Parameters */, parseParameter);
setYieldContext(savedYieldContext);
setAwaitContext(savedAwaitContext);
- if (!parseExpected(18 /* CloseParenToken */) && requireCompleteParameterList) {
+ if (!parseExpected(19 /* CloseParenToken */) && requireCompleteParameterList) {
// Caller insisted that we had to end with a ) We didn't. So just return
// undefined here.
return undefined;
@@ -14761,7 +14815,7 @@ var ts;
function parseTypeMemberSemicolon() {
// We allow type members to be separated by commas or (possibly ASI) semicolons.
// First check if it was a comma. If so, we're done with the member.
- if (parseOptional(24 /* CommaToken */)) {
+ if (parseOptional(25 /* CommaToken */)) {
return;
}
// Didn't have a comma. We must have a (possible ASI) semicolon.
@@ -14769,15 +14823,15 @@ var ts;
}
function parseSignatureMember(kind) {
var node = createNode(kind);
- if (kind === 152 /* ConstructSignature */) {
- parseExpected(92 /* NewKeyword */);
+ if (kind === 153 /* ConstructSignature */) {
+ parseExpected(93 /* NewKeyword */);
}
- fillSignature(54 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node);
+ fillSignature(55 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node);
parseTypeMemberSemicolon();
return addJSDocComment(finishNode(node));
}
function isIndexSignature() {
- if (token() !== 19 /* OpenBracketToken */) {
+ if (token() !== 20 /* OpenBracketToken */) {
return false;
}
return lookAhead(isUnambiguouslyIndexSignature);
@@ -14800,7 +14854,7 @@ var ts;
// []
//
nextToken();
- if (token() === 22 /* DotDotDotToken */ || token() === 20 /* CloseBracketToken */) {
+ if (token() === 23 /* DotDotDotToken */ || token() === 21 /* CloseBracketToken */) {
return true;
}
if (ts.isModifierKind(token())) {
@@ -14819,49 +14873,49 @@ var ts;
// A colon signifies a well formed indexer
// A comma should be a badly formed indexer because comma expressions are not allowed
// in computed properties.
- if (token() === 54 /* ColonToken */ || token() === 24 /* CommaToken */) {
+ if (token() === 55 /* ColonToken */ || token() === 25 /* CommaToken */) {
return true;
}
// Question mark could be an indexer with an optional property,
// or it could be a conditional expression in a computed property.
- if (token() !== 53 /* QuestionToken */) {
+ if (token() !== 54 /* QuestionToken */) {
return false;
}
// If any of the following tokens are after the question mark, it cannot
// be a conditional expression, so treat it as an indexer.
nextToken();
- return token() === 54 /* ColonToken */ || token() === 24 /* CommaToken */ || token() === 20 /* CloseBracketToken */;
+ return token() === 55 /* ColonToken */ || token() === 25 /* CommaToken */ || token() === 21 /* CloseBracketToken */;
}
function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) {
- var node = createNode(153 /* IndexSignature */, fullStart);
+ var node = createNode(154 /* IndexSignature */, fullStart);
node.decorators = decorators;
node.modifiers = modifiers;
- node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 19 /* OpenBracketToken */, 20 /* CloseBracketToken */);
+ node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 20 /* OpenBracketToken */, 21 /* CloseBracketToken */);
node.type = parseTypeAnnotation();
parseTypeMemberSemicolon();
return finishNode(node);
}
function parsePropertyOrMethodSignature(fullStart, modifiers) {
var name = parsePropertyName();
- var questionToken = parseOptionalToken(53 /* QuestionToken */);
- if (token() === 17 /* OpenParenToken */ || token() === 25 /* LessThanToken */) {
- var method = createNode(146 /* MethodSignature */, fullStart);
+ var questionToken = parseOptionalToken(54 /* QuestionToken */);
+ if (token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */) {
+ var method = createNode(147 /* MethodSignature */, fullStart);
method.modifiers = modifiers;
method.name = name;
method.questionToken = questionToken;
// Method signatures don't exist in expression contexts. So they have neither
// [Yield] nor [Await]
- fillSignature(54 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, method);
+ fillSignature(55 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, method);
parseTypeMemberSemicolon();
return addJSDocComment(finishNode(method));
}
else {
- var property = createNode(144 /* PropertySignature */, fullStart);
+ var property = createNode(145 /* PropertySignature */, fullStart);
property.modifiers = modifiers;
property.name = name;
property.questionToken = questionToken;
property.type = parseTypeAnnotation();
- if (token() === 56 /* EqualsToken */) {
+ if (token() === 57 /* EqualsToken */) {
// Although type literal properties cannot not have initializers, we attempt
// to parse an initializer so we can report in the checker that an interface
// property or type literal property cannot have an initializer.
@@ -14874,7 +14928,7 @@ var ts;
function isTypeMemberStart() {
var idToken;
// Return true if we have the start of a signature member
- if (token() === 17 /* OpenParenToken */ || token() === 25 /* LessThanToken */) {
+ if (token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */) {
return true;
}
// Eat up all modifiers, but hold on to the last one in case it is actually an identifier
@@ -14883,7 +14937,7 @@ var ts;
nextToken();
}
// Index signatures and computed property names are type members
- if (token() === 19 /* OpenBracketToken */) {
+ if (token() === 20 /* OpenBracketToken */) {
return true;
}
// Try to get the first property-like token following all modifiers
@@ -14894,21 +14948,21 @@ var ts;
// If we were able to get any potential identifier, check that it is
// the start of a member declaration
if (idToken) {
- return token() === 17 /* OpenParenToken */ ||
- token() === 25 /* LessThanToken */ ||
- token() === 53 /* QuestionToken */ ||
- token() === 54 /* ColonToken */ ||
- token() === 24 /* CommaToken */ ||
+ return token() === 18 /* OpenParenToken */ ||
+ token() === 26 /* LessThanToken */ ||
+ token() === 54 /* QuestionToken */ ||
+ token() === 55 /* ColonToken */ ||
+ token() === 25 /* CommaToken */ ||
canParseSemicolon();
}
return false;
}
function parseTypeMember() {
- if (token() === 17 /* OpenParenToken */ || token() === 25 /* LessThanToken */) {
- return parseSignatureMember(151 /* CallSignature */);
+ if (token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */) {
+ return parseSignatureMember(152 /* CallSignature */);
}
- if (token() === 92 /* NewKeyword */ && lookAhead(isStartOfConstructSignature)) {
- return parseSignatureMember(152 /* ConstructSignature */);
+ if (token() === 93 /* NewKeyword */ && lookAhead(isStartOfConstructSignature)) {
+ return parseSignatureMember(153 /* ConstructSignature */);
}
var fullStart = getNodePos();
var modifiers = parseModifiers();
@@ -14919,18 +14973,18 @@ var ts;
}
function isStartOfConstructSignature() {
nextToken();
- return token() === 17 /* OpenParenToken */ || token() === 25 /* LessThanToken */;
+ return token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */;
}
function parseTypeLiteral() {
- var node = createNode(159 /* TypeLiteral */);
+ var node = createNode(160 /* TypeLiteral */);
node.members = parseObjectTypeMembers();
return finishNode(node);
}
function parseObjectTypeMembers() {
var members;
- if (parseExpected(15 /* OpenBraceToken */)) {
+ if (parseExpected(16 /* OpenBraceToken */)) {
members = parseList(4 /* TypeMembers */, parseTypeMember);
- parseExpected(16 /* CloseBraceToken */);
+ parseExpected(17 /* CloseBraceToken */);
}
else {
members = createMissingList();
@@ -14938,31 +14992,31 @@ var ts;
return members;
}
function parseTupleType() {
- var node = createNode(161 /* TupleType */);
- node.elementTypes = parseBracketedList(19 /* TupleElementTypes */, parseType, 19 /* OpenBracketToken */, 20 /* CloseBracketToken */);
+ var node = createNode(162 /* TupleType */);
+ node.elementTypes = parseBracketedList(19 /* TupleElementTypes */, parseType, 20 /* OpenBracketToken */, 21 /* CloseBracketToken */);
return finishNode(node);
}
function parseParenthesizedType() {
- var node = createNode(164 /* ParenthesizedType */);
- parseExpected(17 /* OpenParenToken */);
+ var node = createNode(165 /* ParenthesizedType */);
+ parseExpected(18 /* OpenParenToken */);
node.type = parseType();
- parseExpected(18 /* CloseParenToken */);
+ parseExpected(19 /* CloseParenToken */);
return finishNode(node);
}
function parseFunctionOrConstructorType(kind) {
var node = createNode(kind);
- if (kind === 157 /* ConstructorType */) {
- parseExpected(92 /* NewKeyword */);
+ if (kind === 158 /* ConstructorType */) {
+ parseExpected(93 /* NewKeyword */);
}
- fillSignature(34 /* EqualsGreaterThanToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node);
+ fillSignature(35 /* EqualsGreaterThanToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node);
return finishNode(node);
}
function parseKeywordAndNoDot() {
var node = parseTokenNode();
- return token() === 21 /* DotToken */ ? undefined : node;
+ return token() === 22 /* DotToken */ ? undefined : node;
}
function parseLiteralTypeNode() {
- var node = createNode(166 /* LiteralType */);
+ var node = createNode(167 /* LiteralType */);
node.literal = parseSimpleUnaryExpression();
finishNode(node);
return node;
@@ -14972,42 +15026,42 @@ var ts;
}
function parseNonArrayType() {
switch (token()) {
- case 117 /* AnyKeyword */:
- case 132 /* StringKeyword */:
- case 130 /* NumberKeyword */:
- case 120 /* BooleanKeyword */:
- case 133 /* SymbolKeyword */:
- case 135 /* UndefinedKeyword */:
- case 127 /* NeverKeyword */:
+ case 118 /* AnyKeyword */:
+ case 133 /* StringKeyword */:
+ case 131 /* NumberKeyword */:
+ case 121 /* BooleanKeyword */:
+ case 134 /* SymbolKeyword */:
+ case 136 /* UndefinedKeyword */:
+ case 128 /* NeverKeyword */:
// If these are followed by a dot, then parse these out as a dotted type reference instead.
var node = tryParse(parseKeywordAndNoDot);
return node || parseTypeReference();
case 9 /* StringLiteral */:
case 8 /* NumericLiteral */:
- case 99 /* TrueKeyword */:
- case 84 /* FalseKeyword */:
+ case 100 /* TrueKeyword */:
+ case 85 /* FalseKeyword */:
return parseLiteralTypeNode();
- case 36 /* MinusToken */:
+ case 37 /* MinusToken */:
return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode() : parseTypeReference();
- case 103 /* VoidKeyword */:
- case 93 /* NullKeyword */:
+ case 104 /* VoidKeyword */:
+ case 94 /* NullKeyword */:
return parseTokenNode();
- case 97 /* ThisKeyword */: {
+ case 98 /* ThisKeyword */: {
var thisKeyword = parseThisTypeNode();
- if (token() === 124 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 125 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) {
return parseThisTypePredicate(thisKeyword);
}
else {
return thisKeyword;
}
}
- case 101 /* TypeOfKeyword */:
+ case 102 /* TypeOfKeyword */:
return parseTypeQuery();
- case 15 /* OpenBraceToken */:
+ case 16 /* OpenBraceToken */:
return parseTypeLiteral();
- case 19 /* OpenBracketToken */:
+ case 20 /* OpenBracketToken */:
return parseTupleType();
- case 17 /* OpenParenToken */:
+ case 18 /* OpenParenToken */:
return parseParenthesizedType();
default:
return parseTypeReference();
@@ -15015,29 +15069,29 @@ var ts;
}
function isStartOfType() {
switch (token()) {
- case 117 /* AnyKeyword */:
- case 132 /* StringKeyword */:
- case 130 /* NumberKeyword */:
- case 120 /* BooleanKeyword */:
- case 133 /* SymbolKeyword */:
- case 103 /* VoidKeyword */:
- case 135 /* UndefinedKeyword */:
- case 93 /* NullKeyword */:
- case 97 /* ThisKeyword */:
- case 101 /* TypeOfKeyword */:
- case 127 /* NeverKeyword */:
- case 15 /* OpenBraceToken */:
- case 19 /* OpenBracketToken */:
- case 25 /* LessThanToken */:
- case 92 /* NewKeyword */:
+ case 118 /* AnyKeyword */:
+ case 133 /* StringKeyword */:
+ case 131 /* NumberKeyword */:
+ case 121 /* BooleanKeyword */:
+ case 134 /* SymbolKeyword */:
+ case 104 /* VoidKeyword */:
+ case 136 /* UndefinedKeyword */:
+ case 94 /* NullKeyword */:
+ case 98 /* ThisKeyword */:
+ case 102 /* TypeOfKeyword */:
+ case 128 /* NeverKeyword */:
+ case 16 /* OpenBraceToken */:
+ case 20 /* OpenBracketToken */:
+ case 26 /* LessThanToken */:
+ case 93 /* NewKeyword */:
case 9 /* StringLiteral */:
case 8 /* NumericLiteral */:
- case 99 /* TrueKeyword */:
- case 84 /* FalseKeyword */:
+ case 100 /* TrueKeyword */:
+ case 85 /* FalseKeyword */:
return true;
- case 36 /* MinusToken */:
+ case 37 /* MinusToken */:
return lookAhead(nextTokenIsNumericLiteral);
- case 17 /* OpenParenToken */:
+ case 18 /* OpenParenToken */:
// Only consider '(' the start of a type if followed by ')', '...', an identifier, a modifier,
// or something that starts a type. We don't want to consider things like '(1)' a type.
return lookAhead(isStartOfParenthesizedOrFunctionType);
@@ -15047,13 +15101,13 @@ var ts;
}
function isStartOfParenthesizedOrFunctionType() {
nextToken();
- return token() === 18 /* CloseParenToken */ || isStartOfParameter() || isStartOfType();
+ return token() === 19 /* CloseParenToken */ || isStartOfParameter() || isStartOfType();
}
function parseArrayTypeOrHigher() {
var type = parseNonArrayType();
- while (!scanner.hasPrecedingLineBreak() && parseOptional(19 /* OpenBracketToken */)) {
- parseExpected(20 /* CloseBracketToken */);
- var node = createNode(160 /* ArrayType */, type.pos);
+ while (!scanner.hasPrecedingLineBreak() && parseOptional(20 /* OpenBracketToken */)) {
+ parseExpected(21 /* CloseBracketToken */);
+ var node = createNode(161 /* ArrayType */, type.pos);
node.elementType = type;
type = finishNode(node);
}
@@ -15074,27 +15128,27 @@ var ts;
return type;
}
function parseIntersectionTypeOrHigher() {
- return parseUnionOrIntersectionType(163 /* IntersectionType */, parseArrayTypeOrHigher, 46 /* AmpersandToken */);
+ return parseUnionOrIntersectionType(164 /* IntersectionType */, parseArrayTypeOrHigher, 47 /* AmpersandToken */);
}
function parseUnionTypeOrHigher() {
- return parseUnionOrIntersectionType(162 /* UnionType */, parseIntersectionTypeOrHigher, 47 /* BarToken */);
+ return parseUnionOrIntersectionType(163 /* UnionType */, parseIntersectionTypeOrHigher, 48 /* BarToken */);
}
function isStartOfFunctionType() {
- if (token() === 25 /* LessThanToken */) {
+ if (token() === 26 /* LessThanToken */) {
return true;
}
- return token() === 17 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType);
+ return token() === 18 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType);
}
function skipParameterStart() {
if (ts.isModifierKind(token())) {
// Skip modifiers
parseModifiers();
}
- if (isIdentifier() || token() === 97 /* ThisKeyword */) {
+ if (isIdentifier() || token() === 98 /* ThisKeyword */) {
nextToken();
return true;
}
- if (token() === 19 /* OpenBracketToken */ || token() === 15 /* OpenBraceToken */) {
+ if (token() === 20 /* OpenBracketToken */ || token() === 16 /* OpenBraceToken */) {
// Return true if we can parse an array or object binding pattern with no errors
var previousErrorCount = parseDiagnostics.length;
parseIdentifierOrPattern();
@@ -15104,7 +15158,7 @@ var ts;
}
function isUnambiguouslyStartOfFunctionType() {
nextToken();
- if (token() === 18 /* CloseParenToken */ || token() === 22 /* DotDotDotToken */) {
+ if (token() === 19 /* CloseParenToken */ || token() === 23 /* DotDotDotToken */) {
// ( )
// ( ...
return true;
@@ -15112,17 +15166,17 @@ var ts;
if (skipParameterStart()) {
// We successfully skipped modifiers (if any) and an identifier or binding pattern,
// now see if we have something that indicates a parameter declaration
- if (token() === 54 /* ColonToken */ || token() === 24 /* CommaToken */ ||
- token() === 53 /* QuestionToken */ || token() === 56 /* EqualsToken */) {
+ if (token() === 55 /* ColonToken */ || token() === 25 /* CommaToken */ ||
+ token() === 54 /* QuestionToken */ || token() === 57 /* EqualsToken */) {
// ( xxx :
// ( xxx ,
// ( xxx ?
// ( xxx =
return true;
}
- if (token() === 18 /* CloseParenToken */) {
+ if (token() === 19 /* CloseParenToken */) {
nextToken();
- if (token() === 34 /* EqualsGreaterThanToken */) {
+ if (token() === 35 /* EqualsGreaterThanToken */) {
// ( xxx ) =>
return true;
}
@@ -15134,7 +15188,7 @@ var ts;
var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix);
var type = parseType();
if (typePredicateVariable) {
- var node = createNode(154 /* TypePredicate */, typePredicateVariable.pos);
+ var node = createNode(155 /* TypePredicate */, typePredicateVariable.pos);
node.parameterName = typePredicateVariable;
node.type = type;
return finishNode(node);
@@ -15145,7 +15199,7 @@ var ts;
}
function parseTypePredicatePrefix() {
var id = parseIdentifier();
- if (token() === 124 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 125 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) {
nextToken();
return id;
}
@@ -15157,37 +15211,37 @@ var ts;
}
function parseTypeWorker() {
if (isStartOfFunctionType()) {
- return parseFunctionOrConstructorType(156 /* FunctionType */);
+ return parseFunctionOrConstructorType(157 /* FunctionType */);
}
- if (token() === 92 /* NewKeyword */) {
- return parseFunctionOrConstructorType(157 /* ConstructorType */);
+ if (token() === 93 /* NewKeyword */) {
+ return parseFunctionOrConstructorType(158 /* ConstructorType */);
}
return parseUnionTypeOrHigher();
}
function parseTypeAnnotation() {
- return parseOptional(54 /* ColonToken */) ? parseType() : undefined;
+ return parseOptional(55 /* ColonToken */) ? parseType() : undefined;
}
// EXPRESSIONS
function isStartOfLeftHandSideExpression() {
switch (token()) {
- case 97 /* ThisKeyword */:
- case 95 /* SuperKeyword */:
- case 93 /* NullKeyword */:
- case 99 /* TrueKeyword */:
- case 84 /* FalseKeyword */:
+ case 98 /* ThisKeyword */:
+ case 96 /* SuperKeyword */:
+ case 94 /* NullKeyword */:
+ case 100 /* TrueKeyword */:
+ case 85 /* FalseKeyword */:
case 8 /* NumericLiteral */:
case 9 /* StringLiteral */:
- case 11 /* NoSubstitutionTemplateLiteral */:
- case 12 /* TemplateHead */:
- case 17 /* OpenParenToken */:
- case 19 /* OpenBracketToken */:
- case 15 /* OpenBraceToken */:
- case 87 /* FunctionKeyword */:
- case 73 /* ClassKeyword */:
- case 92 /* NewKeyword */:
- case 39 /* SlashToken */:
- case 61 /* SlashEqualsToken */:
- case 69 /* Identifier */:
+ case 12 /* NoSubstitutionTemplateLiteral */:
+ case 13 /* TemplateHead */:
+ case 18 /* OpenParenToken */:
+ case 20 /* OpenBracketToken */:
+ case 16 /* OpenBraceToken */:
+ case 88 /* FunctionKeyword */:
+ case 74 /* ClassKeyword */:
+ case 93 /* NewKeyword */:
+ case 40 /* SlashToken */:
+ case 62 /* SlashEqualsToken */:
+ case 70 /* Identifier */:
return true;
default:
return isIdentifier();
@@ -15198,18 +15252,18 @@ var ts;
return true;
}
switch (token()) {
- case 35 /* PlusToken */:
- case 36 /* MinusToken */:
- case 50 /* TildeToken */:
- case 49 /* ExclamationToken */:
- case 78 /* DeleteKeyword */:
- case 101 /* TypeOfKeyword */:
- case 103 /* VoidKeyword */:
- case 41 /* PlusPlusToken */:
- case 42 /* MinusMinusToken */:
- case 25 /* LessThanToken */:
- case 119 /* AwaitKeyword */:
- case 114 /* YieldKeyword */:
+ case 36 /* PlusToken */:
+ case 37 /* MinusToken */:
+ case 51 /* TildeToken */:
+ case 50 /* ExclamationToken */:
+ case 79 /* DeleteKeyword */:
+ case 102 /* TypeOfKeyword */:
+ case 104 /* VoidKeyword */:
+ case 42 /* PlusPlusToken */:
+ case 43 /* MinusMinusToken */:
+ case 26 /* LessThanToken */:
+ case 120 /* AwaitKeyword */:
+ case 115 /* YieldKeyword */:
// Yield/await always starts an expression. Either it is an identifier (in which case
// it is definitely an expression). Or it's a keyword (either because we're in
// a generator or async function, or in strict mode (or both)) and it started a yield or await expression.
@@ -15227,10 +15281,10 @@ var ts;
}
function isStartOfExpressionStatement() {
// As per the grammar, none of '{' or 'function' or 'class' can start an expression statement.
- return token() !== 15 /* OpenBraceToken */ &&
- token() !== 87 /* FunctionKeyword */ &&
- token() !== 73 /* ClassKeyword */ &&
- token() !== 55 /* AtToken */ &&
+ return token() !== 16 /* OpenBraceToken */ &&
+ token() !== 88 /* FunctionKeyword */ &&
+ token() !== 74 /* ClassKeyword */ &&
+ token() !== 56 /* AtToken */ &&
isStartOfExpression();
}
function parseExpression() {
@@ -15244,7 +15298,7 @@ var ts;
}
var expr = parseAssignmentExpressionOrHigher();
var operatorToken;
- while ((operatorToken = parseOptionalToken(24 /* CommaToken */))) {
+ while ((operatorToken = parseOptionalToken(25 /* CommaToken */))) {
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher());
}
if (saveDecoratorContext) {
@@ -15253,7 +15307,7 @@ var ts;
return expr;
}
function parseInitializer(inParameter) {
- if (token() !== 56 /* EqualsToken */) {
+ if (token() !== 57 /* EqualsToken */) {
// It's not uncommon during typing for the user to miss writing the '=' token. Check if
// there is no newline after the last token and if we're on an expression. If so, parse
// this as an equals-value clause with a missing equals.
@@ -15262,7 +15316,7 @@ var ts;
// it's more likely that a { would be a allowed (as an object literal). While this
// is also allowed for parameters, the risk is that we consume the { as an object
// literal when it really will be for the block following the parameter.
- if (scanner.hasPrecedingLineBreak() || (inParameter && token() === 15 /* OpenBraceToken */) || !isStartOfExpression()) {
+ if (scanner.hasPrecedingLineBreak() || (inParameter && token() === 16 /* OpenBraceToken */) || !isStartOfExpression()) {
// preceding line break, open brace in a parameter (likely a function body) or current token is not an expression -
// do not try to parse initializer
return undefined;
@@ -15270,7 +15324,7 @@ var ts;
}
// Initializer[In, Yield] :
// = AssignmentExpression[?In, ?Yield]
- parseExpected(56 /* EqualsToken */);
+ parseExpected(57 /* EqualsToken */);
return parseAssignmentExpressionOrHigher();
}
function parseAssignmentExpressionOrHigher() {
@@ -15316,7 +15370,7 @@ var ts;
// To avoid a look-ahead, we did not handle the case of an arrow function with a single un-parenthesized
// parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single
// identifier and the current token is an arrow.
- if (expr.kind === 69 /* Identifier */ && token() === 34 /* EqualsGreaterThanToken */) {
+ if (expr.kind === 70 /* Identifier */ && token() === 35 /* EqualsGreaterThanToken */) {
return parseSimpleArrowFunctionExpression(expr);
}
// Now see if we might be in cases '2' or '3'.
@@ -15332,7 +15386,7 @@ var ts;
return parseConditionalExpressionRest(expr);
}
function isYieldExpression() {
- if (token() === 114 /* YieldKeyword */) {
+ if (token() === 115 /* YieldKeyword */) {
// If we have a 'yield' keyword, and this is a context where yield expressions are
// allowed, then definitely parse out a yield expression.
if (inYieldContext()) {
@@ -15361,15 +15415,15 @@ var ts;
return !scanner.hasPrecedingLineBreak() && isIdentifier();
}
function parseYieldExpression() {
- var node = createNode(190 /* YieldExpression */);
+ var node = createNode(191 /* YieldExpression */);
// YieldExpression[In] :
// yield
// yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield]
// yield [no LineTerminator here] * [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield]
nextToken();
if (!scanner.hasPrecedingLineBreak() &&
- (token() === 37 /* AsteriskToken */ || isStartOfExpression())) {
- node.asteriskToken = parseOptionalToken(37 /* AsteriskToken */);
+ (token() === 38 /* AsteriskToken */ || isStartOfExpression())) {
+ node.asteriskToken = parseOptionalToken(38 /* AsteriskToken */);
node.expression = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
@@ -15380,21 +15434,21 @@ var ts;
}
}
function parseSimpleArrowFunctionExpression(identifier, asyncModifier) {
- ts.Debug.assert(token() === 34 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
+ ts.Debug.assert(token() === 35 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
var node;
if (asyncModifier) {
- node = createNode(180 /* ArrowFunction */, asyncModifier.pos);
+ node = createNode(181 /* ArrowFunction */, asyncModifier.pos);
node.modifiers = asyncModifier;
}
else {
- node = createNode(180 /* ArrowFunction */, identifier.pos);
+ node = createNode(181 /* ArrowFunction */, identifier.pos);
}
- var parameter = createNode(142 /* Parameter */, identifier.pos);
+ var parameter = createNode(143 /* Parameter */, identifier.pos);
parameter.name = identifier;
finishNode(parameter);
node.parameters = createNodeArray([parameter], parameter.pos);
node.parameters.end = parameter.end;
- node.equalsGreaterThanToken = parseExpectedToken(34 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>");
+ node.equalsGreaterThanToken = parseExpectedToken(35 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>");
node.body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier);
return addJSDocComment(finishNode(node));
}
@@ -15419,8 +15473,8 @@ var ts;
// If we have an arrow, then try to parse the body. Even if not, try to parse if we
// have an opening brace, just in case we're in an error state.
var lastToken = token();
- arrowFunction.equalsGreaterThanToken = parseExpectedToken(34 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>");
- arrowFunction.body = (lastToken === 34 /* EqualsGreaterThanToken */ || lastToken === 15 /* OpenBraceToken */)
+ arrowFunction.equalsGreaterThanToken = parseExpectedToken(35 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>");
+ arrowFunction.body = (lastToken === 35 /* EqualsGreaterThanToken */ || lastToken === 16 /* OpenBraceToken */)
? parseArrowFunctionExpressionBody(isAsync)
: parseIdentifier();
return addJSDocComment(finishNode(arrowFunction));
@@ -15430,10 +15484,10 @@ var ts;
// Unknown -> There *might* be a parenthesized arrow function here.
// Speculatively look ahead to be sure, and rollback if not.
function isParenthesizedArrowFunctionExpression() {
- if (token() === 17 /* OpenParenToken */ || token() === 25 /* LessThanToken */ || token() === 118 /* AsyncKeyword */) {
+ if (token() === 18 /* OpenParenToken */ || token() === 26 /* LessThanToken */ || token() === 119 /* AsyncKeyword */) {
return lookAhead(isParenthesizedArrowFunctionExpressionWorker);
}
- if (token() === 34 /* EqualsGreaterThanToken */) {
+ if (token() === 35 /* EqualsGreaterThanToken */) {
// ERROR RECOVERY TWEAK:
// If we see a standalone => try to parse it as an arrow function expression as that's
// likely what the user intended to write.
@@ -15443,28 +15497,28 @@ var ts;
return 0 /* False */;
}
function isParenthesizedArrowFunctionExpressionWorker() {
- if (token() === 118 /* AsyncKeyword */) {
+ if (token() === 119 /* AsyncKeyword */) {
nextToken();
if (scanner.hasPrecedingLineBreak()) {
return 0 /* False */;
}
- if (token() !== 17 /* OpenParenToken */ && token() !== 25 /* LessThanToken */) {
+ if (token() !== 18 /* OpenParenToken */ && token() !== 26 /* LessThanToken */) {
return 0 /* False */;
}
}
var first = token();
var second = nextToken();
- if (first === 17 /* OpenParenToken */) {
- if (second === 18 /* CloseParenToken */) {
+ if (first === 18 /* OpenParenToken */) {
+ if (second === 19 /* CloseParenToken */) {
// Simple cases: "() =>", "(): ", and "() {".
// This is an arrow function with no parameters.
// The last one is not actually an arrow function,
// but this is probably what the user intended.
var third = nextToken();
switch (third) {
- case 34 /* EqualsGreaterThanToken */:
- case 54 /* ColonToken */:
- case 15 /* OpenBraceToken */:
+ case 35 /* EqualsGreaterThanToken */:
+ case 55 /* ColonToken */:
+ case 16 /* OpenBraceToken */:
return 1 /* True */;
default:
return 0 /* False */;
@@ -15476,12 +15530,12 @@ var ts;
// ({ x }) => { }
// ([ x ])
// ({ x })
- if (second === 19 /* OpenBracketToken */ || second === 15 /* OpenBraceToken */) {
+ if (second === 20 /* OpenBracketToken */ || second === 16 /* OpenBraceToken */) {
return 2 /* Unknown */;
}
// Simple case: "(..."
// This is an arrow function with a rest parameter.
- if (second === 22 /* DotDotDotToken */) {
+ if (second === 23 /* DotDotDotToken */) {
return 1 /* True */;
}
// If we had "(" followed by something that's not an identifier,
@@ -15494,7 +15548,7 @@ var ts;
}
// If we have something like "(a:", then we must have a
// type-annotated parameter in an arrow function expression.
- if (nextToken() === 54 /* ColonToken */) {
+ if (nextToken() === 55 /* ColonToken */) {
return 1 /* True */;
}
// This *could* be a parenthesized arrow function.
@@ -15502,7 +15556,7 @@ var ts;
return 2 /* Unknown */;
}
else {
- ts.Debug.assert(first === 25 /* LessThanToken */);
+ ts.Debug.assert(first === 26 /* LessThanToken */);
// If we have "<" not followed by an identifier,
// then this definitely is not an arrow function.
if (!isIdentifier()) {
@@ -15512,17 +15566,17 @@ var ts;
if (sourceFile.languageVariant === 1 /* JSX */) {
var isArrowFunctionInJsx = lookAhead(function () {
var third = nextToken();
- if (third === 83 /* ExtendsKeyword */) {
+ if (third === 84 /* ExtendsKeyword */) {
var fourth = nextToken();
switch (fourth) {
- case 56 /* EqualsToken */:
- case 27 /* GreaterThanToken */:
+ case 57 /* EqualsToken */:
+ case 28 /* GreaterThanToken */:
return false;
default:
return true;
}
}
- else if (third === 24 /* CommaToken */) {
+ else if (third === 25 /* CommaToken */) {
return true;
}
return false;
@@ -15541,7 +15595,7 @@ var ts;
}
function tryParseAsyncSimpleArrowFunctionExpression() {
// We do a check here so that we won't be doing unnecessarily call to "lookAhead"
- if (token() === 118 /* AsyncKeyword */) {
+ if (token() === 119 /* AsyncKeyword */) {
var isUnParenthesizedAsyncArrowFunction = lookAhead(isUnParenthesizedAsyncArrowFunctionWorker);
if (isUnParenthesizedAsyncArrowFunction === 1 /* True */) {
var asyncModifier = parseModifiersForArrowFunction();
@@ -15555,23 +15609,23 @@ var ts;
// AsyncArrowFunctionExpression:
// 1) async[no LineTerminator here]AsyncArrowBindingIdentifier[?Yield][no LineTerminator here]=>AsyncConciseBody[?In]
// 2) CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await][no LineTerminator here]=>AsyncConciseBody[?In]
- if (token() === 118 /* AsyncKeyword */) {
+ if (token() === 119 /* AsyncKeyword */) {
nextToken();
// If the "async" is followed by "=>" token then it is not a begining of an async arrow-function
// but instead a simple arrow-function which will be parsed inside "parseAssignmentExpressionOrHigher"
- if (scanner.hasPrecedingLineBreak() || token() === 34 /* EqualsGreaterThanToken */) {
+ if (scanner.hasPrecedingLineBreak() || token() === 35 /* EqualsGreaterThanToken */) {
return 0 /* False */;
}
// Check for un-parenthesized AsyncArrowFunction
var expr = parseBinaryExpressionOrHigher(/*precedence*/ 0);
- if (!scanner.hasPrecedingLineBreak() && expr.kind === 69 /* Identifier */ && token() === 34 /* EqualsGreaterThanToken */) {
+ if (!scanner.hasPrecedingLineBreak() && expr.kind === 70 /* Identifier */ && token() === 35 /* EqualsGreaterThanToken */) {
return 1 /* True */;
}
}
return 0 /* False */;
}
function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) {
- var node = createNode(180 /* ArrowFunction */);
+ var node = createNode(181 /* ArrowFunction */);
node.modifiers = parseModifiersForArrowFunction();
var isAsync = !!(ts.getModifierFlags(node) & 256 /* Async */);
// Arrow functions are never generators.
@@ -15581,7 +15635,7 @@ var ts;
// a => (b => c)
// And think that "(b =>" was actually a parenthesized arrow function with a missing
// close paren.
- fillSignature(54 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ isAsync, /*requireCompleteParameterList*/ !allowAmbiguity, node);
+ fillSignature(55 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ isAsync, /*requireCompleteParameterList*/ !allowAmbiguity, node);
// If we couldn't get parameters, we definitely could not parse out an arrow function.
if (!node.parameters) {
return undefined;
@@ -15594,19 +15648,19 @@ var ts;
// - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
//
// So we need just a bit of lookahead to ensure that it can only be a signature.
- if (!allowAmbiguity && token() !== 34 /* EqualsGreaterThanToken */ && token() !== 15 /* OpenBraceToken */) {
+ if (!allowAmbiguity && token() !== 35 /* EqualsGreaterThanToken */ && token() !== 16 /* OpenBraceToken */) {
// Returning undefined here will cause our caller to rewind to where we started from.
return undefined;
}
return node;
}
function parseArrowFunctionExpressionBody(isAsync) {
- if (token() === 15 /* OpenBraceToken */) {
+ if (token() === 16 /* OpenBraceToken */) {
return parseFunctionBlock(/*allowYield*/ false, /*allowAwait*/ isAsync, /*ignoreMissingOpenBrace*/ false);
}
- if (token() !== 23 /* SemicolonToken */ &&
- token() !== 87 /* FunctionKeyword */ &&
- token() !== 73 /* ClassKeyword */ &&
+ if (token() !== 24 /* SemicolonToken */ &&
+ token() !== 88 /* FunctionKeyword */ &&
+ token() !== 74 /* ClassKeyword */ &&
isStartOfStatement() &&
!isStartOfExpressionStatement()) {
// Check if we got a plain statement (i.e. no expression-statements, no function/class expressions/declarations)
@@ -15631,17 +15685,17 @@ var ts;
}
function parseConditionalExpressionRest(leftOperand) {
// Note: we are passed in an expression which was produced from parseBinaryExpressionOrHigher.
- var questionToken = parseOptionalToken(53 /* QuestionToken */);
+ var questionToken = parseOptionalToken(54 /* QuestionToken */);
if (!questionToken) {
return leftOperand;
}
// Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and
// we do not that for the 'whenFalse' part.
- var node = createNode(188 /* ConditionalExpression */, leftOperand.pos);
+ var node = createNode(189 /* ConditionalExpression */, leftOperand.pos);
node.condition = leftOperand;
node.questionToken = questionToken;
node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher);
- node.colonToken = parseExpectedToken(54 /* ColonToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(54 /* ColonToken */));
+ node.colonToken = parseExpectedToken(55 /* ColonToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(55 /* ColonToken */));
node.whenFalse = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
@@ -15650,7 +15704,7 @@ var ts;
return parseBinaryExpressionRest(precedence, leftOperand);
}
function isInOrOfKeyword(t) {
- return t === 90 /* InKeyword */ || t === 138 /* OfKeyword */;
+ return t === 91 /* InKeyword */ || t === 139 /* OfKeyword */;
}
function parseBinaryExpressionRest(precedence, leftOperand) {
while (true) {
@@ -15679,16 +15733,16 @@ var ts;
// ^^token; leftOperand = b. Return b ** c to the caller as a rightOperand
// a ** b - c
// ^token; leftOperand = b. Return b to the caller as a rightOperand
- var consumeCurrentOperator = token() === 38 /* AsteriskAsteriskToken */ ?
+ var consumeCurrentOperator = token() === 39 /* AsteriskAsteriskToken */ ?
newPrecedence >= precedence :
newPrecedence > precedence;
if (!consumeCurrentOperator) {
break;
}
- if (token() === 90 /* InKeyword */ && inDisallowInContext()) {
+ if (token() === 91 /* InKeyword */ && inDisallowInContext()) {
break;
}
- if (token() === 116 /* AsKeyword */) {
+ if (token() === 117 /* AsKeyword */) {
// Make sure we *do* perform ASI for constructs like this:
// var x = foo
// as (Bar)
@@ -15709,48 +15763,48 @@ var ts;
return leftOperand;
}
function isBinaryOperator() {
- if (inDisallowInContext() && token() === 90 /* InKeyword */) {
+ if (inDisallowInContext() && token() === 91 /* InKeyword */) {
return false;
}
return getBinaryOperatorPrecedence() > 0;
}
function getBinaryOperatorPrecedence() {
switch (token()) {
- case 52 /* BarBarToken */:
+ case 53 /* BarBarToken */:
return 1;
- case 51 /* AmpersandAmpersandToken */:
+ case 52 /* AmpersandAmpersandToken */:
return 2;
- case 47 /* BarToken */:
+ case 48 /* BarToken */:
return 3;
- case 48 /* CaretToken */:
+ case 49 /* CaretToken */:
return 4;
- case 46 /* AmpersandToken */:
+ case 47 /* AmpersandToken */:
return 5;
- case 30 /* EqualsEqualsToken */:
- case 31 /* ExclamationEqualsToken */:
- case 32 /* EqualsEqualsEqualsToken */:
- case 33 /* ExclamationEqualsEqualsToken */:
+ case 31 /* EqualsEqualsToken */:
+ case 32 /* ExclamationEqualsToken */:
+ case 33 /* EqualsEqualsEqualsToken */:
+ case 34 /* ExclamationEqualsEqualsToken */:
return 6;
- case 25 /* LessThanToken */:
- case 27 /* GreaterThanToken */:
- case 28 /* LessThanEqualsToken */:
- case 29 /* GreaterThanEqualsToken */:
- case 91 /* InstanceOfKeyword */:
- case 90 /* InKeyword */:
- case 116 /* AsKeyword */:
+ case 26 /* LessThanToken */:
+ case 28 /* GreaterThanToken */:
+ case 29 /* LessThanEqualsToken */:
+ case 30 /* GreaterThanEqualsToken */:
+ case 92 /* InstanceOfKeyword */:
+ case 91 /* InKeyword */:
+ case 117 /* AsKeyword */:
return 7;
- case 43 /* LessThanLessThanToken */:
- case 44 /* GreaterThanGreaterThanToken */:
- case 45 /* GreaterThanGreaterThanGreaterThanToken */:
+ case 44 /* LessThanLessThanToken */:
+ case 45 /* GreaterThanGreaterThanToken */:
+ case 46 /* GreaterThanGreaterThanGreaterThanToken */:
return 8;
- case 35 /* PlusToken */:
- case 36 /* MinusToken */:
+ case 36 /* PlusToken */:
+ case 37 /* MinusToken */:
return 9;
- case 37 /* AsteriskToken */:
- case 39 /* SlashToken */:
- case 40 /* PercentToken */:
+ case 38 /* AsteriskToken */:
+ case 40 /* SlashToken */:
+ case 41 /* PercentToken */:
return 10;
- case 38 /* AsteriskAsteriskToken */:
+ case 39 /* AsteriskAsteriskToken */:
return 11;
}
// -1 is lower than all other precedences. Returning it will cause binary expression
@@ -15758,45 +15812,45 @@ var ts;
return -1;
}
function makeBinaryExpression(left, operatorToken, right) {
- var node = createNode(187 /* BinaryExpression */, left.pos);
+ var node = createNode(188 /* BinaryExpression */, left.pos);
node.left = left;
node.operatorToken = operatorToken;
node.right = right;
return finishNode(node);
}
function makeAsExpression(left, right) {
- var node = createNode(195 /* AsExpression */, left.pos);
+ var node = createNode(196 /* AsExpression */, left.pos);
node.expression = left;
node.type = right;
return finishNode(node);
}
function parsePrefixUnaryExpression() {
- var node = createNode(185 /* PrefixUnaryExpression */);
+ var node = createNode(186 /* PrefixUnaryExpression */);
node.operator = token();
nextToken();
node.operand = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseDeleteExpression() {
- var node = createNode(181 /* DeleteExpression */);
+ var node = createNode(182 /* DeleteExpression */);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseTypeOfExpression() {
- var node = createNode(182 /* TypeOfExpression */);
+ var node = createNode(183 /* TypeOfExpression */);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseVoidExpression() {
- var node = createNode(183 /* VoidExpression */);
+ var node = createNode(184 /* VoidExpression */);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
function isAwaitExpression() {
- if (token() === 119 /* AwaitKeyword */) {
+ if (token() === 120 /* AwaitKeyword */) {
if (inAwaitContext()) {
return true;
}
@@ -15806,7 +15860,7 @@ var ts;
return false;
}
function parseAwaitExpression() {
- var node = createNode(184 /* AwaitExpression */);
+ var node = createNode(185 /* AwaitExpression */);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
@@ -15830,7 +15884,7 @@ var ts;
*/
if (isUpdateExpression()) {
var incrementExpression = parseIncrementExpression();
- return token() === 38 /* AsteriskAsteriskToken */ ?
+ return token() === 39 /* AsteriskAsteriskToken */ ?
parseBinaryExpressionRest(getBinaryOperatorPrecedence(), incrementExpression) :
incrementExpression;
}
@@ -15847,9 +15901,9 @@ var ts;
*/
var unaryOperator = token();
var simpleUnaryExpression = parseSimpleUnaryExpression();
- if (token() === 38 /* AsteriskAsteriskToken */) {
+ if (token() === 39 /* AsteriskAsteriskToken */) {
var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos);
- if (simpleUnaryExpression.kind === 177 /* TypeAssertionExpression */) {
+ if (simpleUnaryExpression.kind === 178 /* TypeAssertionExpression */) {
parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses);
}
else {
@@ -15874,23 +15928,23 @@ var ts;
*/
function parseSimpleUnaryExpression() {
switch (token()) {
- case 35 /* PlusToken */:
- case 36 /* MinusToken */:
- case 50 /* TildeToken */:
- case 49 /* ExclamationToken */:
+ case 36 /* PlusToken */:
+ case 37 /* MinusToken */:
+ case 51 /* TildeToken */:
+ case 50 /* ExclamationToken */:
return parsePrefixUnaryExpression();
- case 78 /* DeleteKeyword */:
+ case 79 /* DeleteKeyword */:
return parseDeleteExpression();
- case 101 /* TypeOfKeyword */:
+ case 102 /* TypeOfKeyword */:
return parseTypeOfExpression();
- case 103 /* VoidKeyword */:
+ case 104 /* VoidKeyword */:
return parseVoidExpression();
- case 25 /* LessThanToken */:
+ case 26 /* LessThanToken */:
// This is modified UnaryExpression grammar in TypeScript
// UnaryExpression (modified):
// < type > UnaryExpression
return parseTypeAssertion();
- case 119 /* AwaitKeyword */:
+ case 120 /* AwaitKeyword */:
if (isAwaitExpression()) {
return parseAwaitExpression();
}
@@ -15912,16 +15966,16 @@ var ts;
// This function is called inside parseUnaryExpression to decide
// whether to call parseSimpleUnaryExpression or call parseIncrementExpression directly
switch (token()) {
- case 35 /* PlusToken */:
- case 36 /* MinusToken */:
- case 50 /* TildeToken */:
- case 49 /* ExclamationToken */:
- case 78 /* DeleteKeyword */:
- case 101 /* TypeOfKeyword */:
- case 103 /* VoidKeyword */:
- case 119 /* AwaitKeyword */:
+ case 36 /* PlusToken */:
+ case 37 /* MinusToken */:
+ case 51 /* TildeToken */:
+ case 50 /* ExclamationToken */:
+ case 79 /* DeleteKeyword */:
+ case 102 /* TypeOfKeyword */:
+ case 104 /* VoidKeyword */:
+ case 120 /* AwaitKeyword */:
return false;
- case 25 /* LessThanToken */:
+ case 26 /* LessThanToken */:
// If we are not in JSX context, we are parsing TypeAssertion which is an UnaryExpression
if (sourceFile.languageVariant !== 1 /* JSX */) {
return false;
@@ -15944,21 +15998,21 @@ var ts;
* In TypeScript (2), (3) are parsed as PostfixUnaryExpression. (4), (5) are parsed as PrefixUnaryExpression
*/
function parseIncrementExpression() {
- if (token() === 41 /* PlusPlusToken */ || token() === 42 /* MinusMinusToken */) {
- var node = createNode(185 /* PrefixUnaryExpression */);
+ if (token() === 42 /* PlusPlusToken */ || token() === 43 /* MinusMinusToken */) {
+ var node = createNode(186 /* PrefixUnaryExpression */);
node.operator = token();
nextToken();
node.operand = parseLeftHandSideExpressionOrHigher();
return finishNode(node);
}
- else if (sourceFile.languageVariant === 1 /* JSX */ && token() === 25 /* LessThanToken */ && lookAhead(nextTokenIsIdentifierOrKeyword)) {
+ else if (sourceFile.languageVariant === 1 /* JSX */ && token() === 26 /* LessThanToken */ && lookAhead(nextTokenIsIdentifierOrKeyword)) {
// JSXElement is part of primaryExpression
return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ true);
}
var expression = parseLeftHandSideExpressionOrHigher();
ts.Debug.assert(ts.isLeftHandSideExpression(expression));
- if ((token() === 41 /* PlusPlusToken */ || token() === 42 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) {
- var node = createNode(186 /* PostfixUnaryExpression */, expression.pos);
+ if ((token() === 42 /* PlusPlusToken */ || token() === 43 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) {
+ var node = createNode(187 /* PostfixUnaryExpression */, expression.pos);
node.operand = expression;
node.operator = token();
nextToken();
@@ -15997,7 +16051,7 @@ var ts;
// the last two CallExpression productions. Or we have a MemberExpression which either
// completes the LeftHandSideExpression, or starts the beginning of the first four
// CallExpression productions.
- var expression = token() === 95 /* SuperKeyword */
+ var expression = token() === 96 /* SuperKeyword */
? parseSuperExpression()
: parseMemberExpressionOrHigher();
// Now, we *may* be complete. However, we might have consumed the start of a
@@ -16057,14 +16111,14 @@ var ts;
}
function parseSuperExpression() {
var expression = parseTokenNode();
- if (token() === 17 /* OpenParenToken */ || token() === 21 /* DotToken */ || token() === 19 /* OpenBracketToken */) {
+ if (token() === 18 /* OpenParenToken */ || token() === 22 /* DotToken */ || token() === 20 /* OpenBracketToken */) {
return expression;
}
// If we have seen "super" it must be followed by '(' or '.'.
// If it wasn't then just try to parse out a '.' and report an error.
- var node = createNode(172 /* PropertyAccessExpression */, expression.pos);
+ var node = createNode(173 /* PropertyAccessExpression */, expression.pos);
node.expression = expression;
- parseExpectedToken(21 /* DotToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
+ parseExpectedToken(22 /* DotToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true);
return finishNode(node);
}
@@ -16072,10 +16126,10 @@ var ts;
if (lhs.kind !== rhs.kind) {
return false;
}
- if (lhs.kind === 69 /* Identifier */) {
+ if (lhs.kind === 70 /* Identifier */) {
return lhs.text === rhs.text;
}
- if (lhs.kind === 97 /* ThisKeyword */) {
+ if (lhs.kind === 98 /* ThisKeyword */) {
return true;
}
// If we are at this statement then we must have PropertyAccessExpression and because tag name in Jsx element can only
@@ -16087,8 +16141,8 @@ var ts;
function parseJsxElementOrSelfClosingElement(inExpressionContext) {
var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext);
var result;
- if (opening.kind === 243 /* JsxOpeningElement */) {
- var node = createNode(241 /* JsxElement */, opening.pos);
+ if (opening.kind === 244 /* JsxOpeningElement */) {
+ var node = createNode(242 /* JsxElement */, opening.pos);
node.openingElement = opening;
node.children = parseJsxChildren(node.openingElement.tagName);
node.closingElement = parseJsxClosingElement(inExpressionContext);
@@ -16098,7 +16152,7 @@ var ts;
result = finishNode(node);
}
else {
- ts.Debug.assert(opening.kind === 242 /* JsxSelfClosingElement */);
+ ts.Debug.assert(opening.kind === 243 /* JsxSelfClosingElement */);
// Nothing else to do for self-closing elements
result = opening;
}
@@ -16109,15 +16163,15 @@ var ts;
// does less damage and we can report a better error.
// Since JSX elements are invalid < operands anyway, this lookahead parse will only occur in error scenarios
// of one sort or another.
- if (inExpressionContext && token() === 25 /* LessThanToken */) {
+ if (inExpressionContext && token() === 26 /* LessThanToken */) {
var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ true); });
if (invalidElement) {
parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element);
- var badNode = createNode(187 /* BinaryExpression */, result.pos);
+ var badNode = createNode(188 /* BinaryExpression */, result.pos);
badNode.end = invalidElement.end;
badNode.left = result;
badNode.right = invalidElement;
- badNode.operatorToken = createMissingNode(24 /* CommaToken */, /*reportAtCurrentPosition*/ false, /*diagnosticMessage*/ undefined);
+ badNode.operatorToken = createMissingNode(25 /* CommaToken */, /*reportAtCurrentPosition*/ false, /*diagnosticMessage*/ undefined);
badNode.operatorToken.pos = badNode.operatorToken.end = badNode.right.pos;
return badNode;
}
@@ -16125,17 +16179,17 @@ var ts;
return result;
}
function parseJsxText() {
- var node = createNode(244 /* JsxText */, scanner.getStartPos());
+ var node = createNode(10 /* JsxText */, scanner.getStartPos());
currentToken = scanner.scanJsxToken();
return finishNode(node);
}
function parseJsxChild() {
switch (token()) {
- case 244 /* JsxText */:
+ case 10 /* JsxText */:
return parseJsxText();
- case 15 /* OpenBraceToken */:
+ case 16 /* OpenBraceToken */:
return parseJsxExpression(/*inExpressionContext*/ false);
- case 25 /* LessThanToken */:
+ case 26 /* LessThanToken */:
return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ false);
}
ts.Debug.fail("Unknown JSX child kind " + token());
@@ -16146,7 +16200,7 @@ var ts;
parsingContext |= 1 << 14 /* JsxChildren */;
while (true) {
currentToken = scanner.reScanJsxToken();
- if (token() === 26 /* LessThanSlashToken */) {
+ if (token() === 27 /* LessThanSlashToken */) {
// Closing tag
break;
}
@@ -16164,27 +16218,27 @@ var ts;
}
function parseJsxOpeningOrSelfClosingElement(inExpressionContext) {
var fullStart = scanner.getStartPos();
- parseExpected(25 /* LessThanToken */);
+ parseExpected(26 /* LessThanToken */);
var tagName = parseJsxElementName();
var attributes = parseList(13 /* JsxAttributes */, parseJsxAttribute);
var node;
- if (token() === 27 /* GreaterThanToken */) {
+ if (token() === 28 /* GreaterThanToken */) {
// Closing tag, so scan the immediately-following text with the JSX scanning instead
// of regular scanning to avoid treating illegal characters (e.g. '#') as immediate
// scanning errors
- node = createNode(243 /* JsxOpeningElement */, fullStart);
+ node = createNode(244 /* JsxOpeningElement */, fullStart);
scanJsxText();
}
else {
- parseExpected(39 /* SlashToken */);
+ parseExpected(40 /* SlashToken */);
if (inExpressionContext) {
- parseExpected(27 /* GreaterThanToken */);
+ parseExpected(28 /* GreaterThanToken */);
}
else {
- parseExpected(27 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);
+ parseExpected(28 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);
scanJsxText();
}
- node = createNode(242 /* JsxSelfClosingElement */, fullStart);
+ node = createNode(243 /* JsxSelfClosingElement */, fullStart);
}
node.tagName = tagName;
node.attributes = attributes;
@@ -16197,10 +16251,10 @@ var ts;
// primaryExpression in the form of an identifier and "this" keyword
// We can't just simply use parseLeftHandSideExpressionOrHigher because then we will start consider class,function etc as a keyword
// We only want to consider "this" as a primaryExpression
- var expression = token() === 97 /* ThisKeyword */ ?
+ var expression = token() === 98 /* ThisKeyword */ ?
parseTokenNode() : parseIdentifierName();
- while (parseOptional(21 /* DotToken */)) {
- var propertyAccess = createNode(172 /* PropertyAccessExpression */, expression.pos);
+ while (parseOptional(22 /* DotToken */)) {
+ var propertyAccess = createNode(173 /* PropertyAccessExpression */, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true);
expression = finishNode(propertyAccess);
@@ -16209,27 +16263,27 @@ var ts;
}
function parseJsxExpression(inExpressionContext) {
var node = createNode(248 /* JsxExpression */);
- parseExpected(15 /* OpenBraceToken */);
- if (token() !== 16 /* CloseBraceToken */) {
+ parseExpected(16 /* OpenBraceToken */);
+ if (token() !== 17 /* CloseBraceToken */) {
node.expression = parseAssignmentExpressionOrHigher();
}
if (inExpressionContext) {
- parseExpected(16 /* CloseBraceToken */);
+ parseExpected(17 /* CloseBraceToken */);
}
else {
- parseExpected(16 /* CloseBraceToken */, /*message*/ undefined, /*shouldAdvance*/ false);
+ parseExpected(17 /* CloseBraceToken */, /*message*/ undefined, /*shouldAdvance*/ false);
scanJsxText();
}
return finishNode(node);
}
function parseJsxAttribute() {
- if (token() === 15 /* OpenBraceToken */) {
+ if (token() === 16 /* OpenBraceToken */) {
return parseJsxSpreadAttribute();
}
scanJsxIdentifier();
var node = createNode(246 /* JsxAttribute */);
node.name = parseIdentifierName();
- if (token() === 56 /* EqualsToken */) {
+ if (token() === 57 /* EqualsToken */) {
switch (scanJsxAttributeValue()) {
case 9 /* StringLiteral */:
node.initializer = parseLiteralNode();
@@ -16243,71 +16297,71 @@ var ts;
}
function parseJsxSpreadAttribute() {
var node = createNode(247 /* JsxSpreadAttribute */);
- parseExpected(15 /* OpenBraceToken */);
- parseExpected(22 /* DotDotDotToken */);
+ parseExpected(16 /* OpenBraceToken */);
+ parseExpected(23 /* DotDotDotToken */);
node.expression = parseExpression();
- parseExpected(16 /* CloseBraceToken */);
+ parseExpected(17 /* CloseBraceToken */);
return finishNode(node);
}
function parseJsxClosingElement(inExpressionContext) {
var node = createNode(245 /* JsxClosingElement */);
- parseExpected(26 /* LessThanSlashToken */);
+ parseExpected(27 /* LessThanSlashToken */);
node.tagName = parseJsxElementName();
if (inExpressionContext) {
- parseExpected(27 /* GreaterThanToken */);
+ parseExpected(28 /* GreaterThanToken */);
}
else {
- parseExpected(27 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);
+ parseExpected(28 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);
scanJsxText();
}
return finishNode(node);
}
function parseTypeAssertion() {
- var node = createNode(177 /* TypeAssertionExpression */);
- parseExpected(25 /* LessThanToken */);
+ var node = createNode(178 /* TypeAssertionExpression */);
+ parseExpected(26 /* LessThanToken */);
node.type = parseType();
- parseExpected(27 /* GreaterThanToken */);
+ parseExpected(28 /* GreaterThanToken */);
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseMemberExpressionRest(expression) {
while (true) {
- var dotToken = parseOptionalToken(21 /* DotToken */);
+ var dotToken = parseOptionalToken(22 /* DotToken */);
if (dotToken) {
- var propertyAccess = createNode(172 /* PropertyAccessExpression */, expression.pos);
+ var propertyAccess = createNode(173 /* PropertyAccessExpression */, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true);
expression = finishNode(propertyAccess);
continue;
}
- if (token() === 49 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 50 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) {
nextToken();
- var nonNullExpression = createNode(196 /* NonNullExpression */, expression.pos);
+ var nonNullExpression = createNode(197 /* NonNullExpression */, expression.pos);
nonNullExpression.expression = expression;
expression = finishNode(nonNullExpression);
continue;
}
// when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName
- if (!inDecoratorContext() && parseOptional(19 /* OpenBracketToken */)) {
- var indexedAccess = createNode(173 /* ElementAccessExpression */, expression.pos);
+ if (!inDecoratorContext() && parseOptional(20 /* OpenBracketToken */)) {
+ var indexedAccess = createNode(174 /* ElementAccessExpression */, expression.pos);
indexedAccess.expression = expression;
// It's not uncommon for a user to write: "new Type[]".
// Check for that common pattern and report a better error message.
- if (token() !== 20 /* CloseBracketToken */) {
+ if (token() !== 21 /* CloseBracketToken */) {
indexedAccess.argumentExpression = allowInAnd(parseExpression);
if (indexedAccess.argumentExpression.kind === 9 /* StringLiteral */ || indexedAccess.argumentExpression.kind === 8 /* NumericLiteral */) {
var literal = indexedAccess.argumentExpression;
literal.text = internIdentifier(literal.text);
}
}
- parseExpected(20 /* CloseBracketToken */);
+ parseExpected(21 /* CloseBracketToken */);
expression = finishNode(indexedAccess);
continue;
}
- if (token() === 11 /* NoSubstitutionTemplateLiteral */ || token() === 12 /* TemplateHead */) {
- var tagExpression = createNode(176 /* TaggedTemplateExpression */, expression.pos);
+ if (token() === 12 /* NoSubstitutionTemplateLiteral */ || token() === 13 /* TemplateHead */) {
+ var tagExpression = createNode(177 /* TaggedTemplateExpression */, expression.pos);
tagExpression.tag = expression;
- tagExpression.template = token() === 11 /* NoSubstitutionTemplateLiteral */
+ tagExpression.template = token() === 12 /* NoSubstitutionTemplateLiteral */
? parseLiteralNode()
: parseTemplateExpression();
expression = finishNode(tagExpression);
@@ -16319,7 +16373,7 @@ var ts;
function parseCallExpressionRest(expression) {
while (true) {
expression = parseMemberExpressionRest(expression);
- if (token() === 25 /* LessThanToken */) {
+ if (token() === 26 /* LessThanToken */) {
// See if this is the start of a generic invocation. If so, consume it and
// keep checking for postfix expressions. Otherwise, it's just a '<' that's
// part of an arithmetic expression. Break out so we consume it higher in the
@@ -16328,15 +16382,15 @@ var ts;
if (!typeArguments) {
return expression;
}
- var callExpr = createNode(174 /* CallExpression */, expression.pos);
+ var callExpr = createNode(175 /* CallExpression */, expression.pos);
callExpr.expression = expression;
callExpr.typeArguments = typeArguments;
callExpr.arguments = parseArgumentList();
expression = finishNode(callExpr);
continue;
}
- else if (token() === 17 /* OpenParenToken */) {
- var callExpr = createNode(174 /* CallExpression */, expression.pos);
+ else if (token() === 18 /* OpenParenToken */) {
+ var callExpr = createNode(175 /* CallExpression */, expression.pos);
callExpr.expression = expression;
callExpr.arguments = parseArgumentList();
expression = finishNode(callExpr);
@@ -16346,17 +16400,17 @@ var ts;
}
}
function parseArgumentList() {
- parseExpected(17 /* OpenParenToken */);
+ parseExpected(18 /* OpenParenToken */);
var result = parseDelimitedList(11 /* ArgumentExpressions */, parseArgumentExpression);
- parseExpected(18 /* CloseParenToken */);
+ parseExpected(19 /* CloseParenToken */);
return result;
}
function parseTypeArgumentsInExpression() {
- if (!parseOptional(25 /* LessThanToken */)) {
+ if (!parseOptional(26 /* LessThanToken */)) {
return undefined;
}
var typeArguments = parseDelimitedList(18 /* TypeArguments */, parseType);
- if (!parseExpected(27 /* GreaterThanToken */)) {
+ if (!parseExpected(28 /* GreaterThanToken */)) {
// If it doesn't have the closing > then it's definitely not an type argument list.
return undefined;
}
@@ -16368,32 +16422,32 @@ var ts;
}
function canFollowTypeArgumentsInExpression() {
switch (token()) {
- case 17 /* OpenParenToken */: // foo(
+ case 18 /* OpenParenToken */: // foo(
// this case are the only case where this token can legally follow a type argument
// list. So we definitely want to treat this as a type arg list.
- case 21 /* DotToken */: // foo.
- case 18 /* CloseParenToken */: // foo)
- case 20 /* CloseBracketToken */: // foo]
- case 54 /* ColonToken */: // foo:
- case 23 /* SemicolonToken */: // foo;
- case 53 /* QuestionToken */: // foo?
- case 30 /* EqualsEqualsToken */: // foo ==
- case 32 /* EqualsEqualsEqualsToken */: // foo